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

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

Issue 315043005: Simplify CSSSelector::isAttributeSelector() by not checking each Match type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move new value to end of enum Created 6 years, 6 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 | « no previous file | no next file » | 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..df2083566484bffa352c30a120c46fd3d5152467 100644
--- a/Source/core/css/CSSSelector.h
+++ b/Source/core/css/CSSSelector.h
@@ -110,16 +110,17 @@ namespace WebCore {
Tag, // Example: div
Id, // Example: #id
Class, // example: .class
+ PseudoClass, // Example: :nth-child(2)
+ PseudoElement, // Example: ::first-line
+ PagePseudoClass, // ??
Exact, // Example: E[foo="bar"]
Set, // Example: E[foo]
- List, // Example: E[foo~="bar"]
Hyphen, // Example: E[foo|="bar"]
- PseudoClass, // Example: :nth-child(2)
- PseudoElement, // Example: ::first-line
+ List, // Example: E[foo~="bar"]
Contain, // css3: E[foo*="bar"]
Begin, // css3: E[foo^="bar"]
End, // css3: E[foo$="bar"]
- PagePseudoClass // ??
+ FirstAttributeSelectorMatch = Exact,
};
enum Relation {
@@ -402,13 +403,7 @@ inline bool CSSSelector::isSiblingSelector() const
inline bool CSSSelector::isAttributeSelector() const
{
- return m_match == CSSSelector::Exact
- || m_match == CSSSelector::Set
- || m_match == CSSSelector::List
- || m_match == CSSSelector::Hyphen
- || m_match == CSSSelector::Contain
- || m_match == CSSSelector::Begin
- || m_match == CSSSelector::End;
+ return m_match >= FirstAttributeSelectorMatch;
}
inline bool CSSSelector::isContentPseudoElement() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698