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

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

Issue 1576163002: Move scroll-snap related properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing 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 | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('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/parser/LegacyCSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
index 95d8ab2bef4852fcb067af87df29ca896ad12aa1..84458fd3894d8cd95f7451eef33e88975be4685d 100644
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -876,15 +876,10 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
case CSSPropertyListStyleImage:
case CSSPropertyListStyle:
case CSSPropertyPerspective:
- validPrimitive = false;
- break;
-
+ case CSSPropertyScrollSnapCoordinate:
case CSSPropertyScrollSnapPointsX:
case CSSPropertyScrollSnapPointsY:
- parsedValue = parseScrollSnapPoints();
- break;
- case CSSPropertyScrollSnapCoordinate:
- parsedValue = parseScrollSnapCoordinate();
+ validPrimitive = false;
break;
default:
@@ -1195,43 +1190,6 @@ bool CSSPropertyParser::parse4Values(CSSPropertyID propId, const CSSPropertyID *
return true;
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollSnapPoints()
-{
- CSSParserValue* value = m_valueList->current();
-
- if (value->id == CSSValueNone) {
- m_valueList->next();
- return cssValuePool().createIdentifierValue(CSSValueNone);
- }
-
- if (value->m_unit == CSSParserValue::Function && value->function->id == CSSValueRepeat) {
- // The spec defines the following grammar: repeat( <length>)
- CSSParserValueList* arguments = value->function->args.get();
- if (!arguments || arguments->size() != 1)
- return nullptr;
-
- CSSParserValue* repeatValue = arguments->valueAt(0);
- if (validUnit(repeatValue, FNonNeg | FLength | FPercent) && (m_parsedCalculation || repeatValue->fValue > 0)) {
- RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueRepeat);
- result->append(parseValidPrimitive(repeatValue->id, repeatValue));
- m_valueList->next();
- return result.release();
- }
- }
-
- return nullptr;
-}
-
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollSnapCoordinate()
-{
- if (m_valueList->current()->id == CSSValueNone) {
- m_valueList->next();
- return cssValuePool().createIdentifierValue(CSSValueNone);
- }
-
- return parsePositionList(m_valueList);
-}
-
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseColor(const CSSParserValue* value, bool acceptQuirkyColors)
{
CSSValueID id = value->id;
@@ -3318,37 +3276,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseReflect()
return CSSReflectValue::create(direction.release(), offset.release(), mask.release());
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parsePosition(CSSParserValueList* valueList)
-{
- RefPtrWillBeRawPtr<CSSValue> xValue = nullptr;
- RefPtrWillBeRawPtr<CSSValue> yValue = nullptr;
- parseFillPosition(valueList, xValue, yValue);
- if (!xValue || !yValue)
- return nullptr;
- return CSSValuePair::create(xValue.release(), yValue.release(), CSSValuePair::KeepIdenticalValues);
-}
-
-// Parses a list of comma separated positions. i.e., <position>#
-PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parsePositionList(CSSParserValueList* valueList)
-{
- RefPtrWillBeRawPtr<CSSValueList> positions = CSSValueList::createCommaSeparated();
- while (true) {
- // parsePosition consumes values until it reaches a separator [,/],
- // an invalid token, or end of the list
- RefPtrWillBeRawPtr<CSSValue> position = parsePosition(valueList);
- if (!position)
- return nullptr;
- positions->append(position);
-
- if (!valueList->current())
- break;
- if (!consumeComma(valueList) || !valueList->current())
- return nullptr;
- }
-
- return positions.release();
-}
-
class BorderImageParseContext {
STACK_ALLOCATED();
public:
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698