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

Unified Diff: Source/core/testing/Internals.cpp

Issue 598093005: Simplify SelectRuleFeatureSet class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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/dom/shadow/SelectRuleFeatureSet.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 08b553c884e0a9f151adca4b93e340914a57ef66..0c9db5419f82213d2651f4e677803d78624dac01 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -424,25 +424,7 @@ bool Internals::hasSelectorForPseudoClassInShadow(Element* host, const String& p
exceptionState.throwDOMException(InvalidAccessError, "The host element does not have a shadow.");
return 0;
}
-
- const SelectRuleFeatureSet& featureSet = host->shadow()->ensureSelectFeatureSet();
- if (pseudoClass == "checked")
- return featureSet.hasSelectorForChecked();
- if (pseudoClass == "enabled")
- return featureSet.hasSelectorForEnabled();
- if (pseudoClass == "disabled")
- return featureSet.hasSelectorForDisabled();
- if (pseudoClass == "indeterminate")
- return featureSet.hasSelectorForIndeterminate();
- if (pseudoClass == "link")
- return featureSet.hasSelectorForLink();
- if (pseudoClass == "target")
- return featureSet.hasSelectorForTarget();
- if (pseudoClass == "visited")
- return featureSet.hasSelectorForVisited();
-
- ASSERT_NOT_REACHED();
- return false;
+ return host->shadow()->ensureSelectFeatureSet().hasSelectorForPseudoType(CSSSelector::parsePseudoType(AtomicString(pseudoClass), false));
}
unsigned short Internals::compareTreeScopePosition(const Node* node1, const Node* node2, ExceptionState& exceptionState) const
« no previous file with comments | « Source/core/dom/shadow/SelectRuleFeatureSet.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698