Bug 922669 - Part 8: Look at user action pseudo-classes on pseudo-elements during selector matching. r=bz
authorCameron McCormack <cam@mcc.id.au>
Thu, 28 Nov 2013 17:46:39 +1100
changeset 157873 78c9cc1869676256f91d47ad722864bd81adc705
parent 157872 771432bdb5457ba6ae9e9079b5df0f4c8cb6f6e4
child 157874 2c0cdf0d2c845a5bb930fbcda4fcb1af26bdf3ee
push id36877
push usercmccormack@mozilla.com
push dateThu, 28 Nov 2013 06:47:44 +0000
treeherdermozilla-inbound@3f7925e3933b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs922669
milestone28.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 922669 - Part 8: Look at user action pseudo-classes on pseudo-elements during selector matching. r=bz
layout/style/nsCSSRuleProcessor.cpp
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -2456,16 +2456,22 @@ void ContentEnumFunc(const RuleValue& va
   if (!data->mTreeMatchContext.SetStyleScopeForSelectorMatching(data->mElement,
                                                                 data->mScope)) {
     // The selector is for a rule in a scoped style sheet, and the subject
     // of the selector matching is not in its scope.
     return;
   }
   nsCSSSelector* selector = aSelector;
   if (selector->IsPseudoElement()) {
+    PseudoElementRuleProcessorData* pdata =
+      static_cast<PseudoElementRuleProcessorData*>(data);
+    if (!StateSelectorMatches(pdata->mPseudoElement, aSelector, nodeContext,
+                              data->mTreeMatchContext)) {
+      return;
+    }
     selector = selector->mNext;
   }
   if (SelectorMatches(data->mElement, selector, nodeContext,
                       data->mTreeMatchContext)) {
     nsCSSSelector *next = selector->mNext;
     if (!next || SelectorMatchesTree(data->mElement, next,
                                      data->mTreeMatchContext,
                                      !nodeContext.mIsRelevantLink)) {