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>
Wed, 06 Sep 2017 12:56:53 -0700
changeset 660277 3ce2b48d16549d59ca8da3d35b039fc7223d7711
parent 659233 973e8b890a62aee4b3170558ac3b608928162ef6
child 730188 bc0c51fdaa5d5b55a2f115104877e3b917ccc1d5
push id78349
push userbmo:npancholi@mozilla.com
push dateWed, 06 Sep 2017 19:57:15 +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
@@ -595,30 +595,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);
     }