| Index: Source/core/css/CSSSelector.h
|
| diff --git a/Source/core/css/CSSSelector.h b/Source/core/css/CSSSelector.h
|
| index 176bc34a69f32f0362996dd870d74e22f0ef850d..cb951582c3aa234b775d2bbd390589dfe5c628f1 100644
|
| --- a/Source/core/css/CSSSelector.h
|
| +++ b/Source/core/css/CSSSelector.h
|
| @@ -239,6 +239,11 @@ namespace blink {
|
| RightBottomMarginBox,
|
| };
|
|
|
| + enum AttributeMatchType {
|
| + CaseSensitive,
|
| + CaseInsensitive,
|
| + };
|
| +
|
| PseudoType pseudoType() const
|
| {
|
| if (m_pseudoType == PseudoNotParsed)
|
| @@ -262,6 +267,7 @@ namespace blink {
|
| // how you use the returned QualifiedName.
|
| // http://www.w3.org/TR/css3-selectors/#attrnmsp
|
| const QualifiedName& attribute() const;
|
| + AttributeMatchType attributeMatchType() const;
|
| // Returns the argument of a parameterized selector. For example, nth-child(2) would have an argument of 2.
|
| const AtomicString& argument() const { return m_hasRareData ? m_data.m_rareData->m_argument : nullAtom; }
|
| const CSSSelectorList* selectorList() const { return m_hasRareData ? m_data.m_rareData->m_selectorList.get() : 0; }
|
| @@ -272,7 +278,7 @@ namespace blink {
|
| #endif
|
|
|
| void setValue(const AtomicString&);
|
| - void setAttribute(const QualifiedName&);
|
| + void setAttribute(const QualifiedName&, AttributeMatchType);
|
| void setArgument(const AtomicString&);
|
| void setSelectorList(PassOwnPtr<CSSSelectorList>);
|
| void setMatchUserAgentOnly();
|
| @@ -344,10 +350,19 @@ namespace blink {
|
|
|
| bool parseNth();
|
| bool matchNth(int count);
|
| + int nthAValue() const { return m_bits.m_nth.m_a; }
|
| + void setNthAValue(int nthA) { m_bits.m_nth.m_a = nthA; }
|
| + int nthBValue() const { return m_bits.m_nth.m_b; }
|
| + void setNthBValue(int nthB) { m_bits.m_nth.m_b = nthB; }
|
|
|
| AtomicString m_value;
|
| - int m_a; // Used for :nth-*
|
| - int m_b; // Used for :nth-*
|
| + union {
|
| + struct {
|
| + int m_a; // Used for :nth-*
|
| + int m_b; // Used for :nth-*
|
| + } m_nth;
|
| + AttributeMatchType m_attributeMatchType; // used for attribute selector (with value)
|
| + } m_bits;
|
| QualifiedName m_attribute; // used for attribute selector
|
| AtomicString m_argument; // Used for :contains, :lang, :nth-*
|
| OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and :not
|
| @@ -372,6 +387,13 @@ inline const QualifiedName& CSSSelector::attribute() const
|
| return m_data.m_rareData->m_attribute;
|
| }
|
|
|
| +inline CSSSelector::AttributeMatchType CSSSelector::attributeMatchType() const
|
| +{
|
| + ASSERT(isAttributeSelector());
|
| + ASSERT(m_hasRareData);
|
| + return m_data.m_rareData->m_bits.m_attributeMatchType;
|
| +}
|
| +
|
| inline bool CSSSelector::matchesPseudoElement() const
|
| {
|
| if (m_pseudoType == PseudoUnknown)
|
|
|