Bug 1345695 - stylo: Assert that we have computed style in Servo_ResolveStyle when lazy computation is forbidden. r=bholley draft
authorCameron McCormack <cam@mcc.id.au>
Wed, 12 Apr 2017 10:05:26 +0800
changeset 560873 b365b632ab4162800a2f4c304bc572c58ad1d397
parent 560546 abf145ebd05fe105efbc78b761858c34f7690154
child 623827 3bd8f6eff8124fc36b1e4b294350c3200d7b4867
push id53570
push userbmo:cam@mcc.id.au
push dateWed, 12 Apr 2017 02:05:56 +0000
reviewersbholley
bugs1345695
milestone55.0a1
Bug 1345695 - stylo: Assert that we have computed style in Servo_ResolveStyle when lazy computation is forbidden. r=bholley MozReview-Commit-ID: Bul00XOpfxA
layout/style/ServoStyleSet.cpp
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -165,20 +165,19 @@ ServoStyleSet::GetContext(nsIContent* aC
                           nsStyleContext* aParentContext,
                           nsIAtom* aPseudoTag,
                           CSSPseudoElementType aPseudoType,
                           LazyComputeBehavior aMayCompute)
 {
   MOZ_ASSERT(aContent->IsElement());
   Element* element = aContent->AsElement();
 
-
-  PreTraverseSync();
   RefPtr<ServoComputedValues> computedValues;
   if (aMayCompute == LazyComputeBehavior::Allow) {
+    PreTraverseSync();
     computedValues = ResolveStyleLazily(element, nullptr);
   } else {
     computedValues = ResolveServoStyle(element);
   }
 
   MOZ_ASSERT(computedValues);
   return GetContext(computedValues.forget(), aParentContext, aPseudoTag, aPseudoType,
                     element);