Bug 1364274 part 2 - Move HAS_TEXT_DECORATION_LINES bit computation back to ApplyStyleFixups. r=heycam draft
authorXidorn Quan <me@upsuper.org>
Tue, 04 Jul 2017 16:54:11 +1000
changeset 608728 37923ac7ab91c75245d14dafa7bef623ce92603b
parent 608727 7e38904b7c5f229e5527b02008cac6459a8bcdc8
child 608729 beb99889b8f8c10dda6a95bd9ae45d0bbe789d86
push id68393
push userxquan@mozilla.com
push dateFri, 14 Jul 2017 03:52:32 +0000
reviewersheycam
bugs1364274
milestone56.0a1
Bug 1364274 part 2 - Move HAS_TEXT_DECORATION_LINES bit computation back to ApplyStyleFixups. r=heycam MozReview-Commit-ID: vsLnXvJ9UI
layout/style/GeckoStyleContext.cpp
--- a/layout/style/GeckoStyleContext.cpp
+++ b/layout/style/GeckoStyleContext.cpp
@@ -518,27 +518,16 @@ ShouldSuppressLineBreak(const nsStyleCon
 void
 nsStyleContext::SetStyleBits()
 {
   // Here we set up various style bits for both the Gecko and Servo paths.
   // _Only_ change the bits here.  For fixups of the computed values, you can
   // add to ApplyStyleFixups in Gecko and StyleAdjuster as part of Servo's
   // cascade.
 
-  // See if we have any text decorations.
-  // First see if our parent has text decorations.  If our parent does, then we inherit the bit.
-  if (mParent && mParent->HasTextDecorationLines()) {
-    AddStyleBit(NS_STYLE_HAS_TEXT_DECORATION_LINES);
-  } else {
-    // We might have defined a decoration.
-    if (StyleTextReset()->HasTextDecorationLines()) {
-      AddStyleBit(NS_STYLE_HAS_TEXT_DECORATION_LINES);
-    }
-  }
-
   if ((mParent && mParent->HasPseudoElementData()) || IsPseudoElement()) {
     AddStyleBit(NS_STYLE_HAS_PSEUDO_ELEMENT_DATA);
   }
 
   // Set the NS_STYLE_IN_DISPLAY_NONE_SUBTREE bit
   const nsStyleDisplay* disp = StyleDisplay();
   if ((mParent && mParent->IsInDisplayNoneSubtree()) ||
       disp->mDisplay == mozilla::StyleDisplay::None) {
@@ -712,16 +701,27 @@ GeckoStyleContext::ApplyStyleFixups(bool
         NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL) {
     MOZ_ASSERT(!PeekStyleVisibility(), "If StyleVisibility was already "
                "computed, some properties may have been computed "
                "incorrectly based on the old writing mode value");
     nsStyleVisibility* mutableVis = GET_UNIQUE_STYLE_DATA(Visibility);
     mutableVis->mWritingMode = NS_STYLE_WRITING_MODE_HORIZONTAL_TB;
   }
 
+  // See if we have any text decorations.
+  // First see if our parent has text decorations.  If our parent does, then we inherit the bit.
+  if (mParent && mParent->HasTextDecorationLines()) {
+    AddStyleBit(NS_STYLE_HAS_TEXT_DECORATION_LINES);
+  } else {
+    // We might have defined a decoration.
+    if (StyleTextReset()->HasTextDecorationLines()) {
+      AddStyleBit(NS_STYLE_HAS_TEXT_DECORATION_LINES);
+    }
+  }
+
   // CSS 2.1 10.1: Propagate the root element's 'direction' to the ICB.
   // (PageContentFrame/CanvasFrame etc will inherit 'direction')
   if (mPseudoTag == nsCSSAnonBoxes::viewport) {
     nsPresContext* presContext = PresContext();
     mozilla::dom::Element* docElement = presContext->Document()->GetRootElement();
     if (docElement) {
       RefPtr<nsStyleContext> rootStyle =
         presContext->StyleSet()->AsGecko()->ResolveStyleFor(docElement, nullptr);