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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase / fix comments for tests (FYI) Created 4 years, 11 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/CSSSelector.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.cpp b/third_party/WebKit/Source/core/css/CSSSelector.cpp
index 2910c45972c2fd945cbc0bc497337606b813006f..ef91085506abb8f11b546bcdedb7ea38466c5bc3 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelector.cpp
@@ -264,6 +264,7 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
case PseudoFullScreenAncestor:
case PseudoSpatialNavigationFocus:
case PseudoListBox:
+ case PseudoSlotted:
return NOPSEUDO;
}
@@ -367,6 +368,7 @@ const static NameToPseudoStruct pseudoTypeWithArgumentsMap[] = {
{"nth-last-child", CSSSelector::PseudoNthLastChild},
{"nth-last-of-type", CSSSelector::PseudoNthLastOfType},
{"nth-of-type", CSSSelector::PseudoNthOfType},
+{"slotted", CSSSelector::PseudoSlotted},
};
class NameToPseudoCompare {
@@ -481,6 +483,7 @@ void CSSSelector::updatePseudoType(const AtomicString& value, bool hasArguments)
case PseudoWebKitCustomElement:
case PseudoContent:
case PseudoShadow:
+ case PseudoSlotted:
if (m_match != PseudoElement)
m_pseudoType = PseudoUnknown;
break;
@@ -729,6 +732,7 @@ String CSSSelector::selectorText(const String& rightSide) const
case SubSelector:
ASSERT_NOT_REACHED();
case ShadowPseudo:
+ case ShadowSlot:
return tagHistory->selectorText(str.toString() + rightSide);
}
}
@@ -799,6 +803,7 @@ static bool validateSubSelector(const CSSSelector* selector)
case CSSSelector::PseudoNot:
case CSSSelector::PseudoSpatialNavigationFocus:
case CSSSelector::PseudoListBox:
+ case CSSSelector::PseudoSlotted:
return true;
default:
return false;
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelector.h ('k') | third_party/WebKit/Source/core/css/CSSSelectorList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698