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

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 value to 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..371bc6615a3d157c100eb2676b1cfc28cf084f8d 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"]
+ FirstAttributeSelectorMatch = Exact,
Inactive 2014/06/04 23:49:52 esprehn@, is this what you had in mind? I'd like n
Inactive 2014/06/05 02:00:22 Maybe I should move this one to the end of the enu
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 // ??
};
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