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

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

Issue 1394663003: Support deeply nested uncommonAttributeSelectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/LayoutTests/fast/selectors/style-sharing-attribute-selector-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/RuleSet.cpp
diff --git a/third_party/WebKit/Source/core/css/RuleSet.cpp b/third_party/WebKit/Source/core/css/RuleSet.cpp
index b0572ea07a6bcb5492c6526769d7c475a11ea63f..54db1e85db8bb2316237d5ceb7e560668c5359f2 100644
--- a/third_party/WebKit/Source/core/css/RuleSet.cpp
+++ b/third_party/WebKit/Source/core/css/RuleSet.cpp
@@ -50,16 +50,16 @@ using namespace HTMLNames;
// -----------------------------------------------------------------
+static bool containsUncommonAttributeSelector(const CSSSelector&);
+
static inline bool selectorListContainsUncommonAttributeSelector(const CSSSelector* selector)
{
const CSSSelectorList* selectorList = selector->selectorList();
if (!selectorList)
return false;
for (const CSSSelector* selector = selectorList->first(); selector; selector = CSSSelectorList::next(*selector)) {
- for (const CSSSelector* component = selector; component; component = component->tagHistory()) {
- if (component->isAttributeSelector())
- return true;
- }
+ if (containsUncommonAttributeSelector(*selector))
+ return true;
}
return false;
}
@@ -70,7 +70,7 @@ static inline bool isCommonAttributeSelectorAttribute(const QualifiedName& attri
return attribute == typeAttr || attribute == readonlyAttr;
}
-static inline bool containsUncommonAttributeSelector(const CSSSelector& selector)
+static bool containsUncommonAttributeSelector(const CSSSelector& selector)
{
const CSSSelector* current = &selector;
for (; current; current = current->tagHistory()) {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/selectors/style-sharing-attribute-selector-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698