Reduce scope of :hover quirk: make it apply normally if it has a class selector, and be quirky (only apply to links) only when actually global. (Bug 197686) r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Fri, 22 Apr 2011 18:36:24 -0700
changeset 68457 b7b5af018848cfc3cac7df84ed0deac7d74b7860
parent 68456 c73c4d6907fef68ad8acc1509997fe2d4a656812
child 68458 05825e4dc77a3157b3ce7c6b7fb330a4d11c68da
push id19647
push userdbaron@mozilla.com
push dateSat, 23 Apr 2011 01:41:58 +0000
treeherdermozilla-central@b7b5af018848 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs197686
milestone6.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
Reduce scope of :hover quirk: make it apply normally if it has a class selector, and be quirky (only apply to links) only when actually global. (Bug 197686) r=bzbarsky
layout/style/nsCSSRuleProcessor.cpp
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -1916,19 +1916,19 @@ static PRBool SelectorMatches(Element* a
 
       default:
         NS_ABORT_IF_FALSE(PR_FALSE, "How did that happen?");
       }
     } else {
       // Bit-based pseudo-classes
       if (statesToCheck.HasAtLeastOneOfStates(NS_EVENT_STATE_HOVER | NS_EVENT_STATE_ACTIVE) &&
           aTreeMatchContext.mCompatMode == eCompatibility_NavQuirks &&
-          // global selector (but don't check .class):
+          // global selector:
           !aSelector->HasTagSelector() && !aSelector->mIDList && 
-          !aSelector->mAttrList &&
+          !aSelector->mClassList && !aSelector->mAttrList &&
           // This (or the other way around) both make :not() asymmetric
           // in quirks mode (and it's hard to work around since we're
           // testing the current mNegations, not the first
           // (unnegated)). This at least makes it closer to the spec.
           !isNegated &&
           // important for |IsQuirkEventSensitive|:
           aElement->IsHTML() && !nsCSSRuleProcessor::IsLink(aElement) &&
           !IsQuirkEventSensitive(aElement->Tag())) {