Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: Source/core/css/CSSSelector.h

Issue 252683011: Add support for case-insensitive attribute value selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add runtime flag; fix selector serializing Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSParserValues.h ('k') | Source/core/css/CSSSelector.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSSelector.h
diff --git a/Source/core/css/CSSSelector.h b/Source/core/css/CSSSelector.h
index d9c9933b5eb282626bcf6e84a532f724c6d6ede3..36892a43ec0aa926e47cd104c21c7b2ba5f910b8 100644
--- a/Source/core/css/CSSSelector.h
+++ b/Source/core/css/CSSSelector.h
@@ -237,6 +237,11 @@ namespace WebCore {
RightBottomMarginBox,
};
+ enum AttributeFlags {
+ NoAttributeFlags,
+ CaseInsensitive,
+ };
+
PseudoType pseudoType() const
{
if (m_pseudoType == PseudoNotParsed)
@@ -260,6 +265,7 @@ namespace WebCore {
// how you use the returned QualifiedName.
// http://www.w3.org/TR/css3-selectors/#attrnmsp
const QualifiedName& attribute() const;
+ unsigned attributeFlags() const;
eseidel 2014/05/07 18:12:58 Can't this return the enum? Normally we store enu
fs 2014/06/12 16:42:31 Sure (done in [1]). It doesn't really add much in
// 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; }
@@ -270,7 +276,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();
@@ -337,6 +343,7 @@ namespace WebCore {
int m_a; // Used for :nth-*
int m_b; // Used for :nth-*
QualifiedName m_attribute; // used for attribute selector
+ unsigned m_attributeFlags; // used for attribute selector (with value)
eseidel 2014/05/29 00:25:01 I think we have a ton of CSSSelector objects... I
apavlov 2014/06/11 12:26:19 This is RareData. Consequently, it will be found i
fs 2014/06/12 16:42:31 Yes, hopefully they are indeed "rare". Disregardin
AtomicString m_argument; // Used for :contains, :lang, :nth-*
OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and :not
@@ -360,6 +367,13 @@ inline const QualifiedName& CSSSelector::attribute() const
return m_data.m_rareData->m_attribute;
}
+inline unsigned CSSSelector::attributeFlags() const
+{
+ ASSERT(isAttributeSelector());
+ ASSERT(m_hasRareData);
+ return m_data.m_rareData->m_attributeFlags;
+}
+
inline bool CSSSelector::matchesPseudoElement() const
{
if (m_pseudoType == PseudoUnknown)
« no previous file with comments | « Source/core/css/CSSParserValues.h ('k') | Source/core/css/CSSSelector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698