Chromium Code Reviews| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 PseudoFullScreen, | 207 PseudoFullScreen, |
| 208 PseudoFullScreenDocument, | 208 PseudoFullScreenDocument, |
| 209 PseudoFullScreenAncestor, | 209 PseudoFullScreenAncestor, |
| 210 PseudoInRange, | 210 PseudoInRange, |
| 211 PseudoOutOfRange, | 211 PseudoOutOfRange, |
| 212 PseudoUserAgentCustomElement, | 212 PseudoUserAgentCustomElement, |
| 213 PseudoWebKitCustomElement, | 213 PseudoWebKitCustomElement, |
| 214 PseudoCue, | 214 PseudoCue, |
| 215 PseudoFutureCue, | 215 PseudoFutureCue, |
| 216 PseudoPastCue, | 216 PseudoPastCue, |
| 217 PseudoDistributed, | |
| 218 PseudoUnresolved, | 217 PseudoUnresolved, |
| 219 PseudoContent, | 218 PseudoContent, |
| 220 PseudoHost, | 219 PseudoHost, |
| 221 PseudoHostContext | 220 PseudoHostContext |
| 222 }; | 221 }; |
| 223 | 222 |
| 224 enum OptionalPseudoTypeRequirements { | |
|
hayato
2014/03/26 06:59:15
Note: This should have been removed in another pat
| |
| 225 // 0 is used to mean "no requirements". | |
| 226 RequiresShadowDOM = 1 | |
| 227 }; | |
| 228 | |
| 229 enum MarginBoxType { | 223 enum MarginBoxType { |
| 230 TopLeftCornerMarginBox, | 224 TopLeftCornerMarginBox, |
| 231 TopLeftMarginBox, | 225 TopLeftMarginBox, |
| 232 TopCenterMarginBox, | 226 TopCenterMarginBox, |
| 233 TopRightMarginBox, | 227 TopRightMarginBox, |
| 234 TopRightCornerMarginBox, | 228 TopRightCornerMarginBox, |
| 235 BottomLeftCornerMarginBox, | 229 BottomLeftCornerMarginBox, |
| 236 BottomLeftMarginBox, | 230 BottomLeftMarginBox, |
| 237 BottomCenterMarginBox, | 231 BottomCenterMarginBox, |
| 238 BottomRightMarginBox, | 232 BottomRightMarginBox, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 | 279 |
| 286 bool parseNth() const; | 280 bool parseNth() const; |
| 287 bool matchNth(int count) const; | 281 bool matchNth(int count) const; |
| 288 | 282 |
| 289 bool matchesPseudoElement() const; | 283 bool matchesPseudoElement() const; |
| 290 bool isUnknownPseudoElement() const; | 284 bool isUnknownPseudoElement() const; |
| 291 bool isCustomPseudoElement() const; | 285 bool isCustomPseudoElement() const; |
| 292 bool isDirectAdjacentSelector() const { return m_relation == DirectAdjac ent; } | 286 bool isDirectAdjacentSelector() const { return m_relation == DirectAdjac ent; } |
| 293 bool isSiblingSelector() const; | 287 bool isSiblingSelector() const; |
| 294 bool isAttributeSelector() const; | 288 bool isAttributeSelector() const; |
| 295 bool isDistributedPseudoElement() const; | |
| 296 bool isContentPseudoElement() const; | 289 bool isContentPseudoElement() const; |
| 297 bool isHostPseudoClass() const; | 290 bool isHostPseudoClass() const; |
| 298 | 291 |
| 299 // FIXME: selectors with no tagHistory() get a relation() of Descendant. It should instead be | 292 // FIXME: selectors with no tagHistory() get a relation() of Descendant. It should instead be |
| 300 // None. | 293 // None. |
| 301 Relation relation() const { return static_cast<Relation>(m_relation); } | 294 Relation relation() const { return static_cast<Relation>(m_relation); } |
| 302 | 295 |
| 303 bool isLastInSelectorList() const { return m_isLastInSelectorList; } | 296 bool isLastInSelectorList() const { return m_isLastInSelectorList; } |
| 304 void setLastInSelectorList() { m_isLastInSelectorList = true; } | 297 void setLastInSelectorList() { m_isLastInSelectorList = true; } |
| 305 bool isLastInTagHistory() const { return m_isLastInTagHistory; } | 298 bool isLastInTagHistory() const { return m_isLastInTagHistory; } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 { | 405 { |
| 413 return m_match == CSSSelector::Exact | 406 return m_match == CSSSelector::Exact |
| 414 || m_match == CSSSelector::Set | 407 || m_match == CSSSelector::Set |
| 415 || m_match == CSSSelector::List | 408 || m_match == CSSSelector::List |
| 416 || m_match == CSSSelector::Hyphen | 409 || m_match == CSSSelector::Hyphen |
| 417 || m_match == CSSSelector::Contain | 410 || m_match == CSSSelector::Contain |
| 418 || m_match == CSSSelector::Begin | 411 || m_match == CSSSelector::Begin |
| 419 || m_match == CSSSelector::End; | 412 || m_match == CSSSelector::End; |
| 420 } | 413 } |
| 421 | 414 |
| 422 inline bool CSSSelector::isDistributedPseudoElement() const | |
| 423 { | |
| 424 return m_match == PseudoElement && pseudoType() == PseudoDistributed; | |
| 425 } | |
| 426 | |
| 427 inline bool CSSSelector::isContentPseudoElement() const | 415 inline bool CSSSelector::isContentPseudoElement() const |
| 428 { | 416 { |
| 429 return m_match == PseudoElement && pseudoType() == PseudoContent; | 417 return m_match == PseudoElement && pseudoType() == PseudoContent; |
| 430 } | 418 } |
| 431 | 419 |
| 432 inline void CSSSelector::setValue(const AtomicString& value) | 420 inline void CSSSelector::setValue(const AtomicString& value) |
| 433 { | 421 { |
| 434 ASSERT(m_match != Tag); | 422 ASSERT(m_match != Tag); |
| 435 ASSERT(m_pseudoType == PseudoNotParsed); | 423 ASSERT(m_pseudoType == PseudoNotParsed); |
| 436 // Need to do ref counting manually for the union. | 424 // Need to do ref counting manually for the union. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 520 if (m_hasRareData) | 508 if (m_hasRareData) |
| 521 return m_data.m_rareData->m_value; | 509 return m_data.m_rareData->m_value; |
| 522 // AtomicString is really just a StringImpl* so the cast below is safe. | 510 // AtomicString is really just a StringImpl* so the cast below is safe. |
| 523 // FIXME: Perhaps call sites could be changed to accept StringImpl? | 511 // FIXME: Perhaps call sites could be changed to accept StringImpl? |
| 524 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); | 512 return *reinterpret_cast<const AtomicString*>(&m_data.m_value); |
| 525 } | 513 } |
| 526 | 514 |
| 527 } // namespace WebCore | 515 } // namespace WebCore |
| 528 | 516 |
| 529 #endif // CSSSelector_h | 517 #endif // CSSSelector_h |
| OLD | NEW |