summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/autoconf/toolchain.m42
-rw-r--r--dom/base/Navigator.cpp5
-rw-r--r--dom/system/OSFileConstants.cpp8
-rw-r--r--js/src/ctypes/CTypes.cpp15
-rw-r--r--js/src/frontend/Parser.cpp67
-rw-r--r--js/src/frontend/Parser.h1
-rw-r--r--js/src/tests/ecma_2017/AsyncFunctions/async-property-name-error.js21
-rw-r--r--js/src/tests/test262/local/let-newline-await-in-async-function.js18
-rw-r--r--js/src/tests/test262/local/let-newline-await-in-normal-function.js20
-rw-r--r--layout/forms/nsComboboxControlFrame.cpp8
-rw-r--r--layout/forms/nsDateTimeControlFrame.cpp7
-rw-r--r--layout/forms/nsFieldSetFrame.cpp14
-rw-r--r--layout/forms/nsHTMLButtonControlFrame.cpp9
-rw-r--r--layout/forms/nsMeterFrame.cpp4
-rw-r--r--layout/forms/nsNumberControlFrame.cpp8
-rw-r--r--layout/forms/nsProgressFrame.cpp4
-rw-r--r--layout/forms/nsRangeFrame.cpp23
-rw-r--r--layout/forms/nsTextControlFrame.cpp8
-rw-r--r--layout/generic/ReflowOutput.h2
-rw-r--r--layout/generic/nsBlockFrame.cpp11
-rw-r--r--layout/generic/nsBlockReflowContext.cpp8
-rw-r--r--layout/generic/nsCanvasFrame.cpp10
-rw-r--r--layout/generic/nsColumnSetFrame.cpp13
-rw-r--r--layout/generic/nsContainerFrame.cpp92
-rw-r--r--layout/generic/nsContainerFrame.h55
-rw-r--r--layout/generic/nsFlexContainerFrame.cpp26
-rw-r--r--layout/generic/nsFrame.cpp9
-rw-r--r--layout/generic/nsFrameSetFrame.cpp5
-rw-r--r--layout/generic/nsGfxScrollFrame.cpp24
-rw-r--r--layout/generic/nsGridContainerFrame.cpp14
-rw-r--r--layout/generic/nsHTMLCanvasFrame.cpp6
-rw-r--r--layout/generic/nsIFrame.h25
-rw-r--r--layout/generic/nsLineLayout.cpp4
-rw-r--r--layout/generic/nsPageContentFrame.cpp13
-rw-r--r--layout/generic/nsPageFrame.cpp10
-rw-r--r--layout/generic/nsRubyFrame.cpp3
-rw-r--r--layout/generic/nsSimplePageSequenceFrame.cpp6
-rw-r--r--layout/generic/nsVideoFrame.cpp26
-rw-r--r--layout/generic/nsViewportFrame.cpp7
-rw-r--r--layout/mathml/nsMathMLContainerFrame.cpp8
-rw-r--r--layout/mathml/nsMathMLSelectedFrame.cpp3
-rw-r--r--layout/mathml/nsMathMLTokenFrame.cpp3
-rw-r--r--layout/mathml/nsMathMLmfencedFrame.cpp5
-rw-r--r--layout/mathml/nsMathMLmfracFrame.cpp12
-rw-r--r--layout/mathml/nsMathMLmmultiscriptsFrame.cpp34
-rw-r--r--layout/mathml/nsMathMLmrootFrame.cpp6
-rw-r--r--layout/mathml/nsMathMLmunderoverFrame.cpp10
-rw-r--r--layout/svg/nsSVGForeignObjectFrame.cpp7
-rw-r--r--layout/tables/nsTableCellFrame.cpp11
-rw-r--r--layout/tables/nsTableColGroupFrame.cpp6
-rw-r--r--layout/tables/nsTableFrame.cpp39
-rw-r--r--layout/tables/nsTableRowFrame.cpp19
-rw-r--r--layout/tables/nsTableRowGroupFrame.cpp17
-rw-r--r--layout/tables/nsTableWrapperFrame.cpp14
-rw-r--r--layout/xul/nsBox.cpp21
-rw-r--r--layout/xul/nsBoxFrame.cpp4
-rw-r--r--layout/xul/nsBoxLayoutState.cpp2
-rw-r--r--layout/xul/nsBoxLayoutState.h9
-rw-r--r--layout/xul/nsDeckFrame.cpp5
-rw-r--r--layout/xul/nsMenuPopupFrame.cpp9
-rw-r--r--layout/xul/nsMenuPopupFrame.h2
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp2
-rw-r--r--toolkit/components/osfile/modules/osfile_shared_allthreads.jsm8
-rw-r--r--toolkit/components/osfile/modules/osfile_unix_back.jsm2
-rw-r--r--toolkit/components/osfile/modules/osfile_unix_front.jsm4
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_aarch64.cpp180
66 files changed, 621 insertions, 432 deletions
diff --git a/build/autoconf/toolchain.m4 b/build/autoconf/toolchain.m4
index 9fc76a3f6e..47f4ec0505 100644
--- a/build/autoconf/toolchain.m4
+++ b/build/autoconf/toolchain.m4
@@ -27,7 +27,7 @@ fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then
GNU_AS=1
fi
-if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c LLVM`" != "0"; then
+if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c Apple`" != "0"; then
GNU_AS=1
fi
rm -f conftest.out
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 28b66be3db..05268a5156 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1390,9 +1390,8 @@ Navigator::GetPlatform(nsAString& aPlatform, bool aUsePrefOverriddenValue)
aPlatform.AssignLiteral("Win32");
#elif defined(XP_MACOSX) && defined(__ppc__)
aPlatform.AssignLiteral("MacPPC");
-#elif defined(XP_MACOSX) && defined(__i386__)
- aPlatform.AssignLiteral("MacIntel");
-#elif defined(XP_MACOSX) && defined(__x86_64__)
+#elif defined(XP_MACOSX)
+ // Always return "MacIntel", even on ARM64 macOS like Safari does.
aPlatform.AssignLiteral("MacIntel");
#else
// XXX Communicator uses compiled-in build-time string defines
diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp
index 551ed5773f..2f985f45d6 100644
--- a/dom/system/OSFileConstants.cpp
+++ b/dom/system/OSFileConstants.cpp
@@ -704,10 +704,10 @@ static const dom::ConstantSpec gLibcProperties[] =
// Under MacOSX, to avoid using deprecated functions that do not
// match the constants we define in this object (including
// |sizeof|/|offsetof| stuff, but not only), for a number of
- // functions, we need to adapt the name of the symbols we are using,
- // whenever macro _DARWIN_FEATURE_64_BIT_INODE is set. We export
- // this value to be able to do so from JavaScript.
-#if defined(_DARWIN_FEATURE_64_BIT_INODE)
+ // functions, we need to use functions with a $INODE64 suffix.
+ // That is true on Intel-based mac when the _DARWIN_FEATURE_64_BIT_INODE
+ // macro is set. But not on Apple Silicon.
+#if defined(_DARWIN_FEATURE_64_BIT_INODE) && !defined(__aarch64__)
{ "_DARWIN_FEATURE_64_BIT_INODE", JS::Int32Value(1) },
#endif // defined(_DARWIN_FEATURE_64_BIT_INODE)
diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp
index b75b42072f..3bc249e015 100644
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -6708,12 +6708,15 @@ PrepareCIF(JSContext* cx,
if (!rtype)
return false;
- ffi_status status =
- ffi_prep_cif(&fninfo->mCIF,
- abi,
- fninfo->mFFITypes.length(),
- rtype,
- fninfo->mFFITypes.begin());
+ ffi_status status;
+ if (fninfo->mIsVariadic) {
+ status = ffi_prep_cif_var(&fninfo->mCIF, abi, fninfo->mArgTypes.length(),
+ fninfo->mFFITypes.length(), rtype,
+ fninfo->mFFITypes.begin());
+ } else {
+ status = ffi_prep_cif(&fninfo->mCIF, abi, fninfo->mFFITypes.length(), rtype,
+ fninfo->mFFITypes.begin());
+ }
switch (status) {
case FFI_OK:
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index a66183b4a8..cb84a939f6 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -7085,6 +7085,7 @@ JSOpFromPropertyType(PropertyType propType)
case PropertyType::Method:
case PropertyType::GeneratorMethod:
case PropertyType::AsyncMethod:
+ case PropertyType::AsyncGeneratorMethod:
case PropertyType::Constructor:
case PropertyType::DerivedConstructor:
return JSOP_INITPROP;
@@ -7208,7 +7209,7 @@ Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
if (propType != PropertyType::Getter && propType != PropertyType::Setter &&
propType != PropertyType::Method && propType != PropertyType::GeneratorMethod &&
- propType != PropertyType::AsyncMethod &&
+ propType != PropertyType::AsyncMethod && propType != PropertyType::AsyncGeneratorMethod &&
propType != PropertyType::Constructor && propType != PropertyType::DerivedConstructor)
{
errorAt(nameOffset, JSMSG_BAD_METHOD_DEF);
@@ -7348,6 +7349,11 @@ Parser<ParseHandler>::nextTokenContinuesLetDeclaration(TokenKind next, YieldHand
if (next == TOK_YIELD)
return yieldHandling == YieldIsName;
+ // Somewhat similar logic applies for "await", except that it's not tracked
+ // with an AwaitHandling argument.
+ if (next == TOK_AWAIT)
+ return !awaitIsKeyword();
+
// Otherwise a let declaration must have a name.
if (TokenKindIsPossibleIdentifier(next)) {
// A "let" edge case deserves special comment. Consider this:
@@ -9731,6 +9737,9 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
// AsyncMethod[Yield, Await]:
// async [no LineTerminator here] PropertyName[?Yield, ?Await] ...
//
+ // AsyncGeneratorMethod[Yield, Await]:
+ // async [no LineTerminator here] * PropertyName[?Yield, ?Await] ...
+ //
// PropertyName:
// LiteralPropertyName
// ComputedPropertyName[?Yield, ?Await]
@@ -9743,13 +9752,14 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
// ComputedPropertyName[Yield, Await]:
// [ ...
TokenKind tt = TOK_EOF;
- if (!tokenStream.getToken(&tt))
+ if (!tokenStream.peekTokenSameLine(&tt))
return null();
- if (tt != TOK_LP && tt != TOK_COLON && tt != TOK_RC && tt != TOK_ASSIGN) {
+ if (tt == TOK_STRING || tt == TOK_NUMBER || tt == TOK_LB ||
+ TokenKindIsPossibleIdentifierName(tt) || tt == TOK_MUL)
+ {
isAsync = true;
+ tokenStream.consumeKnownToken(tt);
ltok = tt;
- } else {
- tokenStream.ungetToken();
}
}
@@ -9771,6 +9781,21 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
return null();
break;
+ case TOK_STRING: {
+ propAtom.set(tokenStream.currentToken().atom());
+ uint32_t index;
+ if (propAtom->isIndex(&index)) {
+ propName = handler.newNumber(index, NoDecimal, pos());
+ if (!propName)
+ return null();
+ break;
+ }
+ propName = stringLiteral();
+ if (!propName)
+ return null();
+ break;
+ }
+
case TOK_LB:
propName = computedPropertyName(yieldHandling, maybeDecl, propList);
if (!propName)
@@ -9784,7 +9809,7 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
}
propAtom.set(tokenStream.currentName());
- // Do not look for accessor syntax on generators
+ // Do not look for accessor syntax on generator or async methods.
if (isGenerator || isAsync || !(ltok == TOK_GET || ltok == TOK_SET)) {
propName = handler.newObjectLiteralPropertyName(propAtom, pos());
if (!propName)
@@ -9839,21 +9864,6 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
return null();
break;
}
-
- case TOK_STRING: {
- propAtom.set(tokenStream.currentToken().atom());
- uint32_t index;
- if (propAtom->isIndex(&index)) {
- propName = handler.newNumber(index, NoDecimal, pos());
- if (!propName)
- return null();
- break;
- }
- propName = stringLiteral();
- if (!propName)
- return null();
- break;
- }
}
TokenKind tt;
@@ -9861,7 +9871,7 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
return null();
if (tt == TOK_COLON) {
- if (isGenerator) {
+ if (isGenerator || isAsync) {
error(JSMSG_BAD_PROP_ID);
return null();
}
@@ -9872,7 +9882,7 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
if (TokenKindIsPossibleIdentifierName(ltok) &&
(tt == TOK_COMMA || tt == TOK_RC || tt == TOK_ASSIGN))
{
- if (isGenerator) {
+ if (isGenerator || isAsync) {
error(JSMSG_BAD_PROP_ID);
return null();
}
@@ -9885,7 +9895,9 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
if (tt == TOK_LP) {
tokenStream.ungetToken();
- if (isGenerator)
+ if (isGenerator && isAsync)
+ *propType = PropertyType::AsyncGeneratorMethod;
+ else if (isGenerator)
*propType = PropertyType::GeneratorMethod;
else if (isAsync)
*propType = PropertyType::AsyncMethod;
@@ -10163,6 +10175,7 @@ Parser<ParseHandler>::methodDefinition(uint32_t toStringStart, PropertyType prop
case PropertyType::Method:
case PropertyType::GeneratorMethod:
case PropertyType::AsyncMethod:
+ case PropertyType::AsyncGeneratorMethod:
kind = Method;
break;
@@ -10178,11 +10191,13 @@ Parser<ParseHandler>::methodDefinition(uint32_t toStringStart, PropertyType prop
MOZ_CRASH("Parser: methodDefinition: unexpected property type");
}
- GeneratorKind generatorKind = propType == PropertyType::GeneratorMethod
+ GeneratorKind generatorKind = (propType == PropertyType::GeneratorMethod ||
+ propType == PropertyType::AsyncGeneratorMethod)
? StarGenerator
: NotGenerator;
- FunctionAsyncKind asyncKind = (propType == PropertyType::AsyncMethod)
+ FunctionAsyncKind asyncKind = (propType == PropertyType::AsyncMethod ||
+ propType == PropertyType::AsyncGeneratorMethod)
? AsyncFunction
: SyncFunction;
diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
index 97f6917bd6..1e9028cbee 100644
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -579,6 +579,7 @@ enum class PropertyType {
Method,
GeneratorMethod,
AsyncMethod,
+ AsyncGeneratorMethod,
Constructor,
DerivedConstructor
};
diff --git a/js/src/tests/ecma_2017/AsyncFunctions/async-property-name-error.js b/js/src/tests/ecma_2017/AsyncFunctions/async-property-name-error.js
new file mode 100644
index 0000000000..926794e5d0
--- /dev/null
+++ b/js/src/tests/ecma_2017/AsyncFunctions/async-property-name-error.js
@@ -0,0 +1,21 @@
+function assertSyntaxError(code) {
+ assertThrowsInstanceOf(() => { Function(code); }, SyntaxError, "Function:" + code);
+ assertThrowsInstanceOf(() => { eval(code); }, SyntaxError, "eval:" + code);
+ var ieval = eval;
+ assertThrowsInstanceOf(() => { ieval(code); }, SyntaxError, "indirect eval:" + code);
+}
+
+assertSyntaxError(`({async async: 0})`);
+assertSyntaxError(`({async async})`);
+assertSyntaxError(`({async async, })`);
+assertSyntaxError(`({async async = 0} = {})`);
+
+for (let decl of ["var", "let", "const"]) {
+ assertSyntaxError(`${decl} {async async: a} = {}`);
+ assertSyntaxError(`${decl} {async async} = {}`);
+ assertSyntaxError(`${decl} {async async, } = {}`);
+ assertSyntaxError(`${decl} {async async = 0} = {}`);
+}
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);
diff --git a/js/src/tests/test262/local/let-newline-await-in-async-function.js b/js/src/tests/test262/local/let-newline-await-in-async-function.js
new file mode 100644
index 0000000000..c43a5b2745
--- /dev/null
+++ b/js/src/tests/test262/local/let-newline-await-in-async-function.js
@@ -0,0 +1,18 @@
+// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+author: Jeff Walden <jwalden+code@mit.edu>
+esid: sec-let-and-const-declarations
+description: >
+ |await| is excluded from LexicalDeclaration by grammar parameter, in
+ AsyncFunction. Therefore |let| followed by |await| inside AsyncFunction is
+ an ASI opportunity, and this code must parse without error.
+---*/
+
+async function f() {
+ let
+ await 0;
+}
+
+reportCompare(true, f instanceof Function);
diff --git a/js/src/tests/test262/local/let-newline-await-in-normal-function.js b/js/src/tests/test262/local/let-newline-await-in-normal-function.js
new file mode 100644
index 0000000000..f49f9ea528
--- /dev/null
+++ b/js/src/tests/test262/local/let-newline-await-in-normal-function.js
@@ -0,0 +1,20 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+author: Jeff Walden <jwalden+code@mit.edu>
+esid: sec-let-and-const-declarations
+description: >
+ Outside AsyncFunction, |await| is a perfectly cromulent LexicalDeclaration
+ variable name. Therefore ASI doesn't apply, and so the |0| where a |=| was
+ expected is a syntax error.
+negative:
+ phase: early
+ type: SyntaxError
+---*/
+
+function f() {
+ let
+ await 0;
+}
diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp
index 9db6ae5e45..459c6f7ecc 100644
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -460,10 +460,10 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
// Allow the child to move/size/change-visibility its view if it's currently
// dropped down
- int32_t flags = mDroppedDown ? 0
- : NS_FRAME_NO_MOVE_FRAME |
- NS_FRAME_NO_VISIBILITY |
- NS_FRAME_NO_SIZE_VIEW;
+ ReflowChildFlags flags = mDroppedDown ? ReflowChildFlags::Default
+ : ReflowChildFlags::NoMoveFrame |
+ ReflowChildFlags::NoVisibility |
+ ReflowChildFlags::NoSizeView;
//XXX Can this be different from the dropdown's writing mode?
// That would be odd!
diff --git a/layout/forms/nsDateTimeControlFrame.cpp b/layout/forms/nsDateTimeControlFrame.cpp
index fa22dcebac..145a2d4724 100644
--- a/layout/forms/nsDateTimeControlFrame.cpp
+++ b/layout/forms/nsDateTimeControlFrame.cpp
@@ -233,8 +233,8 @@ nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
// will be fixed later.
const nsSize dummyContainerSize;
ReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
- childReflowOuput, myWM, childOffset, dummyContainerSize, 0,
- childStatus);
+ childReflowOuput, myWM, childOffset, dummyContainerSize,
+ ReflowChildFlags::Default, childStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
"We gave our child unconstrained available block-size, "
"so it should be complete");
@@ -271,7 +271,8 @@ nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
// Place the child
FinishReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
- &childReflowOuput, myWM, childOffset, borderBoxSize, 0);
+ &childReflowOuput, myWM, childOffset, borderBoxSize,
+ ReflowChildFlags::Default);
nsSize contentBoxSize =
LogicalSize(myWM, contentBoxISize, contentBoxBSize).
diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp
index a5177560de..ce66f5d0f1 100644
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -397,8 +397,8 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
- ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
- ocStatus);
+ ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
+ ReflowChildFlags::Default, ocStatus);
}
//------------ Handle Incremental Reflow -----------------
@@ -459,7 +459,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
const nsSize dummyContainerSize;
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowInput,
wm, LogicalPoint(wm), dummyContainerSize,
- NS_FRAME_NO_MOVE_FRAME, aStatus);
+ ReflowChildFlags::NoMoveFrame, aStatus);
#ifdef NOISY_REFLOW
printf(" returned (%d, %d)\n",
legendDesiredSize.Width(), legendDesiredSize.Height());
@@ -488,7 +488,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
FinishReflowChild(legend, aPresContext, legendDesiredSize,
legendReflowInput.ptr(), wm, LogicalPoint(wm),
- dummyContainerSize, NS_FRAME_NO_MOVE_FRAME);
+ dummyContainerSize, ReflowChildFlags::NoMoveFrame);
} else if (!legend) {
mLegendRect.SetEmpty();
mLegendSpace = 0;
@@ -540,13 +540,13 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
// if necessary.
const nsSize dummyContainerSize;
ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowInput,
- wm, pt, dummyContainerSize, 0, aStatus);
+ wm, pt, dummyContainerSize, ReflowChildFlags::Default, aStatus);
// Update containerSize to account for size of the inner frame, so that
// FinishReflowChild can position it correctly.
containerSize += kidDesiredSize.PhysicalSize();
- FinishReflowChild(inner, aPresContext, kidDesiredSize,
- &kidReflowInput, wm, pt, containerSize, 0);
+ FinishReflowChild(inner, aPresContext, kidDesiredSize, &kidReflowInput, wm,
+ pt, containerSize, ReflowChildFlags::Default);
NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow", aStatus);
} else if (inner) {
// |inner| didn't need to be reflowed but we do need to include its size
diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp
index 495686cfc7..afedfa7748 100644
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -333,7 +333,8 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
nsSize dummyContainerSize;
ReflowChild(aFirstKid, aPresContext,
contentsDesiredSize, contentsReflowInput,
- wm, childPos, dummyContainerSize, 0, contentsReflowStatus);
+ wm, childPos, dummyContainerSize, ReflowChildFlags::Default,
+ contentsReflowStatus);
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(contentsReflowStatus),
"We gave button-contents frame unconstrained available height, "
"so it should be complete");
@@ -386,9 +387,9 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
(buttonContentBox + clbp.Size(wm)).GetPhysicalSize(wm);
// Place the child
- FinishReflowChild(aFirstKid, aPresContext,
- contentsDesiredSize, &contentsReflowInput,
- wm, childPos, containerSize, 0);
+ FinishReflowChild(aFirstKid, aPresContext, contentsDesiredSize,
+ &contentsReflowInput, wm, childPos, containerSize,
+ ReflowChildFlags::Default);
// Make sure we have a useful 'ascent' value for the child
if (contentsDesiredSize.BlockStartAscent() ==
diff --git a/layout/forms/nsMeterFrame.cpp b/layout/forms/nsMeterFrame.cpp
index 6ef362820f..e90bbb4667 100644
--- a/layout/forms/nsMeterFrame.cpp
+++ b/layout/forms/nsMeterFrame.cpp
@@ -187,9 +187,9 @@ nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
ReflowOutput barDesiredSize(reflowInput);
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowInput, xoffset,
- yoffset, 0, aStatus);
+ yoffset, ReflowChildFlags::Default, aStatus);
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowInput,
- xoffset, yoffset, 0);
+ xoffset, yoffset, ReflowChildFlags::Default);
}
nsresult
diff --git a/layout/forms/nsNumberControlFrame.cpp b/layout/forms/nsNumberControlFrame.cpp
index 64e3df0fe3..3e625d39af 100644
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -181,8 +181,8 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
// will be fixed later.
const nsSize dummyContainerSize;
ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
- wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize, 0,
- childStatus);
+ wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize,
+ ReflowChildFlags::Default, childStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
"We gave our child unconstrained available block-size, "
"so it should be complete");
@@ -219,8 +219,8 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
// Place the child
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
- &wrapperReflowInput, myWM, wrapperOffset,
- borderBoxSize, 0);
+ &wrapperReflowInput, myWM, wrapperOffset, borderBoxSize,
+ ReflowChildFlags::Default);
nsSize contentBoxSize =
LogicalSize(myWM, contentBoxISize, contentBoxBSize).
diff --git a/layout/forms/nsProgressFrame.cpp b/layout/forms/nsProgressFrame.cpp
index 60c7abe42c..c734787d24 100644
--- a/layout/forms/nsProgressFrame.cpp
+++ b/layout/forms/nsProgressFrame.cpp
@@ -203,9 +203,9 @@ nsProgressFrame::ReflowChildFrame(nsIFrame* aChild,
ReflowOutput barDesiredSize(aReflowInput);
ReflowChild(aChild, aPresContext, barDesiredSize, reflowInput, xoffset,
- yoffset, 0, aStatus);
+ yoffset, ReflowChildFlags::Default, aStatus);
FinishReflowChild(aChild, aPresContext, barDesiredSize, &reflowInput,
- xoffset, yoffset, 0);
+ xoffset, yoffset, ReflowChildFlags::Default);
}
nsresult
diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp
index f1755e69fa..7ed05a21c4 100644
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -415,12 +415,13 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
nsReflowStatus frameStatus;
ReflowOutput trackDesiredSize(aReflowInput);
- ReflowChild(trackFrame, aPresContext, trackDesiredSize,
- trackReflowInput, trackX, trackY, 0, frameStatus);
+ ReflowChild(trackFrame, aPresContext, trackDesiredSize, trackReflowInput,
+ trackX, trackY, ReflowChildFlags::Default, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
- &trackReflowInput, trackX, trackY, 0);
+ &trackReflowInput, trackX, trackY,
+ ReflowChildFlags::Default);
}
nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
@@ -437,12 +438,12 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
nsReflowStatus frameStatus;
ReflowOutput thumbDesiredSize(aReflowInput);
- ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
- thumbReflowInput, 0, 0, 0, frameStatus);
+ ReflowChild(thumbFrame, aPresContext, thumbDesiredSize, thumbReflowInput, 0,
+ 0, ReflowChildFlags::Default, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
- &thumbReflowInput, 0, 0, 0);
+ &thumbReflowInput, 0, 0, ReflowChildFlags::Default);
DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
aDesiredSize.Height()));
}
@@ -462,13 +463,13 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
nsReflowStatus frameStatus;
ReflowOutput progressDesiredSize(aReflowInput);
- ReflowChild(rangeProgressFrame, aPresContext,
- progressDesiredSize, progressReflowInput, 0, 0,
- 0, frameStatus);
+ ReflowChild(rangeProgressFrame, aPresContext, progressDesiredSize,
+ progressReflowInput, 0, 0, ReflowChildFlags::Default,
+ frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
"We gave our child unconstrained height, so it should be complete");
- FinishReflowChild(rangeProgressFrame, aPresContext,
- progressDesiredSize, &progressReflowInput, 0, 0, 0);
+ FinishReflowChild(rangeProgressFrame, aPresContext, progressDesiredSize,
+ &progressReflowInput, 0, 0, ReflowChildFlags::Default);
DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
aDesiredSize.Height()));
}
diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp
index 7e610f9313..ca55cf629c 100644
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -581,12 +581,12 @@ nsTextControlFrame::ReflowTextControlChild(nsIFrame* aKid,
// reflow the child
ReflowOutput desiredSize(aReflowInput);
- ReflowChild(aKid, aPresContext, desiredSize, kidReflowInput,
- xOffset, yOffset, 0, aStatus);
+ ReflowChild(aKid, aPresContext, desiredSize, kidReflowInput, xOffset, yOffset,
+ ReflowChildFlags::Default, aStatus);
// place the child
- FinishReflowChild(aKid, aPresContext, desiredSize,
- &kidReflowInput, xOffset, yOffset, 0);
+ FinishReflowChild(aKid, aPresContext, desiredSize, &kidReflowInput, xOffset,
+ yOffset, ReflowChildFlags::Default);
// consider the overflow
aParentDesiredSize.mOverflowAreas.UnionWith(desiredSize.mOverflowAreas);
diff --git a/layout/generic/ReflowOutput.h b/layout/generic/ReflowOutput.h
index 9877ed6fac..ff1afde2ae 100644
--- a/layout/generic/ReflowOutput.h
+++ b/layout/generic/ReflowOutput.h
@@ -281,7 +281,7 @@ public:
nscoord& Width() { return mWritingMode.IsVertical() ? mBSize : mISize; }
nscoord& Height() { return mWritingMode.IsVertical() ? mISize : mBSize; }
- nsSize PhysicalSize()
+ nsSize PhysicalSize() const
{
return Size(mWritingMode).GetPhysicalSize(mWritingMode);
}
diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp
index 152b3d06ad..7f19839a14 100644
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1182,8 +1182,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
- ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds, 0,
- ocStatus);
+ ReflowOverflowContainerChildren(aPresContext, *reflowInput, ocBounds,
+ ReflowChildFlags::Default, ocStatus);
}
// Now that we're done cleaning up our overflow container lists, we can
@@ -6297,10 +6297,9 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
WritingMode metricsWM = metrics.GetWritingMode();
aFloat->SetSize(metricsWM, metrics.Size(metricsWM));
if (aFloat->HasView()) {
- nsContainerFrame::SyncFrameViewAfterReflow(aState.mPresContext, aFloat,
- aFloat->GetView(),
- metrics.VisualOverflow(),
- NS_FRAME_NO_MOVE_VIEW);
+ nsContainerFrame::SyncFrameViewAfterReflow(
+ aState.mPresContext, aFloat, aFloat->GetView(),
+ metrics.VisualOverflow(), ReflowChildFlags::NoMoveView);
}
// Pass floatRS so the frame hierarchy can be used (redoFloatRS has the same hierarchy)
aFloat->DidReflow(aState.mPresContext, &floatRS,
diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp
index 3be74c929a..775f41a044 100644
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -448,15 +448,11 @@ nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput,
ConvertTo(frameWM, mWritingMode,
mContainerSize - mMetrics.PhysicalSize());
- // ApplyRelativePositioning in right-to-left writing modes needs to
- // know the updated frame width
- mFrame->SetSize(mWritingMode, mMetrics.Size(mWritingMode));
- aReflowInput.ApplyRelativePositioning(&logPos, mContainerSize);
-
// Now place the frame and complete the reflow process
nsContainerFrame::FinishReflowChild(mFrame, mPresContext, mMetrics,
&aReflowInput, frameWM, logPos,
- mContainerSize, 0);
+ mContainerSize,
+ nsIFrame::ReflowChildFlags::ApplyRelativePositioning);
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp
index 61efb57e25..b4e1f0319a 100644
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -636,12 +636,12 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.ApplyRelativePositioning(&kidPt, containerSize);
// Reflow the frame
- ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
- kidWM, kidPt, containerSize, 0, aStatus);
+ ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, kidWM,
+ kidPt, containerSize, ReflowChildFlags::Default, aStatus);
// Complete the reflow and position and size the child frame
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput,
- kidWM, kidPt, containerSize, 0);
+ kidWM, kidPt, containerSize, ReflowChildFlags::Default);
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
@@ -696,8 +696,8 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
if (prevCanvasFrame) {
ReflowOverflowContainerChildren(aPresContext, aReflowInput,
- aDesiredSize.mOverflowAreas, 0,
- aStatus);
+ aDesiredSize.mOverflowAreas,
+ ReflowChildFlags::Default, aStatus);
}
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp
index 99733c549b..ad4211bd8c 100644
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -641,8 +641,8 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
kidReflowInput.ComputedLogicalMargin().IStart(wm),
childOrigin.B(wm) +
kidReflowInput.ComputedLogicalMargin().BStart(wm));
- ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput,
- wm, origin, containerSize, 0, aStatus);
+ ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput, wm,
+ origin, containerSize, ReflowChildFlags::Default, aStatus);
reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
@@ -656,8 +656,9 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
*aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
- FinishReflowChild(child, PresContext(), kidDesiredSize,
- &kidReflowInput, wm, childOrigin, containerSize, 0);
+ FinishReflowChild(child, PresContext(), kidDesiredSize, &kidReflowInput,
+ wm, childOrigin, containerSize,
+ ReflowChildFlags::Default);
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
if (childContentBEnd > aConfig.mColMaxBSize) {
@@ -1052,8 +1053,8 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
- ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds, 0,
- ocStatus);
+ ReflowOverflowContainerChildren(aPresContext, aReflowInput, ocBounds,
+ ReflowChildFlags::Default, ocStatus);
}
//------------ Handle Incremental Reflow -----------------
diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp
index dd20ccffee..6af2db5c70 100644
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -755,21 +755,21 @@ void nsContainerFrame::SetSizeConstraints(nsPresContext* aPresContext,
void
nsContainerFrame::SyncFrameViewAfterReflow(nsPresContext* aPresContext,
- nsIFrame* aFrame,
+ nsIFrame* aFrame,
nsView* aView,
- const nsRect& aVisualOverflowArea,
- uint32_t aFlags)
+ const nsRect& aVisualOverflowArea,
+ ReflowChildFlags aFlags)
{
if (!aView) {
return;
}
// Make sure the view is sized and positioned correctly
- if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView)) {
PositionFrameView(aFrame);
}
- if (0 == (aFlags & NS_FRAME_NO_SIZE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoSizeView)) {
nsViewManager* vm = aView->GetViewManager();
vm->ResizeView(aView, aVisualOverflowArea, true);
@@ -781,7 +781,7 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
nsIFrame* aFrame,
nsStyleContext* aStyleContext,
nsView* aView,
- uint32_t aFlags)
+ ReflowChildFlags aFlags)
{
NS_ASSERTION(!aStyleContext || aFrame->StyleContext() == aStyleContext,
"Wrong style context for frame?");
@@ -797,7 +797,7 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
}
// Make sure visibility is correct. This only affects nsSubdocumentFrame.
- if (0 == (aFlags & NS_FRAME_NO_VISIBILITY) &&
+ if (!(aFlags & ReflowChildFlags::NoVisibility) &&
!aFrame->SupportsVisibilityHidden()) {
// See if the view should be hidden or visible
vm->SetViewVisibility(aView,
@@ -1032,7 +1032,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
const WritingMode& aWM,
const LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker)
{
@@ -1043,11 +1043,12 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
}
// Position the child frame and its view if requested.
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
aKidFrame->SetPosition(aWM, aPos, aContainerSize);
}
- if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView)) {
PositionFrameView(aKidFrame);
PositionChildViews(aKidFrame);
}
@@ -1056,10 +1057,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
// If the child frame is complete, delete any next-in-flows,
- // but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
- if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
- NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
- !(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
+ // but only if the NoDeleteNextInFlowChild flag isn't set.
+ if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) && NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
+ !(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
if (kidNextInFlow) {
// Remove all of the childs next-in-flows. Make sure that we ask
@@ -1080,18 +1080,19 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
const ReflowInput& aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker)
{
NS_PRECONDITION(aReflowInput.mFrame == aKidFrame, "bad reflow state");
// Position the child frame and its view if requested.
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
aKidFrame->SetPosition(nsPoint(aX, aY));
}
- if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView)) {
PositionFrameView(aKidFrame);
PositionChildViews(aKidFrame);
}
@@ -1100,9 +1101,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
// If the child frame is complete, delete any next-in-flows,
- // but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
+ // but only if the NoDeleteNextInFlowChild flag isn't set.
if (NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
- !(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
+ !(aFlags & ReflowChildFlags::NoDeleteNextInFlowChild)) {
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
if (kidNextInFlow) {
// Remove all of the childs next-in-flows. Make sure that we ask
@@ -1161,11 +1162,11 @@ nsContainerFrame::PositionChildViews(nsIFrame* aFrame)
* - invoked the DidReflow() function
*
* Flags:
- * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aX and aY are ignored in this
- * case. Also implies NS_FRAME_NO_MOVE_VIEW
- * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
- * don't want to automatically sync the frame and view
- * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
+ * ReflowChildFlags::NoMoveFrame - don't move the frame. aX and aY are ignored
+ * in this case. Also implies ReflowChildFlags::NoMoveView
+ * ReflowChildFlags::NoMoveView - don't position the frame's view. Set this if
+ * you don't want to automatically sync the frame and view
+ * ReflowChildFlags::NoSizeView - don't size the frame's view
*/
void
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
@@ -1175,7 +1176,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
const WritingMode& aWM,
const LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags)
+ nsIFrame::ReflowChildFlags aFlags)
{
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
@@ -1184,11 +1185,21 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
nsPoint curOrigin = aKidFrame->GetPosition();
WritingMode outerWM = aDesiredSize.GetWritingMode();
- LogicalSize convertedSize = aDesiredSize.Size(outerWM).ConvertTo(aWM,
- outerWM);
+ LogicalSize convertedSize =
+ aDesiredSize.Size(outerWM).ConvertTo(aWM, outerWM);
+ LogicalPoint pos(aPos);
+
+ if (aFlags & ReflowChildFlags::ApplyRelativePositioning) {
+ MOZ_ASSERT(aReflowInput, "caller must have passed reflow input");
+ // ApplyRelativePositioning in right-to-left writing modes needs to know
+ // the updated frame width to set the normal position correctly.
+ aKidFrame->SetSize(aWM, convertedSize);
+ aReflowInput->ApplyRelativePositioning(&pos, aContainerSize);
+ }
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
- aKidFrame->SetRect(aWM, LogicalRect(aWM, aPos, convertedSize),
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
+ aKidFrame->SetRect(aWM, LogicalRect(aWM, pos, convertedSize),
aContainerSize);
} else {
aKidFrame->SetSize(aWM, convertedSize);
@@ -1203,7 +1214,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
}
nsPoint newOrigin = aKidFrame->GetPosition();
- if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) && curOrigin != newOrigin) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView) && curOrigin != newOrigin) {
if (!aKidFrame->HasView()) {
// If the frame has moved, then we need to make sure any child views are
// correctly positioned
@@ -1223,14 +1234,21 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
const ReflowInput* aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags)
+ ReflowChildFlags aFlags)
{
+ MOZ_ASSERT(!(aFlags & ReflowChildFlags::ApplyRelativePositioning),
+ "only the logical version supports ApplyRelativePositioning "
+ "since ApplyRelativePositioning requires the container size");
+
nsPoint curOrigin = aKidFrame->GetPosition();
+ nsPoint pos(aX, aY);
+ nsSize size(aDesiredSize.PhysicalSize());
- if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
- aKidFrame->SetRect(nsRect(aX, aY, aDesiredSize.Width(), aDesiredSize.Height()));
+ if (ReflowChildFlags::NoMoveFrame !=
+ (aFlags & ReflowChildFlags::NoMoveFrame)) {
+ aKidFrame->SetRect(nsRect(pos, size));
} else {
- aKidFrame->SetSize(nsSize(aDesiredSize.Width(), aDesiredSize.Height()));
+ aKidFrame->SetSize(size);
}
if (aKidFrame->HasView()) {
@@ -1241,8 +1259,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
aDesiredSize.VisualOverflow(), aFlags);
}
- if (!(aFlags & NS_FRAME_NO_MOVE_VIEW) &&
- (curOrigin.x != aX || curOrigin.y != aY)) {
+ if (!(aFlags & ReflowChildFlags::NoMoveView) && curOrigin != pos) {
if (!aKidFrame->HasView()) {
// If the frame has moved, then we need to make sure any child views are
// correctly positioned
@@ -1253,11 +1270,12 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
aKidFrame->DidReflow(aPresContext, aReflowInput, nsDidReflowStatus::FINISHED);
}
+
void
nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPresContext,
const ReflowInput& aReflowInput,
nsOverflowAreas& aOverflowRects,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
ChildFrameMerger aMergeFunc)
{
diff --git a/layout/generic/nsContainerFrame.h b/layout/generic/nsContainerFrame.h
index e3cc54b0b0..030622e8ea 100644
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -13,16 +13,6 @@
#include "nsFrameList.h"
#include "nsLayoutUtils.h"
-// Option flags for ReflowChild() and FinishReflowChild()
-// member functions
-#define NS_FRAME_NO_MOVE_VIEW 0x0001
-#define NS_FRAME_NO_MOVE_FRAME (0x0002 | NS_FRAME_NO_MOVE_VIEW)
-#define NS_FRAME_NO_SIZE_VIEW 0x0004
-#define NS_FRAME_NO_VISIBILITY 0x0008
-// Only applies to ReflowChild; if true, don't delete the next-in-flow, even
-// if the reflow is fully complete.
-#define NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD 0x0010
-
class nsOverflowContinuationTracker;
// Some macros for container classes to do sanity checking on
@@ -173,14 +163,14 @@ public:
// Set the view's size and position after its frame has been reflowed.
//
// Flags:
- // NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
+ // NoMoveView - don't position the frame's view. Set this if you
// don't want to automatically sync the frame and view
- // NS_FRAME_NO_SIZE_VIEW - don't size the view
- static void SyncFrameViewAfterReflow(nsPresContext* aPresContext,
- nsIFrame* aFrame,
- nsView* aView,
- const nsRect& aVisualOverflowArea,
- uint32_t aFlags = 0);
+ // NoSizeView - don't size the view
+ static void SyncFrameViewAfterReflow(nsPresContext* aPresContext,
+ nsIFrame* aFrame,
+ nsView* aView,
+ const nsRect& aVisualOverflowArea,
+ ReflowChildFlags aFlags = ReflowChildFlags::Default);
// Syncs properties to the top level view and window, like transparency and
// shadow.
@@ -205,7 +195,7 @@ public:
nsIFrame* aFrame,
nsStyleContext* aStyleContext,
nsView* aView,
- uint32_t aFlags = 0);
+ ReflowChildFlags aFlags = ReflowChildFlags::Default);
/**
* Converts the minimum and maximum sizes given in inner window app units to
@@ -222,7 +212,7 @@ public:
const nsSize& aMaxSize);
// Used by both nsInlineFrame and nsFirstLetterFrame.
- void DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
+ void DoInlineIntrinsicISize(nsRenderingContext* aRenderingContext,
InlineIntrinsicISizeData *aData,
nsLayoutUtils::IntrinsicISizeType aType);
@@ -248,10 +238,10 @@ public:
* @param aContainerSize size of the border-box of the containing frame
*
* Flags:
- * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
+ * NoMoveView - don't position the frame's view. Set this if you
* don't want to automatically sync the frame and view
- * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
- * case. Also implies NS_FRAME_NO_MOVE_VIEW
+ * NoMoveFrame - don't move the frame. aPos is ignored in this
+ * case. Also implies NoMoveView
*/
void ReflowChild(nsIFrame* aChildFrame,
nsPresContext* aPresContext,
@@ -260,7 +250,7 @@ public:
const mozilla::WritingMode& aWM,
const mozilla::LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker = nullptr);
@@ -277,11 +267,11 @@ public:
* @param aContainerSize size of the border-box of the containing frame
*
* Flags:
- * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
- * case. Also implies NS_FRAME_NO_MOVE_VIEW
- * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
+ * NoMoveFrame - don't move the frame. aPos is ignored in this
+ * case. Also implies NoMoveView
+ * NoMoveView - don't position the frame's view. Set this if you
* don't want to automatically sync the frame and view
- * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
+ * NoSizeView - don't size the frame's view
*/
static void FinishReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
@@ -290,7 +280,8 @@ public:
const mozilla::WritingMode& aWM,
const mozilla::LogicalPoint& aPos,
const nsSize& aContainerSize,
- uint32_t aFlags);
+ ReflowChildFlags aFlags);
+
//XXX temporary: hold on to a copy of the old physical versions of
// ReflowChild and FinishReflowChild so that we can convert callers
@@ -301,7 +292,7 @@ public:
const ReflowInput& aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker = nullptr);
@@ -311,7 +302,8 @@ public:
const ReflowInput* aReflowInput,
nscoord aX,
nscoord aY,
- uint32_t aFlags);
+ ReflowChildFlags aFlags);
+
static void PositionChildViews(nsIFrame* aFrame);
@@ -391,11 +383,12 @@ public:
void ReflowOverflowContainerChildren(nsPresContext* aPresContext,
const ReflowInput& aReflowInput,
nsOverflowAreas& aOverflowRects,
- uint32_t aFlags,
+ ReflowChildFlags aFlags,
nsReflowStatus& aStatus,
ChildFrameMerger aMergeFunc =
DefaultChildFrameMerge);
+
/**
* Move any frames on our overflow list to the end of our principal list.
* @return true if there were any overflow frames
diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp
index 4429111e46..18a0643f14 100644
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -1856,7 +1856,7 @@ nsFlexContainerFrame::MeasureAscentAndHeightForFlexItem(
ReflowOutput childDesiredSize(aChildReflowInput);
nsReflowStatus childReflowStatus;
- const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
+ const ReflowChildFlags flags = ReflowChildFlags::NoMoveFrame;
ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, aChildReflowInput,
0, 0, flags, childReflowStatus);
@@ -4856,7 +4856,8 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, childReflowInput,
outerWM, aFramePos, aContainerSize,
- 0, childReflowStatus);
+ ReflowChildFlags::Default,
+ childReflowStatus);
// XXXdholbert Once we do pagination / splitting, we'll need to actually
// handle incomplete childReflowStatuses. But for now, we give our kids
@@ -4872,9 +4873,9 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
offsets, &aFramePos,
aContainerSize);
- FinishReflowChild(aItem.Frame(), aPresContext,
- childDesiredSize, &childReflowInput,
- outerWM, aFramePos, aContainerSize, 0);
+ FinishReflowChild(aItem.Frame(), aPresContext, childDesiredSize,
+ &childReflowInput, outerWM, aFramePos, aContainerSize,
+ ReflowChildFlags::Default);
aItem.SetAscent(childDesiredSize.BlockStartAscent());
}
@@ -4899,14 +4900,13 @@ nsFlexContainerFrame::ReflowPlaceholders(nsPresContext* aPresContext,
placeholder, availSize);
ReflowOutput childDesiredSize(childReflowInput);
nsReflowStatus childReflowStatus;
- ReflowChild(placeholder, aPresContext,
- childDesiredSize, childReflowInput,
- outerWM, aContentBoxOrigin, aContainerSize, 0,
- childReflowStatus);
-
- FinishReflowChild(placeholder, aPresContext,
- childDesiredSize, &childReflowInput,
- outerWM, aContentBoxOrigin, aContainerSize, 0);
+ ReflowChild(placeholder, aPresContext, childDesiredSize, childReflowInput,
+ outerWM, aContentBoxOrigin, aContainerSize,
+ ReflowChildFlags::Default, childReflowStatus);
+
+ FinishReflowChild(placeholder, aPresContext, childDesiredSize,
+ &childReflowInput, outerWM, aContentBoxOrigin,
+ aContainerSize, ReflowChildFlags::Default);
// Mark the placeholder frame to indicate that it's not actually at the
// element's static position, because we need to apply CSS Alignment after
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index 7e819ddf3b..43ad970890 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6583,9 +6583,9 @@ nsIFrame::UpdateOverflow()
if (FinishAndStoreOverflow(overflowAreas, GetSize())) {
nsView* view = GetView();
if (view) {
- uint32_t flags = GetXULLayoutFlags();
+ ReflowChildFlags flags = GetXULLayoutFlags();
- if ((flags & NS_FRAME_NO_SIZE_VIEW) == 0) {
+ if (!(flags & ReflowChildFlags::NoSizeView)) {
// Make sure the frame's view is properly sized.
nsViewManager* vm = view->GetViewManager();
vm->ResizeView(view, overflowAreas.VisualOverflow(), true);
@@ -9820,9 +9820,10 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
- uint32_t layoutFlags = aState.LayoutFlags();
+ ReflowChildFlags layoutFlags = aState.LayoutFlags();
nsContainerFrame::FinishReflowChild(this, aPresContext, aDesiredSize,
- &reflowInput, aX, aY, layoutFlags | NS_FRAME_NO_MOVE_FRAME);
+ &reflowInput, aX, aY, layoutFlags |
+ ReflowChildFlags::NoMoveFrame);
// Save the ascent. (bug 103925)
if (IsXULCollapsed()) {
diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp
index 4315b9b8af..a3970b5a98 100644
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -699,13 +699,14 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
nsReflowStatus status;
ReflowChild(aChild, aPresContext, reflowOutput, reflowInput, aOffset.x,
- aOffset.y, 0, status);
+ aOffset.y, ReflowChildFlags::Default, status);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
// Place and size the child
reflowOutput.Width() = aSize.width;
reflowOutput.Height() = aSize.height;
- FinishReflowChild(aChild, aPresContext, reflowOutput, nullptr, aOffset.x, aOffset.y, 0);
+ FinishReflowChild(aChild, aPresContext, reflowOutput, nullptr, aOffset.x,
+ aOffset.y, ReflowChildFlags::Default);
}
static
diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp
index bbde1d7dc0..ff8500b92f 100644
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -571,11 +571,11 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
nsReflowStatus status;
// No need to pass a true container-size to ReflowChild or
// FinishReflowChild, because it's only used there when positioning
- // the frame (i.e. if NS_FRAME_NO_MOVE_FRAME isn't set)
+ // the frame (i.e. if ReflowChildFlags::NoMoveFrame isn't set)
const nsSize dummyContainerSize;
- ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
- kidReflowInput, wm, LogicalPoint(wm), dummyContainerSize,
- NS_FRAME_NO_MOVE_FRAME, status);
+ ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics, kidReflowInput,
+ wm, LogicalPoint(wm), dummyContainerSize,
+ ReflowChildFlags::NoMoveFrame, status);
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
mHelper.mHasVerticalScrollbar = didHaveVerticalScrollbar;
@@ -588,7 +588,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
FinishReflowChild(mHelper.mScrolledFrame, presContext,
*aMetrics, &kidReflowInput, wm, LogicalPoint(wm),
dummyContainerSize,
- NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW);
+ ReflowChildFlags::NoMoveFrame | ReflowChildFlags::NoSizeView);
// XXX Some frames (e.g., nsPluginFrame, nsFrameFrame, nsTextFrame) don't bother
// setting their mOverflowArea. This is wrong because every frame should
@@ -801,7 +801,7 @@ nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState,
scrolledFrame,
scrolledFrame->GetView(),
scrolledArea,
- 0);
+ ReflowChildFlags::Default);
}
nscoord
@@ -1664,7 +1664,7 @@ nsXULScrollFrame::GetFrameName(nsAString& aResult) const
NS_IMETHODIMP
nsXULScrollFrame::DoXULLayout(nsBoxLayoutState& aState)
{
- uint32_t flags = aState.LayoutFlags();
+ ReflowChildFlags flags = aState.LayoutFlags();
nsresult rv = XULLayout(aState);
aState.SetLayoutFlags(flags);
@@ -4956,14 +4956,12 @@ nsXULScrollFrame::AddRemoveScrollbar(bool& aHasScrollbar, nscoord& aXY,
return false;
}
-void
-nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
- const nsPoint& aScrollPosition)
-{
- uint32_t oldflags = aState.LayoutFlags();
+void nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
+ const nsPoint& aScrollPosition) {
+ ReflowChildFlags oldflags = aState.LayoutFlags();
nsRect childRect = nsRect(mHelper.mScrollPort.TopLeft() - aScrollPosition,
mHelper.mScrollPort.Size());
- int32_t flags = NS_FRAME_NO_MOVE_VIEW;
+ ReflowChildFlags flags = ReflowChildFlags::NoMoveView;
nsSize minSize = mHelper.mScrolledFrame->GetXULMinSize(aState);
diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp
index 0a953d6fff..34113e4fa7 100644
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -3789,7 +3789,10 @@ MeasuringReflow(nsIFrame* aChild,
ReflowInput childRI(pc, *rs, aChild, aAvailableSize, &aCBSize, riFlags);
ReflowOutput childSize(childRI);
nsReflowStatus childStatus;
- const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW;
+ const nsIFrame::ReflowChildFlags flags =
+ 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,
@@ -5341,7 +5344,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
ReflowOutput childSize(childRI);
const nsSize dummyContainerSize;
ReflowChild(aChild, pc, childSize, childRI, childWM, LogicalPoint(childWM),
- dummyContainerSize, 0, aStatus);
+ dummyContainerSize, ReflowChildFlags::Default, aStatus);
LogicalPoint childPos =
cb.Origin(wm).ConvertTo(childWM, wm,
aContainerSize - childSize.PhysicalSize());
@@ -5370,7 +5373,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
childRI.ApplyRelativePositioning(&childPos, aContainerSize);
FinishReflowChild(aChild, pc, childSize, &childRI, childWM, childPos,
- aContainerSize, 0);
+ aContainerSize, ReflowChildFlags::Default);
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, aChild);
}
@@ -5884,14 +5887,15 @@ nsGridContainerFrame::ReflowChildren(GridReflowInput& aState,
nsReflowStatus& aStatus)
{
MOZ_ASSERT(aState.mReflowInput);
+ MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
aStatus = NS_FRAME_COMPLETE;
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
ReflowOverflowContainerChildren(PresContext(), *aState.mReflowInput,
- ocBounds, 0, ocStatus,
- MergeSortedFrameListsFor);
+ ocBounds, ReflowChildFlags::Default,
+ ocStatus, MergeSortedFrameListsFor);
}
WritingMode wm = aState.mReflowInput->GetWritingMode();
diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp
index f40f799bab..8808907006 100644
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -281,10 +281,10 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), aMetrics.mFlags);
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
availSize);
- ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput,
- 0, 0, 0, childStatus, nullptr);
+ ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput, 0,
+ 0, ReflowChildFlags::Default, childStatus, nullptr);
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
- &childReflowInput, 0, 0, 0);
+ &childReflowInput, 0, 0, ReflowChildFlags::Default);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("exit nsHTMLCanvasFrame::Reflow: size=%d,%d",
diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h
index bc5a5fe971..be439dbdc2 100644
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -2239,6 +2239,24 @@ public:
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) = 0;
+ // Option flags for ReflowChild() and FinishReflowChild()
+ // member functions
+ enum class ReflowChildFlags : uint32_t {
+ Default = 0,
+ NoMoveView = 1 << 0,
+ NoMoveFrame = (1 << 1) | NoMoveView,
+ NoSizeView = 1 << 2,
+ NoVisibility = 1 << 3,
+
+ // Only applies to ReflowChild; if true, don't delete the next-in-flow, even
+ // if the reflow is fully complete.
+ NoDeleteNextInFlowChild = 1 << 4,
+
+ // Only applies to FinishReflowChild. Tell it to call
+ // ApplyRelativePositioning.
+ ApplyRelativePositioning = 1 << 5
+ };
+
/**
* Post-reflow hook. After a frame is reflowed this method will be called
* informing the frame that this reflow process is complete, and telling the
@@ -3213,8 +3231,9 @@ size_t SizeOfFramePropertiesForTree(mozilla::MallocSizeOf aMallocSizeOf) const;
virtual nsBoxLayout* GetXULLayoutManager() { return nullptr; }
nsresult GetXULClientRect(nsRect& aContentRect);
- virtual uint32_t GetXULLayoutFlags()
- { return 0; }
+ virtual ReflowChildFlags GetXULLayoutFlags() {
+ return ReflowChildFlags::Default;
+ }
// For nsSprocketLayout
virtual Valignment GetXULVAlign() const = 0;
@@ -3776,6 +3795,8 @@ public:
#endif
};
+MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsIFrame::ReflowChildFlags)
+
//----------------------------------------------------------------------
/**
diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp
index 60e4e8c964..8cac02d603 100644
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -3331,7 +3331,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
if (frame->HasView())
nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, frame,
frame->GetView(), pfd->mOverflowAreas.VisualOverflow(),
- NS_FRAME_NO_SIZE_VIEW);
+ nsIFrame::ReflowChildFlags::NoSizeView);
// Note: the combined area of a child is in its coordinate
// system. We adjust the childs combined area into our coordinate
@@ -3379,7 +3379,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, frame,
frame->GetView(),
r.VisualOverflow(),
- NS_FRAME_NO_MOVE_VIEW);
+ nsIFrame::ReflowChildFlags::NoMoveView);
overflowAreas.UnionWith(r + frame->GetPosition());
}
diff --git a/layout/generic/nsPageContentFrame.cpp b/layout/generic/nsPageContentFrame.cpp
index 2c7348afca..cb558374db 100644
--- a/layout/generic/nsPageContentFrame.cpp
+++ b/layout/generic/nsPageContentFrame.cpp
@@ -58,12 +58,13 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.SetComputedBSize(logicalSize.BSize(wm));
// Reflow the page content area
- ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, 0, 0, 0, aStatus);
+ ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, 0, 0,
+ ReflowChildFlags::Default, aStatus);
// The document element's background should cover the entire canvas, so
// take into account the combined area and any space taken up by
// absolutely positioned elements
- nsMargin padding(0,0,0,0);
+ nsMargin padding(0, 0, 0, 0);
// XXXbz this screws up percentage padding (sets padding to zero
// in the percentage padding case)
@@ -87,10 +88,12 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
}
// Place and size the child
- FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, 0, 0, 0);
+ FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, 0, 0,
+ ReflowChildFlags::Default);
- NS_ASSERTION(aPresContext->IsDynamic() || !NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
- !frame->GetNextInFlow(), "bad child flow list");
+ NS_ASSERTION(aPresContext->IsDynamic() || !aStatus.IsFullyComplete() ||
+ !frame->GetNextInFlow(),
+ "bad child flow list");
}
// Reflow our fixed frames
diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp
index 31a686e83e..6120e35103 100644
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -141,13 +141,15 @@ nsPageFrame::Reflow(nsPresContext* aPresContext,
nscoord yc = mPageContentMargin.top;
// Get the child's desired size
- ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, xc, yc, 0, aStatus);
+ ReflowChild(frame, aPresContext, aDesiredSize, kidReflowInput, xc, yc,
+ ReflowChildFlags::Default, aStatus);
// Place and size the child
- FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, xc, yc, 0);
+ FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, xc,
+ yc, ReflowChildFlags::Default);
- NS_ASSERTION(!NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
- !frame->GetNextInFlow(), "bad child flow list");
+ NS_ASSERTION(!aStatus.IsFullyComplete() || !frame->GetNextInFlow(),
+ "bad child flow list");
}
PR_PL(("PageFrame::Reflow %p ", this));
PR_PL(("[%d,%d][%d,%d]\n", aDesiredSize.Width(), aDesiredSize.Height(),
diff --git a/layout/generic/nsRubyFrame.cpp b/layout/generic/nsRubyFrame.cpp
index 797b00fcf1..b6a3d0180d 100644
--- a/layout/generic/nsRubyFrame.cpp
+++ b/layout/generic/nsRubyFrame.cpp
@@ -345,7 +345,8 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
// correct. We will fix it in nsLineLayout after the whole line is
// reflowed.
FinishReflowChild(textContainer, aPresContext, textMetrics,
- &textReflowInput, lineWM, position, dummyContainerSize, 0);
+ &textReflowInput, lineWM, position, dummyContainerSize,
+ ReflowChildFlags::Default);
}
MOZ_ASSERT(baseRect.ISize(lineWM) == offsetRect.ISize(lineWM),
"Annotations should only be placed on the block directions");
diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp
index d8ec898a6a..444512fba6 100644
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -255,13 +255,15 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
nscoord x = pageCSSMargin.left;
// Place and size the page.
- ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, x, y, 0, status);
+ ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, x, y,
+ ReflowChildFlags::Default, status);
// If the page is narrower than our width, then center it horizontally:
x += ComputeCenteringMargin(aReflowInput.ComputedWidth(),
kidSize.Width(), pageCSSMargin);
- FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, x, y, 0);
+ FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, x, y,
+ ReflowChildFlags::Default);
y += kidSize.Height();
y += pageCSSMargin.bottom;
diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp
index 0472ebe626..7986f672c1 100644
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -308,6 +308,9 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
// Reflow the child frames. We may have up to two, an image frame
// which is the poster, and a box frame, which is the video controls.
for (nsIFrame* child : mFrames) {
+ nsSize oldChildSize = child->GetSize();
+ nsReflowStatus childStatus;
+
if (child->GetContent() == mPosterImage) {
// Reflow the poster frame.
nsImageFrame* imageFrame = static_cast<nsImageFrame*>(child);
@@ -332,10 +335,15 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.SetComputedWidth(posterRenderRect.width);
kidReflowInput.SetComputedHeight(posterRenderRect.height);
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
- posterRenderRect.x, posterRenderRect.y, 0, aStatus);
- FinishReflowChild(imageFrame, aPresContext,
- kidDesiredSize, &kidReflowInput,
- posterRenderRect.x, posterRenderRect.y, 0);
+ posterRenderRect.x, posterRenderRect.y,
+ ReflowChildFlags::Default, childStatus);
+ MOZ_ASSERT(childStatus.IsFullyComplete(),
+ "We gave our child unconstrained available block-size, "
+ "so it should be complete!");
+
+ FinishReflowChild(imageFrame, aPresContext, kidDesiredSize,
+ &kidReflowInput, posterRenderRect.x, posterRenderRect.y,
+ ReflowChildFlags::Default);
} else if (child->GetContent() == mVideoControls) {
// Reflow the video controls frame.
nsBoxLayoutState boxState(PresContext(), aReflowInput.mRenderingContext);
@@ -370,10 +378,16 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.SetComputedHeight(std::max(size.height, 0));
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
- mBorderPadding.left, mBorderPadding.top, 0, aStatus);
+ mBorderPadding.left, mBorderPadding.top,
+ ReflowChildFlags::Default, childStatus);
+ MOZ_ASSERT(childStatus.IsFullyComplete(),
+ "We gave our child unconstrained available block-size, "
+ "so it should be complete!");
+
FinishReflowChild(child, aPresContext,
kidDesiredSize, &kidReflowInput,
- mBorderPadding.left, mBorderPadding.top, 0);
+ mBorderPadding.left, mBorderPadding.top,
+ ReflowChildFlags::Default);
}
}
aMetrics.SetOverflowAreasToDesiredBounds();
diff --git a/layout/generic/nsViewportFrame.cpp b/layout/generic/nsViewportFrame.cpp
index a37d2a5a7c..ec933b84e3 100644
--- a/layout/generic/nsViewportFrame.cpp
+++ b/layout/generic/nsViewportFrame.cpp
@@ -315,11 +315,12 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
// Reflow the frame
kidReflowInput.SetComputedBSize(aReflowInput.ComputedBSize());
- ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput,
- 0, 0, 0, aStatus);
+ ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, 0, 0,
+ ReflowChildFlags::Default, aStatus);
kidBSize = kidDesiredSize.BSize(wm);
- FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0, 0);
+ FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0,
+ ReflowChildFlags::Default);
} else {
kidBSize = LogicalSize(wm, mFrames.FirstChild()->GetSize()).BSize(wm);
}
diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp
index 8e22ba204d..bd2eb36529 100644
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -835,9 +835,9 @@ nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
NS_ASSERTION(!inlineFrame, "Inline frames should be wrapped in blocks");
#endif
- nsContainerFrame::
- ReflowChild(aChildFrame, aPresContext, aDesiredSize, aReflowInput,
- 0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
+ nsContainerFrame::ReflowChild(aChildFrame, aPresContext, aDesiredSize,
+ aReflowInput, 0, 0,
+ ReflowChildFlags::NoMoveFrame, aStatus);
if (aDesiredSize.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
// This will be suitable for inline frames, which are wrapped in a block.
@@ -1311,7 +1311,7 @@ nsMathMLContainerFrame::PositionRowChildFrames(nscoord aOffsetX,
nscoord dx = aOffsetX + child.X();
nscoord dy = aBaseline - child.Ascent();
FinishReflowChild(child.Frame(), PresContext(), child.GetReflowOutput(),
- nullptr, dx, dy, 0);
+ nullptr, dx, dy, ReflowChildFlags::Default);
++child;
}
}
diff --git a/layout/mathml/nsMathMLSelectedFrame.cpp b/layout/mathml/nsMathMLSelectedFrame.cpp
index 11eb14d83f..43e0785a63 100644
--- a/layout/mathml/nsMathMLSelectedFrame.cpp
+++ b/layout/mathml/nsMathMLSelectedFrame.cpp
@@ -178,7 +178,8 @@ nsMathMLSelectedFrame::Place(DrawTarget* aDrawTarget,
if (childFrame) {
GetReflowAndBoundingMetricsFor(childFrame, aDesiredSize, mBoundingMetrics);
if (aPlaceOrigin) {
- FinishReflowChild(childFrame, PresContext(), aDesiredSize, nullptr, 0, 0, 0);
+ FinishReflowChild(childFrame, PresContext(), aDesiredSize, nullptr, 0, 0,
+ ReflowChildFlags::Default);
}
mReference.x = 0;
mReference.y = aDesiredSize.BlockStartAscent();
diff --git a/layout/mathml/nsMathMLTokenFrame.cpp b/layout/mathml/nsMathMLTokenFrame.cpp
index 7558664f21..c57e97e615 100644
--- a/layout/mathml/nsMathMLTokenFrame.cpp
+++ b/layout/mathml/nsMathMLTokenFrame.cpp
@@ -193,7 +193,8 @@ nsMathMLTokenFrame::Place(DrawTarget* aDrawTarget,
// place and size the child; (dx,0) makes the caret happy - bug 188146
dy = childSize.Height() == 0 ? 0 : aDesiredSize.BlockStartAscent() - childSize.BlockStartAscent();
- FinishReflowChild(childFrame, PresContext(), childSize, nullptr, dx, dy, 0);
+ FinishReflowChild(childFrame, PresContext(), childSize, nullptr, dx, dy,
+ ReflowChildFlags::Default);
dx += childSize.Width();
}
}
diff --git a/layout/mathml/nsMathMLmfencedFrame.cpp b/layout/mathml/nsMathMLmfencedFrame.cpp
index bc663a5718..edf5c0d987 100644
--- a/layout/mathml/nsMathMLmfencedFrame.cpp
+++ b/layout/mathml/nsMathMLmfencedFrame.cpp
@@ -403,8 +403,9 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
else
aDesiredSize.mBoundingMetrics += bm;
- FinishReflowChild(childFrame, aPresContext, childSize, nullptr,
- dx, ascent - childSize.BlockStartAscent(), 0);
+ FinishReflowChild(childFrame, aPresContext, childSize, nullptr, dx,
+ ascent - childSize.BlockStartAscent(),
+ ReflowChildFlags::Default);
dx += childSize.Width();
if (i < mSeparatorsCount) {
diff --git a/layout/mathml/nsMathMLmfracFrame.cpp b/layout/mathml/nsMathMLmfracFrame.cpp
index 731cca7d0c..c4f21136eb 100644
--- a/layout/mathml/nsMathMLmfracFrame.cpp
+++ b/layout/mathml/nsMathMLmfracFrame.cpp
@@ -451,10 +451,12 @@ nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
nscoord dy;
// place numerator
dy = 0;
- FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dxNum, dy, 0);
+ FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dxNum, dy,
+ ReflowChildFlags::Default);
// place denominator
dy = aDesiredSize.Height() - sizeDen.Height();
- FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dxDen, dy, 0);
+ FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dxDen, dy,
+ ReflowChildFlags::Default);
// place the fraction bar - dy is top of bar
dy = aDesiredSize.BlockStartAscent() - (axisHeight + actualRuleThickness/2);
mLineRect.SetRect(leftSpace, dy, width - (leftSpace + rightSpace),
@@ -571,7 +573,8 @@ nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
dx = MirrorIfRTL(aDesiredSize.Width(), sizeNum.Width(),
leadingSpace);
dy = aDesiredSize.BlockStartAscent() - numShift - sizeNum.BlockStartAscent();
- FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dx, dy, 0);
+ FinishReflowChild(frameNum, presContext, sizeNum, nullptr, dx, dy,
+ ReflowChildFlags::Default);
// place the fraction bar
dx = MirrorIfRTL(aDesiredSize.Width(), mLineRect.width,
@@ -584,7 +587,8 @@ nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
dx = MirrorIfRTL(aDesiredSize.Width(), sizeDen.Width(),
leadingSpace + bmNum.width + mLineRect.width);
dy = aDesiredSize.BlockStartAscent() + denShift - sizeDen.BlockStartAscent();
- FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dx, dy, 0);
+ FinishReflowChild(frameDen, presContext, sizeDen, nullptr, dx, dy,
+ ReflowChildFlags::Default);
}
}
diff --git a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
index 3504bdafd5..74b1ad05c8 100644
--- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
+++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
@@ -632,11 +632,11 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
// place the base ...
childFrame = baseFrame;
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
- FinishReflowChild (baseFrame, aPresContext, baseSize, nullptr,
- aFrame->MirrorIfRTL(aDesiredSize.Width(),
- baseSize.Width(),
- dx),
- dy, 0);
+ FinishReflowChild(baseFrame, aPresContext, baseSize, nullptr,
+ aFrame->MirrorIfRTL(aDesiredSize.Width(),
+ baseSize.Width(),
+ dx),
+ dy, ReflowChildFlags::Default);
dx += bmBase.width;
} else if (prescriptsFrame == childFrame) {
// Clear reflow flags of prescripts frame.
@@ -668,12 +668,12 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
x += width - subScriptSize.Width();
dy = aDesiredSize.BlockStartAscent() - subScriptSize.BlockStartAscent() +
maxSubScriptShift;
- FinishReflowChild (subScriptFrame, aPresContext, subScriptSize,
- nullptr,
- aFrame->MirrorIfRTL(aDesiredSize.Width(),
- subScriptSize.Width(),
- x),
- dy, 0);
+ FinishReflowChild(subScriptFrame, aPresContext, subScriptSize,
+ nullptr,
+ aFrame->MirrorIfRTL(aDesiredSize.Width(),
+ subScriptSize.Width(),
+ x),
+ dy, ReflowChildFlags::Default);
}
if (supScriptFrame) {
@@ -686,12 +686,12 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
}
dy = aDesiredSize.BlockStartAscent() - supScriptSize.BlockStartAscent() -
maxSupScriptShift;
- FinishReflowChild (supScriptFrame, aPresContext, supScriptSize,
- nullptr,
- aFrame->MirrorIfRTL(aDesiredSize.Width(),
- supScriptSize.Width(),
- x),
- dy, 0);
+ FinishReflowChild(supScriptFrame, aPresContext, supScriptSize,
+ nullptr,
+ aFrame->MirrorIfRTL(aDesiredSize.Width(),
+ supScriptSize.Width(),
+ x),
+ dy, ReflowChildFlags::Default);
}
dx += width + scriptSpace;
}
diff --git a/layout/mathml/nsMathMLmrootFrame.cpp b/layout/mathml/nsMathMLmrootFrame.cpp
index 300adcb91c..b3353b385a 100644
--- a/layout/mathml/nsMathMLmrootFrame.cpp
+++ b/layout/mathml/nsMathMLmrootFrame.cpp
@@ -333,7 +333,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
(indexRaisedAscent + indexSize.BlockStartAscent() - bmIndex.ascent);
FinishReflowChild(indexFrame, aPresContext, indexSize, nullptr,
MirrorIfRTL(aDesiredSize.Width(), indexSize.Width(), dx),
- dy, 0);
+ dy, ReflowChildFlags::Default);
// place the radical symbol and the radical bar
dx = dxSqr;
@@ -347,8 +347,8 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
// place the base
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
FinishReflowChild(baseFrame, aPresContext, baseSize, nullptr,
- MirrorIfRTL(aDesiredSize.Width(), baseSize.Width(), dx),
- dy, 0);
+ MirrorIfRTL(aDesiredSize.Width(), baseSize.Width(), dx), dy,
+ ReflowChildFlags::Default);
mReference.x = 0;
mReference.y = aDesiredSize.BlockStartAscent();
diff --git a/layout/mathml/nsMathMLmunderoverFrame.cpp b/layout/mathml/nsMathMLmunderoverFrame.cpp
index 8fb932719d..e152e3c2fa 100644
--- a/layout/mathml/nsMathMLmunderoverFrame.cpp
+++ b/layout/mathml/nsMathMLmunderoverFrame.cpp
@@ -668,18 +668,20 @@ nsMathMLmunderoverFrame::Place(DrawTarget* aDrawTarget,
dy = aDesiredSize.BlockStartAscent() -
mBoundingMetrics.ascent + bmOver.ascent -
overSize.BlockStartAscent();
- FinishReflowChild (overFrame, PresContext(), overSize, nullptr, dxOver, dy, 0);
+ FinishReflowChild(overFrame, PresContext(), overSize, nullptr, dxOver, dy,
+ ReflowChildFlags::Default);
}
// place base
dy = aDesiredSize.BlockStartAscent() - baseSize.BlockStartAscent();
- FinishReflowChild (baseFrame, PresContext(), baseSize, nullptr, dxBase, dy, 0);
+ FinishReflowChild(baseFrame, PresContext(), baseSize, nullptr, dxBase, dy,
+ ReflowChildFlags::Default);
// place underscript
if (underFrame) {
dy = aDesiredSize.BlockStartAscent() +
mBoundingMetrics.descent - bmUnder.descent -
underSize.BlockStartAscent();
- FinishReflowChild (underFrame, PresContext(), underSize, nullptr,
- dxUnder, dy, 0);
+ FinishReflowChild(underFrame, PresContext(), underSize, nullptr,
+ dxUnder, dy, ReflowChildFlags::Default);
}
}
return NS_OK;
diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp
index f8584a4f1e..f917f60890 100644
--- a/layout/svg/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/nsSVGForeignObjectFrame.cpp
@@ -562,11 +562,12 @@ nsSVGForeignObjectFrame::DoReflow()
reflowInput.SetComputedBSize(BSize(wm));
ReflowChild(kid, presContext, desiredSize, reflowInput, 0, 0,
- NS_FRAME_NO_MOVE_FRAME, status);
+ ReflowChildFlags::NoMoveFrame, status);
NS_ASSERTION(mRect.width == desiredSize.Width() &&
- mRect.height == desiredSize.Height(), "unexpected size");
+ mRect.height == desiredSize.Height(),
+ "unexpected size");
FinishReflowChild(kid, presContext, desiredSize, &reflowInput, 0, 0,
- NS_FRAME_NO_MOVE_FRAME);
+ ReflowChildFlags::NoMoveFrame);
mInReflow = false;
}
diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp
index ee05565a9c..1e0b6a3d99 100644
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -640,7 +640,8 @@ void nsTableCellFrame::BlockDirAlignChild(WritingMode aWM, nscoord aMaxAscent)
if (HasView()) {
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this,
GetView(),
- desiredSize.VisualOverflow(), 0);
+ desiredSize.VisualOverflow(),
+ ReflowChildFlags::Default);
}
}
@@ -937,8 +938,8 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
nsRect origVisualOverflow = firstKid->GetVisualOverflowRect();
bool firstReflow = firstKid->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
- ReflowChild(firstKid, aPresContext, kidSize, kidReflowInput,
- wm, kidOrigin, containerSize, 0, aStatus);
+ ReflowChild(firstKid, aPresContext, kidSize, kidReflowInput, wm, kidOrigin,
+ containerSize, ReflowChildFlags::Default, aStatus);
if (NS_FRAME_OVERFLOW_IS_INCOMPLETE(aStatus)) {
// Don't pass OVERFLOW_INCOMPLETE through tables until they can actually handle it
//XXX should paginate overflow as overflow, but not in this patch (bug 379349)
@@ -967,8 +968,8 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
SetContentEmpty(isEmpty);
// Place the child
- FinishReflowChild(firstKid, aPresContext, kidSize, &kidReflowInput,
- wm, kidOrigin, containerSize, 0);
+ FinishReflowChild(firstKid, aPresContext, kidSize, &kidReflowInput, wm,
+ kidOrigin, containerSize, ReflowChildFlags::Default);
nsTableFrame::InvalidateTableFrame(firstKid, origRect, origVisualOverflow,
firstReflow);
diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp
index be5b71bb24..14dcd19b56 100644
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -374,8 +374,10 @@ nsTableColGroupFrame::Reflow(nsPresContext* aPresContext,
LogicalSize(kidFrame->GetWritingMode()));
nsReflowStatus status;
- ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, 0, 0, 0, status);
- FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0, 0);
+ ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, 0, 0,
+ ReflowChildFlags::Default, status);
+ FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0,
+ ReflowChildFlags::Default);
}
aDesiredSize.ClearSize();
diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp
index 7e11a978b1..52a6eb0a3d 100644
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -103,13 +103,13 @@ struct TableReflowInput {
availSize.BSize(wm) = std::max(0, availSize.BSize(wm));
}
}
-
- void ReduceAvailableBSizeBy(WritingMode aWM, nscoord aAmount) {
- if (availSize.BSize(aWM) == NS_UNCONSTRAINEDSIZE) {
- return;
- }
- availSize.BSize(aWM) -= aAmount;
- availSize.BSize(aWM) = std::max(0, availSize.BSize(aWM));
+
+ void ReduceAvailableBSizeBy(WritingMode aWM, nscoord aAmount) {
+ if (availSize.BSize(aWM) == NS_UNCONSTRAINEDSIZE) {
+ return;
+ }
+ availSize.BSize(aWM) -= aAmount;
+ availSize.BSize(aWM) = std::max(0, availSize.BSize(aWM));
}
};
@@ -2680,7 +2680,7 @@ nsTableFrame::PlaceChild(TableReflowInput& aReflowInput,
// Place and size the child
FinishReflowChild(aKidFrame, PresContext(), aKidDesiredSize, nullptr,
- aKidPosition.x, aKidPosition.y, 0);
+ aKidPosition.x, aKidPosition.y, ReflowChildFlags::Default);
InvalidateTableFrame(aKidFrame, aOriginalKidRect, aOriginalKidVisualOverflow,
isFirstReflow);
@@ -2832,9 +2832,9 @@ nsTableFrame::SetupHeaderFooterChild(const TableReflowInput& aReflowInput,
ReflowOutput desiredSize(aReflowInput.reflowInput);
desiredSize.ClearSize();
nsReflowStatus status;
- ReflowChild(aFrame, presContext, desiredSize, kidReflowInput,
- wm, LogicalPoint(wm, aReflowInput.iCoord, aReflowInput.bCoord),
- containerSize, 0, status);
+ ReflowChild(aFrame, presContext, desiredSize, kidReflowInput, wm,
+ LogicalPoint(wm, aReflowInput.iCoord, aReflowInput.bCoord),
+ containerSize, ReflowChildFlags::Default, status);
// The child will be reflowed again "for real" so no need to place it now
aFrame->SetRepeatable(IsRepeatable(desiredSize.Height(), pageHeight));
@@ -2870,8 +2870,9 @@ nsTableFrame::PlaceRepeatedFooter(TableReflowInput& aReflowInput,
ReflowOutput desiredSize(aReflowInput.reflowInput);
desiredSize.ClearSize();
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
- ReflowChild(aTfoot, presContext, desiredSize, footerReflowInput,
- wm, kidPosition, containerSize, 0, footerStatus);
+ ReflowChild(aTfoot, presContext, desiredSize, footerReflowInput, wm,
+ kidPosition, containerSize, ReflowChildFlags::Default,
+ footerStatus);
footerReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
PlaceChild(aReflowInput, aTfoot,
@@ -3029,8 +3030,9 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
}
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
- ReflowChild(kidFrame, presContext, desiredSize, kidReflowInput,
- wm, kidPosition, containerSize, 0, aStatus);
+ ReflowChild(kidFrame, presContext, desiredSize, kidReflowInput, wm,
+ kidPosition, containerSize, ReflowChildFlags::Default,
+ aStatus);
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
if (reorder) {
@@ -3209,9 +3211,10 @@ nsTableFrame::ReflowColGroups(nsRenderingContext *aRenderingContext)
kidReflowInput(presContext, kidFrame, aRenderingContext,
LogicalSize(kidFrame->GetWritingMode()));
nsReflowStatus cgStatus;
- ReflowChild(kidFrame, presContext, kidMet, kidReflowInput, 0, 0, 0,
- cgStatus);
- FinishReflowChild(kidFrame, presContext, kidMet, nullptr, 0, 0, 0);
+ ReflowChild(kidFrame, presContext, kidMet, kidReflowInput, 0, 0,
+ ReflowChildFlags::Default, cgStatus);
+ FinishReflowChild(kidFrame, presContext, kidMet, nullptr, 0, 0,
+ ReflowChildFlags::Default);
}
}
SetHaveReflowedColGroups(true);
diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp
index 18f11f876b..374bb2562e 100644
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -386,7 +386,8 @@ nsTableRowFrame::DidResize()
FinishAndStoreOverflow(&desiredSize);
if (HasView()) {
nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(),
- desiredSize.VisualOverflow(), 0);
+ desiredSize.VisualOverflow(),
+ ReflowChildFlags::Default);
}
// Let our base class do the usual work
}
@@ -812,7 +813,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
InitChildReflowInput(*aPresContext, LogicalSize(wm), false, kidReflowInput);
ReflowOutput desiredSize(aReflowInput);
nsReflowStatus status;
- ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput, 0, 0, 0, status);
+ ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput, 0, 0,
+ ReflowChildFlags::Default, status);
kidFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
continue;
@@ -906,8 +908,9 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
*kidReflowInput);
nsReflowStatus status;
- ReflowChild(kidFrame, aPresContext, desiredSize, *kidReflowInput,
- wm, kidPosition, containerSize, 0, status);
+ ReflowChild(kidFrame, aPresContext, desiredSize, *kidReflowInput, wm,
+ kidPosition, containerSize, ReflowChildFlags::Default,
+ status);
// allow the table to determine if/how the table needs to be rebalanced
// If any of the cells are not complete, then we're not complete
@@ -977,8 +980,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
// In vertical-rl mode, we are likely to have containerSize.width = 0
// because ComputedWidth() was NS_UNCONSTRAINEDSIZE.
// For cases where that's wrong, we will fix up the position later.
- FinishReflowChild(kidFrame, aPresContext, desiredSize, nullptr,
- wm, kidPosition, containerSize, 0);
+ FinishReflowChild(kidFrame, aPresContext, desiredSize, nullptr, wm,
+ kidPosition, containerSize, ReflowChildFlags::Default);
nsTableFrame::InvalidateTableFrame(kidFrame, kidRect, kidVisualOverflow,
firstReflow);
@@ -1149,8 +1152,8 @@ nsTableRowFrame::ReflowCellFrame(nsPresContext* aPresContext,
ReflowOutput desiredSize(aReflowInput);
- ReflowChild(aCellFrame, aPresContext, desiredSize, cellReflowInput,
- 0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
+ ReflowChild(aCellFrame, aPresContext, desiredSize, cellReflowInput, 0, 0,
+ ReflowChildFlags::NoMoveFrame, aStatus);
bool fullyComplete = NS_FRAME_IS_COMPLETE(aStatus) && !NS_FRAME_IS_TRUNCATED(aStatus);
if (fullyComplete) {
desiredSize.BSize(wm) = aAvailableBSize;
diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp
index b6d8a43647..e62c644c05 100644
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -279,8 +279,8 @@ nsTableRowGroupFrame::PlaceChild(nsPresContext* aPresContext,
bool isFirstReflow = aKidFrame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
// Place and size the child
- FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr,
- aWM, aKidPosition, aContainerSize, 0);
+ FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr, aWM,
+ aKidPosition, aContainerSize, ReflowChildFlags::Default);
nsTableFrame::InvalidateTableFrame(aKidFrame, aOriginalKidRect,
aOriginalKidVisualOverflow, isFirstReflow);
@@ -411,8 +411,9 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
}
LogicalPoint kidPosition(wm, 0, aReflowInput.bCoord);
- ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput,
- wm, kidPosition, containerSize, 0, aStatus);
+ ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowInput, wm,
+ kidPosition, containerSize, ReflowChildFlags::Default,
+ aStatus);
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
// Place the child
@@ -1147,10 +1148,10 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
nsRect oldRowRect = rowFrame->GetRect();
nsRect oldRowVisualOverflow = rowFrame->GetVisualOverflowRect();
- // Reflow the cell with the constrained height. A cell with rowspan >1 will get this
- // reflow later during SplitSpanningCells.
- ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowInput,
- 0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
+ // Reflow the cell with the constrained height. A cell with rowspan >1
+ // will get this reflow later during SplitSpanningCells.
+ ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowInput, 0, 0,
+ ReflowChildFlags::NoMoveFrame, aStatus);
rowFrame->SetSize(nsSize(rowMetrics.Width(), rowMetrics.Height()));
rowFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
rowFrame->DidResize();
diff --git a/layout/tables/nsTableWrapperFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp
index 86f032218e..e87575b2ea 100644
--- a/layout/tables/nsTableWrapperFrame.cpp
+++ b/layout/tables/nsTableWrapperFrame.cpp
@@ -822,7 +822,7 @@ nsTableWrapperFrame::OuterDoReflowChild(nsPresContext* aPresContext,
// Use the current position as a best guess for placement.
LogicalPoint childPt = aChildFrame->GetLogicalPosition(wm, zeroCSize);
- uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
+ ReflowChildFlags flags = ReflowChildFlags::NoMoveFrame;
// We don't want to delete our next-in-flow's child if it's an inner table
// frame, because table wrapper frames always assume that their inner table
@@ -830,7 +830,7 @@ nsTableWrapperFrame::OuterDoReflowChild(nsPresContext* aPresContext,
// a next-in-flow of an already complete table wrapper frame, then it will
// take care of removing it's inner table frame.
if (aChildFrame == InnerTableFrame()) {
- flags |= NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD;
+ flags |= ReflowChildFlags::NoDeleteNextInFlowChild;
}
ReflowChild(aChildFrame, aPresContext, aMetrics, aChildRI,
@@ -1024,7 +1024,8 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
GetCaptionOrigin(captionSide, containSize, innerSize, innerMargin,
captionSize, captionMargin, captionOrigin, wm);
FinishReflowChild(mCaptionFrames.FirstChild(), aPresContext, *captionMet,
- captionRI.ptr(), wm, captionOrigin, containerSize, 0);
+ captionRI.ptr(), wm, captionOrigin, containerSize,
+ ReflowChildFlags::ApplyRelativePositioning);
captionRI.reset();
}
// XXX If the bsize is constrained then we need to check whether
@@ -1033,8 +1034,9 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
LogicalPoint innerOrigin(wm);
GetInnerOrigin(captionSide, containSize, captionSize, captionMargin,
innerSize, innerMargin, innerOrigin, wm);
+ // NOTE: Relative positioning on the table applies to the whole table wrapper.
FinishReflowChild(InnerTableFrame(), aPresContext, innerMet, innerRI.ptr(),
- wm, innerOrigin, containerSize, 0);
+ wm, innerOrigin, containerSize, ReflowChildFlags::Default);
innerRI.reset();
nsTableFrame::InvalidateTableFrame(InnerTableFrame(), origInnerRect,
@@ -1051,8 +1053,8 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
if (GetPrevInFlow()) {
ReflowOverflowContainerChildren(aPresContext, aOuterRI,
- aDesiredSize.mOverflowAreas, 0,
- aStatus);
+ aDesiredSize.mOverflowAreas,
+ ReflowChildFlags::Default, aStatus);
}
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aOuterRI, aStatus);
diff --git a/layout/xul/nsBox.cpp b/layout/xul/nsBox.cpp
index 787758b157..c43c5cbb7d 100644
--- a/layout/xul/nsBox.cpp
+++ b/layout/xul/nsBox.cpp
@@ -235,16 +235,14 @@ nsBox::SetXULBounds(nsBoxLayoutState& aState, const nsRect& aRect, bool aRemoveO
nsRect rect(mRect);
- uint32_t flags = GetXULLayoutFlags();
+ ReflowChildFlags flags = GetXULLayoutFlags() | aState.LayoutFlags();
- uint32_t stateFlags = aState.LayoutFlags();
-
- flags |= stateFlags;
-
- if ((flags & NS_FRAME_NO_MOVE_FRAME) == NS_FRAME_NO_MOVE_FRAME)
+ if ((flags & ReflowChildFlags::NoMoveFrame) ==
+ ReflowChildFlags::NoMoveFrame) {
SetSize(aRect.Size());
- else
+ } else {
SetRect(aRect);
+ }
// Nuke the overflow area. The caller is responsible for restoring
// it if necessary.
@@ -253,8 +251,7 @@ nsBox::SetXULBounds(nsBoxLayoutState& aState, const nsRect& aRect, bool aRemoveO
ClearOverflowRects();
}
- if (!(flags & NS_FRAME_NO_MOVE_VIEW))
- {
+ if (!(flags & ReflowChildFlags::NoMoveView)) {
nsContainerFrame::PositionFrameView(this);
if ((rect.x != aRect.x) || (rect.y != aRect.y))
nsContainerFrame::PositionChildViews(this);
@@ -533,11 +530,7 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
nsPresContext* presContext = aState.PresContext();
- uint32_t flags = GetXULLayoutFlags();
-
- uint32_t stateFlags = aState.LayoutFlags();
-
- flags |= stateFlags;
+ ReflowChildFlags flags = GetXULLayoutFlags() | aState.LayoutFlags();
nsRect visualOverflow;
diff --git a/layout/xul/nsBoxFrame.cpp b/layout/xul/nsBoxFrame.cpp
index d63861794a..4ede720143 100644
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -905,8 +905,8 @@ nsBoxFrame::GetXULFlex()
NS_IMETHODIMP
nsBoxFrame::DoXULLayout(nsBoxLayoutState& aState)
{
- uint32_t oldFlags = aState.LayoutFlags();
- aState.SetLayoutFlags(0);
+ ReflowChildFlags oldFlags = aState.LayoutFlags();
+ aState.SetLayoutFlags(ReflowChildFlags::Default);
nsresult rv = NS_OK;
if (mLayoutManager) {
diff --git a/layout/xul/nsBoxLayoutState.cpp b/layout/xul/nsBoxLayoutState.cpp
index e1219534e0..2e459ade8e 100644
--- a/layout/xul/nsBoxLayoutState.cpp
+++ b/layout/xul/nsBoxLayoutState.cpp
@@ -19,7 +19,7 @@ nsBoxLayoutState::nsBoxLayoutState(nsPresContext* aPresContext,
: mPresContext(aPresContext)
, mRenderingContext(aRenderingContext)
, mOuterReflowInput(aOuterReflowInput)
- , mLayoutFlags(0)
+ , mLayoutFlags(nsIFrame::ReflowChildFlags::Default)
, mReflowDepth(aReflowDepth)
, mPaintingDisabled(false)
{
diff --git a/layout/xul/nsBoxLayoutState.h b/layout/xul/nsBoxLayoutState.h
index b857ad9c09..91c99def2d 100644
--- a/layout/xul/nsBoxLayoutState.h
+++ b/layout/xul/nsBoxLayoutState.h
@@ -15,6 +15,7 @@
#include "nsCOMPtr.h"
#include "nsPresContext.h"
+#include "nsIFrame.h"
#include "nsIPresShell.h"
class nsRenderingContext;
@@ -38,8 +39,10 @@ public:
nsPresContext* PresContext() const { return mPresContext; }
nsIPresShell* PresShell() const { return mPresContext->PresShell(); }
- uint32_t LayoutFlags() const { return mLayoutFlags; }
- void SetLayoutFlags(uint32_t aFlags) { mLayoutFlags = aFlags; }
+ nsIFrame::ReflowChildFlags LayoutFlags() const { return mLayoutFlags; }
+ void SetLayoutFlags(nsIFrame::ReflowChildFlags aFlags) {
+ mLayoutFlags = aFlags;
+ }
// if true no one under us will paint during reflow.
void SetPaintingDisabled(bool aDisable) { mPaintingDisabled = aDisable; }
@@ -68,7 +71,7 @@ private:
RefPtr<nsPresContext> mPresContext;
nsRenderingContext *mRenderingContext;
const ReflowInput *mOuterReflowInput;
- uint32_t mLayoutFlags;
+ nsIFrame::ReflowChildFlags mLayoutFlags;
uint16_t mReflowDepth;
bool mPaintingDisabled;
};
diff --git a/layout/xul/nsDeckFrame.cpp b/layout/xul/nsDeckFrame.cpp
index 91359c177a..44470185dc 100644
--- a/layout/xul/nsDeckFrame.cpp
+++ b/layout/xul/nsDeckFrame.cpp
@@ -202,8 +202,9 @@ nsDeckFrame::DoXULLayout(nsBoxLayoutState& aState)
{
// Make sure we tweak the state so it does not resize our children.
// We will do that.
- uint32_t oldFlags = aState.LayoutFlags();
- aState.SetLayoutFlags(NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_VISIBILITY);
+ ReflowChildFlags oldFlags = aState.LayoutFlags();
+ aState.SetLayoutFlags(ReflowChildFlags::NoSizeView |
+ ReflowChildFlags::NoVisibility);
// do a normal layout
nsresult rv = nsBoxFrame::DoXULLayout(aState);
diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp
index 378d719d44..73e7d2fa55 100644
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -531,7 +531,7 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState, nsIFrame* aParentMenu,
}
viewManager->SetViewVisibility(view, nsViewVisibility_kShow);
- nsContainerFrame::SyncFrameViewProperties(pc, this, nullptr, view, 0);
+ nsContainerFrame::SyncFrameViewProperties(pc, this, nullptr, view);
}
// finally, if the popup just opened, send a popupshown event
@@ -993,10 +993,9 @@ nsMenuPopupFrame::HidePopup(bool aDeselectMenu, nsPopupState aNewState)
}
}
-uint32_t
-nsMenuPopupFrame::GetXULLayoutFlags()
-{
- return NS_FRAME_NO_SIZE_VIEW | NS_FRAME_NO_MOVE_VIEW | NS_FRAME_NO_VISIBILITY;
+nsIFrame::ReflowChildFlags nsMenuPopupFrame::GetXULLayoutFlags() {
+ return ReflowChildFlags::NoSizeView | ReflowChildFlags::NoMoveView |
+ ReflowChildFlags::NoVisibility;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/layout/xul/nsMenuPopupFrame.h b/layout/xul/nsMenuPopupFrame.h
index b32073960c..c5d70eab02 100644
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -447,7 +447,7 @@ protected:
nsPopupLevel PopupLevel(bool aIsNoAutoHide) const;
// redefine to tell the box system not to move the views.
- virtual uint32_t GetXULLayoutFlags() override;
+ ReflowChildFlags GetXULLayoutFlags() override;
void InitPositionFromAnchorAlign(const nsAString& aAnchor,
const nsAString& aAlign);
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index 7b6dcc0216..92cf9d5b54 100644
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -830,7 +830,7 @@ nsHttpHandler::InitUserAgentComponents()
#elif defined (XP_MACOSX)
#if defined(__ppc__)
mOscpu.AssignLiteral("PPC Mac OS X");
-#elif defined(__i386__) || defined(__x86_64__)
+#else
mOscpu.AssignLiteral("Intel Mac OS X");
#endif
SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor();
diff --git a/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm b/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm
index c5c5051026..5d09d765c3 100644
--- a/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm
+++ b/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm
@@ -1130,6 +1130,14 @@ var declareFFI = function declareFFI(lib, symbol, abi,
throw new TypeError("Missing type for argument " + ( i - 3 ) +
" of symbol " + symbol);
}
+ // Ellipsis for variadic arguments.
+ if (current == "...") {
+ if (i != arguments.length - 1) {
+ throw new TypeError("Variadic ellipsis must be the last argument");
+ }
+ signature.push(current);
+ continue;
+ }
if (!current.implementation) {
throw new TypeError("Missing implementation for argument " + (i - 3)
+ " of symbol " + symbol
diff --git a/toolkit/components/osfile/modules/osfile_unix_back.jsm b/toolkit/components/osfile/modules/osfile_unix_back.jsm
index 4cc4445673..6678edf25b 100644
--- a/toolkit/components/osfile/modules/osfile_unix_back.jsm
+++ b/toolkit/components/osfile/modules/osfile_unix_back.jsm
@@ -435,7 +435,7 @@
/*return*/ Type.negativeone_or_fd,
/*path*/ Type.path,
/*oflags*/ Type.int,
- /*mode*/ Type.int);
+ "...");
if (OS.Constants.Sys.Name == "NetBSD") {
libc.declareLazyFFI(SysFile, "opendir",
diff --git a/toolkit/components/osfile/modules/osfile_unix_front.jsm b/toolkit/components/osfile/modules/osfile_unix_front.jsm
index 4e41036dfc..44454daf1d 100644
--- a/toolkit/components/osfile/modules/osfile_unix_front.jsm
+++ b/toolkit/components/osfile/modules/osfile_unix_front.jsm
@@ -320,7 +320,7 @@
flags |= Const.O_APPEND;
}
}
- return error_or_file(UnixFile.open(path, flags, omode), path);
+ return error_or_file(UnixFile.open(path, flags, ctypes.int(omode)), path);
};
/**
@@ -675,7 +675,7 @@
// If necessary, fail if the destination file exists
if (options.noOverwrite) {
- let fd = UnixFile.open(destPath, Const.O_RDONLY, 0);
+ let fd = UnixFile.open(destPath, Const.O_RDONLY);
if (fd != -1) {
fd.dispose();
// The file exists and we have access
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_aarch64.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_aarch64.cpp
index e5807dbcde..385cba17ad 100644
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_aarch64.cpp
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_aarch64.cpp
@@ -23,109 +23,137 @@
#error "Only little endian compatibility was tested"
#endif
-/*
- * Allocation of integer function arguments initially to registers r1-r7
- * and then to stack. Handling of 'that' argument which goes to register r0
- * is handled separately and does not belong here.
- *
- * 'ireg_args' - pointer to the current position in the buffer,
- * corresponding to the register arguments
- * 'stack_args' - pointer to the current position in the buffer,
- * corresponding to the arguments on stack
- * 'end' - pointer to the end of the registers argument
- * buffer.
- */
-static inline void alloc_word(uint64_t* &ireg_args,
- uint64_t* &stack_args,
- uint64_t* end,
- uint64_t data)
-{
- if (ireg_args < end) {
- *ireg_args = data;
- ireg_args++;
- } else {
- *stack_args = data;
- stack_args++;
- }
+// The AAPCS doesn't require argument widening, but Apple's calling convention
+// does. If we are really fortunate, the compiler will clean up all the
+// copying for us.
+template<typename T>
+inline uint64_t normalize_arg(T value) {
+ return (uint64_t)value;
}
-static inline void alloc_double(double* &freg_args,
- uint64_t* &stack_args,
- double* end,
- double data)
-{
- if (freg_args < end) {
- *freg_args = data;
- freg_args++;
- } else {
- memcpy(stack_args, &data, sizeof(data));
- stack_args++;
- }
+template<>
+inline uint64_t normalize_arg(float value) {
+ uint64_t result = 0;
+ memcpy(&result, &value, sizeof(value));
+ return result;
+}
+
+template<>
+inline uint64_t normalize_arg(double value) {
+ uint64_t result = 0;
+ memcpy(&result, &value, sizeof(value));
+ return result;
}
-static inline void alloc_float(double* &freg_args,
- uint64_t* &stack_args,
- double* end,
- float data)
+/*
+ * Allocation of function arguments to their appropriate place in registers
+ * if possible and then to the stack. Handling of 'that' argument which
+ * goes to register r0 is handled separately and does not belong here.
+ *
+ * Note that we are handling integer arguments and floating-point arguments
+ * identically, depending on which register area is passed to this function.
+ *
+ * 'reg_args' - pointer to the current position in the buffer,
+ * corresponding to the register arguments.
+ * 'reg_args_end' - pointer to the end of the registers argument
+ * buffer.
+ * 'stack_args' - pointer to the current position in the buffer,
+ * corresponding to the arguments on stack.
+ * 'data' - typed data to put on the stack.
+ */
+template<typename T>
+static inline void alloc_arg(uint64_t* &reg_args,
+ uint64_t* reg_args_end,
+ void* &stack_args,
+ T* data)
{
- if (freg_args < end) {
- memcpy(freg_args, &data, sizeof(data));
- freg_args++;
+ if (reg_args < reg_args_end) {
+ *reg_args = normalize_arg(*data);
+ reg_args++;
} else {
- memcpy(stack_args, &data, sizeof(data));
- stack_args++;
+ // According to the ABI, types that are smaller than 8 bytes are
+ // passed in registers or 8-byte stack slots. This rule is only
+ // partially true on Apple platforms, where types smaller than 8
+ // bytes occupy only the space they require on the stack and
+ // their stack slot must be properly aligned.
+#ifdef __APPLE__
+ const size_t aligned_size = sizeof(T);
+#else
+ const size_t aligned_size = 8;
+#endif
+ // Ensure the pointer is aligned for the type
+ uintptr_t addr = (reinterpret_cast<uintptr_t>(stack_args) + aligned_size - 1) & ~(aligned_size - 1);
+ memcpy(reinterpret_cast<void*>(addr), data, sizeof(T));
+ // Point the stack to the next slot.
+ stack_args = reinterpret_cast<void*>(addr + aligned_size);
}
}
-
extern "C" void
invoke_copy_to_stack(uint64_t* stk, uint64_t *end,
uint32_t paramCount, nsXPTCVariant* s)
{
- uint64_t *ireg_args = stk;
- uint64_t *ireg_end = ireg_args + 8;
- double *freg_args = (double *)ireg_end;
- double *freg_end = freg_args + 8;
- uint64_t *stack_args = (uint64_t *)freg_end;
+ uint64_t* ireg_args = stk;
+ uint64_t* ireg_end = ireg_args + 8;
+ // Pun on integer and floating-point registers being the same size.
+ uint64_t* freg_args = ireg_end;
+ uint64_t* freg_end = freg_args + 8;
+ void* stack_args = freg_end;
// leave room for 'that' argument in x0
++ireg_args;
for (uint32_t i = 0; i < paramCount; i++, s++) {
- uint64_t word;
-
- if (s->IsPtrData()) {
- word = (uint64_t)s->ptr;
+ if (s->IsIndirect()) {
+ void* ptr = &s->val;
+ alloc_arg(ireg_args, ireg_end, stack_args, &ptr);
} else {
- // According to the ABI, integral types that are smaller than 8
- // bytes are to be passed in 8-byte registers or 8-byte stack
- // slots.
switch (s->type) {
case nsXPTType::T_FLOAT:
- alloc_float(freg_args, stack_args, freg_end, s->val.f);
- continue;
+ alloc_arg(freg_args, freg_end, stack_args, &s->val.f);
+ break;
case nsXPTType::T_DOUBLE:
- alloc_double(freg_args, stack_args, freg_end, s->val.d);
- continue;
- case nsXPTType::T_I8: word = s->val.i8; break;
- case nsXPTType::T_I16: word = s->val.i16; break;
- case nsXPTType::T_I32: word = s->val.i32; break;
- case nsXPTType::T_I64: word = s->val.i64; break;
- case nsXPTType::T_U8: word = s->val.u8; break;
- case nsXPTType::T_U16: word = s->val.u16; break;
- case nsXPTType::T_U32: word = s->val.u32; break;
- case nsXPTType::T_U64: word = s->val.u64; break;
- case nsXPTType::T_BOOL: word = s->val.b; break;
- case nsXPTType::T_CHAR: word = s->val.c; break;
- case nsXPTType::T_WCHAR: word = s->val.wc; break;
+ alloc_arg(freg_args, freg_end, stack_args, &s->val.d);
+ break;
+ case nsXPTType::T_I8:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.i8);
+ break;
+ case nsXPTType::T_I16:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.i16);
+ break;
+ case nsXPTType::T_I32:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.i32);
+ break;
+ case nsXPTType::T_I64:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.i64);
+ break;
+ case nsXPTType::T_U8:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.u8);
+ break;
+ case nsXPTType::T_U16:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.u16);
+ break;
+ case nsXPTType::T_U32:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.u32);
+ break;
+ case nsXPTType::T_U64:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.u64);
+ break;
+ case nsXPTType::T_BOOL:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.b);
+ break;
+ case nsXPTType::T_CHAR:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.c);
+ break;
+ case nsXPTType::T_WCHAR:
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.wc);
+ break;
default:
// all the others are plain pointer types
- word = reinterpret_cast<uint64_t>(s->val.p);
+ alloc_arg(ireg_args, ireg_end, stack_args, &s->val.p);
break;
}
}
-
- alloc_word(ireg_args, stack_args, ireg_end, word);
}
}