diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index e3a9d2e0cf..ad9b33bb2e 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -263,7 +263,7 @@ nsCSPContext::permitsInternal(CSPDirective aDir, // Do not send a report or notify observers if this is a preload - the // decision may be wrong due to the inability to get the nonce, and will // incorrectly fail the unit tests. - if (CSPService::sCSPReportingEnabled && (!aIsPreload && aSendViolationReports)) { + if (CSPService::sCSPReportingEnabled && !aIsPreload && aSendViolationReports) { uint32_t lineNumber = 0; uint32_t columnNumber = 0; nsAutoCString spec; @@ -648,9 +648,11 @@ nsCSPContext::GetAllowsInline(CSPDirective aDirective, keyword, observerTopic) \ case nsIContentSecurityPolicy::VIOLATION_TYPE_ ## violationType : \ PR_BEGIN_MACRO \ - if (CSPService::sCSPReportingEnabled && \ - (!mPolicies[p]->allows(directive##_SRC_DIRECTIVE, keyword, nonceOrHash,\ - false))) { \ + static_assert(directive##_SRC_DIRECTIVE == SCRIPT_SRC_DIRECTIVE || \ + directive##_SRC_DIRECTIVE == STYLE_SRC_DIRECTIVE); \ + if(CSPService::sCSPReportingEnabled && \ + !mPolicies[p]->allows(directive##_SRC_DIRECTIVE, keyword, nonceOrHash, \ + false)) { \ nsAutoString violatedDirective; \ mPolicies[p]->getDirectiveStringForContentType( \ directive##_SRC_DIRECTIVE, violatedDirective); \ diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp index 25e9e93b3b..79f2d23d96 100644 --- a/js/src/vm/StructuredClone.cpp +++ b/js/src/vm/StructuredClone.cpp @@ -1700,6 +1700,8 @@ JSStructuredCloneWriter::write(HandleValue v) return false; if (cls == ESClass::Map) { + if (!counts.back()) + return false; counts.back()--; RootedValue val(context(), entries.back()); entries.popBack(); diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index e58c76dcfe..f2f5ee0f65 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3793,10 +3793,25 @@ MeasuringReflow(nsIFrame* aChild, nsIFrame::ReflowChildFlags::NoMoveFrame | nsIFrame::ReflowChildFlags::NoSizeView | nsIFrame::ReflowChildFlags::NoDeleteNextInFlowChild; - parent->ReflowChild(aChild, pc, childSize, childRI, wm, - LogicalPoint(wm), nsSize(), flags, childStatus); - parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm, - LogicalPoint(wm), nsSize(), flags); + if (childSize.mBoundingMetrics.width != 0) { + parent->ReflowChild(aChild, + pc, + childSize, + childRI, + wm, + LogicalPoint(wm), + nsSize(), + flags, + childStatus); + parent->FinishReflowChild(aChild, + pc, + childSize, + &childRI, + wm, + LogicalPoint(wm), + nsSize(), + flags); + } #ifdef DEBUG parent->DeleteProperty(nsContainerFrame::DebugReflowingWithInfiniteISize()); #endif