Bug 1351205 - Skip debug check for Stylo in nsComputedDOMStyle::UpdateCurrentStyleSources(). r=heycam
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 28 Mar 2017 16:08:07 +0800
changeset 352112 4721f0c609d4d9bdd5c8e860ec0fee29921e5f69
parent 352111 d3a67f59e7eea5b8e79861ed3183690206d913c4
child 352113 ac21e09b76bd385e0d853f1c788b4040281771be
push id40396
push usertlin@mozilla.com
push dateMon, 10 Apr 2017 07:27:03 +0000
treeherderautoland@4721f0c609d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1351205
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1351205 - Skip debug check for Stylo in nsComputedDOMStyle::UpdateCurrentStyleSources(). r=heycam 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
@@ -836,17 +836,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()) {