OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * 1999 Waldo Bastian (bastian@kde.org) | 3 * 1999 Waldo Bastian (bastian@kde.org) |
4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 FirstAttributeSelectorMatch = AttributeExact, | 110 FirstAttributeSelectorMatch = AttributeExact, |
111 }; | 111 }; |
112 | 112 |
113 enum Relation { | 113 enum Relation { |
114 SubSelector, // No combinator | 114 SubSelector, // No combinator |
115 Descendant, // "Space" combinator | 115 Descendant, // "Space" combinator |
116 Child, // > combinator | 116 Child, // > combinator |
117 DirectAdjacent, // + combinator | 117 DirectAdjacent, // + combinator |
118 IndirectAdjacent, // ~ combinator | 118 IndirectAdjacent, // ~ combinator |
119 ShadowPseudo, // Special case of shadow DOM pseudo elements / shadow pse
udo element | 119 ShadowPseudo, // Special case of shadow DOM pseudo elements / shadow pse
udo element |
120 ShadowDeep // /deep/ combinator | 120 ShadowDeep, // /deep/ combinator |
| 121 ShadowSlot // slotted to <slot> element |
121 }; | 122 }; |
122 | 123 |
123 enum PseudoType { | 124 enum PseudoType { |
124 PseudoUnknown, | 125 PseudoUnknown, |
125 PseudoEmpty, | 126 PseudoEmpty, |
126 PseudoFirstChild, | 127 PseudoFirstChild, |
127 PseudoFirstOfType, | 128 PseudoFirstOfType, |
128 PseudoLastChild, | 129 PseudoLastChild, |
129 PseudoLastOfType, | 130 PseudoLastOfType, |
130 PseudoOnlyChild, | 131 PseudoOnlyChild, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 PseudoWebKitCustomElement, | 195 PseudoWebKitCustomElement, |
195 PseudoCue, | 196 PseudoCue, |
196 PseudoFutureCue, | 197 PseudoFutureCue, |
197 PseudoPastCue, | 198 PseudoPastCue, |
198 PseudoUnresolved, | 199 PseudoUnresolved, |
199 PseudoContent, | 200 PseudoContent, |
200 PseudoHost, | 201 PseudoHost, |
201 PseudoHostContext, | 202 PseudoHostContext, |
202 PseudoShadow, | 203 PseudoShadow, |
203 PseudoSpatialNavigationFocus, | 204 PseudoSpatialNavigationFocus, |
204 PseudoListBox | 205 PseudoListBox, |
| 206 PseudoSlotted |
205 }; | 207 }; |
206 | 208 |
207 enum AttributeMatchType { | 209 enum AttributeMatchType { |
208 CaseSensitive, | 210 CaseSensitive, |
209 CaseInsensitive, | 211 CaseInsensitive, |
210 }; | 212 }; |
211 | 213 |
212 PseudoType pseudoType() const { return static_cast<PseudoType>(m_pseudoType)
; } | 214 PseudoType pseudoType() const { return static_cast<PseudoType>(m_pseudoType)
; } |
213 void updatePseudoType(const AtomicString&, bool hasArguments); | 215 void updatePseudoType(const AtomicString&, bool hasArguments); |
214 | 216 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 291 |
290 private: | 292 private: |
291 unsigned m_relation : 3; // enum Relation | 293 unsigned m_relation : 3; // enum Relation |
292 unsigned m_match : 4; // enum Match | 294 unsigned m_match : 4; // enum Match |
293 unsigned m_pseudoType : 8; // enum PseudoType | 295 unsigned m_pseudoType : 8; // enum PseudoType |
294 unsigned m_isLastInSelectorList : 1; | 296 unsigned m_isLastInSelectorList : 1; |
295 unsigned m_isLastInTagHistory : 1; | 297 unsigned m_isLastInTagHistory : 1; |
296 unsigned m_hasRareData : 1; | 298 unsigned m_hasRareData : 1; |
297 unsigned m_isForPage : 1; | 299 unsigned m_isForPage : 1; |
298 unsigned m_tagIsImplicit : 1; | 300 unsigned m_tagIsImplicit : 1; |
299 unsigned m_relationIsAffectedByPseudoContent : 1; | 301 unsigned m_relationIsAffectedByPseudoContent : 1; |
300 | 302 |
301 void setPseudoType(PseudoType pseudoType) | 303 void setPseudoType(PseudoType pseudoType) |
302 { | 304 { |
303 m_pseudoType = pseudoType; | 305 m_pseudoType = pseudoType; |
304 ASSERT(static_cast<PseudoType>(m_pseudoType) == pseudoType); // using a
bitfield. | 306 ASSERT(static_cast<PseudoType>(m_pseudoType) == pseudoType); // using a
bitfield. |
305 } | 307 } |
306 | 308 |
307 unsigned specificityForOneSelector() const; | 309 unsigned specificityForOneSelector() const; |
308 unsigned specificityForPage() const; | 310 unsigned specificityForPage() const; |
309 | 311 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 if (m_hasRareData) | 491 if (m_hasRareData) |
490 return m_data.m_rareData->m_serializingValue; | 492 return m_data.m_rareData->m_serializingValue; |
491 // AtomicString is really just a StringImpl* so the cast below is safe. | 493 // AtomicString is really just a StringImpl* so the cast below is safe. |
492 // FIXME: Perhaps call sites could be changed to accept StringImpl? | 494 // FIXME: Perhaps call sites could be changed to accept StringImpl? |
493 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); | 495 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); |
494 } | 496 } |
495 | 497 |
496 } // namespace blink | 498 } // namespace blink |
497 | 499 |
498 #endif // CSSSelector_h | 500 #endif // CSSSelector_h |
OLD | NEW |