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

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

Issue 2850743003: Stop matching scrollbar pseudo element without a scrollbar. (Closed)
Patch Set: Added unit test. Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/css/AffectedByPseudoTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86a68368667e7ce6e0f9daff6d0c8b93e0a910f4..049b269a99f5e363fadc20a39271793451ab11b5 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -260,6 +260,17 @@ SelectorChecker::MatchStatus SelectorChecker::MatchForSubSelector(
dynamic_pseudo != kPseudoIdNone &&
(scrollbar_ || dynamic_pseudo == kPseudoIdScrollbarCorner ||
dynamic_pseudo == kPseudoIdResizer);
+
+ // Only match pseudo classes following scrollbar pseudo elements while
+ // actually computing style for scrollbar pseudo elements. This is to
+ // avoid incorrectly setting affected-by flags on actual elements for
+ // cases like: div::-webkit-scrollbar-thumb:hover { }
+ if (context.in_rightmost_compound && dynamic_pseudo != kPseudoIdNone &&
+ dynamic_pseudo != kPseudoIdSelection &&
+ !next_context.has_scrollbar_pseudo) {
+ return kSelectorFailsCompletely;
+ }
+
next_context.has_selection_pseudo = dynamic_pseudo == kPseudoIdSelection;
next_context.is_sub_selector = true;
return MatchSelector(next_context, result);
« no previous file with comments | « third_party/WebKit/Source/core/css/AffectedByPseudoTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698