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

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

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.h
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.h b/third_party/WebKit/Source/core/css/CSSSelector.h
index 6982381afae2f0cd5d09d02e2dc487dadb470917..83c6119d558c92c94b83f025321973ec7a3ef0ec 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.h
+++ b/third_party/WebKit/Source/core/css/CSSSelector.h
@@ -117,7 +117,8 @@ public:
DirectAdjacent, // + combinator
IndirectAdjacent, // ~ combinator
ShadowPseudo, // Special case of shadow DOM pseudo elements / shadow pseudo element
- ShadowDeep // /deep/ combinator
+ ShadowDeep, // /deep/ combinator
+ ShadowSlot // slotted to <slot> element
};
enum PseudoType {
@@ -201,7 +202,8 @@ public:
PseudoHostContext,
PseudoShadow,
PseudoSpatialNavigationFocus,
- PseudoListBox
+ PseudoListBox,
+ PseudoSlotted
};
enum AttributeMatchType {
@@ -255,6 +257,7 @@ public:
bool isAttributeSelector() const { return m_match >= FirstAttributeSelectorMatch; }
bool isHostPseudoClass() const { return m_pseudoType == PseudoHost || m_pseudoType == PseudoHostContext; }
bool isInsertionPointCrossing() const { return m_pseudoType == PseudoHostContext || m_pseudoType == PseudoContent; }
+ bool isSlottedPseudoElement() const { return m_pseudoType == PseudoSlotted; }
Relation relation() const { return static_cast<Relation>(m_relation); }
void setRelation(Relation relation)
@@ -287,6 +290,9 @@ public:
bool relationIsAffectedByPseudoContent() const { return m_relationIsAffectedByPseudoContent; }
void setRelationIsAffectedByPseudoContent() { m_relationIsAffectedByPseudoContent = true; }
+ bool relationIsAffectedByPseudoSlotted() const { return m_relationIsAffectedByPseudoSlotted; }
+ void setRelationIsAffectedByPseudoSlotted() { m_relationIsAffectedByPseudoSlotted = true; }
+
private:
unsigned m_relation : 3; // enum Relation
unsigned m_match : 4; // enum Match
@@ -296,7 +302,8 @@ private:
unsigned m_hasRareData : 1;
unsigned m_isForPage : 1;
unsigned m_tagIsImplicit : 1;
- unsigned m_relationIsAffectedByPseudoContent : 1;
+ unsigned m_relationIsAffectedByPseudoContent : 1;
+ unsigned m_relationIsAffectedByPseudoSlotted : 1;
void setPseudoType(PseudoType pseudoType)
{
@@ -416,6 +423,7 @@ inline CSSSelector::CSSSelector()
, m_isForPage(false)
, m_tagIsImplicit(false)
, m_relationIsAffectedByPseudoContent(false)
+ , m_relationIsAffectedByPseudoSlotted(false)
{
}
@@ -429,6 +437,7 @@ inline CSSSelector::CSSSelector(const QualifiedName& tagQName, bool tagIsImplici
, m_isForPage(false)
, m_tagIsImplicit(tagIsImplicit)
, m_relationIsAffectedByPseudoContent(false)
+ , m_relationIsAffectedByPseudoSlotted(false)
{
m_data.m_tagQName = tagQName.impl();
m_data.m_tagQName->ref();
@@ -444,6 +453,7 @@ inline CSSSelector::CSSSelector(const CSSSelector& o)
, m_isForPage(o.m_isForPage)
, m_tagIsImplicit(o.m_tagIsImplicit)
, m_relationIsAffectedByPseudoContent(o.m_relationIsAffectedByPseudoContent)
+ , m_relationIsAffectedByPseudoSlotted(o.m_relationIsAffectedByPseudoSlotted)
{
if (o.m_match == Tag) {
m_data.m_tagQName = o.m_data.m_tagQName;

Powered by Google App Engine
This is Rietveld 408576698