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

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

Issue 1653303002: Rename prelude to range in parsePageSelector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | 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/parser/CSSParserImpl.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
index 801a3e1d94990fa43550ff011d7737bb60f63198..760ac1d91ea2eda0282ec80fb9a373038605bae0 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
@@ -174,24 +174,25 @@ void CSSParserImpl::parseStyleSheet(const String& string, const CSSParserContext
"length", string.length());
}
-CSSSelectorList CSSParserImpl::parsePageSelector(CSSParserTokenRange prelude, StyleSheetContents* styleSheet)
+CSSSelectorList CSSParserImpl::parsePageSelector(CSSParserTokenRange range, StyleSheetContents* styleSheet)
{
- prelude.consumeWhitespace();
+ // We only support a small subset of the css-page spec.
+ range.consumeWhitespace();
AtomicString typeSelector;
- if (prelude.peek().type() == IdentToken)
- typeSelector = prelude.consume().value();
+ if (range.peek().type() == IdentToken)
+ typeSelector = range.consume().value();
AtomicString pseudo;
- if (prelude.peek().type() == ColonToken) {
- prelude.consume();
- if (prelude.peek().type() != IdentToken)
+ if (range.peek().type() == ColonToken) {
+ range.consume();
+ if (range.peek().type() != IdentToken)
return CSSSelectorList();
- pseudo = prelude.consume().value();
+ pseudo = range.consume().value();
}
- prelude.consumeWhitespace();
- if (!prelude.atEnd())
- return CSSSelectorList(); // Parse error; extra tokens in @page header
+ range.consumeWhitespace();
+ if (!range.atEnd())
+ return CSSSelectorList(); // Parse error; extra tokens in @page selector
OwnPtr<CSSParserSelector> selector;
if (!typeSelector.isNull() && pseudo.isNull()) {
@@ -579,10 +580,9 @@ PassRefPtrWillBeRawPtr<StyleRuleKeyframes> CSSParserImpl::consumeKeyframesRule(b
PassRefPtrWillBeRawPtr<StyleRulePage> CSSParserImpl::consumePageRule(CSSParserTokenRange prelude, CSSParserTokenRange block)
{
- // We only support a small subset of the css-page spec.
CSSSelectorList selectorList = parsePageSelector(prelude, m_styleSheet);
if (!selectorList.isValid())
- return nullptr;
+ return nullptr; // Parse error, invalid @page selector
if (m_observerWrapper) {
unsigned endOffset = m_observerWrapper->endOffset(prelude);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698