From 9cd802936bc0384ea4eff45a04686a84cb449a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 5 Jan 2018 11:48:00 +0100 Subject: [PATCH] Bug 1428164: Restyle owned anon boxes after processing children. r=bz MozReview-Commit-ID: 4QcJPY9hkSm --- layout/base/ServoRestyleManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 4f48296bda3d..09970731149b 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -909,7 +909,6 @@ ServoRestyleManager::ProcessPostTraversal( if (styleFrame) { UpdateAdditionalStyleContexts(styleFrame, aRestyleState); - styleFrame->UpdateStyleOfOwnedAnonBoxes(childrenRestyleState); } if (!aElement->GetParent()) { @@ -973,6 +972,10 @@ ServoRestyleManager::ProcessPostTraversal( 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. + styleFrame->UpdateStyleOfOwnedAnonBoxes(childrenRestyleState); UpdateFramePseudoElementStyles(styleFrame, childrenRestyleState); } else if (traverseElementChildren && styleFrame->IsFrameOfType(nsIFrame::eBlockFrame)) {