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

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

Issue 2509593002: Implement ::placeholder CSS selector. (Closed)
Patch Set: Introduce PseudoType::PseudoPlaceholder Created 4 years, 1 month 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 283ffa0a4a28c583d9cdf1aab23bd2553cfabd32..0c0016bb4588024620873a7f903947fe449c89a6 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -1094,6 +1094,12 @@ bool SelectorChecker::checkPseudoElement(const SelectorCheckingContext& context,
}
return false;
}
+ case CSSSelector::PseudoPlaceholder:
+ if (ShadowRoot* root = element.containingShadowRoot()) {
+ return root->type() == ShadowRootType::UserAgent &&
+ element.shadowPseudoId() == "-webkit-input-placeholder";
+ }
+ return false;
case CSSSelector::PseudoWebKitCustomElement: {
if (ShadowRoot* root = element.containingShadowRoot())
return root->type() == ShadowRootType::UserAgent &&

Powered by Google App Engine
This is Rietveld 408576698