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

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: 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..f50a13f3b07d5235481b1691ae159a071afb1895 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -917,6 +917,14 @@ 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)
esprehn 2016/05/09 19:39:50 this should check that containingShadowRoot()->typ
tkent 2016/05/10 04:29:29 Done.
+ return false;
+ if (!element.shadowHost())
+ return false;
+ if (!element.shadowHost()->computedStyle())
esprehn 2016/05/09 19:39:50 Don't call computedStyle repeatedly, save to a loc
tkent 2016/05/10 04:29:29 Done.
+ return false;
+ return element.shadowHost()->computedStyle()->hasAppearance();
case CSSSelector::PseudoWindowInactive:
if (!context.hasSelectionPseudo)
return false;
@@ -960,11 +968,12 @@ bool SelectorChecker::checkPseudoElement(const SelectorCheckingContext& context,
return false;
}
case CSSSelector::PseudoWebKitCustomElement:
- {
- if (ShadowRoot* root = element.containingShadowRoot())
- return root->type() == ShadowRootType::UserAgent && element.shadowPseudoId() == selector.value();
- return false;
+ if (ShadowRoot* root = element.containingShadowRoot()) {
+ if (selector.value().startsWith("-webkit-internal-") && !m_isUARule)
esprehn 2016/05/09 19:39:50 why do we need this? We should just make the pseud
tkent 2016/05/10 04:29:29 We should avoid to expose new vendor-specific pseu
+ return false;
+ return root->type() == ShadowRootType::UserAgent && element.shadowPseudoId() == selector.value();
}
+ return false;
case CSSSelector::PseudoSlotted:
{
SelectorCheckingContext subContext(context);

Powered by Google App Engine
This is Rietveld 408576698