Bug 1437774 - Mark stylist dirty when author style disabled state changes. r=emilio draft
authorXidorn Quan <me@upsuper.org>
Tue, 13 Feb 2018 18:33:00 +1100
changeset 754625 456c88c7b26e077e4503bc1aa8a751f73fae4cef
parent 754338 ddebcac28b2cce0b2710b64f00d3057886d2f043
child 754718 ed232dabe7ad0e50cb450aa5697bef1742924084
push id98950
push userxquan@mozilla.com
push dateTue, 13 Feb 2018 22:39:39 +0000
reviewersemilio
bugs1437774, 1436798
milestone60.0a1
Bug 1437774 - Mark stylist dirty when author style disabled state changes. r=emilio This is a workaround for regression from bug 1436798. MozReview-Commit-ID: BJzk5cjjPd5
layout/style/ServoStyleSet.cpp
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -364,16 +364,22 @@ ServoStyleSet::SetAuthorStyleDisabled(bo
 
   mAuthorStyleDisabled = aStyleDisabled;
   if (Element* root = mDocument->GetRootElement()) {
     if (nsPresContext* pc = GetPresContext()) {
       pc->RestyleManager()->PostRestyleEvent(root, eRestyle_Subtree, nsChangeHint(0));
     }
   }
   Servo_StyleSet_SetAuthorStyleDisabled(mRawSet.get(), mAuthorStyleDisabled);
+  // XXX Workaround for the assertion in InvalidateStyleForDocumentStateChanges
+  // which is called by nsIPresShell::SetAuthorStyleDisabled via nsIPresShell::
+  // RestyleForCSSRuleChanges. It is not really necessary because we don't need
+  // to rebuild stylist for this change. But we have bug around this, and we
+  // may want to rethink how things should work. See bug 1437785.
+  SetStylistStyleSheetsDirty();
 }
 
 void
 ServoStyleSet::BeginUpdate()
 {
 }
 
 nsresult