Bug 1450721: Remove special-case in nsCSSFrameConstructor. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 02 Apr 2018 05:33:27 +0200
changeset 776062 50e5f64693f81fb8194ecd3848a992a46c3773e2
parent 776061 98edf48975259dd0491b0e5ebf44f8ebb3689ecb
child 776067 f41110b7b8d0632f76dc739e1bf2ff4976234a2e
child 776075 171e38cd4dff463777c2d0313e78ee696187b48b
push id104805
push userbmo:emilio@crisal.io
push dateMon, 02 Apr 2018 16:38:02 +0000
reviewersbz
bugs1450721
milestone61.0a1
Bug 1450721: Remove special-case in nsCSSFrameConstructor. r?bz We don't extend these elements, and I don't feel bad making that code depend on the UA rule at: https://searchfox.org/mozilla-central/rev/b80994a43e5d92c2f79160ece176127eed85dcc9/toolkit/content/xul.css#63 If we don't create frames for these, we bail out due to the lack of an insertion point. If we do, well, things are buggy already. MozReview-Commit-ID: DBBo8jBpqFc
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7105,33 +7105,16 @@ nsCSSFrameConstructor::ContentAppended(n
     // XXX the GetContent() != child check is needed due to bug 135040.
     // Remove it once that's fixed.
     MOZ_ASSERT(!child->GetPrimaryFrame() ||
                child->GetPrimaryFrame()->GetContent() != child,
                "asked to construct a frame for a node that already has a frame");
   }
 #endif
 
-#ifdef MOZ_XUL
-  if (aFirstNewContent->GetParent()) {
-    int32_t namespaceID;
-    nsAtom* tag =
-      mDocument->BindingManager()->ResolveTag(aFirstNewContent->GetParent(), &namespaceID);
-
-    // Just ignore tree tags, anyway we don't create any frames for them.
-    //
-    // FIXME(emilio): Is this special-case needed? If we don't create a frame
-    // for them we won't find an insertion point anyway.
-    if (tag == nsGkAtoms::treechildren ||
-        tag == nsGkAtoms::treeitem ||
-        tag == nsGkAtoms::treerow)
-      return;
-  }
-#endif // MOZ_XUL
-
   LAYOUT_PHASE_TEMP_EXIT();
   InsertionPoint insertion =
     GetRangeInsertionPoint(aFirstNewContent, nullptr, aInsertionKind);
   nsContainerFrame*& parentFrame = insertion.mParentFrame;
   LAYOUT_PHASE_TEMP_REENTER();
   if (!parentFrame) {
     // We're punting on frame construction because there's no container frame.
     // The Servo-backed style system handles this case like the lazy frame