Bug 1450617: No need to ResolveTag to disable first-line on fieldsets. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 02 Apr 2018 05:52:57 +0200
changeset 776487 6d3811accd7605f311a83a76eb56e05c6802c531
parent 776486 cb6598552b9b0437858b695f93808d56b7cb53e6
push id104888
push userbmo:emilio@crisal.io
push dateTue, 03 Apr 2018 07:00:14 +0000
reviewersbz
bugs1450617
milestone61.0a1
Bug 1450617: No need to ResolveTag to disable first-line on fieldsets. r?bz We don't extend HTML fieldsets with XBL, and I don't think we want to start doing that now. MozReview-Commit-ID: GiltTWXUBzZ
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -9352,24 +9352,18 @@ nsCSSFrameConstructor::HasFirstLetterSty
 bool
 nsCSSFrameConstructor::ShouldHaveFirstLineStyle(nsIContent* aContent,
                                                 ComputedStyle* aComputedStyle)
 {
   bool hasFirstLine =
     nsLayoutUtils::HasPseudoStyle(aContent, aComputedStyle,
                                   CSSPseudoElementType::firstLine,
                                   mPresShell->GetPresContext());
-  if (hasFirstLine) {
-    // But disable for fieldsets
-    int32_t namespaceID;
-    nsAtom* tag = mDocument->BindingManager()->ResolveTag(aContent,
-                                                           &namespaceID);
-    // This check must match the one in FindHTMLData.
-    hasFirstLine = tag != nsGkAtoms::fieldset ||
-      namespaceID != kNameSpaceID_XHTML;
+  if (hasFirstLine && aContent->IsHTMLElement(nsGkAtoms::fieldset)) {
+    return false;
   }
 
   return hasFirstLine;
 }
 
 void
 nsCSSFrameConstructor::ShouldHaveSpecialBlockStyle(nsIContent* aContent,
                                                    ComputedStyle* aComputedStyle,