Commit 86c916bd authored by timloh's avatar timloh Committed by Commit bot

Move consumeColor and consumePosition to CSSPropertyParserHelpers

This patch moves the routines for consuming <color> and <position> out
of CSSPropertyParser.cpp and into CSSPropertyParserHelpers. We expect
that we'll require these routines for various Houdini APIs.

BUG=499780

Review URL: https://codereview.chromium.org/1802673003

Cr-Commit-Position: refs/heads/master@{#381865}
parent 04dfd7b7
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "core/animation/CSSColorInterpolationType.h" #include "core/animation/CSSColorInterpolationType.h"
#include "core/animation/ColorPropertyFunctions.h" #include "core/animation/ColorPropertyFunctions.h"
#include "core/css/CSSColorValue.h"
#include "core/css/parser/CSSPropertyParser.h" #include "core/css/parser/CSSPropertyParser.h"
#include "core/css/resolver/StyleResolverState.h" #include "core/css/resolver/StyleResolverState.h"
#include "core/layout/LayoutTheme.h" #include "core/layout/LayoutTheme.h"
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#ifndef CSSPropertyParser_h #ifndef CSSPropertyParser_h
#define CSSPropertyParser_h #define CSSPropertyParser_h
#include "core/css/CSSColorValue.h"
#include "core/css/CSSGridTemplateAreasValue.h" #include "core/css/CSSGridTemplateAreasValue.h"
#include "core/css/StyleRule.h" #include "core/css/StyleRule.h"
#include "core/css/parser/CSSParserTokenRange.h" #include "core/css/parser/CSSParserTokenRange.h"
...@@ -74,6 +73,7 @@ public: ...@@ -74,6 +73,7 @@ public:
// Parses a non-shorthand CSS property // Parses a non-shorthand CSS property
static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const CSSParserTokenRange&, const CSSParserContext&); static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const CSSParserTokenRange&, const CSSParserContext&);
// TODO(timloh): This doesn't seem like the right place for these
static bool isSystemColor(CSSValueID); static bool isSystemColor(CSSValueID);
static bool isColorKeyword(CSSValueID); static bool isColorKeyword(CSSValueID);
static bool isValidNumericValue(double); static bool isValidNumericValue(double);
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace blink { namespace blink {
class CSSStringValue; class CSSStringValue;
class CSSValuePair;
// When these functions are successful, they will consume all the relevant // When these functions are successful, they will consume all the relevant
// tokens from the range and also consume any whitespace which follows. When // tokens from the range and also consume any whitespace which follows. When
...@@ -51,7 +52,13 @@ PassRefPtrWillBeRawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRan ...@@ -51,7 +52,13 @@ PassRefPtrWillBeRawPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRan
PassRefPtrWillBeRawPtr<CSSStringValue> consumeString(CSSParserTokenRange&); PassRefPtrWillBeRawPtr<CSSStringValue> consumeString(CSSParserTokenRange&);
String consumeUrl(CSSParserTokenRange&); String consumeUrl(CSSParserTokenRange&);
// TODO(timloh): Move across consumeColor, consumeImage and consumePosition PassRefPtrWillBeRawPtr<CSSValue> consumeColor(CSSParserTokenRange&, CSSParserMode, bool acceptQuirkyColors = false);
PassRefPtrWillBeRawPtr<CSSValuePair> consumePosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk);
bool consumePosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY);
bool consumeOneOrTwoValuedPosition(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk, RefPtrWillBeRawPtr<CSSValue>& resultX, RefPtrWillBeRawPtr<CSSValue>& resultY);
// TODO(timloh): Move across consumeImage
// Template implementations are at the bottom of the file for readability. // Template implementations are at the bottom of the file for readability.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment