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

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: WIP Created 5 years 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 47de0758ff32a931becbe277109f6e2ddf89e36f..1452b9972e135f5cf42d055b5eafabc809d408ed 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelector.cpp
@@ -265,6 +265,7 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
case PseudoFullScreenAncestor:
case PseudoSpatialNavigationFocus:
case PseudoListBox:
+ case PseudoSlotted:
return NOPSEUDO;
}
@@ -368,6 +369,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 {
@@ -482,6 +484,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;
@@ -730,6 +733,7 @@ String CSSSelector::selectorText(const String& rightSide) const
case SubSelector:
ASSERT_NOT_REACHED();
case ShadowPseudo:
+ case ShadowSlot:
return tagHistory->selectorText(str.toString() + rightSide);
}
}
@@ -800,6 +804,7 @@ static bool validateSubSelector(const CSSSelector* selector)
case CSSSelector::PseudoNot:
case CSSSelector::PseudoSpatialNavigationFocus:
case CSSSelector::PseudoListBox:
+ case CSSSelector::PseudoSlotted:
return true;
default:
return false;

Powered by Google App Engine
This is Rietveld 408576698