Bug 1433591: Update the style of child anon box wrapper after owned anon boxes. r?bz draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 28 Jan 2018 04:15:13 +0100
changeset 748094 4aed50eaca06977d1ae684895db3bb595fcdefec
parent 748092 c79f9a3eec428b489a9ace7abc56db305f619a88
child 748095 2ab211fe5a619bdea2b495a2b2ea04f922c8563c
child 748107 98279243fa8fa26f029e872a11ee997c640cfbd2
push id97069
push userbmo:emilio@crisal.io
push dateSun, 28 Jan 2018 04:09:15 +0000
reviewersbz
bugs1433591
milestone60.0a1
Bug 1433591: Update the style of child anon box wrapper after owned anon boxes. r?bz Since the former could inherit from the latter. Test incoming in a followup. MozReview-Commit-ID: LJjprcyjDyU
layout/base/ServoRestyleManager.cpp
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -965,24 +965,27 @@ ServoRestyleManager::ProcessPostTraversa
     }
   }
 
   // We want to update frame pseudo-element styles after we've traversed our
   // kids, because some of those updates (::first-line/::first-letter) need to
   // modify the styles of the kids, and the child traversal above would just
   // clobber those modifications.
   if (styleFrame) {
-    // Process anon box wrapper frames before ::first-line bits.
-    childrenRestyleState.ProcessWrapperRestyles(styleFrame);
-
     if (wasRestyled) {
       // Make sure to update anon boxes and pseudo bits after updating text,
-      // otherwise we could clobber first-letter styles from
-      // ProcessPostTraversalForText, for example.
+      // otherwise ProcessPostTraversalForText could clobber first-letter
+      // styles, for example.
       styleFrame->UpdateStyleOfOwnedAnonBoxes(childrenRestyleState);
+    }
+    // Process anon box wrapper frames before ::first-line bits, but _after_
+    // owned anon boxes, since the children wrapper anon boxes could be
+    // inheriting from our own owned anon boxes.
+    childrenRestyleState.ProcessWrapperRestyles(styleFrame);
+    if (wasRestyled) {
       UpdateFramePseudoElementStyles(styleFrame, childrenRestyleState);
     } else if (traverseElementChildren &&
                styleFrame->IsFrameOfType(nsIFrame::eBlockFrame)) {
       // Even if we were not restyled, if we're a block with a first-line and
       // one of our descendant elements which is on the first line was restyled,
       // we need to update the styles of things on the first line, because
       // they're wrong now.
       //