Bug 1389029 - Undo code changes in Bug 1388234 which is unnecessary now that we post restyle events for rowspan/colspan changes. draft
authorNeerja Pancholi <npancholi@mozilla.com>
Thu, 31 Aug 2017 14:44:28 -0700
changeset 657696 c9ef8b0299bcd5fc04ca9ddb82f9e68a226f9abb
parent 657695 d85753b422b0cfdc284852d42985028a5dc1ffe8
child 729497 2e75dae5516b720080752be47cdb9e2bb6151462
push id77598
push userbmo:npancholi@mozilla.com
push dateFri, 01 Sep 2017 20:40:51 +0000
bugs1389029, 1388234
milestone57.0a1
Bug 1389029 - Undo code changes in Bug 1388234 which is unnecessary now that we post restyle events for rowspan/colspan changes. MozReview-Commit-ID: 5eTW5dCcxzP This patch reverts the code changes, but not the test changes from changeset bf9cf6f393eb. There is a crashtest here which is valuable to keep.
layout/style/ServoStyleSet.cpp
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -529,30 +529,27 @@ ServoStyleSet::ResolveStyleLazily(Elemen
 }
 
 already_AddRefed<ServoStyleContext>
 ServoStyleSet::ResolveInheritingAnonymousBoxStyle(nsIAtom* aPseudoTag,
                                                   ServoStyleContext* aParentContext)
 {
   MOZ_ASSERT(nsCSSAnonBoxes::IsAnonBox(aPseudoTag) &&
              !nsCSSAnonBoxes::IsNonInheritingAnonBox(aPseudoTag));
+  MOZ_ASSERT_IF(aParentContext, !StylistNeedsUpdate());
+
+  UpdateStylistIfNeeded();
+
   RefPtr<ServoStyleContext> style = nullptr;
 
   if (aParentContext) {
     style = aParentContext->GetCachedInheritingAnonBoxStyle(aPseudoTag);
   }
 
   if (!style) {
-    // People like to call into here from random attribute notifications (see
-    // bug 1388234, and bug 1389029).
-    //
-    // We may get a wrong cached style if the stylist needs an update, but we'll
-    // have a whole restyle scheduled anyway.
-    UpdateStylistIfNeeded();
-
     style =
       Servo_ComputedValues_GetForAnonymousBox(aParentContext,
                                               aPseudoTag,
                                               mRawSet.get()).Consume();
     MOZ_ASSERT(style);
     if (aParentContext) {
       aParentContext->SetCachedInheritedAnonBoxStyle(aPseudoTag, style);
     }