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

Unified Diff: Source/core/css/parser/CSSParserValues.cpp

Issue 1317743006: Move CSSParserSelector out of CSSParserValues.h/cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « Source/core/css/parser/CSSParserValues.h ('k') | Source/core/css/parser/CSSSelectorParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSParserValues.cpp
diff --git a/Source/core/css/parser/CSSParserValues.cpp b/Source/core/css/parser/CSSParserValues.cpp
index c8b86885528fb5d8665d7b2857ca975c3ae2b4b2..5d32628616b5b423a5bce110ba015e44fb063a5a 100644
--- a/Source/core/css/parser/CSSParserValues.cpp
+++ b/Source/core/css/parser/CSSParserValues.cpp
@@ -22,7 +22,6 @@
#include "core/css/parser/CSSParserValues.h"
#include "core/css/CSSFunctionValue.h"
-#include "core/css/CSSSelectorList.h"
#include "core/css/parser/CSSParserToken.h"
#include "core/css/parser/CSSParserTokenRange.h"
#include "core/css/parser/CSSPropertyParser.h"
@@ -255,97 +254,4 @@ void CSSParserValueList::addValue(const CSSParserValue& v)
m_values.append(v);
}
-CSSParserSelector::CSSParserSelector()
- : m_selector(adoptPtr(new CSSSelector()))
-{
-}
-
-CSSParserSelector::CSSParserSelector(const QualifiedName& tagQName, bool isImplicit)
- : m_selector(adoptPtr(new CSSSelector(tagQName, isImplicit)))
-{
-}
-
-CSSParserSelector::~CSSParserSelector()
-{
- if (!m_tagHistory)
- return;
- Vector<OwnPtr<CSSParserSelector>, 16> toDelete;
- OwnPtr<CSSParserSelector> selector = m_tagHistory.release();
- while (true) {
- OwnPtr<CSSParserSelector> next = selector->m_tagHistory.release();
- toDelete.append(selector.release());
- if (!next)
- break;
- selector = next.release();
- }
-}
-
-void CSSParserSelector::adoptSelectorVector(Vector<OwnPtr<CSSParserSelector>>& selectorVector)
-{
- CSSSelectorList* selectorList = new CSSSelectorList();
- selectorList->adoptSelectorVector(selectorVector);
- m_selector->setSelectorList(adoptPtr(selectorList));
-}
-
-void CSSParserSelector::setSelectorList(PassOwnPtr<CSSSelectorList> selectorList)
-{
- m_selector->setSelectorList(selectorList);
-}
-
-bool CSSParserSelector::isSimple() const
-{
- if (m_selector->selectorList() || m_selector->match() == CSSSelector::PseudoElement)
- return false;
-
- if (!m_tagHistory)
- return true;
-
- if (m_selector->match() == CSSSelector::Tag) {
- // We can't check against anyQName() here because namespace may not be nullAtom.
- // Example:
- // @namespace "http://www.w3.org/2000/svg";
- // svg:not(:root) { ...
- if (m_selector->tagQName().localName() == starAtom)
- return m_tagHistory->isSimple();
- }
-
- 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;
- while (end->tagHistory())
- end = end->tagHistory();
- end->setRelation(relation);
- end->setTagHistory(selector);
-}
-
-void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool isImplicit)
-{
- OwnPtr<CSSParserSelector> second = CSSParserSelector::create();
- second->m_selector = m_selector.release();
- second->m_tagHistory = m_tagHistory.release();
- m_tagHistory = second.release();
- m_selector = adoptPtr(new CSSSelector(tagQName, isImplicit));
-}
-
-bool CSSParserSelector::hasHostPseudoSelector() 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;
-}
-
} // namespace blink
« no previous file with comments | « Source/core/css/parser/CSSParserValues.h ('k') | Source/core/css/parser/CSSSelectorParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698