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

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

Issue 1958073002: Introduce :-internal-shadow-host-has-appearance pseudo class, and apply it to METER element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add PseudoBlinkInternalElement 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
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleSet.cpp ('k') | third_party/WebKit/Source/core/css/html.css » ('j') | 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 3416c2386789fce0db221a12c9e35cd4d44c2431..581bee9feacab09d2ebf0f4b1bcb2d5423bdd978 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -917,6 +917,16 @@ bool SelectorChecker::checkPseudoClass(const SelectorCheckingContext& context, M
return m_isUARule && matchesSpatialNavigationFocusPseudoClass(element);
case CSSSelector::PseudoListBox:
return m_isUARule && matchesListBoxPseudoClass(element);
+ case CSSSelector::PseudoHostHasAppearance:
+ if (!m_isUARule)
+ return false;
+ if (ShadowRoot* root = element.containingShadowRoot()) {
+ if (root->type() != ShadowRootType::UserAgent || !root->host())
esprehn 2016/05/13 22:18:40 host() can't be null on a ShadowRoot
tkent 2016/05/16 00:21:25 Removed the null check.
+ return false;
+ const ComputedStyle* style = root->host()->computedStyle();
+ return style && style->hasAppearance();
+ }
+ return false;
case CSSSelector::PseudoWindowInactive:
if (!context.hasSelectionPseudo)
return false;
@@ -965,6 +975,12 @@ bool SelectorChecker::checkPseudoElement(const SelectorCheckingContext& context,
return root->type() == ShadowRootType::UserAgent && element.shadowPseudoId() == selector.value();
return false;
}
+ case CSSSelector::PseudoBlinkInternalElement:
+ if (!m_isUARule)
+ return false;
+ if (ShadowRoot* root = element.containingShadowRoot())
+ return root->type() == ShadowRootType::UserAgent && element.shadowPseudoId() == selector.value();
+ return false;
case CSSSelector::PseudoSlotted:
{
SelectorCheckingContext subContext(context);
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleSet.cpp ('k') | third_party/WebKit/Source/core/css/html.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698