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

Unified Diff: Source/core/css/CSSSelectorList.cpp

Issue 1305973007: Clean up empty namespace handling and fix empty namespaces in compound selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@defaultns
Patch Set: Created 5 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
Index: Source/core/css/CSSSelectorList.cpp
diff --git a/Source/core/css/CSSSelectorList.cpp b/Source/core/css/CSSSelectorList.cpp
index 95a690526da0cab5c4f582947d0aa5dadb02b7d3..71ebc1e6501a60aa0d052cde24c0f766f1d48c94 100644
--- a/Source/core/css/CSSSelectorList.cpp
+++ b/Source/core/css/CSSSelectorList.cpp
@@ -153,11 +153,10 @@ class SelectorNeedsNamespaceResolutionFunctor {
public:
bool operator()(const CSSSelector& selector)
{
- if (selector.match() == CSSSelector::Tag && selector.tagQName().prefix() != nullAtom && selector.tagQName().prefix() != starAtom)
- return true;
- if (selector.isAttributeSelector() && selector.attribute().prefix() != nullAtom && selector.attribute().prefix() != starAtom)
- return true;
- return false;
+ if (selector.match() != CSSSelector::Tag && !selector.isAttributeSelector())
+ return false;
+ const AtomicString& prefix = selector.isAttributeSelector() ? selector.attribute().prefix() : selector.tagQName().prefix();
+ return prefix != nullAtom && prefix != emptyAtom && prefix != starAtom;
}
};
« no previous file with comments | « LayoutTests/fast/css/namespaces/empty-namespace-compound-selector-2.xhtml ('k') | Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698