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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 PseudoFullScreenAncestor, | 156 PseudoFullScreenAncestor, |
157 PseudoInRange, | 157 PseudoInRange, |
158 PseudoOutOfRange, | 158 PseudoOutOfRange, |
159 PseudoUserAgentCustomElement, | 159 PseudoUserAgentCustomElement, |
160 PseudoWebKitCustomElement, | 160 PseudoWebKitCustomElement, |
161 PseudoCue, | 161 PseudoCue, |
162 PseudoFutureCue, | 162 PseudoFutureCue, |
163 PseudoPastCue, | 163 PseudoPastCue, |
164 PseudoSeamlessDocument, | 164 PseudoSeamlessDocument, |
165 PseudoDistributed, | 165 PseudoDistributed, |
166 PseudoPart, | |
167 PseudoUnresolved, | 166 PseudoUnresolved, |
168 PseudoContent, | 167 PseudoContent, |
169 PseudoHost | 168 PseudoHost |
170 }; | 169 }; |
171 | 170 |
172 enum MarginBoxType { | 171 enum MarginBoxType { |
173 TopLeftCornerMarginBox, | 172 TopLeftCornerMarginBox, |
174 TopLeftMarginBox, | 173 TopLeftMarginBox, |
175 TopCenterMarginBox, | 174 TopCenterMarginBox, |
176 TopRightMarginBox, | 175 TopRightMarginBox, |
(...skipping 23 matching lines...) Expand all Loading... |
200 | 199 |
201 // Selectors are kept in an array by CSSSelectorList. The next component
of the selector is | 200 // Selectors are kept in an array by CSSSelectorList. The next component
of the selector is |
202 // the next item in the array. | 201 // the next item in the array. |
203 const CSSSelector* tagHistory() const { return m_isLastInTagHistory ? 0
: const_cast<CSSSelector*>(this + 1); } | 202 const CSSSelector* tagHistory() const { return m_isLastInTagHistory ? 0
: const_cast<CSSSelector*>(this + 1); } |
204 | 203 |
205 const QualifiedName& tagQName() const; | 204 const QualifiedName& tagQName() const; |
206 const AtomicString& value() const; | 205 const AtomicString& value() const; |
207 const QualifiedName& attribute() const; | 206 const QualifiedName& attribute() const; |
208 const AtomicString& argument() const { return m_hasRareData ? m_data.m_r
areData->m_argument : nullAtom; } | 207 const AtomicString& argument() const { return m_hasRareData ? m_data.m_r
areData->m_argument : nullAtom; } |
209 const CSSSelectorList* selectorList() const { return m_hasRareData ? m_d
ata.m_rareData->m_selectorList.get() : 0; } | 208 const CSSSelectorList* selectorList() const { return m_hasRareData ? m_d
ata.m_rareData->m_selectorList.get() : 0; } |
210 bool isMatchUserAgentOnly() const { return m_hasRareData ? m_data.m_rare
Data->m_matchUserAgentOnly : false; } | |
211 | 209 |
212 void setValue(const AtomicString&); | 210 void setValue(const AtomicString&); |
213 void setAttribute(const QualifiedName&); | 211 void setAttribute(const QualifiedName&); |
214 void setArgument(const AtomicString&); | 212 void setArgument(const AtomicString&); |
215 void setSelectorList(PassOwnPtr<CSSSelectorList>); | 213 void setSelectorList(PassOwnPtr<CSSSelectorList>); |
216 void setMatchUserAgentOnly(); | 214 void setMatchUserAgentOnly(); |
217 | 215 |
218 bool parseNth() const; | 216 bool parseNth() const; |
219 bool matchNth(int count) const; | 217 bool matchNth(int count) const; |
220 | 218 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 static PassRefPtr<RareData> create(PassRefPtr<StringImpl> value) { r
eturn adoptRef(new RareData(value)); } | 266 static PassRefPtr<RareData> create(PassRefPtr<StringImpl> value) { r
eturn adoptRef(new RareData(value)); } |
269 ~RareData(); | 267 ~RareData(); |
270 | 268 |
271 bool parseNth(); | 269 bool parseNth(); |
272 bool matchNth(int count); | 270 bool matchNth(int count); |
273 | 271 |
274 StringImpl* m_value; // Plain pointer to keep things uniform with th
e union. | 272 StringImpl* m_value; // Plain pointer to keep things uniform with th
e union. |
275 int m_a; // Used for :nth-* | 273 int m_a; // Used for :nth-* |
276 int m_b; // Used for :nth-* | 274 int m_b; // Used for :nth-* |
277 QualifiedName m_attribute; // used for attribute selector | 275 QualifiedName m_attribute; // used for attribute selector |
278 AtomicString m_argument; // Used for :contains, :lang, :nth-* and ::
part | 276 AtomicString m_argument; // Used for :contains, :lang, :nth-* |
279 OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and
:not | 277 OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and
:not |
280 unsigned m_matchUserAgentOnly : 1; // Used to make ::part with "-web
kit"-prefixed part name match only elements in UA shadow roots. | |
281 | 278 |
282 private: | 279 private: |
283 RareData(PassRefPtr<StringImpl> value); | 280 RareData(PassRefPtr<StringImpl> value); |
284 }; | 281 }; |
285 void createRareData(); | 282 void createRareData(); |
286 | 283 |
287 union DataUnion { | 284 union DataUnion { |
288 DataUnion() : m_value(0) { } | 285 DataUnion() : m_value(0) { } |
289 StringImpl* m_value; | 286 StringImpl* m_value; |
290 QualifiedName::QualifiedNameImpl* m_tagQName; | 287 QualifiedName::QualifiedNameImpl* m_tagQName; |
(...skipping 15 matching lines...) Expand all Loading... |
306 return m_match == PseudoElement; | 303 return m_match == PseudoElement; |
307 } | 304 } |
308 | 305 |
309 inline bool CSSSelector::isUnknownPseudoElement() const | 306 inline bool CSSSelector::isUnknownPseudoElement() const |
310 { | 307 { |
311 return m_match == PseudoElement && m_pseudoType == PseudoUnknown; | 308 return m_match == PseudoElement && m_pseudoType == PseudoUnknown; |
312 } | 309 } |
313 | 310 |
314 inline bool CSSSelector::isCustomPseudoElement() const | 311 inline bool CSSSelector::isCustomPseudoElement() const |
315 { | 312 { |
316 return m_match == PseudoElement && (m_pseudoType == PseudoUserAgentCustomEle
ment || m_pseudoType == PseudoWebKitCustomElement || m_pseudoType == PseudoPart)
; | 313 return m_match == PseudoElement && (m_pseudoType == PseudoUserAgentCustomEle
ment || m_pseudoType == PseudoWebKitCustomElement); |
317 } | 314 } |
318 | 315 |
319 inline bool CSSSelector::isHostPseudoClass() const | 316 inline bool CSSSelector::isHostPseudoClass() const |
320 { | 317 { |
321 return m_match == PseudoClass && m_pseudoType == PseudoHost; | 318 return m_match == PseudoClass && m_pseudoType == PseudoHost; |
322 } | 319 } |
323 | 320 |
324 inline bool CSSSelector::isSiblingSelector() const | 321 inline bool CSSSelector::isSiblingSelector() const |
325 { | 322 { |
326 PseudoType type = pseudoType(); | 323 PseudoType type = pseudoType(); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 ASSERT(m_match != Tag); | 450 ASSERT(m_match != Tag); |
454 // AtomicString is really just a StringImpl* so the cast below is safe. | 451 // AtomicString is really just a StringImpl* so the cast below is safe. |
455 // FIXME: Perhaps call sites could be changed to accept StringImpl? | 452 // FIXME: Perhaps call sites could be changed to accept StringImpl? |
456 return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rare
Data->m_value : &m_data.m_value); | 453 return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rare
Data->m_value : &m_data.m_value); |
457 } | 454 } |
458 | 455 |
459 | 456 |
460 } // namespace WebCore | 457 } // namespace WebCore |
461 | 458 |
462 #endif // CSSSelector_h | 459 #endif // CSSSelector_h |
OLD | NEW |