Index: third_party/WebKit/Source/core/css/SelectorChecker.cpp |
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
index 3416c2386789fce0db221a12c9e35cd4d44c2431..16d0217a6c9ce1bcf5f44fbccb1ffec15bdd49b2 100644 |
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
@@ -155,9 +155,17 @@ static bool shouldMatchHoverOrActive(const SelectorChecker::SelectorCheckingCont |
return true; |
if (context.isSubSelector) |
return true; |
- if (context.selector->relation() == CSSSelector::SubSelector && context.selector->tagHistory()) |
+ if (context.element->isLink()) |
return true; |
- return context.element->isLink(); |
+ const CSSSelector* selector = context.selector; |
+ while (selector->relation() == CSSSelector::SubSelector && selector->tagHistory()) { |
+ selector = selector->tagHistory(); |
+ if (selector->match() != CSSSelector::PseudoClass) |
+ return true; |
+ if (selector->getPseudoType() != CSSSelector::PseudoHover && selector->getPseudoType() != CSSSelector::PseudoActive) |
+ return true; |
+ } |
+ return false; |
} |
static bool isFirstChild(Element& element) |