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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 bool matchesPseudoElement() const; | 290 bool matchesPseudoElement() const; |
291 bool isCustomPseudoElement() const; | 291 bool isCustomPseudoElement() const; |
292 bool isDirectAdjacentSelector() const { return m_relation == DirectAdjac
ent; } | 292 bool isDirectAdjacentSelector() const { return m_relation == DirectAdjac
ent; } |
293 bool isAdjacentSelector() const { return m_relation == DirectAdjacent ||
m_relation == IndirectAdjacent; } | 293 bool isAdjacentSelector() const { return m_relation == DirectAdjacent ||
m_relation == IndirectAdjacent; } |
294 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_r
elation == ShadowDeep; } | 294 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_r
elation == ShadowDeep; } |
295 bool isSiblingSelector() const; | 295 bool isSiblingSelector() const; |
296 bool isAttributeSelector() const; | 296 bool isAttributeSelector() const; |
297 bool isContentPseudoElement() const; | 297 bool isContentPseudoElement() const; |
298 bool isShadowPseudoElement() const; | 298 bool isShadowPseudoElement() const; |
299 bool isHostPseudoClass() const; | 299 bool isHostPseudoClass() const; |
300 | 300 bool isTreeBoundaryCrossing() const; |
| 301 bool isInsertionPointCrossing() const; |
301 // FIXME: selectors with no tagHistory() get a relation() of Descendant
(and sometimes even SubSelector). It should instead be | 302 // FIXME: selectors with no tagHistory() get a relation() of Descendant
(and sometimes even SubSelector). It should instead be |
302 // None. | 303 // None. |
303 Relation relation() const { return static_cast<Relation>(m_relation); } | 304 Relation relation() const { return static_cast<Relation>(m_relation); } |
304 void setRelation(Relation relation) | 305 void setRelation(Relation relation) |
305 { | 306 { |
306 m_relation = relation; | 307 m_relation = relation; |
307 ASSERT(static_cast<Relation>(m_relation) == relation); // using a bi
tfield. | 308 ASSERT(static_cast<Relation>(m_relation) == relation); // using a bi
tfield. |
308 } | 309 } |
309 | 310 |
310 Match match() const { return static_cast<Match>(m_match); } | 311 Match match() const { return static_cast<Match>(m_match); } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 inline bool CSSSelector::isContentPseudoElement() const | 441 inline bool CSSSelector::isContentPseudoElement() const |
441 { | 442 { |
442 return m_match == PseudoElement && pseudoType() == PseudoContent; | 443 return m_match == PseudoElement && pseudoType() == PseudoContent; |
443 } | 444 } |
444 | 445 |
445 inline bool CSSSelector::isShadowPseudoElement() const | 446 inline bool CSSSelector::isShadowPseudoElement() const |
446 { | 447 { |
447 return m_match == PseudoElement && pseudoType() == PseudoShadow; | 448 return m_match == PseudoElement && pseudoType() == PseudoShadow; |
448 } | 449 } |
449 | 450 |
| 451 inline bool CSSSelector::isTreeBoundaryCrossing() const |
| 452 { |
| 453 return m_match == PseudoClass && (pseudoType() == PseudoHost || pseudoType()
== PseudoHostContext); |
| 454 } |
| 455 |
| 456 inline bool CSSSelector::isInsertionPointCrossing() const |
| 457 { |
| 458 return (m_match == PseudoClass && pseudoType() == PseudoHostContext) |
| 459 || (m_match == PseudoElement && pseudoType() == PseudoContent); |
| 460 } |
| 461 |
450 inline void CSSSelector::setValue(const AtomicString& value) | 462 inline void CSSSelector::setValue(const AtomicString& value) |
451 { | 463 { |
452 ASSERT(m_match != Tag); | 464 ASSERT(m_match != Tag); |
453 ASSERT(m_pseudoType == PseudoNotParsed); | 465 ASSERT(m_pseudoType == PseudoNotParsed); |
454 // Need to do ref counting manually for the union. | 466 // Need to do ref counting manually for the union. |
455 if (m_hasRareData) { | 467 if (m_hasRareData) { |
456 m_data.m_rareData->m_value = value; | 468 m_data.m_rareData->m_value = value; |
457 return; | 469 return; |
458 } | 470 } |
459 if (m_data.m_value) | 471 if (m_data.m_value) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 if (m_hasRareData) | 550 if (m_hasRareData) |
539 return m_data.m_rareData->m_value; | 551 return m_data.m_rareData->m_value; |
540 // AtomicString is really just a StringImpl* so the cast below is safe. | 552 // AtomicString is really just a StringImpl* so the cast below is safe. |
541 // FIXME: Perhaps call sites could be changed to accept StringImpl? | 553 // FIXME: Perhaps call sites could be changed to accept StringImpl? |
542 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); | 554 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); |
543 } | 555 } |
544 | 556 |
545 } // namespace blink | 557 } // namespace blink |
546 | 558 |
547 #endif // CSSSelector_h | 559 #endif // CSSSelector_h |
OLD | NEW |