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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserSelector.cpp

Issue 1574323003: Split compound selector after consume finished. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upload-base
Patch Set: Removed obsolete serialization hack and fixed unit tests. Created 4 years, 11 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: third_party/WebKit/Source/core/css/parser/CSSParserSelector.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserSelector.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserSelector.cpp
index d01df94e7f3ca2dd434a5f7dc2ff851ae0b4bb85..bd3cd46722a22898005fa33709a2677d06af7735 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserSelector.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserSelector.cpp
@@ -80,15 +80,6 @@ bool CSSParserSelector::isSimple() const
return false;
}
-void CSSParserSelector::insertTagHistory(CSSSelector::Relation before, PassOwnPtr<CSSParserSelector> selector, CSSSelector::Relation after)
-{
- if (m_tagHistory)
- selector->setTagHistory(m_tagHistory.release());
- setRelation(before);
- selector->setRelation(after);
- m_tagHistory = selector;
-}
-
void CSSParserSelector::appendTagHistory(CSSSelector::Relation relation, PassOwnPtr<CSSParserSelector> selector)
{
CSSParserSelector* end = this;
@@ -98,6 +89,12 @@ void CSSParserSelector::appendTagHistory(CSSSelector::Relation relation, PassOwn
end->setTagHistory(selector);
}
+PassOwnPtr<CSSParserSelector> CSSParserSelector::releaseTagHistory()
+{
+ setRelation(CSSSelector::SubSelector);
+ return m_tagHistory.release();
+}
+
void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool isImplicit)
{
OwnPtr<CSSParserSelector> second = CSSParserSelector::create();
@@ -107,13 +104,9 @@ void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool i
m_selector = adoptPtr(new CSSSelector(tagQName, isImplicit));
}
-bool CSSParserSelector::hasHostPseudoSelector() const
+bool CSSParserSelector::isHostPseudoSelector() const
{
- for (CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); selector; selector = selector->tagHistory()) {
- if (selector->pseudoType() == CSSSelector::PseudoHost || selector->pseudoType() == CSSSelector::PseudoHostContext)
- return true;
- }
- return false;
+ return pseudoType() == CSSSelector::PseudoHost || pseudoType() == CSSSelector::PseudoHostContext;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698