Bug 1351205 - Skip debug check for Stylo in nsComputedDOMStyle::UpdateCurrentStyleSources(). draft
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 28 Mar 2017 16:08:07 +0800
changeset 552307 bcbb9988cfc613f1b3727b7142502639ed3aa677
parent 504632 4c987b7ed54a630a7de76adcc2eb00dab49d5dfd
child 621775 5e4caf29ad8ef641e4e3cc733c11b7bd981fa068
push id51309
push userbmo:tlin@mozilla.com
push dateTue, 28 Mar 2017 08:14:42 +0000
bugs1351205
milestone55.0a1
Bug 1351205 - Skip debug check for Stylo in nsComputedDOMStyle::UpdateCurrentStyleSources(). The debug code calls nsStyleContext::GetParent(), which is invalid in stylo. Let's skip it. MozReview-Commit-ID: 5opMaSuyoNr
layout/style/nsComputedDOMStyle.cpp
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -857,17 +857,17 @@ nsComputedDOMStyle::UpdateCurrentStyleSo
 
       SetFrameStyleContext(mInnerFrame->StyleContext());
       NS_ASSERTION(mStyleContext, "Frame without style context?");
     }
   }
 
   if (!mStyleContext || mStyleContext->HasPseudoElementData()) {
 #ifdef DEBUG
-    if (mStyleContext) {
+    if (mStyleContext && mStyleContext->StyleSource().IsGeckoRuleNodeOrNull()) {
       // We want to check that going through this path because of
       // HasPseudoElementData is rare, because it slows us down a good
       // bit.  So check that we're really inside something associated
       // with a pseudo-element that contains elements.  (We also allow
       // the element to be NAC, just in case some chrome JS calls
       // getComputedStyle on a NAC-implemented pseudo.)
       nsStyleContext* topWithPseudoElementData = mStyleContext;
       while (topWithPseudoElementData->GetParent()->HasPseudoElementData()) {