Index: Source/core/css/CSSSelector.h |
diff --git a/Source/core/css/CSSSelector.h b/Source/core/css/CSSSelector.h |
index da24b51feaf8dc22c402752991b4d71254c48439..d36acdea2ed40967a57bf9475b7b6bffdec86dcf 100644 |
--- a/Source/core/css/CSSSelector.h |
+++ b/Source/core/css/CSSSelector.h |
@@ -238,6 +238,11 @@ namespace WebCore { |
RightBottomMarginBox, |
}; |
+ enum AttributeFlags { |
+ NoAttributeFlags, |
+ CaseInsensitive, |
+ }; |
+ |
PseudoType pseudoType() const |
{ |
if (m_pseudoType == PseudoNotParsed) |
@@ -261,6 +266,7 @@ namespace WebCore { |
// how you use the returned QualifiedName. |
// http://www.w3.org/TR/css3-selectors/#attrnmsp |
const QualifiedName& attribute() const; |
+ AttributeFlags attributeFlags() 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; } |
@@ -271,7 +277,7 @@ namespace WebCore { |
#endif |
void setValue(const AtomicString&); |
- void setAttribute(const QualifiedName&); |
+ void setAttribute(const QualifiedName&, unsigned flags); |
void setArgument(const AtomicString&); |
void setSelectorList(PassOwnPtr<CSSSelectorList>); |
void setMatchUserAgentOnly(); |
@@ -346,8 +352,14 @@ namespace WebCore { |
bool matchNth(int count); |
AtomicString m_value; |
- int m_a; // Used for :nth-* |
- int m_b; // Used for :nth-* |
+ union Bits { |
+ Bits() : m_nth() { } |
+ struct { |
+ int m_a; // Used for :nth-* |
+ int m_b; // Used for :nth-* |
+ } m_nth; |
+ unsigned m_attributeFlags; // 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 +384,13 @@ inline const QualifiedName& CSSSelector::attribute() const |
return m_data.m_rareData->m_attribute; |
} |
+inline CSSSelector::AttributeFlags CSSSelector::attributeFlags() const |
+{ |
+ ASSERT(isAttributeSelector()); |
+ ASSERT(m_hasRareData); |
+ return static_cast<AttributeFlags>(m_data.m_rareData->m_bits.m_attributeFlags); |
+} |
+ |
inline bool CSSSelector::matchesPseudoElement() const |
{ |
if (m_pseudoType == PseudoUnknown) |