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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 unsigned m_relationIsForShadowDistributed : 1; | 247 unsigned m_relationIsForShadowDistributed : 1; |
248 | 248 |
249 unsigned specificityForOneSelector() const; | 249 unsigned specificityForOneSelector() const; |
250 unsigned specificityForPage() const; | 250 unsigned specificityForPage() const; |
251 void extractPseudoType() const; | 251 void extractPseudoType() const; |
252 | 252 |
253 // Hide. | 253 // Hide. |
254 CSSSelector& operator=(const CSSSelector&); | 254 CSSSelector& operator=(const CSSSelector&); |
255 | 255 |
256 struct RareData : public RefCounted<RareData> { | 256 struct RareData : public RefCounted<RareData> { |
257 static PassRefPtr<RareData> create(PassRefPtr<AtomicStringImpl> valu
e) { return adoptRef(new RareData(value)); } | 257 static PassRefPtr<RareData> create(PassRefPtr<StringImpl> value) { r
eturn adoptRef(new RareData(value)); } |
258 ~RareData(); | 258 ~RareData(); |
259 | 259 |
260 bool parseNth(); | 260 bool parseNth(); |
261 bool matchNth(int count); | 261 bool matchNth(int count); |
262 | 262 |
263 AtomicStringImpl* m_value; // Plain pointer to keep things uniform w
ith the union. | 263 StringImpl* m_value; // Plain pointer to keep things uniform with th
e union. |
264 int m_a; // Used for :nth-* | 264 int m_a; // Used for :nth-* |
265 int m_b; // Used for :nth-* | 265 int m_b; // Used for :nth-* |
266 QualifiedName m_attribute; // used for attribute selector | 266 QualifiedName m_attribute; // used for attribute selector |
267 AtomicString m_argument; // Used for :contains, :lang and :nth-* | 267 AtomicString m_argument; // Used for :contains, :lang and :nth-* |
268 OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and
:not | 268 OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and
:not |
269 | 269 |
270 private: | 270 private: |
271 RareData(PassRefPtr<AtomicStringImpl> value); | 271 RareData(PassRefPtr<StringImpl> value); |
272 }; | 272 }; |
273 void createRareData(); | 273 void createRareData(); |
274 | 274 |
275 union DataUnion { | 275 union DataUnion { |
276 DataUnion() : m_value(0) { } | 276 DataUnion() : m_value(0) { } |
277 AtomicStringImpl* m_value; | 277 StringImpl* m_value; |
278 QualifiedName::QualifiedNameImpl* m_tagQName; | 278 QualifiedName::QualifiedNameImpl* m_tagQName; |
279 RareData* m_rareData; | 279 RareData* m_rareData; |
280 } m_data; | 280 } m_data; |
281 }; | 281 }; |
282 | 282 |
283 inline const QualifiedName& CSSSelector::attribute() const | 283 inline const QualifiedName& CSSSelector::attribute() const |
284 { | 284 { |
285 ASSERT(isAttributeSelector()); | 285 ASSERT(isAttributeSelector()); |
286 ASSERT(m_hasRareData); | 286 ASSERT(m_hasRareData); |
287 return m_data.m_rareData->m_attribute; | 287 return m_data.m_rareData->m_attribute; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 inline const QualifiedName& CSSSelector::tagQName() const | 423 inline const QualifiedName& CSSSelector::tagQName() const |
424 { | 424 { |
425 ASSERT(m_match == Tag); | 425 ASSERT(m_match == Tag); |
426 return *reinterpret_cast<const QualifiedName*>(&m_data.m_tagQName); | 426 return *reinterpret_cast<const QualifiedName*>(&m_data.m_tagQName); |
427 } | 427 } |
428 | 428 |
429 inline const AtomicString& CSSSelector::value() const | 429 inline const AtomicString& CSSSelector::value() const |
430 { | 430 { |
431 ASSERT(m_match != Tag); | 431 ASSERT(m_match != Tag); |
432 // AtomicString is really just an AtomicStringImpl* so the cast below is saf
e. | 432 // AtomicString is really just an StringImpl* so the cast below is safe. |
433 // FIXME: Perhaps call sites could be changed to accept AtomicStringImpl? | 433 // FIXME: Perhaps call sites could be changed to accept StringImpl? |
434 return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rare
Data->m_value : &m_data.m_value); | 434 return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rare
Data->m_value : &m_data.m_value); |
435 } | 435 } |
436 | 436 |
437 | 437 |
438 } // namespace WebCore | 438 } // namespace WebCore |
439 | 439 |
440 #endif // CSSSelector_h | 440 #endif // CSSSelector_h |
OLD | NEW |