fixup! Bug 1373018 - Part 7: stylo: Move nsStyleContext::mSource into subclasses; r?bholley draft
authorManish Goregaokar <manishearth@gmail.com>
Wed, 14 Jun 2017 17:18:29 -0700
changeset 594356 a906a502392b5409893da55fcdbe9a166793550d
parent 594351 b6d8e4a6a0874045960c7a3d7dc6c53d4231c636
child 633411 071e781c9fea6c131f2ec268be648110b9b3af9d
push id64015
push userbmo:manishearth@gmail.com
push dateThu, 15 Jun 2017 00:18:48 +0000
reviewersbholley
bugs1373018
milestone55.0a1
fixup! Bug 1373018 - Part 7: stylo: Move nsStyleContext::mSource into subclasses; r?bholley
layout/style/GeckoStyleContext.cpp
--- a/layout/style/GeckoStyleContext.cpp
+++ b/layout/style/GeckoStyleContext.cpp
@@ -201,27 +201,28 @@ GeckoStyleContext::FindChildWithRules(co
                                    nsRuleNode* aSource,
                                    nsRuleNode* aSourceIfVisited,
                                    bool aRelevantLinkVisited)
 {
   uint32_t threshold = 10; // The # of siblings we're willing to examine
                            // before just giving this whole thing up.
 
   RefPtr<GeckoStyleContext> result;
-  GeckoStyleContext *list = aSource.MatchesNoRules() ? mEmptyChild : mChild;
+  MOZ_ASSERT(aSource);
+  GeckoStyleContext *list = aSource->IsRoot() ? mEmptyChild : mChild;
 
   if (list) {
     GeckoStyleContext *child = list;
     do {
       if (child->StyleSource() == aSource &&
           child->mPseudoTag == aPseudoTag &&
           !child->IsStyleIfVisited() &&
           child->RelevantLinkVisited() == aRelevantLinkVisited) {
         bool match = false;
-        if (!aSourceIfVisited.IsNull()) {
+        if (!aSourceIfVisited) {
           match = child->GetStyleIfVisited() &&
                   child->GetStyleIfVisited()->RuleNode() == aSourceIfVisited;
         } else {
           match = !child->GetStyleIfVisited();
         }
         if (match && !(child->mBits & NS_STYLE_INELIGIBLE_FOR_SHARING)) {
           result = child;
           break;