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

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

Issue 2970623002: [WIP] Compute the linkMatchType inside the CSSSelectorParser.
Patch Set: [WIP] Compute the linkMatchType inside the CSSSelectorParser. Created 3 years, 5 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 | third_party/WebKit/Source/core/css/CSSSelector.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSSelector.h
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.h b/third_party/WebKit/Source/core/css/CSSSelector.h
index 319b859e1fe8192d14aeee48e97d5f801986b9df..36f8e8490753fa085a5696a19ddaa3fa095612d6 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.h
+++ b/third_party/WebKit/Source/core/css/CSSSelector.h
@@ -332,7 +332,8 @@ class CORE_EXPORT CSSSelector {
kMatchVisited = 2,
kMatchAll = kMatchLink | kMatchVisited
};
- unsigned ComputeLinkMatchType() const;
+ void UpdateLinkMatchType();
+ unsigned linkMatchType() const { return link_match_type_; }
bool IsForPage() const { return is_for_page_; }
void SetForPage() { is_for_page_ = true; }
@@ -361,6 +362,7 @@ class CORE_EXPORT CSSSelector {
unsigned is_for_page_ : 1;
unsigned tag_is_implicit_ : 1;
unsigned relation_is_affected_by_pseudo_content_ : 1;
+ unsigned link_match_type_ : 2; // enum LinkMatchMask
void SetPseudoType(PseudoType pseudo_type) {
pseudo_type_ = pseudo_type;
@@ -461,7 +463,8 @@ inline CSSSelector::CSSSelector()
has_rare_data_(false),
is_for_page_(false),
tag_is_implicit_(false),
- relation_is_affected_by_pseudo_content_(false) {}
+ relation_is_affected_by_pseudo_content_(false),
+ link_match_type_(kMatchAll) {}
inline CSSSelector::CSSSelector(const QualifiedName& tag_q_name,
bool tag_is_implicit)
@@ -473,7 +476,8 @@ inline CSSSelector::CSSSelector(const QualifiedName& tag_q_name,
has_rare_data_(false),
is_for_page_(false),
tag_is_implicit_(tag_is_implicit),
- relation_is_affected_by_pseudo_content_(false) {
+ relation_is_affected_by_pseudo_content_(false),
+ link_match_type_(kMatchAll) {
data_.tag_q_name_ = tag_q_name.Impl();
data_.tag_q_name_->Ref();
}
@@ -488,7 +492,8 @@ inline CSSSelector::CSSSelector(const CSSSelector& o)
is_for_page_(o.is_for_page_),
tag_is_implicit_(o.tag_is_implicit_),
relation_is_affected_by_pseudo_content_(
- o.relation_is_affected_by_pseudo_content_) {
+ o.relation_is_affected_by_pseudo_content_),
+ link_match_type_(kMatchAll) {
if (o.match_ == kTag) {
data_.tag_q_name_ = o.data_.tag_q_name_;
data_.tag_q_name_->Ref();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSSelector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698