Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1088)

Unified Diff: third_party/WebKit/Source/core/css/SelectorChecker.cpp

Issue 1972713002: Multiple :hover/:active incorrectly matching in quirks mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Windows compile error Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698