<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[205869] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/205869">205869</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2016-09-13 12:08:30 -0700 (Tue, 13 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSCustomPropertyValueh">trunk/Source/WebCore/css/CSSCustomPropertyValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuecpp">trunk/Source/WebCore/css/CSSValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueh">trunk/Source/WebCore/css/CSSValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSVariableDependentValueh">trunk/Source/WebCore/css/CSSVariableDependentValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSVariableValueh">trunk/Source/WebCore/css/CSSVariableValue.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSAtRuleIDcpp">trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserImplcpp">trunk/Source/WebCore/css/parser/CSSParserImpl.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSSelectorParsercpp">trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSSupportsParsercpp">trunk/Source/WebCore/css/parser/CSSSupportsParser.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecssCSSCustomIdentValuecpp">trunk/Source/WebCore/css/CSSCustomIdentValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSCustomIdentValueh">trunk/Source/WebCore/css/CSSCustomIdentValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSCustomPropertyDeclarationcpp">trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSCustomPropertyDeclarationh">trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSVariableDatacpp">trunk/Source/WebCore/css/CSSVariableData.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSVariableDatah">trunk/Source/WebCore/css/CSSVariableData.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSVariableReferenceValuecpp">trunk/Source/WebCore/css/CSSVariableReferenceValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSVariableReferenceValueh">trunk/Source/WebCore/css/CSSVariableReferenceValue.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSVariableParsercpp">trunk/Source/WebCore/css/parser/CSSVariableParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSVariableParserh">trunk/Source/WebCore/css/parser/CSSVariableParser.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -1253,6 +1253,8 @@
</span><span class="cx">     css/CSSContentDistributionValue.cpp
</span><span class="cx">     css/CSSCrossfadeValue.cpp
</span><span class="cx">     css/CSSCursorImageValue.cpp
</span><ins>+    css/CSSCustomIdentValue.cpp
+    css/CSSCustomPropertyDeclaration.cpp
</ins><span class="cx">     css/CSSDefaultStyleSheets.cpp
</span><span class="cx">     css/CSSFilterImageValue.cpp
</span><span class="cx">     css/FontFaceSet.cpp
</span><span class="lines">@@ -1307,7 +1309,9 @@
</span><span class="cx">     css/CSSValue.cpp
</span><span class="cx">     css/CSSValueList.cpp
</span><span class="cx">     css/CSSValuePool.cpp
</span><ins>+    css/CSSVariableData.cpp
</ins><span class="cx">     css/CSSVariableDependentValue.cpp
</span><ins>+    css/CSSVariableReferenceValue.cpp
</ins><span class="cx">     css/CSSVariableValue.cpp
</span><span class="cx">     css/DOMCSSNamespace.cpp
</span><span class="cx">     css/DocumentRuleSets.cpp
</span><span class="lines">@@ -1364,6 +1368,7 @@
</span><span class="cx">     css/parser/CSSSupportsParser.cpp
</span><span class="cx">     css/parser/CSSTokenizer.cpp
</span><span class="cx">     css/parser/CSSTokenizerInputStream.cpp
</span><ins>+    css/parser/CSSVariableParser.cpp
</ins><span class="cx">     css/parser/MediaQueryBlockWatcher.cpp
</span><span class="cx">     css/parser/MediaQueryParser.cpp
</span><span class="cx">     css/parser/SizesAttributeParser.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/ChangeLog        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -1,3 +1,79 @@
</span><ins>+2016-09-13  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        [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.
+
</ins><span class="cx"> 2016-09-13  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove CSS keyword properties from CSSParser::parseValue(CSSPropertyID, bool)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -3347,6 +3347,16 @@
</span><span class="cx">                 9444CBD41D860C8B0073A074 /* SizesCalcParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBCF1D860C740073A074 /* SizesCalcParser.h */; };
</span><span class="cx">                 9444CBD51D860C8B0073A074 /* SizesAttributeParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBD21D860C740073A074 /* SizesAttributeParser.cpp */; };
</span><span class="cx">                 9444CBD61D860C8B0073A074 /* SizesAttributeParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBD11D860C740073A074 /* SizesAttributeParser.h */; };
</span><ins>+                9444CBD91D88483A0073A074 /* CSSVariableParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBD81D88482A0073A074 /* CSSVariableParser.cpp */; };
+                9444CBDA1D88483A0073A074 /* CSSVariableParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBD71D88482A0073A074 /* CSSVariableParser.h */; };
+                9444CBE31D8861980073A074 /* CSSCustomIdentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBE21D8861580073A074 /* CSSCustomIdentValue.cpp */; };
+                9444CBE41D8861990073A074 /* CSSCustomIdentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBE11D8861580073A074 /* CSSCustomIdentValue.h */; };
+                9444CBE51D8861990073A074 /* CSSCustomPropertyDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBE01D8861580073A074 /* CSSCustomPropertyDeclaration.cpp */; };
+                9444CBE61D8861990073A074 /* CSSCustomPropertyDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDF1D8861580073A074 /* CSSCustomPropertyDeclaration.h */; };
+                9444CBE71D8861C20073A074 /* CSSVariableData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBDE1D8861580073A074 /* CSSVariableData.cpp */; };
+                9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDD1D8861580073A074 /* CSSVariableData.h */; };
+                9444CBE91D8861CA0073A074 /* CSSVariableReferenceValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */; };
+                9444CBEA1D8861CA0073A074 /* CSSVariableReferenceValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDB1D8861580073A074 /* CSSVariableReferenceValue.h */; };
</ins><span class="cx">                 946D372D1D6CB2940077084F /* CSSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37281D6CB28B0077084F /* CSSParser.cpp */; };
</span><span class="cx">                 946D372E1D6CB2940077084F /* CSSParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D37291D6CB28B0077084F /* CSSParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 946D372F1D6CB2940077084F /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372A1D6CB28B0077084F /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -10509,6 +10519,16 @@
</span><span class="cx">                 9444CBD01D860C740073A074 /* SizesCalcParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SizesCalcParser.cpp; path = parser/SizesCalcParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9444CBD11D860C740073A074 /* SizesAttributeParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SizesAttributeParser.h; path = parser/SizesAttributeParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9444CBD21D860C740073A074 /* SizesAttributeParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SizesAttributeParser.cpp; path = parser/SizesAttributeParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                9444CBD71D88482A0073A074 /* CSSVariableParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSVariableParser.h; path = parser/CSSVariableParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBD81D88482A0073A074 /* CSSVariableParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSVariableParser.cpp; path = parser/CSSVariableParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBDB1D8861580073A074 /* CSSVariableReferenceValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableReferenceValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableReferenceValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBDD1D8861580073A074 /* CSSVariableData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBDE1D8861580073A074 /* CSSVariableData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBDF1D8861580073A074 /* CSSCustomPropertyDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCustomPropertyDeclaration.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBE01D8861580073A074 /* CSSCustomPropertyDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCustomPropertyDeclaration.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBE11D8861580073A074 /* CSSCustomIdentValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCustomIdentValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9444CBE21D8861580073A074 /* CSSCustomIdentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCustomIdentValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 946D37281D6CB28B0077084F /* CSSParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParser.cpp; path = parser/CSSParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 946D37291D6CB28B0077084F /* CSSParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParser.h; path = parser/CSSParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 946D372A1D6CB28B0077084F /* CSSParserMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserMode.h; path = parser/CSSParserMode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18216,6 +18236,8 @@
</span><span class="cx">                                 946D37371D6CDF980077084F /* CSSTokenizer.h */,
</span><span class="cx">                                 946D37351D6CDF980077084F /* CSSTokenizerInputStream.cpp */,
</span><span class="cx">                                 946D37381D6CDF980077084F /* CSSTokenizerInputStream.h */,
</span><ins>+                                9444CBD81D88482A0073A074 /* CSSVariableParser.cpp */,
+                                9444CBD71D88482A0073A074 /* CSSVariableParser.h */,
</ins><span class="cx">                                 9493B6B61D74B3950088E780 /* MediaQueryBlockWatcher.cpp */,
</span><span class="cx">                                 9493B6B71D74B3950088E780 /* MediaQueryBlockWatcher.h */,
</span><span class="cx">                                 9493B6B81D74B3950088E780 /* MediaQueryParser.cpp */,
</span><span class="lines">@@ -22321,6 +22343,10 @@
</span><span class="cx">                                 2D8FEBDB143E3EF70072502B /* CSSCrossfadeValue.h */,
</span><span class="cx">                                 AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */,
</span><span class="cx">                                 AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */,
</span><ins>+                                9444CBE21D8861580073A074 /* CSSCustomIdentValue.cpp */,
+                                9444CBE11D8861580073A074 /* CSSCustomIdentValue.h */,
+                                9444CBE01D8861580073A074 /* CSSCustomPropertyDeclaration.cpp */,
+                                9444CBDF1D8861580073A074 /* CSSCustomPropertyDeclaration.h */,
</ins><span class="cx">                                 BC779E131BB215BB00CAA8BF /* CSSCustomPropertyValue.h */,
</span><span class="cx">                                 4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */,
</span><span class="cx">                                 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */,
</span><span class="lines">@@ -22453,8 +22479,12 @@
</span><span class="cx">                                 A8D0651C0A23C1FE005E7203 /* CSSValueList.idl */,
</span><span class="cx">                                 E49BDA0A131FD3E5003C56F0 /* CSSValuePool.cpp */,
</span><span class="cx">                                 E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */,
</span><ins>+                                9444CBDE1D8861580073A074 /* CSSVariableData.cpp */,
+                                9444CBDD1D8861580073A074 /* CSSVariableData.h */,
</ins><span class="cx">                                 BC1790BC1BBB36A80006D13E /* CSSVariableDependentValue.cpp */,
</span><span class="cx">                                 BC1790BA1BB5AB3F0006D13E /* CSSVariableDependentValue.h */,
</span><ins>+                                9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */,
+                                9444CBDB1D8861580073A074 /* CSSVariableReferenceValue.h */,
</ins><span class="cx">                                 BC1790BE1BBF2C430006D13E /* CSSVariableValue.cpp */,
</span><span class="cx">                                 BC1790BF1BBF2C430006D13E /* CSSVariableValue.h */,
</span><span class="cx">                                 A80E6CE10A1989CA007FB8C5 /* DashboardRegion.h */,
</span><span class="lines">@@ -24371,6 +24401,7 @@
</span><span class="cx">                                 93309DE4099E64920056E581 /* EditCommand.h in Headers */,
</span><span class="cx">                                 4F1534DE11B532EC0021FD86 /* EditingBehavior.h in Headers */,
</span><span class="cx">                                 4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */,
</span><ins>+                                9444CBE41D8861990073A074 /* CSSCustomIdentValue.h in Headers */,
</ins><span class="cx">                                 3AC648B2129E146500C3EB25 /* EditingBoundary.h in Headers */,
</span><span class="cx">                                 9BAB6C6C12550631001626D4 /* EditingStyle.h in Headers */,
</span><span class="cx">                                 4B3043CD0AE0373B00A82647 /* Editor.h in Headers */,
</span><span class="lines">@@ -25358,6 +25389,7 @@
</span><span class="cx">                                 B2FA3DC30AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothAbs.h in Headers */,
</span><span class="cx">                                 B2FA3DC50AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothRel.h in Headers */,
</span><span class="cx">                                 B2FA3DC70AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticAbs.h in Headers */,
</span><ins>+                                9444CBDA1D88483A0073A074 /* CSSVariableParser.h in Headers */,
</ins><span class="cx">                                 B2FA3DC90AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticRel.h in Headers */,
</span><span class="cx">                                 B2FA3DCB0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothAbs.h in Headers */,
</span><span class="cx">                                 B2FA3DCD0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothRel.h in Headers */,
</span><span class="lines">@@ -25934,6 +25966,7 @@
</span><span class="cx">                                 31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */,
</span><span class="cx">                                 A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */,
</span><span class="cx">                                 97205ABC1239292700B17380 /* PluginDocument.h in Headers */,
</span><ins>+                                9444CBEA1D8861CA0073A074 /* CSSVariableReferenceValue.h in Headers */,
</ins><span class="cx">                                 1A08FEDD1D592B8B008BA8CB /* PluginInfoProvider.h in Headers */,
</span><span class="cx">                                 072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */,
</span><span class="cx">                                 71E2183A17359FB8006E6E4D /* PlugInsResources.h in Headers */,
</span><span class="lines">@@ -26143,6 +26176,7 @@
</span><span class="cx">                                 6ED878C5147493F4004C3597 /* RenderTableCaption.h in Headers */,
</span><span class="cx">                                 A8DF4AE90980C42C0052981B /* RenderTableCell.h in Headers */,
</span><span class="cx">                                 A8DF4AF10980C42C0052981B /* RenderTableCol.h in Headers */,
</span><ins>+                                9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */,
</ins><span class="cx">                                 A8DF4AEE0980C42C0052981B /* RenderTableRow.h in Headers */,
</span><span class="cx">                                 A8DF4AEF0980C42C0052981B /* RenderTableSection.h in Headers */,
</span><span class="cx">                                 BCEA488C097D93020094C9E4 /* RenderText.h in Headers */,
</span><span class="lines">@@ -26744,6 +26778,7 @@
</span><span class="cx">                                 08C7136E128956A3001B107E /* SVGTransformListPropertyTearOff.h in Headers */,
</span><span class="cx">                                 B2227AE20D00BF220071B782 /* SVGTRefElement.h in Headers */,
</span><span class="cx">                                 B2227AE50D00BF220071B782 /* SVGTSpanElement.h in Headers */,
</span><ins>+                                9444CBE61D8861990073A074 /* CSSCustomPropertyDeclaration.h in Headers */,
</ins><span class="cx">                                 B2227AE70D00BF220071B782 /* SVGUnitTypes.h in Headers */,
</span><span class="cx">                                 B2227AEA0D00BF220071B782 /* SVGURIReference.h in Headers */,
</span><span class="cx">                                 B2227AED0D00BF220071B782 /* SVGUseElement.h in Headers */,
</span><span class="lines">@@ -28113,6 +28148,7 @@
</span><span class="cx">                                 976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */,
</span><span class="cx">                                 934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */,
</span><span class="cx">                                 978D07B6145A0F030096908D /* FileException.cpp in Sources */,
</span><ins>+                                9444CBE91D8861CA0073A074 /* CSSVariableReferenceValue.cpp in Sources */,
</ins><span class="cx">                                 1A88A90417553CD7000C74F9 /* FileIconLoader.cpp in Sources */,
</span><span class="cx">                                 F55B3DBD1251F12D003EF269 /* FileInputType.cpp in Sources */,
</span><span class="cx">                                 976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */,
</span><span class="lines">@@ -28674,6 +28710,7 @@
</span><span class="cx">                                 7728698314FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.cpp in Sources */,
</span><span class="cx">                                 7F4C96DC1AD4483500365A50 /* JSFetchBody.cpp in Sources */,
</span><span class="cx">                                 7D4C96DC1AD4483500365A50 /* JSFetchHeaders.cpp in Sources */,
</span><ins>+                                9444CBD91D88483A0073A074 /* CSSVariableParser.cpp in Sources */,
</ins><span class="cx">                                 7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */,
</span><span class="cx">                                 8E4C96DC1AD4483500365A50 /* JSFetchResponse.cpp in Sources */,
</span><span class="cx">                                 BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */,
</span><span class="lines">@@ -28748,6 +28785,7 @@
</span><span class="cx">                                 A80E7E980A1A83E3007FB8C5 /* JSHTMLInputElement.cpp in Sources */,
</span><span class="cx">                                 BCC438780E886CC700533DD5 /* JSHTMLInputElementCustom.cpp in Sources */,
</span><span class="cx">                                 A6148A7812E41E3B0044A784 /* JSHTMLKeygenElement.cpp in Sources */,
</span><ins>+                                9444CBE71D8861C20073A074 /* CSSVariableData.cpp in Sources */,
</ins><span class="cx">                                 1AE2AB210A1CE63B00B42B25 /* JSHTMLLabelElement.cpp in Sources */,
</span><span class="cx">                                 1AE2AB230A1CE63B00B42B25 /* JSHTMLLegendElement.cpp in Sources */,
</span><span class="cx">                                 1AE2AB250A1CE63B00B42B25 /* JSHTMLLIElement.cpp in Sources */,
</span><span class="lines">@@ -29516,6 +29554,7 @@
</span><span class="cx">                                 A7197F2617568AE5007B9442 /* PageThrottler.cpp in Sources */,
</span><span class="cx">                                 E1284AEA10447DEE00EAEB52 /* PageTransitionEvent.cpp in Sources */,
</span><span class="cx">                                 51E1ECC20C91C90400DC255B /* PageURLRecord.cpp in Sources */,
</span><ins>+                                9444CBE31D8861980073A074 /* CSSCustomIdentValue.cpp in Sources */,
</ins><span class="cx">                                 FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */,
</span><span class="cx">                                 FD3160A212B026F700C1A359 /* Panner.cpp in Sources */,
</span><span class="cx">                                 FD31601912B0267600C1A359 /* PannerNode.cpp in Sources */,
</span><span class="lines">@@ -29698,6 +29737,7 @@
</span><span class="cx">                                 8AC822FC180FC03300FB64D5 /* RenderNamedFlowFragment.cpp in Sources */,
</span><span class="cx">                                 1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */,
</span><span class="cx">                                 BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */,
</span><ins>+                                9444CBE51D8861990073A074 /* CSSCustomPropertyDeclaration.cpp in Sources */,
</ins><span class="cx">                                 A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
</span><span class="cx">                                 5A574F24131DB93900471B88 /* RenderQuote.cpp in Sources */,
</span><span class="cx">                                 D70AD65713E1342B005B50B4 /* RenderRegion.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCustomIdentValuecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSCustomIdentValue.cpp (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCustomIdentValue.cpp                                (rev 0)
+++ trunk/Source/WebCore/css/CSSCustomIdentValue.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include &quot;config.h&quot;
+#include &quot;CSSCustomIdentValue.h&quot;
+
+#include &quot;CSSMarkup.h&quot;
+#include &lt;wtf/text/StringBuilder.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+CSSCustomIdentValue::CSSCustomIdentValue(const String&amp; str)
+    : CSSValue(CustomIdentClass)
+    , m_string(str)
+    , m_propertyId(CSSPropertyInvalid) { }
+
+CSSCustomIdentValue::CSSCustomIdentValue(CSSPropertyID id)
+    : CSSValue(CustomIdentClass)
+    , m_string()
+    , m_propertyId(id)
+{
+    ASSERT(isKnownPropertyID());
+}
+
+
+String CSSCustomIdentValue::customCSSText() const
+{
+    if (isKnownPropertyID())
+        return getPropertyNameAtomicString(m_propertyId);
+    StringBuilder builder;
+    serializeIdentifier(m_string, builder);
+    return builder.toString();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSCustomIdentValueh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSCustomIdentValue.h (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCustomIdentValue.h                                (rev 0)
+++ trunk/Source/WebCore/css/CSSCustomIdentValue.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma once
+
+#include &quot;CSSPropertyNames.h&quot;
+#include &quot;CSSValue.h&quot;
+
+namespace WebCore {
+
+class CSSCustomIdentValue : public CSSValue {
+public:
+    static Ref&lt;CSSCustomIdentValue&gt; create(const String&amp; str)
+    {
+        return adoptRef(*new CSSCustomIdentValue(str));
+    }
+
+    // FIXME: Remove this and lazily parse the CSSPropertyID in isKnownPropertyID().
+    static Ref&lt;CSSCustomIdentValue&gt; create(CSSPropertyID id)
+    {
+        return adoptRef(*new CSSCustomIdentValue(id));
+    }
+
+    String value() const { ASSERT(!isKnownPropertyID()); return m_string; }
+    bool isKnownPropertyID() const { return m_propertyId != CSSPropertyInvalid; }
+    CSSPropertyID valueAsPropertyID() const { ASSERT(isKnownPropertyID()); return m_propertyId; }
+
+    String customCSSText() const;
+
+    bool equals(const CSSCustomIdentValue&amp; other) const
+    {
+        return isKnownPropertyID() ? m_propertyId == other.m_propertyId : m_string == other.m_string;
+    }
+
+private:
+    CSSCustomIdentValue(const String&amp;);
+    CSSCustomIdentValue(CSSPropertyID);
+
+    // FIXME: Change this to an AtomicString.
+    String m_string;
+    CSSPropertyID m_propertyId;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCustomIdentValue, isCustomIdentValue())
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSCustomPropertyDeclarationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.cpp (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.cpp                                (rev 0)
+++ trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include &quot;config.h&quot;
+#include &quot;CSSCustomPropertyDeclaration.h&quot;
+
+#include &quot;CSSParserTokenRange.h&quot;
+
+namespace WebCore {
+
+String CSSCustomPropertyDeclaration::customCSSText() const
+{
+    if (m_value)
+        return m_value-&gt;tokenRange().serialize();
+    ASSERT(m_valueId != CSSValueInternalVariableValue);
+    return getValueName(m_valueId);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSCustomPropertyDeclarationh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.h (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.h                                (rev 0)
+++ trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma once
+
+#include &quot;CSSValue.h&quot;
+#include &quot;CSSVariableData.h&quot;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/text/AtomicString.h&gt;
+
+namespace WebCore {
+
+class CSSCustomPropertyDeclaration : public CSSValue {
+public:
+    static Ref&lt;CSSCustomPropertyDeclaration&gt; create(const AtomicString&amp; name, Ref&lt;CSSVariableData&gt;&amp;&amp; value)
+    {
+        return adoptRef(*new CSSCustomPropertyDeclaration(name, WTFMove(value)));
+    }
+
+    static Ref&lt;CSSCustomPropertyDeclaration&gt; create(const AtomicString&amp; name, CSSValueID id)
+    {
+        return adoptRef(*new CSSCustomPropertyDeclaration(name, id));
+    }
+
+    const AtomicString&amp; name() const { return m_name; }
+    CSSVariableData* value() const { return m_value.get(); }
+    CSSValueID id() const { return m_valueId; }
+    String customCSSText() const;
+
+    bool equals(const CSSCustomPropertyDeclaration&amp; other) const { return this == &amp;other; }
+
+private:
+    CSSCustomPropertyDeclaration(const AtomicString&amp; name, CSSValueID id)
+        : CSSValue(CustomPropertyDeclarationClass)
+        , m_name(name)
+        , m_value(nullptr)
+        , m_valueId(id)
+    {
+        ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset || id == CSSValueRevert);
+    }
+
+    CSSCustomPropertyDeclaration(const AtomicString&amp; name, Ref&lt;CSSVariableData&gt;&amp;&amp; value)
+        : CSSValue(CustomPropertyDeclarationClass)
+        , m_name(name)
+        , m_value(WTFMove(value))
+        , m_valueId(CSSValueInternalVariableValue)
+    {
+    }
+
+    const AtomicString m_name;
+    RefPtr&lt;CSSVariableData&gt; m_value;
+    CSSValueID m_valueId;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCustomPropertyDeclaration, isCustomPropertyDeclaration())
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSCustomPropertyValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCustomPropertyValue.h (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCustomPropertyValue.h        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/CSSCustomPropertyValue.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+// FIXME-NEWPARSER: This will be removed in favor of CSSCustomPropertyDeclaration
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSCustomPropertyValue final : public CSSValue {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.cpp (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.cpp        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/CSSValue.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx"> #include &quot;CSSContentDistributionValue.h&quot;
</span><span class="cx"> #include &quot;CSSCrossfadeValue.h&quot;
</span><span class="cx"> #include &quot;CSSCursorImageValue.h&quot;
</span><ins>+#include &quot;CSSCustomIdentValue.h&quot;
+#include &quot;CSSCustomPropertyDeclaration.h&quot;
</ins><span class="cx"> #include &quot;CSSCustomPropertyValue.h&quot;
</span><span class="cx"> #include &quot;CSSFilterImageValue.h&quot;
</span><span class="cx"> #include &quot;CSSFontFaceSrcValue.h&quot;
</span><span class="lines">@@ -58,6 +60,7 @@
</span><span class="cx"> #include &quot;CSSUnsetValue.h&quot;
</span><span class="cx"> #include &quot;CSSValueList.h&quot;
</span><span class="cx"> #include &quot;CSSVariableDependentValue.h&quot;
</span><ins>+#include &quot;CSSVariableReferenceValue.h&quot;
</ins><span class="cx"> #include &quot;CSSVariableValue.h&quot;
</span><span class="cx"> #include &quot;SVGColor.h&quot;
</span><span class="cx"> #include &quot;SVGPaint.h&quot;
</span><span class="lines">@@ -362,6 +365,12 @@
</span><span class="cx">         return downcast&lt;CSSVariableDependentValue&gt;(*this).customCSSText();
</span><span class="cx">     case VariableClass:
</span><span class="cx">         return downcast&lt;CSSVariableValue&gt;(*this).customCSSText();
</span><ins>+    case CustomPropertyDeclarationClass:
+        return downcast&lt;CSSCustomPropertyDeclaration&gt;(*this).customCSSText();
+    case CustomIdentClass:
+        return downcast&lt;CSSCustomIdentValue&gt;(*this).customCSSText();
+    case VariableReferenceClass:
+        return downcast&lt;CSSVariableReferenceValue&gt;(*this).customCSSText();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -505,6 +514,15 @@
</span><span class="cx">     case VariableClass:
</span><span class="cx">         delete downcast&lt;CSSVariableValue&gt;(this);
</span><span class="cx">         return;
</span><ins>+    case CustomPropertyDeclarationClass:
+        delete downcast&lt;CSSCustomPropertyDeclaration&gt;(this);
+        return;
+    case CustomIdentClass:
+        delete downcast&lt;CSSCustomIdentValue&gt;(this);
+        return;
+    case VariableReferenceClass:
+        delete downcast&lt;CSSVariableReferenceValue&gt;(this);
+        return;
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.h (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.h        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/CSSValue.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -123,6 +123,10 @@
</span><span class="cx">     bool isAnimationTriggerScrollValue() const { return m_classType == AnimationTriggerScrollClass; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    bool isCustomPropertyDeclaration() const { return m_classType == CustomPropertyDeclarationClass; }
+    bool isCustomIdentValue() const { return m_classType == CustomIdentClass; }
+    bool isVariableReferenceValue() const { return m_classType == VariableReferenceClass; }
+
</ins><span class="cx">     bool isCSSOMSafe() const { return m_isCSSOMSafe; }
</span><span class="cx">     bool isSubtypeExposedToCSSOM() const
</span><span class="cx">     { 
</span><span class="lines">@@ -192,10 +196,17 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         CSSContentDistributionClass,
</span><ins>+        
+        // FIXME-NEWPARSER: Remove in favor of new variables implementation.
</ins><span class="cx">         CustomPropertyClass,
</span><span class="cx">         VariableDependentClass,
</span><span class="cx">         VariableClass,
</span><span class="cx"> 
</span><ins>+        // New variables implementation.
+        CustomPropertyDeclarationClass,
+        CustomIdentClass,
+        VariableReferenceClass,
+
</ins><span class="cx">         // List class types must appear after ValueListClass.
</span><span class="cx">         ValueListClass,
</span><span class="cx">         ImageSetClass,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -833,6 +833,12 @@
</span><span class="cx"> padding-box
</span><span class="cx"> 
</span><span class="cx"> //
</span><ins>+// Variables Implementation
+//
+var
+-internal-variable-value
+
+//
</ins><span class="cx"> // CSS_PROP_BREAK_BEFORE/AFTER/INSIDE
</span><span class="cx"> //
</span><span class="cx"> avoid-column
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSVariableDatacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSVariableData.cpp (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSVariableData.cpp                                (rev 0)
+++ trunk/Source/WebCore/css/CSSVariableData.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include &quot;config.h&quot;
+#include &quot;CSSVariableData.h&quot;
+
+#include &quot;CSSParser.h&quot;
+#include &quot;CSSParserTokenRange.h&quot;
+#include &lt;wtf/text/StringBuilder.h&gt;
+#include &lt;wtf/text/StringView.h&gt;
+
+namespace WebCore {
+
+template&lt;typename CharacterType&gt; void CSSVariableData::updateTokens(const CSSParserTokenRange&amp; range)
+{
+    const CharacterType* currentOffset = m_backingString.characters&lt;CharacterType&gt;();
+    for (const CSSParserToken&amp; token : range) {
+        if (token.hasStringBacking()) {
+            unsigned length = token.value().length();
+            StringView string(currentOffset, length);
+            m_tokens.append(token.copyWithUpdatedString(string));
+            currentOffset += length;
+        } else
+            m_tokens.append(token);
+    }
+    ASSERT(currentOffset == m_backingString.characters&lt;CharacterType&gt;() + m_backingString.length());
+}
+
+bool CSSVariableData::operator==(const CSSVariableData&amp; other) const
+{
+    return tokens() == other.tokens();
+}
+
+void CSSVariableData::consumeAndUpdateTokens(const CSSParserTokenRange&amp; range)
+{
+    StringBuilder stringBuilder;
+    CSSParserTokenRange localRange = range;
+
+    while (!localRange.atEnd()) {
+        CSSParserToken token = localRange.consume();
+        if (token.hasStringBacking())
+            stringBuilder.append(token.value());
+    }
+    m_backingString = stringBuilder.toString();
+    if (m_backingString.is8Bit())
+        updateTokens&lt;LChar&gt;(range);
+    else
+        updateTokens&lt;UChar&gt;(range);
+}
+
+CSSVariableData::CSSVariableData(const CSSParserTokenRange&amp; range, bool needsVariableResolution)
+    : m_needsVariableResolution(needsVariableResolution)
+{
+    ASSERT(!range.atEnd());
+    consumeAndUpdateTokens(range);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSVariableDatah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSVariableData.h (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSVariableData.h                                (rev 0)
+++ trunk/Source/WebCore/css/CSSVariableData.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma once
+
+#include &quot;CSSParserToken.h&quot;
+#include &quot;CSSParserTokenRange.h&quot;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class CSSParserTokenRange;
+
+class CSSVariableData : public RefCounted&lt;CSSVariableData&gt; {
+    WTF_MAKE_NONCOPYABLE(CSSVariableData);
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static Ref&lt;CSSVariableData&gt; create(const CSSParserTokenRange&amp; range, bool needsVariableResolution = true)
+    {
+        return adoptRef(*new CSSVariableData(range, needsVariableResolution));
+    }
+
+    static Ref&lt;CSSVariableData&gt; createResolved(const Vector&lt;CSSParserToken&gt;&amp; resolvedTokens, const CSSVariableData&amp; unresolvedData)
+    {
+        return adoptRef(*new CSSVariableData(resolvedTokens, unresolvedData.m_backingString));
+    }
+
+    CSSParserTokenRange tokenRange() { return m_tokens; }
+
+    const Vector&lt;CSSParserToken&gt;&amp; tokens() const { return m_tokens; }
+
+    bool operator==(const CSSVariableData&amp; other) const;
+
+    bool needsVariableResolution() const { return m_needsVariableResolution; }
+
+private:
+    CSSVariableData(const CSSParserTokenRange&amp;, bool needsVariableResolution);
+
+    // We can safely copy the tokens (which have raw pointers to substrings) because
+    // StylePropertySets contain references to CSSCustomPropertyDeclarations, which
+    // point to the unresolved CSSVariableData values that own the backing strings
+    // this will potentially reference.
+    CSSVariableData(const Vector&lt;CSSParserToken&gt;&amp; resolvedTokens, String backingString)
+        : m_backingString(backingString)
+        , m_tokens(resolvedTokens)
+        , m_needsVariableResolution(false)
+    { }
+
+    void consumeAndUpdateTokens(const CSSParserTokenRange&amp;);
+    template&lt;typename CharacterType&gt; void updateTokens(const CSSParserTokenRange&amp;);
+
+    String m_backingString;
+    Vector&lt;CSSParserToken&gt; m_tokens;
+    const bool m_needsVariableResolution;
+
+    // FIXME-NEWPARSER: We want to cache StyleProperties once we support @apply.
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSVariableDependentValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSVariableDependentValue.h (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSVariableDependentValue.h        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/CSSVariableDependentValue.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;CSSValueList.h&quot;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> 
</span><ins>+// FIXME-NEWPARSER: This will be removed in favor of CSSVariableReferenceValue
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSVariableDependentValue final : public CSSValue {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSVariableReferenceValuecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSVariableReferenceValue.cpp (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSVariableReferenceValue.cpp                                (rev 0)
+++ trunk/Source/WebCore/css/CSSVariableReferenceValue.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include &quot;config.h&quot;
+#include &quot;CSSVariableReferenceValue.h&quot;
+
+namespace WebCore {
+
+String CSSVariableReferenceValue::customCSSText() const
+{
+    // We may want to consider caching this value.
+    return m_data-&gt;tokenRange().serialize();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSVariableReferenceValueh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSVariableReferenceValue.h (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSVariableReferenceValue.h                                (rev 0)
+++ trunk/Source/WebCore/css/CSSVariableReferenceValue.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma once
+
+#include &quot;CSSValue.h&quot;
+#include &quot;CSSVariableData.h&quot;
+#include &lt;wtf/RefPtr.h&gt;
+
+namespace WebCore {
+
+class CSSVariableReferenceValue : public CSSValue {
+public:
+    static Ref&lt;CSSVariableReferenceValue&gt; create(Ref&lt;CSSVariableData&gt;&amp;&amp; data)
+    {
+        return adoptRef(*new CSSVariableReferenceValue(WTFMove(data)));
+    }
+
+    CSSVariableData* variableDataValue() const
+    {
+        return m_data.get();
+    }
+
+    bool equals(const CSSVariableReferenceValue&amp; other) const { return m_data == other.m_data; }
+    String customCSSText() const;
+
+private:
+    CSSVariableReferenceValue(Ref&lt;CSSVariableData&gt;&amp;&amp; data)
+        : CSSValue(VariableReferenceClass)
+        , m_data(WTFMove(data))
+    {
+    }
+
+    RefPtr&lt;CSSVariableData&gt; m_data;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSVariableReferenceValue, isVariableReferenceValue())
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSVariableValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSVariableValue.h (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSVariableValue.h        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/CSSVariableValue.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSValue.h&quot;
</span><span class="cx"> 
</span><ins>+// FIXME-NEWPARSER: This will be removed in favor of the new variables implementation.
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSValueList;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSAtRuleIDcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -59,5 +59,5 @@
</span><span class="cx">     return CSSAtRuleInvalid;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-} // namespace blink
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include &quot;CSSParserImpl.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSAtRuleID.h&quot;
</span><del>-#include &quot;CSSCustomPropertyValue.h&quot;
</del><ins>+#include &quot;CSSCustomPropertyDeclaration.h&quot;
</ins><span class="cx"> #include &quot;CSSKeyframeRule.h&quot;
</span><span class="cx"> #include &quot;CSSKeyframesRule.h&quot;
</span><span class="cx"> #include &quot;CSSParserObserver.h&quot;
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CSSSupportsParser.h&quot;
</span><span class="cx"> #include &quot;CSSTokenizer.h&quot;
</span><del>-// FIXME-NEWPARSER: #include &quot;CSSVariableParser.h&quot;
</del><ins>+#include &quot;CSSVariableParser.h&quot;
</ins><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> #include &quot;MediaQueryParser.h&quot;
</span><span class="lines">@@ -97,12 +97,11 @@
</span><span class="cx">         const unsigned propertyIDIndex = property.id() - firstCSSProperty;
</span><span class="cx">         
</span><span class="cx">         if (property.id() == CSSPropertyCustom) {
</span><del>-            if (property.value()) {
-                auto&amp; name = downcast&lt;CSSCustomPropertyValue&gt;(*property.value()).name();
-                if (!seenCustomProperties.add(name).isNewEntry)
-                    continue;
-                output[--unusedEntries] = property;
-            }
</del><ins>+            CSSCustomPropertyDeclaration* customValue = downcast&lt;CSSCustomPropertyDeclaration&gt;(property.value());
+            const AtomicString&amp; name = customValue-&gt;name();
+            if (seenCustomProperties.contains(name))
+                continue;
+            seenCustomProperties.add(name);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -779,11 +778,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     size_t propertiesCount = m_parsedProperties.size();
</span><del>-    // FIXME-NEWPARSER: Support variables
-    /*if (unresolvedProperty == CSSPropertyInvalid &amp;&amp; CSSVariableParser::isValidVariableName(token)) {
</del><ins>+    if (unresolvedProperty == CSSPropertyInvalid &amp;&amp; CSSVariableParser::isValidVariableName(token)) {
</ins><span class="cx">         AtomicString variableName = token.value().toAtomicString();
</span><span class="cx">         consumeVariableValue(range.makeSubRange(&amp;range.peek(), declarationValueEnd), variableName, important);
</span><del>-    }*/
</del><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (important &amp;&amp; (ruleType == StyleRule::FontFace || ruleType == StyleRule::Keyframe))
</span><span class="cx">         return;
</span><span class="lines">@@ -798,11 +796,10 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CSSParserImpl::consumeVariableValue(CSSParserTokenRange /* range */, const AtomicString&amp; /*variableName */, bool /* important */)
</del><ins>+void CSSParserImpl::consumeVariableValue(CSSParserTokenRange range, const AtomicString&amp; variableName, bool important)
</ins><span class="cx"> {
</span><del>-    // FIXME-NEWPARSER: Support variables
-    // if (CSSCustomPropertyDeclaration* value = CSSVariableParser::parseDeclarationValue(variableName, range))
-    //     m_parsedProperties.append(CSSProperty(CSSPropertyVariable, *value, important));
</del><ins>+    if (RefPtr&lt;CSSCustomPropertyDeclaration&gt; value = CSSVariableParser::parseDeclarationValue(variableName, range))
+        m_parsedProperties.append(CSSProperty(CSSPropertyCustom, WTFMove(value), important));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSPropertyID unresolvedProperty, bool important, StyleRule::Type ruleType)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSSelectorParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -768,4 +768,4 @@
</span><span class="cx">     return secondCompound;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-} // namespace blink
</del><ins>+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSSupportsParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSSupportsParser.cpp (205868 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSSupportsParser.cpp        2016-09-13 19:01:32 UTC (rev 205868)
+++ trunk/Source/WebCore/css/parser/CSSSupportsParser.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -116,4 +116,4 @@
</span><span class="cx">     return innerRange.peek().type() == IdentToken &amp;&amp; m_parser.supportsDeclaration(innerRange) ? Supported : Unsupported;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-} // namespace blink
</del><ins>+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSVariableParsercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/parser/CSSVariableParser.cpp (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSVariableParser.cpp                                (rev 0)
+++ trunk/Source/WebCore/css/parser/CSSVariableParser.cpp        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,166 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include &quot;config.h&quot;
+#include &quot;CSSVariableParser.h&quot;
+
+#include &quot;CSSCustomPropertyDeclaration.h&quot;
+#include &quot;CSSParserTokenRange.h&quot;
+
+namespace WebCore {
+
+bool CSSVariableParser::isValidVariableName(const CSSParserToken&amp; token)
+{
+    if (token.type() != IdentToken)
+        return false;
+
+    StringView value = token.value();
+    return value.length() &gt;= 2 &amp;&amp; value[0] == '-' &amp;&amp; value[1] == '-';
+}
+
+bool CSSVariableParser::isValidVariableName(const String&amp; string)
+{
+    return string.length() &gt;= 2 &amp;&amp; string[0] == '-' &amp;&amp; string[1] == '-';
+}
+
+bool isValidVariableReference(CSSParserTokenRange, bool&amp; hasAtApplyRule);
+
+static bool classifyBlock(CSSParserTokenRange range, bool&amp; hasReferences, bool&amp; hasAtApplyRule, bool isTopLevelBlock = true)
+{
+    while (!range.atEnd()) {
+        if (range.peek().getBlockType() == CSSParserToken::BlockStart) {
+            const CSSParserToken&amp; token = range.peek();
+            CSSParserTokenRange block = range.consumeBlock();
+            if (token.functionId() == CSSValueVar) {
+                if (!isValidVariableReference(block, hasAtApplyRule))
+                    return false; // Bail if any references are invalid
+                hasReferences = true;
+                continue;
+            }
+            if (!classifyBlock(block, hasReferences, hasAtApplyRule, false))
+                return false;
+            continue;
+        }
+
+        ASSERT(range.peek().getBlockType() != CSSParserToken::BlockEnd);
+
+        const CSSParserToken&amp; token = range.consume();
+        switch (token.type()) {
+        case AtKeywordToken: {
+            if (equalIgnoringASCIICase(token.value(), &quot;apply&quot;)) {
+                range.consumeWhitespace();
+                const CSSParserToken&amp; variableName = range.consumeIncludingWhitespace();
+                if (!CSSVariableParser::isValidVariableName(variableName)
+                    || !(range.atEnd() || range.peek().type() == SemicolonToken || range.peek().type() == RightBraceToken))
+                    return false;
+                hasAtApplyRule = true;
+            }
+            break;
+        }
+        case DelimiterToken: {
+            if (token.delimiter() == '!' &amp;&amp; isTopLevelBlock)
+                return false;
+            break;
+        }
+        case RightParenthesisToken:
+        case RightBraceToken:
+        case RightBracketToken:
+        case BadStringToken:
+        case BadUrlToken:
+            return false;
+        case SemicolonToken:
+            if (isTopLevelBlock)
+                return false;
+            break;
+        default:
+            break;
+        }
+    }
+    return true;
+}
+
+bool isValidVariableReference(CSSParserTokenRange range, bool&amp; hasAtApplyRule)
+{
+    range.consumeWhitespace();
+    if (!CSSVariableParser::isValidVariableName(range.consumeIncludingWhitespace()))
+        return false;
+    if (range.atEnd())
+        return true;
+
+    if (range.consume().type() != CommaToken)
+        return false;
+    if (range.atEnd())
+        return false;
+
+    bool hasReferences = false;
+    return classifyBlock(range, hasReferences, hasAtApplyRule);
+}
+
+static CSSValueID classifyVariableRange(CSSParserTokenRange range, bool&amp; hasReferences, bool&amp; hasAtApplyRule)
+{
+    hasReferences = false;
+    hasAtApplyRule = false;
+
+    range.consumeWhitespace();
+    if (range.peek().type() == IdentToken) {
+        CSSValueID id = range.consumeIncludingWhitespace().id();
+        if (range.atEnd() &amp;&amp; (id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset))
+            return id;
+    }
+
+    if (classifyBlock(range, hasReferences, hasAtApplyRule))
+        return CSSValueInternalVariableValue;
+    return CSSValueInvalid;
+}
+
+bool CSSVariableParser::containsValidVariableReferences(CSSParserTokenRange range)
+{
+    bool hasReferences;
+    bool hasAtApplyRule;
+    CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule);
+    return type == CSSValueInternalVariableValue &amp;&amp; hasReferences &amp;&amp; !hasAtApplyRule;
+}
+
+RefPtr&lt;CSSCustomPropertyDeclaration&gt; CSSVariableParser::parseDeclarationValue(const AtomicString&amp; variableName, CSSParserTokenRange range)
+{
+    if (range.atEnd())
+        return nullptr;
+
+    bool hasReferences;
+    bool hasAtApplyRule;
+    CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule);
+
+    if (type == CSSValueInvalid)
+        return nullptr;
+    if (type == CSSValueInternalVariableValue)
+        return CSSCustomPropertyDeclaration::create(variableName, CSSVariableData::create(range, hasReferences || hasAtApplyRule));
+    return CSSCustomPropertyDeclaration::create(variableName, type);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSVariableParserh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/parser/CSSVariableParser.h (0 => 205869)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSVariableParser.h                                (rev 0)
+++ trunk/Source/WebCore/css/parser/CSSVariableParser.h        2016-09-13 19:08:30 UTC (rev 205869)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright (C) 2016 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//    * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//    * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//    * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma once
+
+#include &quot;CSSParserTokenRange.h&quot;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/text/AtomicString.h&gt;
+
+namespace WebCore {
+
+class CSSCustomPropertyDeclaration;
+
+class CSSVariableParser {
+public:
+    static bool containsValidVariableReferences(CSSParserTokenRange);
+
+    static RefPtr&lt;CSSCustomPropertyDeclaration&gt; parseDeclarationValue(const AtomicString&amp;, CSSParserTokenRange);
+
+    static bool isValidVariableName(const CSSParserToken&amp;);
+    static bool isValidVariableName(const String&amp;);
+};
+
+} // namespace WebCore
</ins></span></pre>
</div>
</div>

</body>
</html>