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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 void setNth(int a, int b); | 256 void setNth(int a, int b); |
257 bool matchNth(int count) const; | 257 bool matchNth(int count) const; |
258 | 258 |
259 bool isAdjacentSelector() const { return m_relation == DirectAdjacent || m_r
elation == IndirectAdjacent; } | 259 bool isAdjacentSelector() const { return m_relation == DirectAdjacent || m_r
elation == IndirectAdjacent; } |
260 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_relat
ion == ShadowDeep; } | 260 bool isShadowSelector() const { return m_relation == ShadowPseudo || m_relat
ion == ShadowDeep; } |
261 bool isAttributeSelector() const { return m_match >= FirstAttributeSelectorM
atch; } | 261 bool isAttributeSelector() const { return m_match >= FirstAttributeSelectorM
atch; } |
262 bool isHostPseudoClass() const { return m_pseudoType == PseudoHost || m_pseu
doType == PseudoHostContext; } | 262 bool isHostPseudoClass() const { return m_pseudoType == PseudoHost || m_pseu
doType == PseudoHostContext; } |
263 bool isUserActionPseudoClass() const; | 263 bool isUserActionPseudoClass() const; |
264 bool isInsertionPointCrossing() const { return m_pseudoType == PseudoHostCon
text || m_pseudoType == PseudoContent; } | 264 bool isInsertionPointCrossing() const { return m_pseudoType == PseudoHostCon
text || m_pseudoType == PseudoContent; } |
| 265 bool isIdClassOrAttributeSelector() const; |
265 | 266 |
266 RelationType relation() const { return static_cast<RelationType>(m_relation)
; } | 267 RelationType relation() const { return static_cast<RelationType>(m_relation)
; } |
267 void setRelation(RelationType relation) | 268 void setRelation(RelationType relation) |
268 { | 269 { |
269 m_relation = relation; | 270 m_relation = relation; |
270 ASSERT(static_cast<RelationType>(m_relation) == relation); // using a bi
tfield. | 271 ASSERT(static_cast<RelationType>(m_relation) == relation); // using a bi
tfield. |
271 } | 272 } |
272 | 273 |
273 MatchType match() const { return static_cast<MatchType>(m_match); } | 274 MatchType match() const { return static_cast<MatchType>(m_match); } |
274 void setMatch(MatchType match) | 275 void setMatch(MatchType match) |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 } | 486 } |
486 | 487 |
487 inline bool CSSSelector::isUserActionPseudoClass() const | 488 inline bool CSSSelector::isUserActionPseudoClass() const |
488 { | 489 { |
489 return m_pseudoType == PseudoHover | 490 return m_pseudoType == PseudoHover |
490 || m_pseudoType == PseudoActive | 491 || m_pseudoType == PseudoActive |
491 || m_pseudoType == PseudoFocus | 492 || m_pseudoType == PseudoFocus |
492 || m_pseudoType == PseudoDrag; | 493 || m_pseudoType == PseudoDrag; |
493 } | 494 } |
494 | 495 |
| 496 inline bool CSSSelector::isIdClassOrAttributeSelector() const |
| 497 { |
| 498 return isAttributeSelector() |
| 499 || match() == CSSSelector::Id |
| 500 || match() == CSSSelector::Class; |
| 501 } |
| 502 |
495 } // namespace blink | 503 } // namespace blink |
496 | 504 |
497 #endif // CSSSelector_h | 505 #endif // CSSSelector_h |
OLD | NEW |