Bug 1356916 - Call PostRestyleEvent() with the change hint obtained by Element::GetAttributeChangeHint in ServoRestyleManager::AttributeChanged. r?heycam
MozReview-Commit-ID: 14clm0eE0iE
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -560,16 +560,21 @@ ServoRestyleManager::AttributeChanged(El
MOZ_ASSERT_IF(snapshot, snapshot->HasAttrs());
#endif
nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
if (primaryFrame) {
primaryFrame->AttributeChanged(aNameSpaceID, aAttribute, aModType);
}
+ nsChangeHint hint = aElement->GetAttributeChangeHint(aAttribute, aModType);
+ if (hint) {
+ PostRestyleEvent(aElement, nsRestyleHint(0), hint);
+ }
+
if (aAttribute == nsGkAtoms::style) {
PostRestyleEvent(aElement, eRestyle_StyleAttribute, nsChangeHint(0));
}
// <td> is affected by the cellpadding on its ancestor table,
// so we should restyle the whole subtree
if (aAttribute == nsGkAtoms::cellpadding && aElement->IsHTMLElement(nsGkAtoms::table)) {
PostRestyleEvent(aElement, eRestyle_Subtree, nsChangeHint(0));
}