Bug 1429088: Enable lazy frame construction for shadow trees. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 09 Jan 2018 16:59:51 +0100
changeset 717815 001e216c6118a1242b41bf69b0c475911739d1a8
parent 717814 e47560c7f785b7875eafe0b7b99f0754f273a058
child 717816 fd21637e9d7d4369fc0bc2b369b1117f58260384
push id94787
push userbmo:emilio@crisal.io
push dateTue, 09 Jan 2018 17:09:57 +0000
reviewersbz
bugs1429088, 1404789
milestone59.0a1
Bug 1429088: Enable lazy frame construction for shadow trees. r?bz There's no reason it wouldn't work after bug 1404789. MozReview-Commit-ID: 28X5x2rDqYn
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7214,28 +7214,25 @@ nsCSSFrameConstructor::MaybeConstructLaz
                                             nsIContent* aChild)
 {
   if (mPresShell->GetPresContext()->IsChrome() || !aContainer ||
       aContainer->IsInNativeAnonymousSubtree() || aContainer->IsXULElement()) {
     return false;
   }
 
   if (aOperation == CONTENTINSERT) {
-    if (aChild->IsRootOfAnonymousSubtree() ||
-        (aChild->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
-         !aChild->IsInNativeAnonymousSubtree()) ||
-        aChild->IsXULElement()) {
+    if (aChild->IsRootOfAnonymousSubtree() || aChild->IsXULElement()) {
       return false;
     }
   } else { // CONTENTAPPEND
     NS_ASSERTION(aOperation == CONTENTAPPEND,
                  "operation should be either insert or append");
     for (nsIContent* child = aChild; child; child = child->GetNextSibling()) {
       NS_ASSERTION(!child->IsRootOfAnonymousSubtree(),
-                   "Should be coming through the CONTENTAPPEND case");
+                   "Should be coming through the CONTENTINSERT case");
       if (child->IsXULElement()) {
         return false;
       }
     }
   }
 
   // We can construct lazily; just need to set suitable bits in the content
   // tree.