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
--- 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.
//