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

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

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 | « third_party/WebKit/Source/core/css/CSSSelector.h ('k') | third_party/WebKit/Source/core/css/RuleSet.h » ('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.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.cpp b/third_party/WebKit/Source/core/css/CSSSelector.cpp
index bf28303979a522b49c13dc6c1ccb20b2a74f68cf..c90b66ff3a336bdcebe83288d503436e5cdff46c 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelector.cpp
@@ -908,9 +908,7 @@ bool CSSSelector::IsCompound() const {
return true;
}
-unsigned CSSSelector::ComputeLinkMatchType() const {
- unsigned link_match_type = kMatchAll;
-
+void CSSSelector::UpdateLinkMatchType() {
// Determine if this selector will match a link in visited, unvisited or any
// state, or never.
// :visited never matches other elements than the innermost link element.
@@ -925,16 +923,16 @@ unsigned CSSSelector::ComputeLinkMatchType() const {
sub_selector; sub_selector = sub_selector->TagHistory()) {
PseudoType sub_type = sub_selector->GetPseudoType();
if (sub_type == kPseudoVisited)
- link_match_type &= ~kMatchVisited;
+ link_match_type_ &= ~kMatchVisited;
else if (sub_type == kPseudoLink)
- link_match_type &= ~kMatchLink;
+ link_match_type_ &= ~kMatchLink;
}
} break;
case kPseudoLink:
- link_match_type &= ~kMatchVisited;
+ link_match_type_ &= ~kMatchVisited;
break;
case kPseudoVisited:
- link_match_type &= ~kMatchLink;
+ link_match_type_ &= ~kMatchLink;
break;
default:
// We don't support :link and :visited inside :-webkit-any.
@@ -944,11 +942,10 @@ unsigned CSSSelector::ComputeLinkMatchType() const {
if (relation == kSubSelector)
continue;
if (relation != kDescendant && relation != kChild)
- return link_match_type;
- if (link_match_type != kMatchAll)
- return link_match_type;
+ return;
+ if (link_match_type_ != kMatchAll)
+ return;
}
- return link_match_type;
}
void CSSSelector::SetNth(int a, int b) {
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelector.h ('k') | third_party/WebKit/Source/core/css/RuleSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698