diff --git a/layout/style/test/test_hover_quirk.html b/layout/style/test/test_hover_quirk.html index 61e19f2a60fb..7a78185178a1 100644 --- a/layout/style/test/test_hover_quirk.html +++ b/layout/style/test/test_hover_quirk.html @@ -54,6 +54,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783213 #dynamic-test:hover > * { background: rgb(0, 255, 0); } + + #dynamic-test-2 :is(button,input,a){ + background-color:yellow !important; + } + + #dynamic-test-2 :is(button,input,a):hover{ + background-color:lime !important; + } + + #dynamic-test-2 :is(button,input):focus{ + background-color:skyblue !important; + } @@ -97,6 +109,21 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783213 is(getComputedStyle(document.getElementById('should-be-green-on-hover')).backgroundColor, "rgb(0, 255, 0)", "Dynamic change should invalidate properly"); + + synthesizeMouseAtCenter(document.getElementById('button'), {type: "mousemove"}); + is(getComputedStyle(document.getElementById('button')).backgroundColor, + "rgb(0, 255, 0)", + "Button hover should be green"); + + synthesizeMouseAtCenter(document.getElementById('input'), {type: "mousemove"}); + is(getComputedStyle(document.getElementById('input')).backgroundColor, + "rgb(0, 255, 0)", + "Input hover should be green"); + + synthesizeMouseAtCenter(document.getElementById('link-2'), {type: "mousemove"}); + is(getComputedStyle(document.getElementById('link-2')).backgroundColor, + "rgb(0, 255, 0)", + "Link hover should be green"); SimpleTest.finish(); }); @@ -113,6 +140,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783213 Link
Div

+
+ + + Link +

 
 
diff --git a/servo/components/selectors/matching.rs b/servo/components/selectors/matching.rs
index 763f65d547bf..7733ac5a0ca8 100644
--- a/servo/components/selectors/matching.rs
+++ b/servo/components/selectors/matching.rs
@@ -643,19 +643,8 @@ fn hover_and_active_quirk_applies(
     }
 
     selector_iter.clone().all(|simple| match *simple {
-        Component::LocalName(_) |
-        Component::AttributeInNoNamespaceExists { .. } |
-        Component::AttributeInNoNamespace { .. } |
-        Component::AttributeOther(_) |
-        Component::ID(_) |
-        Component::Class(_) |
-        Component::PseudoElement(_) |
-        Component::Negation(_) |
-        Component::Empty |
-        Component::Nth(_) |
-        Component::NthOf(_) => false,
         Component::NonTSPseudoClass(ref pseudo_class) => pseudo_class.is_active_or_hover(),
-        _ => true,
+        _ => false,
     })
 }