12016-09-15 Dave Hyatt <hyatt@apple.com>
2
3 [CSS Parser] Get CSSParserFastPaths.cpp compiling
4 https://bugs.webkit.org/show_bug.cgi?id=162033
5
6 Reviewed by NOBODY (OOPS!).
7
8 * CMakeLists.txt:
9 * WebCore.xcodeproj/project.pbxproj:
10 Add new StyleColor.h/.cpp files to the projecty
11
12 * css/CSSFunctionValue.cpp:
13 (WebCore::CSSFunctionValue::CSSFunctionValue):
14 (WebCore::CSSFunctionValue::customCSSText):
15 (WebCore::CSSFunctionValue::append):
16 (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables):
17 * css/CSSFunctionValue.h:
18 Tweak CSSFunctionValue so that the name can be represented as a keyword ID instead of a String. Eventually we also
19 want to make CSSFunctionValue subclass CSSValueList rather than referening a separate CSSValueList as a member. For now
20 I left that alone though in order to not change too much in the old parser.
21
22 * css/CSSProperty.cpp:
23 (WebCore::CSSProperty::isDescriptorOnly):
24 Whether or not a property is only a descriptor, e.g., used in viewport and font face stuff.
25
26 * css/CSSProperty.h:
27 * css/CSSValueKeywords.in:
28 Added new keywords for functions that can be used as values. The new parser uses keywords to represent function names.
29
30 * css/StyleColor.cpp: Added.
31 (WebCore::StyleColor::colorFromKeyword):
32 (WebCore::StyleColor::isColorKeyword):
33 (WebCore::StyleColor::isSystemColor):
34 * css/StyleColor.h: Added.
35 (WebCore::StyleColor::StyleColor):
36 (WebCore::StyleColor::currentColor):
37 (WebCore::StyleColor::isCurrentColor):
38 (WebCore::StyleColor::getColor):
39 (WebCore::StyleColor::resolve):
40 (WebCore::operator==):
41 (WebCore::operator!=):
42 New color helper that contains code for checking and looking up colors. This code is similar to some code we already
43 had in the old CSSParser.cpp file, but this way it can be used outside the parser and/or in different files.
44
45 * css/parser/CSSParserFastPaths.cpp:
46 (WebCore::parseSimpleLengthValue):
47 (WebCore::isColorPropertyID):
48 (WebCore::parseColorIntOrPercentage):
49 (WebCore::fastParseColorInternal):
50 (WebCore::CSSParserFastPaths::parseColor):
51 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
52 (WebCore::isUniversalKeyword):
53 (WebCore::parseKeywordValue):
54 (WebCore::parseTransformTranslateArguments):
55 (WebCore::parseTransformNumberArguments):
56 (WebCore::parseSimpleTransformValue):
57 (WebCore::transformCanLikelyUseFastPath):
58 (WebCore::parseSimpleTransformList):
59 (WebCore::parseSimpleTransform):
60 (WebCore::CSSParserFastPaths::maybeParseValue):
61 * css/parser/CSSParserFastPaths.h:
62 Get everything compiling in this file. Key changes included reverting to our old unit names, making CSSFunctionValue compatible,
63 adding support for StyleColor, adding support for mode checking of keywords, and fixing up the memory management model so that
64 RefPtrs are used on returns from parsing functions.
65
66 * css/parser/CSSParserIdioms.cpp:
67 (WebCore::isValueAllowedInMode):
68 * css/parser/CSSParserIdioms.h:
69 New helper function for restricting keywords to certain modes only. The -webkit-text color quirk has been moved to this function.
70