summaryrefslogtreecommitdiffstats
path: root/layout/base/nsCSSFrameConstructor.cpp
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-12-09 09:45:24 -0600
committertrav90 <travawine@palemoon.org>2018-12-09 09:45:24 -0600
commit96258a022a7daee9606249beda61b1dc5d0eed2c (patch)
treef5979ebfeea6fbae934657494cce3ab035c97fba /layout/base/nsCSSFrameConstructor.cpp
parent09cf173394adb294dd81362745b66f618968517b (diff)
downloadUXP-96258a022a7daee9606249beda61b1dc5d0eed2c.tar
UXP-96258a022a7daee9606249beda61b1dc5d0eed2c.tar.gz
UXP-96258a022a7daee9606249beda61b1dc5d0eed2c.tar.lz
UXP-96258a022a7daee9606249beda61b1dc5d0eed2c.tar.xz
UXP-96258a022a7daee9606249beda61b1dc5d0eed2c.zip
Only disallow lazy frame construction for direct children of display: contents elements
Diffstat (limited to 'layout/base/nsCSSFrameConstructor.cpp')
-rw-r--r--layout/base/nsCSSFrameConstructor.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index c63374541..07a5b80e7 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7021,8 +7021,11 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
nsIContent* aContainer,
nsIContent* aChild)
{
+ // XXXmats no lazy frames for display:contents direct descendants yet
+ // (Mozilla bug 979782).
if (mPresShell->GetPresContext()->IsChrome() || !aContainer ||
- aContainer->IsInNativeAnonymousSubtree() || aContainer->IsXULElement()) {
+ aContainer->IsInNativeAnonymousSubtree() || aContainer->IsXULElement() ||
+ GetDisplayContentsStyleFor(aContainer)) {
return false;
}
@@ -7056,6 +7059,10 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
// ignore anonymous children (eg framesets) make this complicated. So we set
// these two booleans if we encounter these situations and unset them if we
// hit a node with a leaf frame.
+ //
+ // Also, it's fine if one of the nodes without primary frame is a display:
+ // contents node except if it's the direct ancestor of the children we're
+ // recreating frames for.
bool noPrimaryFrame = false;
bool needsFrameBitSet = false;
#endif
@@ -7065,17 +7072,14 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
if (content->GetPrimaryFrame() && content->GetPrimaryFrame()->IsLeaf()) {
noPrimaryFrame = needsFrameBitSet = false;
}
- if (!noPrimaryFrame && !content->GetPrimaryFrame()) {
+ if (!noPrimaryFrame && !content->GetPrimaryFrame() &&
+ !GetDisplayContentsStyleFor(content)) {
noPrimaryFrame = true;
}
if (!needsFrameBitSet && content->HasFlag(NODE_NEEDS_FRAME)) {
needsFrameBitSet = true;
}
#endif
- // XXXmats no lazy frames for display:contents descendants yet (bug 979782).
- if (GetDisplayContentsStyleFor(content)) {
- return false;
- }
content->SetFlags(NODE_DESCENDANTS_NEED_FRAMES);
content = content->GetFlattenedTreeParent();
}