diff --git a/dom/script/ModuleLoadRequest.cpp b/dom/script/ModuleLoadRequest.cpp index ec924ea7a4..2abc6236e8 100644 --- a/dom/script/ModuleLoadRequest.cpp +++ b/dom/script/ModuleLoadRequest.cpp @@ -148,6 +148,11 @@ ModuleLoadRequest::LoadFailed() // We failed to load the source text or an error occurred unrelated to the // content of the module (e.g. OOM). + if (IsCanceled()) { + return; + } + + MOZ_ASSERT(!IsReadyToRun()); MOZ_ASSERT(!mModuleScript); Cancel(); diff --git a/editor/libeditor/EditorEventListener.cpp b/editor/libeditor/EditorEventListener.cpp index 1a3beca6e6..32f3585288 100644 --- a/editor/libeditor/EditorEventListener.cpp +++ b/editor/libeditor/EditorEventListener.cpp @@ -238,6 +238,8 @@ EditorEventListener::Disconnect() void EditorEventListener::UninstallFromEditor() { + CleanupDragDropCaret(); + nsCOMPtr piTarget = mEditorBase->GetDOMEventTarget(); if (!piTarget) { return; diff --git a/layout/base/tests/bug1496118-ref.html b/layout/base/tests/bug1496118-ref.html new file mode 100644 index 0000000000..feaf31476b --- /dev/null +++ b/layout/base/tests/bug1496118-ref.html @@ -0,0 +1,24 @@ + + + + + + + + + +
+ +
+ + + diff --git a/layout/base/tests/bug1496118.html b/layout/base/tests/bug1496118.html new file mode 100644 index 0000000000..7656e010ba --- /dev/null +++ b/layout/base/tests/bug1496118.html @@ -0,0 +1,37 @@ + + + + + + + + + +
+ +
+ + + diff --git a/layout/base/tests/mochitest.ini b/layout/base/tests/mochitest.ini index fc616b1ef8..846ab52813 100644 --- a/layout/base/tests/mochitest.ini +++ b/layout/base/tests/mochitest.ini @@ -179,6 +179,8 @@ support-files = bug1263357-4-ref.html bug1263357-5.html bug1263357-5-ref.html + bug1496118.html + bug1496118-ref.html input-maxlength-valid-before-change.html input-maxlength-valid-change.html input-maxlength-invalid-change.html diff --git a/layout/base/tests/test_reftests_with_caret.html b/layout/base/tests/test_reftests_with_caret.html index 062c605b98..d39dd737ad 100644 --- a/layout/base/tests/test_reftests_with_caret.html +++ b/layout/base/tests/test_reftests_with_caret.html @@ -186,6 +186,7 @@ var tests = [ [ 'bug1263357-3.html' , 'bug1263357-3-ref.html'] , [ 'bug1263357-4.html' , 'bug1263357-4-ref.html'] , [ 'bug1263357-5.html' , 'bug1263357-5-ref.html'] , + [ 'bug1496118.html' , 'bug1496118-ref.html' ] , function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled']]}, nextTest);} , ]; diff --git a/security/nss/lib/pkcs12/p12d.c b/security/nss/lib/pkcs12/p12d.c index 34362db2de..d148d48d5f 100644 --- a/security/nss/lib/pkcs12/p12d.c +++ b/security/nss/lib/pkcs12/p12d.c @@ -341,27 +341,38 @@ sec_pkcs12_decoder_safe_bag_update(void *arg, const char *data, * and that there are no errors. If so, just return rather * than continuing to process. */ - if (!safeContentsCtx || !safeContentsCtx->p12dcx || - safeContentsCtx->p12dcx->error || safeContentsCtx->skipCurrentSafeBag) { + if (!safeContentsCtx || !safeContentsCtx->p12dcx || safeContentsCtx->skipCurrentSafeBag) { return; } p12dcx = safeContentsCtx->p12dcx; + /* make sure that there are no errors and we are not skipping the current safeBag */ + if (p12dcx->error || safeContentsCtx->skipCurrentSafeBag) { + goto loser; + } + rv = SEC_ASN1DecoderUpdate(safeContentsCtx->currentSafeBagA1Dcx, data, len); if (rv != SECSuccess) { p12dcx->errorValue = PORT_GetError(); + p12dcx->error = PR_TRUE; + goto loser; + } + + /* The update may have set safeContentsCtx->skipCurrentSafeBag, and we + * may not get another opportunity to clean up the decoder context. + */ + if (safeContentsCtx->skipCurrentSafeBag) { goto loser; } return; loser: - /* set the error, and finish the decoder context. because there + /* Finish the decoder context. Because there * is not a way of returning an error message, it may be worth * while to do a check higher up and finish any decoding contexts * that are still open. */ - p12dcx->error = PR_TRUE; SEC_ASN1DecoderFinish(safeContentsCtx->currentSafeBagA1Dcx); safeContentsCtx->currentSafeBagA1Dcx = NULL; return; diff --git a/security/nss/lib/pkcs12/p12t.h b/security/nss/lib/pkcs12/p12t.h index b22f0dd823..d449afdd89 100644 --- a/security/nss/lib/pkcs12/p12t.h +++ b/security/nss/lib/pkcs12/p12t.h @@ -73,6 +73,7 @@ struct sec_PKCS12SafeBagStr { sec_PKCS12CRLBag *crlBag; sec_PKCS12SecretBag *secretBag; sec_PKCS12SafeContents *safeContents; + SECItem *unknownBag; } safeBagContent; sec_PKCS12Attribute **attribs; diff --git a/security/nss/lib/pkcs12/p12tmpl.c b/security/nss/lib/pkcs12/p12tmpl.c index 7437cbcc60..b08384f66a 100644 --- a/security/nss/lib/pkcs12/p12tmpl.c +++ b/security/nss/lib/pkcs12/p12tmpl.c @@ -30,12 +30,12 @@ sec_pkcs12_choose_safe_bag_type(void *src_or_dest, PRBool encoding) oiddata = SECOID_FindOID(&safeBag->safeBagType); if (oiddata == NULL) { - return SEC_ASN1_GET(SEC_AnyTemplate); + return SEC_ASN1_GET(SEC_PointerToAnyTemplate); } switch (oiddata->offset) { default: - theTemplate = SEC_ASN1_GET(SEC_AnyTemplate); + theTemplate = SEC_ASN1_GET(SEC_PointerToAnyTemplate); break; case SEC_OID_PKCS12_V1_KEY_BAG_ID: theTemplate = SEC_ASN1_GET(SECKEY_PointerToPrivateKeyInfoTemplate); diff --git a/widget/windows/TaskbarPreview.cpp b/widget/windows/TaskbarPreview.cpp index 502b47964d..ec182d8ae0 100644 --- a/widget/windows/TaskbarPreview.cpp +++ b/widget/windows/TaskbarPreview.cpp @@ -355,32 +355,38 @@ TaskbarPreviewCallback::Done(nsISupports *aCanvas, bool aDrawBorder) { } RefPtr target = new gfxWindowsSurface(source->GetSize(), gfx::SurfaceFormat::A8R8G8B8_UINT32); - if (!target) { + if (target->CairoStatus() != CAIRO_STATUS_SUCCESS) { return NS_ERROR_FAILURE; } - RefPtr srcSurface = source->GetDataSurface(); + using DataSrcSurf = gfx::DataSourceSurface; + RefPtr srcSurface = source->GetDataSurface(); RefPtr imageSurface = target->GetAsImageSurface(); if (!srcSurface || !imageSurface) { return NS_ERROR_FAILURE; } - gfx::DataSourceSurface::MappedSurface sourceMap; - srcSurface->Map(gfx::DataSourceSurface::READ, &sourceMap); - mozilla::gfx::CopySurfaceDataToPackedArray(sourceMap.mData, - imageSurface->Data(), - srcSurface->GetSize(), - sourceMap.mStride, - BytesPerPixel(srcSurface->GetFormat())); - srcSurface->Unmap(); + DataSrcSurf::ScopedMap const sourceMap(srcSurface, DataSrcSurf::READ); + if (sourceMap.IsMapped()) { + mozilla::gfx::CopySurfaceDataToPackedArray(sourceMap.GetData(), + imageSurface->Data(), + srcSurface->GetSize(), + sourceMap.GetStride(), + BytesPerPixel(srcSurface->GetFormat())); + } else if (source->GetSize().IsEmpty()) { + // A zero-size source-surface probably shouldn't happen, but is harmless + // here. Fall through. + } else { + return NS_ERROR_FAILURE; + } HDC hDC = target->GetDC(); HBITMAP hBitmap = (HBITMAP)GetCurrentObject(hDC, OBJ_BITMAP); DWORD flags = aDrawBorder ? DWM_SIT_DISPLAYFRAME : 0; - POINT pptClient = { 0, 0 }; HRESULT hr; if (!mIsThumbnail) { + POINT pptClient = { 0, 0 }; hr = WinUtils::dwmSetIconicLivePreviewBitmapPtr(mPreview->PreviewWindow(), hBitmap, &pptClient, flags); } else { @@ -388,6 +394,7 @@ TaskbarPreviewCallback::Done(nsISupports *aCanvas, bool aDrawBorder) { hBitmap, flags); } MOZ_ASSERT(SUCCEEDED(hr)); + mozilla::Unused << hr; return NS_OK; }