Bug 1356916 - Call PostRestyleEvent() with the change hint obtained by Element::GetAttributeChangeHint in ServoRestyleManager::AttributeChanged. r?heycam draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 11 May 2017 07:30:34 +0900
changeset 575900 bc139e3f57b5fde155775f6b1514cd2ec2fdf6ff
parent 575624 ce2218406119c36a551e3faea4e192186ee46cc5
child 575901 461fa2da1c2f9ae4cf5083f591eaff7717089cf0
push id58191
push userhikezoe@mozilla.com
push dateWed, 10 May 2017 23:18:02 +0000
reviewersheycam
bugs1356916
milestone55.0a1
Bug 1356916 - Call PostRestyleEvent() with the change hint obtained by Element::GetAttributeChangeHint in ServoRestyleManager::AttributeChanged. r?heycam MozReview-Commit-ID: 14clm0eE0iE
layout/base/ServoRestyleManager.cpp
--- 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));
   }