Timestamp:
Sep 13, 2016, 12:08:30 PM (9 years ago)
Author:
[email protected]
Message:

[CSS Parser] Add CSS Variable Parsing support
https://bugs.webkit.org/show_bug.cgi?id=161916

Reviewed by Dean Jackson.

This patch not only adds the parser for CSS variables (from Blink), but it also brings in
all of the data structures used to store variables and custom property declarations. We
will be abandoning our old data structures eventually in favor of these new ones. They
are not significantly different other than operating on the CSSParserTokenRanges rather
than the soon-to-be-removed parser value lists.

  • CMakeLists.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • css/CSSCustomIdentValue.cpp: Added.

(WebCore::CSSCustomIdentValue::CSSCustomIdentValue):
(WebCore::CSSCustomIdentValue::customCSSText):

  • css/CSSCustomIdentValue.h: Added.

(WebCore::CSSCustomIdentValue::create):
(WebCore::CSSCustomIdentValue::value):
(WebCore::CSSCustomIdentValue::isKnownPropertyID):
(WebCore::CSSCustomIdentValue::valueAsPropertyID):
(WebCore::CSSCustomIdentValue::equals):

  • css/CSSCustomPropertyDeclaration.cpp: Added.

(WebCore::CSSCustomPropertyDeclaration::customCSSText):

  • css/CSSCustomPropertyDeclaration.h: Added.

(WebCore::CSSCustomPropertyDeclaration::create):
(WebCore::CSSCustomPropertyDeclaration::name):
(WebCore::CSSCustomPropertyDeclaration::value):
(WebCore::CSSCustomPropertyDeclaration::id):
(WebCore::CSSCustomPropertyDeclaration::equals):
(WebCore::CSSCustomPropertyDeclaration::CSSCustomPropertyDeclaration):

  • css/CSSCustomPropertyValue.h:
  • css/CSSValue.cpp:

(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):

  • css/CSSValue.h:

(WebCore::CSSValue::isCustomPropertyDeclaration):
(WebCore::CSSValue::isCustomIdentValue):
(WebCore::CSSValue::isVariableReferenceValue):

  • css/CSSValueKeywords.in:
  • css/CSSVariableData.cpp: Added.

(WebCore::CSSVariableData::updateTokens):
(WebCore::CSSVariableData::operator==):
(WebCore::CSSVariableData::consumeAndUpdateTokens):
(WebCore::CSSVariableData::CSSVariableData):

  • css/CSSVariableData.h: Added.

(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved):
(WebCore::CSSVariableData::tokenRange):
(WebCore::CSSVariableData::tokens):
(WebCore::CSSVariableData::needsVariableResolution):
(WebCore::CSSVariableData::CSSVariableData):

  • css/CSSVariableDependentValue.h:
  • css/CSSVariableReferenceValue.cpp: Added.

(WebCore::CSSVariableReferenceValue::customCSSText):

  • css/CSSVariableReferenceValue.h: Added.

(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::variableDataValue):
(WebCore::CSSVariableReferenceValue::equals):
(WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue):

  • css/CSSVariableValue.h:
  • css/parser/CSSParserImpl.cpp:

(WebCore::filterProperties):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeVariableValue):

  • css/parser/CSSVariableParser.cpp: Added.

(WebCore::CSSVariableParser::isValidVariableName):
(WebCore::classifyBlock):
(WebCore::isValidVariableReference):
(WebCore::classifyVariableRange):
(WebCore::CSSVariableParser::containsValidVariableReferences):
(WebCore::CSSVariableParser::parseDeclarationValue):

  • css/parser/CSSVariableParser.h: Added.
File:
1 added

Note: See TracChangeset for help on using the changeset viewer.