summaryrefslogtreecommitdiffstats
path: root/layout/base
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 07:19:16 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 07:19:16 -0400
commit352fe83985e4a251a96fb5260d923a36c9ed56b4 (patch)
treeb3f4777416f2023ff44036065c6c93d8220d4f89 /layout/base
parent14bb98e17510892a5cd622d76c605f1a7fd8b247 (diff)
downloadUXP-352fe83985e4a251a96fb5260d923a36c9ed56b4.tar
UXP-352fe83985e4a251a96fb5260d923a36c9ed56b4.tar.gz
UXP-352fe83985e4a251a96fb5260d923a36c9ed56b4.tar.lz
UXP-352fe83985e4a251a96fb5260d923a36c9ed56b4.tar.xz
UXP-352fe83985e4a251a96fb5260d923a36c9ed56b4.zip
Bug 979782 - Implement lazy frame construction for display:contents descendants
* Fixup FindFrameForContentSibling to don't duplicate work and trigger assertions for display: contents * Enable lazy frame construction for display: contents direct descendants Tag #1375
Diffstat (limited to 'layout/base')
-rw-r--r--layout/base/nsCSSFrameConstructor.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index bc49c277b..617e9a940 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6681,6 +6681,12 @@ nsCSSFrameConstructor::FindFrameForContentSibling(nsIContent* aContent,
sibling = aPrevSibling ?
FindPreviousSibling(iter, aTargetContent, aTargetContentDisplay, aParentFrame) :
FindNextSibling(iter, aTargetContent, aTargetContentDisplay, aParentFrame);
+
+ // The recursion above has already done all the placeholder and
+ // continuation fixups.
+ if (sibling) {
+ return sibling;
+ }
}
if (!sibling) {
// ... then ::after / ::before on the opposite end.
@@ -6704,7 +6710,7 @@ nsCSSFrameConstructor::FindFrameForContentSibling(nsIContent* aContent,
sibling = placeholderFrame;
}
- // The frame we have now should never be a continuation
+ // The frame we have now should never be a continuation.
NS_ASSERTION(!sibling->GetPrevContinuation(), "How did that happen?");
if (aPrevSibling) {
@@ -7025,11 +7031,8 @@ 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() ||
- GetDisplayContentsStyleFor(aContainer)) {
+ aContainer->IsInNativeAnonymousSubtree() || aContainer->IsXULElement()) {
return false;
}
@@ -7065,8 +7068,7 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
// 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.
+ // contents node.
bool noPrimaryFrame = false;
bool needsFrameBitSet = false;
#endif