Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2025-02-18 19:13:36 +08:00
commit d4f1c1faed
3 changed files with 27 additions and 8 deletions

View file

@ -263,7 +263,7 @@ nsCSPContext::permitsInternal(CSPDirective aDir,
// Do not send a report or notify observers if this is a preload - the // 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 // decision may be wrong due to the inability to get the nonce, and will
// incorrectly fail the unit tests. // incorrectly fail the unit tests.
if (CSPService::sCSPReportingEnabled && (!aIsPreload && aSendViolationReports)) { if (CSPService::sCSPReportingEnabled && !aIsPreload && aSendViolationReports) {
uint32_t lineNumber = 0; uint32_t lineNumber = 0;
uint32_t columnNumber = 0; uint32_t columnNumber = 0;
nsAutoCString spec; nsAutoCString spec;
@ -648,9 +648,11 @@ nsCSPContext::GetAllowsInline(CSPDirective aDirective,
keyword, observerTopic) \ keyword, observerTopic) \
case nsIContentSecurityPolicy::VIOLATION_TYPE_ ## violationType : \ case nsIContentSecurityPolicy::VIOLATION_TYPE_ ## violationType : \
PR_BEGIN_MACRO \ PR_BEGIN_MACRO \
if (CSPService::sCSPReportingEnabled && \ static_assert(directive##_SRC_DIRECTIVE == SCRIPT_SRC_DIRECTIVE || \
(!mPolicies[p]->allows(directive##_SRC_DIRECTIVE, keyword, nonceOrHash,\ directive##_SRC_DIRECTIVE == STYLE_SRC_DIRECTIVE); \
false))) { \ if(CSPService::sCSPReportingEnabled && \
!mPolicies[p]->allows(directive##_SRC_DIRECTIVE, keyword, nonceOrHash, \
false)) { \
nsAutoString violatedDirective; \ nsAutoString violatedDirective; \
mPolicies[p]->getDirectiveStringForContentType( \ mPolicies[p]->getDirectiveStringForContentType( \
directive##_SRC_DIRECTIVE, violatedDirective); \ directive##_SRC_DIRECTIVE, violatedDirective); \

View file

@ -1700,6 +1700,8 @@ JSStructuredCloneWriter::write(HandleValue v)
return false; return false;
if (cls == ESClass::Map) { if (cls == ESClass::Map) {
if (!counts.back())
return false;
counts.back()--; counts.back()--;
RootedValue val(context(), entries.back()); RootedValue val(context(), entries.back());
entries.popBack(); entries.popBack();

View file

@ -3793,10 +3793,25 @@ MeasuringReflow(nsIFrame* aChild,
nsIFrame::ReflowChildFlags::NoMoveFrame | nsIFrame::ReflowChildFlags::NoMoveFrame |
nsIFrame::ReflowChildFlags::NoSizeView | nsIFrame::ReflowChildFlags::NoSizeView |
nsIFrame::ReflowChildFlags::NoDeleteNextInFlowChild; nsIFrame::ReflowChildFlags::NoDeleteNextInFlowChild;
parent->ReflowChild(aChild, pc, childSize, childRI, wm, if (childSize.mBoundingMetrics.width != 0) {
LogicalPoint(wm), nsSize(), flags, childStatus); parent->ReflowChild(aChild,
parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm, pc,
LogicalPoint(wm), nsSize(), flags); childSize,
childRI,
wm,
LogicalPoint(wm),
nsSize(),
flags,
childStatus);
parent->FinishReflowChild(aChild,
pc,
childSize,
&childRI,
wm,
LogicalPoint(wm),
nsSize(),
flags);
}
#ifdef DEBUG #ifdef DEBUG
parent->DeleteProperty(nsContainerFrame::DebugReflowingWithInfiniteISize()); parent->DeleteProperty(nsContainerFrame::DebugReflowingWithInfiniteISize());
#endif #endif