<!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>[207479] 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/207479">207479</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2016-10-18 13:03:18 -0700 (Tue, 18 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[CSS Parser] Get all the properties turned on
https://bugs.webkit.org/show_bug.cgi?id=163605
Reviewed by Dean Jackson.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFunctionValue.h:
* css/CSSPendingSubstitutionValue.cpp: Added.
(WebCore::CSSPendingSubstitutionValue::customCSSText):
* css/CSSPendingSubstitutionValue.h: Added.
(WebCore::CSSPendingSubstitutionValue::create):
(WebCore::CSSPendingSubstitutionValue::shorthandValue):
(WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
(WebCore::CSSPendingSubstitutionValue::equals):
(WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isPendingSubstitutionValue):
* css/CSSValueKeywords.in:
* css/StylePropertyShorthand.cpp:
(WebCore::transitionShorthandForParsing):
* css/StylePropertyShorthand.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::completeURL):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parseValue):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContext::completeURL):
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::parseAsCSSPropertyID):
(WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
* css/parser/CSSParserToken.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
(WebCore::CSSPropertyParser::addProperty):
(WebCore::CSSPropertyParser::addExpandedPropertyForValue):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::consumeCSSWideKeyword):
(WebCore::consumeTransformOrigin):
(WebCore::consumeWillChange):
(WebCore::consumeFontFeatureTag):
(WebCore::consumeFontFeatureSettings):
(WebCore::consumePage):
(WebCore::consumeQuotes):
(WebCore::FontVariantLigaturesParser::consumeLigature):
(WebCore::FontVariantLigaturesParser::finalizeValue):
(WebCore::consumeFontVariantLigatures):
(WebCore::consumeFontVariantCaps):
(WebCore::FontVariantNumericParser::consumeNumeric):
(WebCore::FontVariantNumericParser::finalizeValue):
(WebCore::consumeFontVariantNumeric):
(WebCore::consumeFontVariantCSS21):
(WebCore::consumeFontVariantList):
(WebCore::consumeFontWeight):
(WebCore::consumeFamilyName):
(WebCore::consumeGenericFamily):
(WebCore::consumeFontFamily):
(WebCore::consumeSpacing):
(WebCore::consumeTabSize):
(WebCore::consumeTextSizeAdjust):
(WebCore::consumeFontSize):
(WebCore::consumeLineHeight):
(WebCore::createPrimitiveValuePair):
(WebCore::consumeCounter):
(WebCore::consumePageSize):
(WebCore::consumeSize):
(WebCore::consumeTextIndent):
(WebCore::validWidthOrHeightKeyword):
(WebCore::consumeMaxWidthOrHeight):
(WebCore::consumeWidthOrHeight):
(WebCore::consumeMarginOrOffset):
(WebCore::consumeClipComponent):
(WebCore::consumeClip):
(WebCore::consumeTouchAction):
(WebCore::consumeLineClamp):
(WebCore::consumeLocale):
(WebCore::consumeColumnWidth):
(WebCore::consumeColumnCount):
(WebCore::consumeColumnGap):
(WebCore::consumeColumnSpan):
(WebCore::consumeZoom):
(WebCore::consumeAnimationIterationCount):
(WebCore::consumeAnimationName):
(WebCore::consumeTransitionProperty):
(WebCore::consumeCubicBezier):
(WebCore::consumeAnimationTimingFunction):
(WebCore::consumeAnimationValue):
(WebCore::isValidAnimationPropertyList):
(WebCore::consumeAnimationPropertyList):
(WebCore::CSSPropertyParser::consumeAnimationShorthand):
(WebCore::consumeZIndex):
(WebCore::parseSingleShadow):
(WebCore::consumeShadow):
(WebCore::consumeFilterFunction):
(WebCore::consumeFilter):
(WebCore::consumeTextDecorationLine):
(WebCore::consumeTextEmphasisStyle):
(WebCore::consumeOutlineColor):
(WebCore::consumeLineWidth):
(WebCore::consumeBorderWidth):
(WebCore::consumeTextStrokeWidth):
(WebCore::consumeColumnRuleWidth):
(WebCore::consumeTranslate3d):
(WebCore::consumeNumbers):
(WebCore::consumePerspective):
(WebCore::consumeTransformValue):
(WebCore::consumeTransform):
(WebCore::consumePositionLonghand):
(WebCore::consumePositionX):
(WebCore::consumePositionY):
(WebCore::consumePaintStroke):
(WebCore::consumePaintOrder):
(WebCore::consumeNoneOrURI):
(WebCore::consumeFlexBasis):
(WebCore::consumeStrokeDasharray):
(WebCore::consumeBaselineShift):
(WebCore::consumeRxOrRy):
(WebCore::consumeCursor):
(WebCore::consumeAttr):
(WebCore::consumeCounterContent):
(WebCore::consumeContent):
(WebCore::consumePositionList):
(WebCore::consumeScrollSnapCoordinate):
(WebCore::consumeScrollSnapPoints):
(WebCore::consumeBorderRadiusCorner):
(WebCore::consumeVerticalAlign):
(WebCore::consumeShapeRadius):
(WebCore::consumeBasicShapeCircle):
(WebCore::consumeBasicShapeEllipse):
(WebCore::consumeBasicShapePolygon):
(WebCore::complete4Sides):
(WebCore::consumeRadii):
(WebCore::consumeBasicShapeInset):
(WebCore::consumeBasicShape):
(WebCore::consumeWebkitClipPath):
(WebCore::consumeShapeOutside):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeBorderImageRepeatKeyword):
(WebCore::consumeBorderImageRepeat):
(WebCore::consumeBorderImageSlice):
(WebCore::consumeBorderImageOutset):
(WebCore::consumeBorderImageWidth):
(WebCore::consumeBorderImageComponents):
(WebCore::consumeWebkitBorderImage):
(WebCore::consumeReflect):
(WebCore::consumeImageOrientation):
(WebCore::consumeBackgroundBlendMode):
(WebCore::consumeBackgroundAttachment):
(WebCore::consumeBackgroundBox):
(WebCore::consumeBackgroundComposite):
(WebCore::consumePrefixedBackgroundBox):
(WebCore::consumeBackgroundSize):
(WebCore::consumeGridAutoFlow):
(WebCore::consumeBackgroundComponent):
(WebCore::addBackgroundValue):
(WebCore::consumeCommaSeparatedBackgroundComponent):
(WebCore::consumeSelfPositionKeyword):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeAlignItems):
(WebCore::consumeJustifyItems):
(WebCore::consumeFitContent):
(WebCore::consumeCustomIdentForGridLine):
(WebCore::consumeGridLine):
(WebCore::isGridTrackFixedSized):
(WebCore::consumeGridBreadth):
(WebCore::consumeGridTrackSize):
(WebCore::consumeGridLineNames):
(WebCore::consumeGridTrackRepeatFunction):
(WebCore::consumeGridTrackList):
(WebCore::consumeGridTemplatesRowsOrColumns):
(WebCore::consumeGridTemplateAreas):
(WebCore::consumeFontFaceUnicodeRange):
(WebCore::consumeFontFaceSrcURI):
(WebCore::consumeFontFaceSrcLocal):
(WebCore::consumeFontFaceSrc):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeSystemFont):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):
(WebCore::CSSPropertyParser::consumeBorderSpacing):
(WebCore::consumeSingleViewportDescriptor):
(WebCore::CSSPropertyParser::parseViewportDescriptor):
(WebCore::consumeColumnWidthOrCount):
(WebCore::CSSPropertyParser::consumeColumns):
(WebCore::CSSPropertyParser::consumeShorthandGreedily):
(WebCore::CSSPropertyParser::consumeFlex):
(WebCore::CSSPropertyParser::consumeBorder):
(WebCore::CSSPropertyParser::consume4Values):
(WebCore::CSSPropertyParser::consumeBorderImage):
(WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
(WebCore::consumeBackgroundPosition):
(WebCore::consumeRepeatStyleComponent):
(WebCore::consumeRepeatStyle):
(WebCore::CSSPropertyParser::consumeBackgroundShorthand):
(WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
(WebCore::CSSPropertyParser::consumeGridAreaShorthand):
(WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
(WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
(WebCore::CSSPropertyParser::consumeGridShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
(WebCore::unresolvedCSSPropertyID): Deleted.
* css/parser/CSSPropertyParser.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeIdent):
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeString):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
* css/parser/CSSPropertyParserHelpers.h:</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="#trunkSourceWebCorecssCSSFunctionValueh">trunk/Source/WebCore/css/CSSFunctionValue.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="#trunkSourceWebCorecssStylePropertyShorthandcpp">trunk/Source/WebCore/css/StylePropertyShorthand.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertyShorthandh">trunk/Source/WebCore/css/StylePropertyShorthand.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParsercpp">trunk/Source/WebCore/css/parser/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserImplcpp">trunk/Source/WebCore/css/parser/CSSParserImpl.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserModeh">trunk/Source/WebCore/css/parser/CSSParserMode.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserTokencpp">trunk/Source/WebCore/css/parser/CSSParserToken.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserTokenh">trunk/Source/WebCore/css/parser/CSSParserToken.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserh">trunk/Source/WebCore/css/parser/CSSPropertyParser.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserHelperscpp">trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserHelpersh">trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecssCSSPendingSubstitutionValuecpp">trunk/Source/WebCore/css/CSSPendingSubstitutionValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPendingSubstitutionValueh">trunk/Source/WebCore/css/CSSPendingSubstitutionValue.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 (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -1298,6 +1298,7 @@
</span><span class="cx"> css/CSSMediaRule.cpp
</span><span class="cx"> css/CSSNamedImageValue.cpp
</span><span class="cx"> css/CSSPageRule.cpp
</span><ins>+ css/CSSPendingSubstitutionValue.cpp
</ins><span class="cx"> css/CSSPrimitiveValue.cpp
</span><span class="cx"> css/CSSProperty.cpp
</span><span class="cx"> css/CSSPropertySourceData.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/ChangeLog        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -1,3 +1,220 @@
</span><ins>+2016-10-18 Dave Hyatt <hyatt@apple.com>
+
+ [CSS Parser] Get all the properties turned on
+ https://bugs.webkit.org/show_bug.cgi?id=163605
+
+ Reviewed by Dean Jackson.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSFunctionValue.h:
+ * css/CSSPendingSubstitutionValue.cpp: Added.
+ (WebCore::CSSPendingSubstitutionValue::customCSSText):
+ * css/CSSPendingSubstitutionValue.h: Added.
+ (WebCore::CSSPendingSubstitutionValue::create):
+ (WebCore::CSSPendingSubstitutionValue::shorthandValue):
+ (WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
+ (WebCore::CSSPendingSubstitutionValue::equals):
+ (WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
+ * css/CSSValue.cpp:
+ (WebCore::CSSValue::cssText):
+ (WebCore::CSSValue::destroy):
+ * css/CSSValue.h:
+ (WebCore::CSSValue::isPendingSubstitutionValue):
+ * css/CSSValueKeywords.in:
+ * css/StylePropertyShorthand.cpp:
+ (WebCore::transitionShorthandForParsing):
+ * css/StylePropertyShorthand.h:
+ * css/parser/CSSParser.cpp:
+ (WebCore::CSSParser::completeURL):
+ * css/parser/CSSParserImpl.cpp:
+ (WebCore::CSSParserImpl::parseValue):
+ (WebCore::CSSParserImpl::consumeDeclaration):
+ (WebCore::CSSParserImpl::consumeDeclarationValue):
+ * css/parser/CSSParserMode.h:
+ (WebCore::CSSParserContext::completeURL):
+ * css/parser/CSSParserToken.cpp:
+ (WebCore::CSSParserToken::parseAsCSSPropertyID):
+ (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
+ * css/parser/CSSParserToken.h:
+ * css/parser/CSSPropertyParser.cpp:
+ (WebCore::cssPropertyID):
+ (WebCore::CSSPropertyParser::addProperty):
+ (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
+ (WebCore::CSSPropertyParser::parseValue):
+ (WebCore::CSSPropertyParser::parseSingleValue):
+ (WebCore::CSSPropertyParser::parseValueStart):
+ (WebCore::CSSPropertyParser::consumeCSSWideKeyword):
+ (WebCore::consumeTransformOrigin):
+ (WebCore::consumeWillChange):
+ (WebCore::consumeFontFeatureTag):
+ (WebCore::consumeFontFeatureSettings):
+ (WebCore::consumePage):
+ (WebCore::consumeQuotes):
+ (WebCore::FontVariantLigaturesParser::consumeLigature):
+ (WebCore::FontVariantLigaturesParser::finalizeValue):
+ (WebCore::consumeFontVariantLigatures):
+ (WebCore::consumeFontVariantCaps):
+ (WebCore::FontVariantNumericParser::consumeNumeric):
+ (WebCore::FontVariantNumericParser::finalizeValue):
+ (WebCore::consumeFontVariantNumeric):
+ (WebCore::consumeFontVariantCSS21):
+ (WebCore::consumeFontVariantList):
+ (WebCore::consumeFontWeight):
+ (WebCore::consumeFamilyName):
+ (WebCore::consumeGenericFamily):
+ (WebCore::consumeFontFamily):
+ (WebCore::consumeSpacing):
+ (WebCore::consumeTabSize):
+ (WebCore::consumeTextSizeAdjust):
+ (WebCore::consumeFontSize):
+ (WebCore::consumeLineHeight):
+ (WebCore::createPrimitiveValuePair):
+ (WebCore::consumeCounter):
+ (WebCore::consumePageSize):
+ (WebCore::consumeSize):
+ (WebCore::consumeTextIndent):
+ (WebCore::validWidthOrHeightKeyword):
+ (WebCore::consumeMaxWidthOrHeight):
+ (WebCore::consumeWidthOrHeight):
+ (WebCore::consumeMarginOrOffset):
+ (WebCore::consumeClipComponent):
+ (WebCore::consumeClip):
+ (WebCore::consumeTouchAction):
+ (WebCore::consumeLineClamp):
+ (WebCore::consumeLocale):
+ (WebCore::consumeColumnWidth):
+ (WebCore::consumeColumnCount):
+ (WebCore::consumeColumnGap):
+ (WebCore::consumeColumnSpan):
+ (WebCore::consumeZoom):
+ (WebCore::consumeAnimationIterationCount):
+ (WebCore::consumeAnimationName):
+ (WebCore::consumeTransitionProperty):
+ (WebCore::consumeCubicBezier):
+ (WebCore::consumeAnimationTimingFunction):
+ (WebCore::consumeAnimationValue):
+ (WebCore::isValidAnimationPropertyList):
+ (WebCore::consumeAnimationPropertyList):
+ (WebCore::CSSPropertyParser::consumeAnimationShorthand):
+ (WebCore::consumeZIndex):
+ (WebCore::parseSingleShadow):
+ (WebCore::consumeShadow):
+ (WebCore::consumeFilterFunction):
+ (WebCore::consumeFilter):
+ (WebCore::consumeTextDecorationLine):
+ (WebCore::consumeTextEmphasisStyle):
+ (WebCore::consumeOutlineColor):
+ (WebCore::consumeLineWidth):
+ (WebCore::consumeBorderWidth):
+ (WebCore::consumeTextStrokeWidth):
+ (WebCore::consumeColumnRuleWidth):
+ (WebCore::consumeTranslate3d):
+ (WebCore::consumeNumbers):
+ (WebCore::consumePerspective):
+ (WebCore::consumeTransformValue):
+ (WebCore::consumeTransform):
+ (WebCore::consumePositionLonghand):
+ (WebCore::consumePositionX):
+ (WebCore::consumePositionY):
+ (WebCore::consumePaintStroke):
+ (WebCore::consumePaintOrder):
+ (WebCore::consumeNoneOrURI):
+ (WebCore::consumeFlexBasis):
+ (WebCore::consumeStrokeDasharray):
+ (WebCore::consumeBaselineShift):
+ (WebCore::consumeRxOrRy):
+ (WebCore::consumeCursor):
+ (WebCore::consumeAttr):
+ (WebCore::consumeCounterContent):
+ (WebCore::consumeContent):
+ (WebCore::consumePositionList):
+ (WebCore::consumeScrollSnapCoordinate):
+ (WebCore::consumeScrollSnapPoints):
+ (WebCore::consumeBorderRadiusCorner):
+ (WebCore::consumeVerticalAlign):
+ (WebCore::consumeShapeRadius):
+ (WebCore::consumeBasicShapeCircle):
+ (WebCore::consumeBasicShapeEllipse):
+ (WebCore::consumeBasicShapePolygon):
+ (WebCore::complete4Sides):
+ (WebCore::consumeRadii):
+ (WebCore::consumeBasicShapeInset):
+ (WebCore::consumeBasicShape):
+ (WebCore::consumeWebkitClipPath):
+ (WebCore::consumeShapeOutside):
+ (WebCore::consumeContentDistributionOverflowPosition):
+ (WebCore::consumeBorderImageRepeatKeyword):
+ (WebCore::consumeBorderImageRepeat):
+ (WebCore::consumeBorderImageSlice):
+ (WebCore::consumeBorderImageOutset):
+ (WebCore::consumeBorderImageWidth):
+ (WebCore::consumeBorderImageComponents):
+ (WebCore::consumeWebkitBorderImage):
+ (WebCore::consumeReflect):
+ (WebCore::consumeImageOrientation):
+ (WebCore::consumeBackgroundBlendMode):
+ (WebCore::consumeBackgroundAttachment):
+ (WebCore::consumeBackgroundBox):
+ (WebCore::consumeBackgroundComposite):
+ (WebCore::consumePrefixedBackgroundBox):
+ (WebCore::consumeBackgroundSize):
+ (WebCore::consumeGridAutoFlow):
+ (WebCore::consumeBackgroundComponent):
+ (WebCore::addBackgroundValue):
+ (WebCore::consumeCommaSeparatedBackgroundComponent):
+ (WebCore::consumeSelfPositionKeyword):
+ (WebCore::consumeSelfPositionOverflowPosition):
+ (WebCore::consumeAlignItems):
+ (WebCore::consumeJustifyItems):
+ (WebCore::consumeFitContent):
+ (WebCore::consumeCustomIdentForGridLine):
+ (WebCore::consumeGridLine):
+ (WebCore::isGridTrackFixedSized):
+ (WebCore::consumeGridBreadth):
+ (WebCore::consumeGridTrackSize):
+ (WebCore::consumeGridLineNames):
+ (WebCore::consumeGridTrackRepeatFunction):
+ (WebCore::consumeGridTrackList):
+ (WebCore::consumeGridTemplatesRowsOrColumns):
+ (WebCore::consumeGridTemplateAreas):
+ (WebCore::consumeFontFaceUnicodeRange):
+ (WebCore::consumeFontFaceSrcURI):
+ (WebCore::consumeFontFaceSrcLocal):
+ (WebCore::consumeFontFaceSrc):
+ (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
+ (WebCore::CSSPropertyParser::consumeSystemFont):
+ (WebCore::CSSPropertyParser::consumeFont):
+ (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
+ (WebCore::CSSPropertyParser::consumeBorderSpacing):
+ (WebCore::consumeSingleViewportDescriptor):
+ (WebCore::CSSPropertyParser::parseViewportDescriptor):
+ (WebCore::consumeColumnWidthOrCount):
+ (WebCore::CSSPropertyParser::consumeColumns):
+ (WebCore::CSSPropertyParser::consumeShorthandGreedily):
+ (WebCore::CSSPropertyParser::consumeFlex):
+ (WebCore::CSSPropertyParser::consumeBorder):
+ (WebCore::CSSPropertyParser::consume4Values):
+ (WebCore::CSSPropertyParser::consumeBorderImage):
+ (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
+ (WebCore::consumeBackgroundPosition):
+ (WebCore::consumeRepeatStyleComponent):
+ (WebCore::consumeRepeatStyle):
+ (WebCore::CSSPropertyParser::consumeBackgroundShorthand):
+ (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
+ (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
+ (WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
+ (WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
+ (WebCore::CSSPropertyParser::consumeGridShorthand):
+ (WebCore::CSSPropertyParser::parseShorthand):
+ (WebCore::unresolvedCSSPropertyID): Deleted.
+ * css/parser/CSSPropertyParser.h:
+ * css/parser/CSSPropertyParserHelpers.cpp:
+ (WebCore::CSSPropertyParserHelpers::consumeIdent):
+ (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
+ (WebCore::CSSPropertyParserHelpers::consumeString):
+ (WebCore::CSSPropertyParserHelpers::consumeImageSet):
+ * css/parser/CSSPropertyParserHelpers.h:
+
</ins><span class="cx"> 2016-10-18 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Correct Document::removeAllEventListeners
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -3387,6 +3387,8 @@
</span><span class="cx">                 93FDAFCA0B11307400E2746F /* EditorInsertAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDAFC90B11307400E2746F /* EditorInsertAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 9418278A1D8B244000492764 /* StyleColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 941827881D8B242200492764 /* StyleColor.cpp */; };
</span><span class="cx">                 9418278B1D8B244000492764 /* StyleColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 941827891D8B242200492764 /* StyleColor.h */; };
</span><ins>+                9418278E1D8CAF9200492764 /* CSSPendingSubstitutionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9418278C1D8CAE9500492764 /* CSSPendingSubstitutionValue.cpp */; };
+                9418278F1D8CAF9200492764 /* CSSPendingSubstitutionValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9418278D1D8CAE9500492764 /* CSSPendingSubstitutionValue.h */; };
</ins><span class="cx">                 9444CBD31D860C8B0073A074 /* SizesCalcParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBD01D860C740073A074 /* SizesCalcParser.cpp */; };
</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="lines">@@ -10739,6 +10741,8 @@
</span><span class="cx">                 93FDAFC90B11307400E2746F /* EditorInsertAction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EditorInsertAction.h; sourceTree = "<group>"; };
</span><span class="cx">                 941827881D8B242200492764 /* StyleColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleColor.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 941827891D8B242200492764 /* StyleColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleColor.h; sourceTree = "<group>"; };
</span><ins>+                9418278C1D8CAE9500492764 /* CSSPendingSubstitutionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPendingSubstitutionValue.cpp; sourceTree = "<group>"; };
+                9418278D1D8CAE9500492764 /* CSSPendingSubstitutionValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPendingSubstitutionValue.h; sourceTree = "<group>"; };
</ins><span class="cx">                 9444CBCF1D860C740073A074 /* SizesCalcParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SizesCalcParser.h; path = parser/SizesCalcParser.h; sourceTree = "<group>"; };
</span><span class="cx">                 9444CBD01D860C740073A074 /* SizesCalcParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SizesCalcParser.cpp; path = parser/SizesCalcParser.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 9444CBD11D860C740073A074 /* SizesAttributeParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SizesAttributeParser.h; path = parser/SizesAttributeParser.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -22832,6 +22836,8 @@
</span><span class="cx">                                 A80E6CCB0A1989CA007FB8C5 /* CSSPageRule.cpp */,
</span><span class="cx">                                 A80E6CD60A1989CA007FB8C5 /* CSSPageRule.h */,
</span><span class="cx">                                 85C56CA60AA89D5F00D95755 /* CSSPageRule.idl */,
</span><ins>+                                9418278C1D8CAE9500492764 /* CSSPendingSubstitutionValue.cpp */,
+                                9418278D1D8CAE9500492764 /* CSSPendingSubstitutionValue.h */,
</ins><span class="cx">                                 A80E6CDB0A1989CA007FB8C5 /* CSSPrimitiveValue.cpp */,
</span><span class="cx">                                 A80E6CBC0A1989CA007FB8C5 /* CSSPrimitiveValue.h */,
</span><span class="cx">                                 9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */,
</span><span class="lines">@@ -26431,6 +26437,7 @@
</span><span class="cx">                                 297BE3D516C03C08003316BD /* PlatformSpeechSynthesisUtterance.h in Headers */,
</span><span class="cx">                                 297BE3D616C03C0B003316BD /* PlatformSpeechSynthesisVoice.h in Headers */,
</span><span class="cx">                                 297BE3D716C03C0E003316BD /* PlatformSpeechSynthesizer.h in Headers */,
</span><ins>+                                9418278F1D8CAF9200492764 /* CSSPendingSubstitutionValue.h in Headers */,
</ins><span class="cx">                                 1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */,
</span><span class="cx">                                 0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */,
</span><span class="cx">                                 074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */,
</span><span class="lines">@@ -30920,6 +30927,7 @@
</span><span class="cx">                                 AAA728F816D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm in Sources */,
</span><span class="cx">                                 AA478A8016CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.mm in Sources */,
</span><span class="cx">                                 2D3EF4491917915C00034184 /* WebActionDisablingCALayerDelegate.mm in Sources */,
</span><ins>+                                9418278E1D8CAF9200492764 /* CSSPendingSubstitutionValue.cpp in Sources */,
</ins><span class="cx">                                 120DE3ED1C86CA3E00B6D4DD /* WebAnimation.cpp in Sources */,
</span><span class="cx">                                 07D637411BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.mm in Sources */,
</span><span class="cx">                                 CDA29A311CBF74DA00901CCF /* WebAVPlayerController.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFunctionValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFunctionValue.h (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFunctionValue.h        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/CSSFunctionValue.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx"> String customCSSText() const;
</span><span class="cx">
</span><span class="cx"> bool equals(const CSSFunctionValue&) const;
</span><ins>+
+ CSSValueID name() const { return m_name; }
</ins><span class="cx">
</span><span class="cx"> CSSValueList* arguments() const { return m_args.get(); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPendingSubstitutionValuecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSPendingSubstitutionValue.cpp (0 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPendingSubstitutionValue.cpp         (rev 0)
+++ trunk/Source/WebCore/css/CSSPendingSubstitutionValue.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -0,0 +1,40 @@
</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
+// "AS IS" 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 "config.h"
+#include "CSSPendingSubstitutionValue.h"
+
+namespace WebCore {
+
+String CSSPendingSubstitutionValue::customCSSText() const
+{
+ return "";
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSPendingSubstitutionValueh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSPendingSubstitutionValue.h (0 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPendingSubstitutionValue.h         (rev 0)
+++ trunk/Source/WebCore/css/CSSPendingSubstitutionValue.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -0,0 +1,73 @@
</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
+// "AS IS" 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 "CSSPropertyNames.h"
+#include "CSSValue.h"
+#include "CSSVariableReferenceValue.h"
+
+namespace WebCore {
+
+class CSSPendingSubstitutionValue : public CSSValue {
+public:
+ static Ref<CSSPendingSubstitutionValue> create(CSSPropertyID shorthandPropertyId, Ref<CSSVariableReferenceValue>&& shorthandValue)
+ {
+ return adoptRef(*new CSSPendingSubstitutionValue(shorthandPropertyId, WTFMove(shorthandValue)));
+ }
+
+ CSSVariableReferenceValue* shorthandValue() const
+ {
+ return m_shorthandValue.get();
+ }
+
+ CSSPropertyID shorthandPropertyId() const
+ {
+ return m_shorthandPropertyId;
+ }
+
+ bool equals(const CSSPendingSubstitutionValue& other) const { return m_shorthandValue == other.m_shorthandValue; }
+ String customCSSText() const;
+
+private:
+ CSSPendingSubstitutionValue(CSSPropertyID shorthandPropertyId, Ref<CSSVariableReferenceValue>&& shorthandValue)
+ : CSSValue(PendingSubstitutionValueClass)
+ , m_shorthandPropertyId(shorthandPropertyId)
+ , m_shorthandValue(WTFMove(shorthandValue))
+ {
+ }
+
+ CSSPropertyID m_shorthandPropertyId;
+ RefPtr<CSSVariableReferenceValue> m_shorthandValue;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSPendingSubstitutionValue, isPendingSubstitutionValue())
+
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.cpp (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.cpp        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/CSSValue.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> #include "CSSInitialValue.h"
</span><span class="cx"> #include "CSSLineBoxContainValue.h"
</span><span class="cx"> #include "CSSNamedImageValue.h"
</span><ins>+#include "CSSPendingSubstitutionValue.h"
</ins><span class="cx"> #include "CSSPrimitiveValue.h"
</span><span class="cx"> #include "CSSProperty.h"
</span><span class="cx"> #include "CSSReflectValue.h"
</span><span class="lines">@@ -365,6 +366,8 @@
</span><span class="cx"> return downcast<CSSCustomIdentValue>(*this).customCSSText();
</span><span class="cx"> case VariableReferenceClass:
</span><span class="cx"> return downcast<CSSVariableReferenceValue>(*this).customCSSText();
</span><ins>+ case PendingSubstitutionValueClass:
+ return downcast<CSSPendingSubstitutionValue>(*this).customCSSText();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -522,6 +525,9 @@
</span><span class="cx"> case VariableReferenceClass:
</span><span class="cx"> delete downcast<CSSVariableReferenceValue>(this);
</span><span class="cx"> return;
</span><ins>+ case PendingSubstitutionValueClass:
+ delete downcast<CSSPendingSubstitutionValue>(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 (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.h        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/CSSValue.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -129,6 +129,7 @@
</span><span class="cx"> bool isCustomPropertyDeclaration() const { return m_classType == CustomPropertyDeclarationClass; }
</span><span class="cx"> bool isCustomIdentValue() const { return m_classType == CustomIdentClass; }
</span><span class="cx"> bool isVariableReferenceValue() const { return m_classType == VariableReferenceClass; }
</span><ins>+ bool isPendingSubstitutionValue() const { return m_classType == PendingSubstitutionValueClass; }
</ins><span class="cx">
</span><span class="cx"> bool isCSSOMSafe() const { return m_isCSSOMSafe; }
</span><span class="cx"> bool isSubtypeExposedToCSSOM() const
</span><span class="lines">@@ -210,6 +211,7 @@
</span><span class="cx"> CustomPropertyDeclarationClass,
</span><span class="cx"> CustomIdentClass,
</span><span class="cx"> VariableReferenceClass,
</span><ins>+ PendingSubstitutionValueClass,
</ins><span class="cx">
</span><span class="cx"> // List class types must appear after ValueListClass.
</span><span class="cx"> ValueListClass,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -1195,6 +1195,8 @@
</span><span class="cx"> blur
</span><span class="cx"> drop-shadow
</span><span class="cx"> url
</span><ins>+cubic-bezier
+steps
</ins><span class="cx">
</span><span class="cx"> // colors
</span><span class="cx"> rgb
</span><span class="lines">@@ -1249,6 +1251,9 @@
</span><span class="cx"> // grid-{column-start|column-end|row-start|row-end}
</span><span class="cx"> span
</span><span class="cx">
</span><ins>+// grid-template-{columns|rows}
+minmax
+
</ins><span class="cx"> // grid-auto-flow
</span><span class="cx"> auto-flow
</span><span class="cx"> dense
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertyShorthandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StylePropertyShorthand.cpp (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StylePropertyShorthand.cpp        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -50,6 +50,16 @@
</span><span class="cx"> return StylePropertyShorthand(CSSPropertyAnimation, animationPropertiesForParsing);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+StylePropertyShorthand transitionShorthandForParsing()
+{
+ // Similar to animations, we have property after timing-function and delay after
+ // duration.
+ static const CSSPropertyID transitionProperties[] = {
+ CSSPropertyTransitionDuration, CSSPropertyTransitionTimingFunction,
+ CSSPropertyTransitionDelay, CSSPropertyTransitionProperty};
+ return StylePropertyShorthand(CSSPropertyTransition, transitionProperties);
+}
+
</ins><span class="cx"> bool isShorthandCSSProperty(CSSPropertyID id)
</span><span class="cx"> {
</span><span class="cx"> return shorthandForProperty(id).length();
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertyShorthandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StylePropertyShorthand.h (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StylePropertyShorthand.h        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">
</span><span class="cx"> // Custom StylePropertyShorthand functions.
</span><span class="cx"> StylePropertyShorthand animationShorthandForParsing();
</span><ins>+StylePropertyShorthand transitionShorthandForParsing();
</ins><span class="cx"> StylePropertyShorthand borderAbridgedShorthand();
</span><span class="cx">
</span><span class="cx"> // Returns empty value if the property is not a shorthand.
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -1554,16 +1554,12 @@
</span><span class="cx">
</span><span class="cx"> URL CSSParser::completeURL(const CSSParserContext& context, const String& url)
</span><span class="cx"> {
</span><del>- if (url.isNull())
- return URL();
- if (context.charset.isEmpty())
- return URL(context.baseURL, url);
- return URL(context.baseURL, url, context.charset);
</del><ins>+ return context.completeURL(url);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> URL CSSParser::completeURL(const String& url) const
</span><span class="cx"> {
</span><del>- return completeURL(m_context, url);
</del><ins>+ return m_context.completeURL(url);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSParser::validateCalculationUnit(ValueWithCalculation& valueWithCalculation, Units unitFlags)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSParserImpl::parseValue(MutableStyleProperties* declaration, CSSPropertyID unresolvedProperty, const String& string, bool important, const CSSParserContext& context)
</del><ins>+bool CSSParserImpl::parseValue(MutableStyleProperties* declaration, CSSPropertyID propertyID, const String& string, bool important, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> CSSParserImpl parser(context);
</span><span class="cx"> StyleRule::Type ruleType = StyleRule::Style;
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> ruleType = StyleRule::Viewport;
</span><span class="cx"> #endif
</span><span class="cx"> CSSTokenizer::Scope scope(string);
</span><del>- parser.consumeDeclarationValue(scope.tokenRange(), unresolvedProperty, important, ruleType);
</del><ins>+ parser.consumeDeclarationValue(scope.tokenRange(), propertyID, important, ruleType);
</ins><span class="cx"> if (parser.m_parsedProperties.isEmpty())
</span><span class="cx"> return false;
</span><span class="cx"> return declaration->addParsedProperties(parser.m_parsedProperties);
</span><span class="lines">@@ -757,7 +757,7 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(range.peek().type() == IdentToken);
</span><span class="cx"> const CSSParserToken& token = range.consumeIncludingWhitespace();
</span><del>- CSSPropertyID unresolvedProperty = token.parseAsUnresolvedCSSPropertyID();
</del><ins>+ CSSPropertyID propertyID = token.parseAsCSSPropertyID();
</ins><span class="cx"> if (range.consume().type() != ColonToken)
</span><span class="cx"> return; // Parse error
</span><span class="cx">
</span><span class="lines">@@ -777,7 +777,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> size_t propertiesCount = m_parsedProperties.size();
</span><del>- if (unresolvedProperty == CSSPropertyInvalid && CSSVariableParser::isValidVariableName(token)) {
</del><ins>+ if (propertyID == CSSPropertyInvalid && CSSVariableParser::isValidVariableName(token)) {
</ins><span class="cx"> AtomicString variableName = token.value().toAtomicString();
</span><span class="cx"> consumeVariableValue(range.makeSubRange(&range.peek(), declarationValueEnd), variableName, important);
</span><span class="cx"> }
</span><span class="lines">@@ -785,8 +785,8 @@
</span><span class="cx"> if (important && (ruleType == StyleRule::FontFace || ruleType == StyleRule::Keyframe))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (unresolvedProperty != CSSPropertyInvalid)
- consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEnd), unresolvedProperty, important, ruleType);
</del><ins>+ if (propertyID != CSSPropertyInvalid)
+ consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEnd), propertyID, important, ruleType);
</ins><span class="cx">
</span><span class="cx"> if (m_observerWrapper && (ruleType == StyleRule::Style || ruleType == StyleRule::Keyframe)) {
</span><span class="cx"> m_observerWrapper->observer().observeProperty(
</span><span class="lines">@@ -801,9 +801,9 @@
</span><span class="cx"> m_parsedProperties.append(CSSProperty(CSSPropertyCustom, WTFMove(value), important));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSPropertyID unresolvedProperty, bool important, StyleRule::Type ruleType)
</del><ins>+void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSPropertyID propertyID, bool important, StyleRule::Type ruleType)
</ins><span class="cx"> {
</span><del>- CSSPropertyParser::parseValue(unresolvedProperty, important, range, m_context, m_parsedProperties, ruleType);
</del><ins>+ CSSPropertyParser::parseValue(propertyID, important, range, m_context, m_parsedProperties, ruleType);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<Vector<double>> CSSParserImpl::consumeKeyframeKeyList(CSSParserTokenRange range)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserModeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserMode.h (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserMode.h        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSParserMode.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #ifndef CSSParserMode_h
</span><span class="cx"> #define CSSParserMode_h
</span><span class="cx">
</span><ins>+#include "TextEncoding.h"
</ins><span class="cx"> #include "URL.h"
</span><span class="cx"> #include "URLHash.h"
</span><span class="cx"> #include <wtf/HashFunctions.h>
</span><span class="lines">@@ -107,6 +108,16 @@
</span><span class="cx"> bool useLegacyBackgroundSizeShorthandBehavior { false };
</span><span class="cx"> bool springTimingFunctionEnabled { false };
</span><span class="cx"> bool useNewParser { false };
</span><ins>+
+ URL completeURL(const String& url) const
+ {
+ if (url.isNull())
+ return URL();
+ if (charset.isEmpty())
+ return URL(baseURL, url);
+ return URL(baseURL, url, TextEncoding(charset));
+ }
+
</ins><span class="cx"> #if ENABLE(VARIATION_FONTS)
</span><span class="cx"> bool variationFontsEnabled { false };
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserTokencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserToken.cpp (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserToken.cpp        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSParserToken.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -296,10 +296,10 @@
</span><span class="cx"> return m_numericValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CSSPropertyID CSSParserToken::parseAsUnresolvedCSSPropertyID() const
</del><ins>+CSSPropertyID CSSParserToken::parseAsCSSPropertyID() const
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_type == IdentToken);
</span><del>- return unresolvedCSSPropertyID(value());
</del><ins>+ return cssPropertyID(value());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CSSValueID CSSParserToken::id() const
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserTokenh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserToken.h (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserToken.h        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSParserToken.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx">
</span><span class="cx"> bool hasStringBacking() const;
</span><span class="cx">
</span><del>- CSSPropertyID parseAsUnresolvedCSSPropertyID() const;
</del><ins>+ CSSPropertyID parseAsCSSPropertyID() const;
</ins><span class="cx">
</span><span class="cx"> void serialize(StringBuilder&) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -32,11 +32,11 @@
</span><span class="cx">
</span><span class="cx"> #include "CSSBasicShapes.h"
</span><span class="cx"> #include "CSSBorderImage.h"
</span><ins>+#include "CSSBorderImageSliceValue.h"
</ins><span class="cx"> #include "CSSContentDistributionValue.h"
</span><span class="cx"> #include "CSSCursorImageValue.h"
</span><del>-// FIXME-NEWPARSER #include "CSSCustomIdentValue.h"
</del><ins>+#include "CSSCustomIdentValue.h"
</ins><span class="cx"> #include "CSSFontFaceSrcValue.h"
</span><del>-// FIXME-NEWPARSER #include "CSSFontFamilyValue.h"
</del><span class="cx"> #include "CSSFontFeatureValue.h"
</span><span class="cx"> #include "CSSFunctionValue.h"
</span><span class="cx"> #include "CSSGridAutoRepeatValue.h"
</span><span class="lines">@@ -46,31 +46,33 @@
</span><span class="cx"> #include "CSSInitialValue.h"
</span><span class="cx"> #include "CSSParserFastPaths.h"
</span><span class="cx"> #include "CSSParserIdioms.h"
</span><del>-// FIXME-NEWPARSER #include "CSSPathValue.h"
-// FIXME-NEWPARSER #include "CSSPendingSubstitutionValue.h"
</del><ins>+#include "CSSPendingSubstitutionValue.h"
</ins><span class="cx"> #include "CSSPrimitiveValueMappings.h"
</span><span class="cx"> #include "CSSPropertyParserHelpers.h"
</span><del>-// FIXME-NEWPARSER #include "CSSQuadValue.h"
</del><span class="cx"> #include "CSSReflectValue.h"
</span><ins>+#include "CSSRevertValue.h"
</ins><span class="cx"> #include "CSSShadowValue.h"
</span><del>-// FIXME-NEWPARSER #include "CSSStringValue.h"
</del><span class="cx"> #include "CSSTimingFunctionValue.h"
</span><del>-// FIXME-NEWPARSER #include "CSSURIValue.h"
</del><span class="cx"> #include "CSSUnicodeRangeValue.h"
</span><span class="cx"> #include "CSSUnsetValue.h"
</span><del>-// FIXME-NEWPARSER #include "CSSValuePair.h"
-// FIXME-NEWPARSER #include "CSSVariableReferenceValue.h"
-// FIXME-NEWPARSER #include "CSSVariableParser.h"
</del><ins>+#include "CSSVariableParser.h"
+#include "CSSVariableReferenceValue.h"
</ins><span class="cx"> #include "Counter.h"
</span><span class="cx"> #include "FontFace.h"
</span><span class="cx"> #include "HashTools.h"
</span><ins>+// FIXME-NEWPARSER: Replace Pair and Rect with actual CSSValue subclasses (CSSValuePair and CSSQuadValue).
+#include "Pair.h"
+#include "Rect.h"
</ins><span class="cx"> #include "RenderTheme.h"
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="cx"> #include "SVGPathUtilities.h"
</span><span class="cx"> #include "StylePropertyShorthand.h"
</span><ins>+#include "StylePropertyShorthandFunctions.h"
</ins><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><ins>+using namespace WTF;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> static bool hasPrefix(const char* string, unsigned length, const char* prefix)
</span><span class="lines">@@ -181,7 +183,7 @@
</span><span class="cx"> return string.is8Bit() ? cssValueKeywordID(string.characters8(), length) : cssValueKeywordID(string.characters16(), length);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CSSPropertyID unresolvedCSSPropertyID(StringView string)
</del><ins>+CSSPropertyID cssPropertyID(StringView string)
</ins><span class="cx"> {
</span><span class="cx"> unsigned length = string.length();
</span><span class="cx">
</span><span class="lines">@@ -193,12 +195,8 @@
</span><span class="cx"> return string.is8Bit() ? cssPropertyID(string.characters8(), length) : cssPropertyID(string.characters16(), length);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME-NEWPARSER
-// Comment out property parsing for now.
-/*
</del><span class="cx"> using namespace CSSPropertyParserHelpers;
</span><span class="cx">
</span><del>-
</del><span class="cx"> CSSPropertyParser::CSSPropertyParser(const CSSParserTokenRange& range,
</span><span class="cx"> const CSSParserContext& context, Vector<CSSProperty, 256>* parsedProperties)
</span><span class="cx"> : m_range(range)
</span><span class="lines">@@ -208,25 +206,22 @@
</span><span class="cx"> m_range.consumeWhitespace();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSPropertyParser::addProperty(CSSPropertyID property, CSSPropertyID currentShorthand, const CSSValue& value, bool important, bool implicit)
</del><ins>+void CSSPropertyParser::addProperty(CSSPropertyID property, CSSPropertyID currentShorthand, Ref<CSSValue>&& value, bool important, bool implicit)
</ins><span class="cx"> {
</span><del>- ASSERT(!isPropertyAlias(property));
-
</del><span class="cx"> int shorthandIndex = 0;
</span><span class="cx"> bool setFromShorthand = false;
</span><span class="cx">
</span><span class="cx"> if (currentShorthand) {
</span><del>- Vector<StylePropertyShorthand, 4> shorthands;
- getMatchingShorthandsForLonghand(property, &shorthands);
</del><ins>+ auto shorthands = matchingShorthandsForLonghand(property);
</ins><span class="cx"> setFromShorthand = true;
</span><span class="cx"> if (shorthands.size() > 1)
</span><span class="cx"> shorthandIndex = indexOfShorthandForLonghand(currentShorthand, shorthands);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- m_parsedProperties->append(CSSProperty(property, value, important, setFromShorthand, shorthandIndex, implicit));
</del><ins>+ m_parsedProperties->append(CSSProperty(property, WTFMove(value), important, setFromShorthand, shorthandIndex, implicit));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID property, const CSSValue& value, bool important)
</del><ins>+void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID property, Ref<CSSValue>&& value, bool important)
</ins><span class="cx"> {
</span><span class="cx"> const StylePropertyShorthand& shorthand = shorthandForProperty(property);
</span><span class="cx"> unsigned shorthandLength = shorthand.length();
</span><span class="lines">@@ -233,84 +228,71 @@
</span><span class="cx"> ASSERT(shorthandLength);
</span><span class="cx"> const CSSPropertyID* longhands = shorthand.properties();
</span><span class="cx"> for (unsigned i = 0; i < shorthandLength; ++i)
</span><del>- addProperty(longhands[i], property, value, important);
</del><ins>+ addProperty(longhands[i], property, WTFMove(value), important);
</ins><span class="cx"> }
</span><del>-*/
</del><span class="cx">
</span><del>-bool CSSPropertyParser::parseValue(CSSPropertyID /*unresolvedProperty*/, bool /*important*/,
- const CSSParserTokenRange& /*range*/, const CSSParserContext& /*context*/,
- ParsedPropertyVector& /*parsedProperties*/, StyleRule::Type /*ruleType*/)
</del><ins>+bool CSSPropertyParser::parseValue(CSSPropertyID propertyID, bool important,
+ const CSSParserTokenRange& range, const CSSParserContext& context,
+ ParsedPropertyVector& parsedProperties, StyleRule::Type ruleType)
</ins><span class="cx"> {
</span><del>- return false;
-
- /*
</del><span class="cx"> int parsedPropertiesSize = parsedProperties.size();
</span><span class="cx">
</span><span class="cx"> CSSPropertyParser parser(range, context, &parsedProperties);
</span><del>- CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty);
</del><span class="cx"> bool parseSuccess;
</span><span class="cx">
</span><del>- if (ruleType == StyleRule::Viewport) {
- parseSuccess = (RuntimeEnabledFeatures::cssViewportEnabled() || isUASheetBehavior(context.mode()))
- && parser.parseViewportDescriptor(resolvedProperty, important);
- } else if (ruleType == StyleRule::FontFace) {
- parseSuccess = parser.parseFontFaceDescriptor(resolvedProperty);
- } else {
- parseSuccess = parser.parseValueStart(unresolvedProperty, important);
- }
</del><ins>+#if ENABLE(CSS_DEVICE_ADAPTATION)
+ if (ruleType == StyleRule::Viewport)
+ parseSuccess = parser.parseViewportDescriptor(propertyID, important);
+ else
+#endif
+ if (ruleType == StyleRule::FontFace)
+ parseSuccess = parser.parseFontFaceDescriptor(propertyID);
+ else
+ parseSuccess = parser.parseValueStart(propertyID, important);
</ins><span class="cx">
</span><del>- // This doesn't count UA style sheets
- if (parseSuccess && context.useCounter())
- context.useCounter()->count(context.mode(), unresolvedProperty);
-
</del><span class="cx"> if (!parseSuccess)
</span><span class="cx"> parsedProperties.shrink(parsedPropertiesSize);
</span><span class="cx">
</span><span class="cx"> return parseSuccess;
</span><del>- */
</del><span class="cx"> }
</span><del>-/*
-const CSSValue* CSSPropertyParser::parseSingleValue(
- CSSPropertyID property, const CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+
+RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, const CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> CSSPropertyParser parser(range, context, nullptr);
</span><del>- const CSSValue* value = parser.parseSingleValue(property);
</del><ins>+ RefPtr<CSSValue> value = parser.parseSingleValue(property);
</ins><span class="cx"> if (!value || !parser.m_range.atEnd())
</span><span class="cx"> return nullptr;
</span><span class="cx"> return value;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSPropertyParser::parseValueStart(CSSPropertyID unresolvedProperty, bool important)
</del><ins>+bool CSSPropertyParser::parseValueStart(CSSPropertyID propertyID, bool important)
</ins><span class="cx"> {
</span><del>- if (consumeCSSWideKeyword(unresolvedProperty, important))
</del><ins>+ if (consumeCSSWideKeyword(propertyID, important))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> CSSParserTokenRange originalRange = m_range;
</span><del>- CSSPropertyID propertyId = resolveCSSPropertyID(unresolvedProperty);
- bool isShorthand = isShorthandProperty(propertyId);
</del><ins>+ bool isShorthand = isShorthandCSSProperty(propertyID);
</ins><span class="cx">
</span><span class="cx"> if (isShorthand) {
</span><span class="cx"> // Variable references will fail to parse here and will fall out to the variable ref parser below.
</span><del>- if (parseShorthand(unresolvedProperty, important))
</del><ins>+ if (parseShorthand(propertyID, important))
</ins><span class="cx"> return true;
</span><span class="cx"> } else {
</span><del>- if (const CSSValue* parsedValue = parseSingleValue(unresolvedProperty)) {
- if (m_range.atEnd()) {
- addProperty(propertyId, CSSPropertyInvalid, *parsedValue, important);
- return true;
- }
</del><ins>+ RefPtr<CSSValue> parsedValue = parseSingleValue(propertyID);
+ if (parsedValue && m_range.atEnd()) {
+ addProperty(propertyID, CSSPropertyInvalid, *parsedValue, important);
+ return true;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::containsValidVariableReferences(originalRange)) {
- CSSVariableReferenceValue* variable = CSSVariableReferenceValue::create(CSSVariableData::create(originalRange));
</del><ins>+ if (CSSVariableParser::containsValidVariableReferences(originalRange)) {
+ RefPtr<CSSVariableReferenceValue> variable = CSSVariableReferenceValue::create(CSSVariableData::create(originalRange));
</ins><span class="cx">
</span><span class="cx"> if (isShorthand) {
</span><del>- const CSSPendingSubstitutionValue& pendingValue = *CSSPendingSubstitutionValue::create(propertyId, variable);
- addExpandedPropertyForValue(propertyId, pendingValue, important);
- } else {
- addProperty(propertyId, CSSPropertyInvalid, *variable, important);
- }
</del><ins>+ RefPtr<CSSPendingSubstitutionValue> pendingValue = CSSPendingSubstitutionValue::create(propertyID, variable.releaseNonNull());
+ addExpandedPropertyForValue(propertyID, pendingValue.releaseNonNull(), important);
+ } else
+ addProperty(propertyID, CSSPropertyInvalid, variable.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -317,48 +299,48 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSPropertyParser::consumeCSSWideKeyword(CSSPropertyID unresolvedProperty, bool important)
</del><ins>+bool CSSPropertyParser::consumeCSSWideKeyword(CSSPropertyID propertyID, bool important)
</ins><span class="cx"> {
</span><span class="cx"> CSSParserTokenRange rangeCopy = m_range;
</span><del>- CSSValueID id = rangeCopy.consumeIncludingWhitespace().id();
</del><ins>+ CSSValueID valueID = rangeCopy.consumeIncludingWhitespace().id();
</ins><span class="cx"> if (!rangeCopy.atEnd())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- CSSValue* value = nullptr;
- if (id == CSSValueInitial)
- value = CSSInitialValue::create();
- else if (id == CSSValueInherit)
- value = CSSInheritedValue::create();
- else if (id == CSSValueUnset)
- value = CSSUnsetValue::create();
</del><ins>+ RefPtr<CSSValue> value;
+ if (valueID == CSSValueInherit)
+ value = CSSValuePool::singleton().createInheritedValue();
+ else if (valueID == CSSValueInitial)
+ value = CSSValuePool::singleton().createExplicitInitialValue();
+ else if (valueID == CSSValueUnset)
+ value = CSSValuePool::singleton().createUnsetValue();
+ else if (valueID == CSSValueRevert)
+ value = CSSValuePool::singleton().createRevertValue();
</ins><span class="cx"> else
</span><span class="cx"> return false;
</span><del>-
- CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
- const StylePropertyShorthand& shorthand = shorthandForProperty(property);
</del><ins>+
+ const StylePropertyShorthand& shorthand = shorthandForProperty(propertyID);
</ins><span class="cx"> if (!shorthand.length()) {
</span><del>- if (CSSPropertyMetadata::isDescriptorOnly(unresolvedProperty))
</del><ins>+ if (CSSProperty::isDescriptorOnly(propertyID))
</ins><span class="cx"> return false;
</span><del>- addProperty(property, CSSPropertyInvalid, *value, important);
- } else {
- addExpandedPropertyForValue(property, *value, important);
- }
</del><ins>+ addProperty(propertyID, CSSPropertyInvalid, value.releaseNonNull(), important);
+ } else
+ addExpandedPropertyForValue(propertyID, value.releaseNonNull(), important);
</ins><span class="cx"> m_range = rangeCopy;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeTransformOrigin(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</del><ins>+static RefPtr<CSSValueList> consumeTransformOrigin(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</ins><span class="cx"> {
</span><del>- CSSValue* resultX = nullptr;
- CSSValue* resultY = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> resultX;
+ RefPtr<CSSPrimitiveValue> resultY;
</ins><span class="cx"> if (consumeOneOrTwoValuedPosition(range, cssParserMode, unitless, resultX, resultY)) {
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
- list->append(*resultX);
- list->append(*resultY);
- CSSValue* resultZ = consumeLength(range, cssParserMode, ValueRangeAll);
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ list->append(resultX.releaseNonNull());
+ list->append(resultY.releaseNonNull());
+ RefPtr<CSSPrimitiveValue> resultZ = consumeLength(range, cssParserMode, ValueRangeAll);
</ins><span class="cx"> if (!resultZ)
</span><del>- resultZ = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pixels);
- list->append(*resultZ);
</del><ins>+ resultZ = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitTypes::CSS_PX);
+ list->append(resultZ.releaseNonNull());
</ins><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -365,25 +347,24 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Methods for consuming non-shorthand properties starts here.
</span><del>-static CSSValue* consumeWillChange(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeWillChange(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* values = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
</ins><span class="cx"> // Every comma-separated list of identifiers is a valid will-change value,
</span><span class="cx"> // unless the list includes an explicitly disallowed identifier.
</span><span class="cx"> while (true) {
</span><span class="cx"> if (range.peek().type() != IdentToken)
</span><span class="cx"> return nullptr;
</span><del>- CSSPropertyID unresolvedProperty = unresolvedCSSPropertyID(range.peek().value());
- if (unresolvedProperty) {
- ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty));
</del><ins>+ CSSPropertyID propertyID = cssPropertyID(range.peek().value());
+ if (propertyID != CSSPropertyInvalid) {
</ins><span class="cx"> // Now "all" is used by both CSSValue and CSSPropertyValue.
</span><span class="cx"> // Need to return nullptr when currentValue is CSSPropertyAll.
</span><del>- if (unresolvedProperty == CSSPropertyWillChange || unresolvedProperty == CSSPropertyAll)
</del><ins>+ if (propertyID == CSSPropertyWillChange || propertyID == CSSPropertyAll)
</ins><span class="cx"> return nullptr;
</span><del>- values->append(*CSSCustomIdentValue::create(unresolvedProperty));
</del><ins>+ values->append(CSSCustomIdentValue::create(propertyID));
</ins><span class="cx"> range.consumeIncludingWhitespace();
</span><span class="cx"> } else {
</span><span class="cx"> switch (range.peek().id()) {
</span><span class="lines">@@ -396,7 +377,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> case CSSValueContents:
</span><span class="cx"> case CSSValueScrollPosition:
</span><del>- values->append(*consumeIdent(range));
</del><ins>+ values->append(consumeIdent(range).releaseNonNull());
</ins><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> range.consumeIncludingWhitespace();
</span><span class="lines">@@ -413,7 +394,7 @@
</span><span class="cx"> return values;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSFontFeatureValue* consumeFontFeatureTag(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSFontFeatureValue> consumeFontFeatureTag(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> // Feature tag name consists of 4-letter characters.
</span><span class="cx"> static const unsigned tagNameLength = 4;
</span><span class="lines">@@ -424,12 +405,14 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (token.value().length() != tagNameLength)
</span><span class="cx"> return nullptr;
</span><del>- AtomicString tag = token.value().toAtomicString();
- for (unsigned i = 0; i < tagNameLength; ++i) {
</del><ins>+
+ FontTag tag;
+ for (unsigned i = 0; i < tag.size(); ++i) {
</ins><span class="cx"> // Limits the range of characters to 0x20-0x7E, following the tag name rules defiend in the OpenType specification.
</span><del>- UChar character = tag[i];
</del><ins>+ UChar character = token.value()[i];
</ins><span class="cx"> if (character < 0x20 || character > 0x7E)
</span><span class="cx"> return nullptr;
</span><ins>+ tag[i] = toASCIILower(character);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> int tagValue = 1;
</span><span class="lines">@@ -441,24 +424,24 @@
</span><span class="cx"> } else if (range.peek().id() == CSSValueOn || range.peek().id() == CSSValueOff) {
</span><span class="cx"> tagValue = range.consumeIncludingWhitespace().id() == CSSValueOn;
</span><span class="cx"> }
</span><del>- return CSSFontFeatureValue::create(tag, tagValue);
</del><ins>+ return CSSFontFeatureValue::create(WTFMove(tag), tagValue);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFontFeatureSettings(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeFontFeatureSettings(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNormal)
</span><span class="cx"> return consumeIdent(range);
</span><del>- CSSValueList* settings = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> settings = CSSValueList::createCommaSeparated();
</ins><span class="cx"> do {
</span><del>- CSSFontFeatureValue* fontFeatureValue = consumeFontFeatureTag(range);
</del><ins>+ RefPtr<CSSFontFeatureValue> fontFeatureValue = consumeFontFeatureTag(range);
</ins><span class="cx"> if (!fontFeatureValue)
</span><span class="cx"> return nullptr;
</span><del>- settings->append(*fontFeatureValue);
</del><ins>+ settings->append(fontFeatureValue.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx"> return settings;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumePage(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumePage(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -465,16 +448,16 @@
</span><span class="cx"> return consumeCustomIdent(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeQuotes(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeQuotes(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><del>- CSSValueList* values = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> while (!range.atEnd()) {
</span><del>- CSSStringValue* parsedValue = consumeString(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue = consumeString(range);
</ins><span class="cx"> if (!parsedValue)
</span><span class="cx"> return nullptr;
</span><del>- values->append(*parsedValue);
</del><ins>+ values->append(parsedValue.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> if (values->length() && values->length() % 2 == 0)
</span><span class="cx"> return values;
</span><span class="lines">@@ -481,16 +464,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeWebkitHighlight(CSSParserTokenRange& range)
-{
- if (range.peek().id() == CSSValueNone)
- return consumeIdent(range);
- return consumeString(range);
-}
-
</del><span class="cx"> class FontVariantLigaturesParser {
</span><del>- STACK_ALLOCATED();
-
</del><span class="cx"> public:
</span><span class="cx"> FontVariantLigaturesParser()
</span><span class="cx"> : m_sawCommonLigaturesValue(false)
</span><span class="lines">@@ -538,14 +512,14 @@
</span><span class="cx"> default:
</span><span class="cx"> return ParseResult::UnknownValue;
</span><span class="cx"> }
</span><del>- m_result->append(*consumeIdent(range));
</del><ins>+ m_result->append(consumeIdent(range).releaseNonNull());
</ins><span class="cx"> return ParseResult::ConsumedValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- CSSValue* finalizeValue()
</del><ins>+ RefPtr<CSSValue> finalizeValue()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_result->length())
</span><del>- return CSSPrimitiveValue::createIdentifier(CSSValueNormal);
</del><ins>+ return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
</ins><span class="cx"> return m_result.release();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -554,10 +528,10 @@
</span><span class="cx"> bool m_sawDiscretionaryLigaturesValue;
</span><span class="cx"> bool m_sawHistoricalLigaturesValue;
</span><span class="cx"> bool m_sawContextualLigaturesValue;
</span><del>- Member<CSSValueList> m_result;
</del><ins>+ RefPtr<CSSValueList> m_result;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-static CSSValue* consumeFontVariantLigatures(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeFontVariantLigatures(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNormal || range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -572,7 +546,7 @@
</span><span class="cx"> return ligaturesParser.finalizeValue();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeFontVariantCaps(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeFontVariantCaps(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdent<CSSValueNormal, CSSValueSmallCaps, CSSValueAllSmallCaps,
</span><span class="cx"> CSSValuePetiteCaps, CSSValueAllPetiteCaps,
</span><span class="lines">@@ -580,8 +554,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> class FontVariantNumericParser {
</span><del>- STACK_ALLOCATED();
-
</del><span class="cx"> public:
</span><span class="cx"> FontVariantNumericParser()
</span><span class="cx"> : m_sawNumericFigureValue(false)
</span><span class="lines">@@ -634,14 +606,14 @@
</span><span class="cx"> default:
</span><span class="cx"> return ParseResult::UnknownValue;
</span><span class="cx"> }
</span><del>- m_result->append(*consumeIdent(range));
</del><ins>+ m_result->append(consumeIdent(range).releaseNonNull());
</ins><span class="cx"> return ParseResult::ConsumedValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- CSSValue* finalizeValue()
</del><ins>+ RefPtr<CSSValue> finalizeValue()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_result->length())
</span><del>- return CSSPrimitiveValue::createIdentifier(CSSValueNormal);
</del><ins>+ return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
</ins><span class="cx"> return m_result.release();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -652,10 +624,10 @@
</span><span class="cx"> bool m_sawNumericFractionValue;
</span><span class="cx"> bool m_sawOrdinalValue;
</span><span class="cx"> bool m_sawSlashedZeroValue;
</span><del>- Member<CSSValueList> m_result;
</del><ins>+ RefPtr<CSSValueList> m_result;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-static CSSValue* consumeFontVariantNumeric(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeFontVariantNumeric(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNormal)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -670,14 +642,14 @@
</span><span class="cx"> return numericParser.finalizeValue();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeFontVariantCSS21(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeFontVariantCSS21(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdent<CSSValueNormal, CSSValueSmallCaps>(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFontVariantList(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeFontVariantList(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><del>- CSSValueList* values = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
</ins><span class="cx"> do {
</span><span class="cx"> if (range.peek().id() == CSSValueAll) {
</span><span class="cx"> // FIXME: CSSPropertyParser::parseFontVariant() implements
</span><span class="lines">@@ -688,9 +660,9 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx"> }
</span><del>- CSSPrimitiveValue* fontVariant = consumeFontVariantCSS21(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> fontVariant = consumeFontVariantCSS21(range);
</ins><span class="cx"> if (fontVariant)
</span><del>- values->append(*fontVariant);
</del><ins>+ values->append(fontVariant.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx">
</span><span class="cx"> if (values->length())
</span><span class="lines">@@ -699,7 +671,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeFontWeight(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeFontWeight(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> const CSSParserToken& token = range.peek();
</span><span class="cx"> if (token.id() >= CSSValueNormal && token.id() <= CSSValueLighter)
</span><span class="lines">@@ -710,7 +682,7 @@
</span><span class="cx"> if ((weight % 100) || weight < 100 || weight > 900)
</span><span class="cx"> return nullptr;
</span><span class="cx"> range.consumeIncludingWhitespace();
</span><del>- return CSSPrimitiveValue::createIdentifier(static_cast<CSSValueID>(CSSValue100 + weight / 100 - 1));
</del><ins>+ return CSSValuePool::singleton().createIdentifierValue(static_cast<CSSValueID>(CSSValue100 + weight / 100 - 1));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static String concatenateFamilyName(CSSParserTokenRange& range)
</span><span class="lines">@@ -730,34 +702,34 @@
</span><span class="cx"> return builder.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFamilyName(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeFamilyName(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().type() == StringToken)
</span><del>- return CSSFontFamilyValue::create(range.consumeIncludingWhitespace().value().toString());
</del><ins>+ return CSSPrimitiveValue::create(range.consumeIncludingWhitespace().value().toString(), CSSPrimitiveValue::UnitTypes::CSS_STRING);
</ins><span class="cx"> if (range.peek().type() != IdentToken)
</span><span class="cx"> return nullptr;
</span><span class="cx"> String familyName = concatenateFamilyName(range);
</span><span class="cx"> if (familyName.isNull())
</span><span class="cx"> return nullptr;
</span><del>- return CSSFontFamilyValue::create(familyName);
</del><ins>+ return CSSPrimitiveValue::create(familyName, CSSPrimitiveValue::UnitTypes::CSS_STRING);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeGenericFamily(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeGenericFamily(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdentRange(range, CSSValueSerif, CSSValueWebkitBody);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeFontFamily(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValueList> consumeFontFamily(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><del>- CSSValueList* list = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
</ins><span class="cx"> do {
</span><del>- CSSValue* parsedValue = consumeGenericFamily(range);
</del><ins>+ RefPtr<CSSValue> parsedValue = consumeGenericFamily(range);
</ins><span class="cx"> if (parsedValue) {
</span><del>- list->append(*parsedValue);
</del><ins>+ list->append(parsedValue.releaseNonNull());
</ins><span class="cx"> } else {
</span><span class="cx"> parsedValue = consumeFamilyName(range);
</span><span class="cx"> if (parsedValue) {
</span><del>- list->append(*parsedValue);
</del><ins>+ list->append(parsedValue.releaseNonNull());
</ins><span class="cx"> } else {
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -766,7 +738,7 @@
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeSpacing(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeSpacing(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNormal)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -774,15 +746,15 @@
</span><span class="cx"> return consumeLength(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeTabSize(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeTabSize(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* parsedValue = consumeInteger(range, 0);
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue = consumeInteger(range, 0);
</ins><span class="cx"> if (parsedValue)
</span><span class="cx"> return parsedValue;
</span><span class="cx"> return consumeLength(range, cssParserMode, ValueRangeNonNegative);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeTextSizeAdjust(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeTextSizeAdjust(CSSParserTokenRange& range, CSSParserMode /* cssParserMode */)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -791,7 +763,7 @@
</span><span class="cx"> return consumePercent(range, ValueRangeNonNegative);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFontSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
</del><ins>+static RefPtr<CSSValue> consumeFontSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() >= CSSValueXxSmall && range.peek().id() <= CSSValueLarger)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -798,123 +770,65 @@
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative, unitless);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeLineHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeLineHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNormal)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSPrimitiveValue* lineHeight = consumeNumber(range, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> lineHeight = consumeNumber(range, ValueRangeNonNegative);
</ins><span class="cx"> if (lineHeight)
</span><span class="cx"> return lineHeight;
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeRotation(CSSParserTokenRange& range)
</del><ins>+template<typename... Args>
+static Ref<CSSPrimitiveValue> createPrimitiveValuePair(Args&&... args)
</ins><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
- CSSValueList* list = CSSValueList::createSpaceSeparated();
-
- CSSValue* rotation = consumeAngle(range);
- if (!rotation)
- return nullptr;
- list->append(*rotation);
-
- if (range.atEnd())
- return list;
-
- for (unsigned i = 0; i < 3; i++) { // 3 dimensions of rotation
- CSSValue* dimension = consumeNumber(range, ValueRangeAll);
- if (!dimension)
- return nullptr;
- list->append(*dimension);
- }
-
- return list;
</del><ins>+ return CSSValuePool::singleton().createValue(Pair::create(std::forward<Args>(args)...));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeScale(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeCounter(CSSParserTokenRange& range, int defaultValue)
</ins><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
-
- CSSValue* scale = consumeNumber(range, ValueRangeAll);
- if (!scale)
- return nullptr;
- CSSValueList* list = CSSValueList::createSpaceSeparated();
- list->append(*scale);
- scale = consumeNumber(range, ValueRangeAll);
- if (scale) {
- list->append(*scale);
- scale = consumeNumber(range, ValueRangeAll);
- if (scale)
- list->append(*scale);
- }
-
- return list;
-}
-
-static CSSValueList* consumeTranslate(CSSParserTokenRange& range, CSSParserMode cssParserMode)
-{
- ASSERT(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
- CSSValue* translate = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll);
- if (!translate)
- return nullptr;
- CSSValueList* list = CSSValueList::createSpaceSeparated();
- list->append(*translate);
- translate = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll);
- if (translate) {
- list->append(*translate);
- translate = consumeLength(range, cssParserMode, ValueRangeAll);
- if (translate)
- list->append(*translate);
- }
-
- return list;
-}
-
-static CSSValue* consumeCounter(CSSParserTokenRange& range, int defaultValue)
-{
</del><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> do {
</span><del>- CSSCustomIdentValue* counterName = consumeCustomIdent(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> counterName = consumeCustomIdent(range);
</ins><span class="cx"> if (!counterName)
</span><span class="cx"> return nullptr;
</span><span class="cx"> int i = defaultValue;
</span><del>- if (CSSPrimitiveValue* counterValue = consumeInteger(range))
- i = counterValue->intValue());
- list->append(*CSSValuePair::create(counterName,
- CSSPrimitiveValue::create(i, CSSPrimitiveValue::UnitType::Integer),
- CSSValuePair::DropIdenticalValues));
</del><ins>+ if (RefPtr<CSSPrimitiveValue> counterValue = consumeInteger(range))
+ i = counterValue->intValue();
+ list->append(createPrimitiveValuePair(counterName.releaseNonNull(), CSSPrimitiveValue::create(i, CSSPrimitiveValue::UnitTypes::CSS_NUMBER), Pair::IdenticalValueEncoding::Coalesce));
</ins><span class="cx"> } while (!range.atEnd());
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumePageSize(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumePageSize(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdent<CSSValueA3, CSSValueA4, CSSValueA5, CSSValueB4, CSSValueB5, CSSValueLedger, CSSValueLegal, CSSValueLetter>(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeSize(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValueList> consumeSize(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><del>- CSSValueList* result = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> result = CSSValueList::createSpaceSeparated();
</ins><span class="cx">
</span><span class="cx"> if (range.peek().id() == CSSValueAuto) {
</span><del>- result->append(*consumeIdent(range));
</del><ins>+ result->append(consumeIdent(range).releaseNonNull());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (CSSValue* width = consumeLength(range, cssParserMode, ValueRangeNonNegative)) {
- CSSValue* height = consumeLength(range, cssParserMode, ValueRangeNonNegative);
- result->append(*width);
</del><ins>+ if (RefPtr<CSSValue> width = consumeLength(range, cssParserMode, ValueRangeNonNegative)) {
+ RefPtr<CSSValue> height = consumeLength(range, cssParserMode, ValueRangeNonNegative);
+ result->append(width.releaseNonNull());
</ins><span class="cx"> if (height)
</span><del>- result->append(*height);
</del><ins>+ result->append(height.releaseNonNull());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- CSSValue* pageSize = consumePageSize(range);
- CSSValue* orientation = consumeIdent<CSSValuePortrait, CSSValueLandscape>(range);
</del><ins>+ RefPtr<CSSValue> pageSize = consumePageSize(range);
+ RefPtr<CSSValue> orientation = consumeIdent<CSSValuePortrait, CSSValueLandscape>(range);
</ins><span class="cx"> if (!pageSize)
</span><span class="cx"> pageSize = consumePageSize(range);
</span><span class="cx">
</span><span class="lines">@@ -921,42 +835,25 @@
</span><span class="cx"> if (!orientation && !pageSize)
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (pageSize)
</span><del>- result->append(*pageSize);
</del><ins>+ result->append(pageSize.releaseNonNull());
</ins><span class="cx"> if (orientation)
</span><del>- result->append(*orientation);
</del><ins>+ result->append(orientation.releaseNonNull());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeSnapHeight(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeTextIndent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* unit = consumeLength(range, cssParserMode, ValueRangeNonNegative);
- if (!unit)
- return nullptr;
- CSSValueList* list = CSSValueList::createSpaceSeparated();
- list->append(*unit);
-
- if (CSSPrimitiveValue* position = consumePositiveInteger(range)) {
- if (position->intValue() > 100)
- return nullptr;
- list->append(*position);
- }
-
- return list;
-}
-
-static CSSValue* consumeTextIndent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
-{
</del><span class="cx"> // [ <length> | <percentage> ] && hanging? && each-line?
</span><span class="cx"> // Keywords only allowed when css3Text is enabled.
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</ins><span class="cx">
</span><span class="cx"> bool hasLengthOrPercentage = false;
</span><del>- bool hasEachLine = false;
</del><ins>+// bool hasEachLine = false;
</ins><span class="cx"> bool hasHanging = false;
</span><span class="cx">
</span><span class="cx"> do {
</span><span class="cx"> if (!hasLengthOrPercentage) {
</span><del>- if (CSSValue* textIndent = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow)) {
</del><ins>+ if (RefPtr<CSSValue> textIndent = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow)) {
</ins><span class="cx"> list->append(*textIndent);
</span><span class="cx"> hasLengthOrPercentage = true;
</span><span class="cx"> continue;
</span><span class="lines">@@ -963,19 +860,21 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (RuntimeEnabledFeatures::css3TextEnabled()) {
- CSSValueID id = range.peek().id();
- if (!hasEachLine && id == CSSValueEachLine) {
- list->append(*consumeIdent(range));
- hasEachLine = true;
- continue;
- }
- if (!hasHanging && id == CSSValueHanging) {
- list->append(*consumeIdent(range));
- hasHanging = true;
- continue;
- }
</del><ins>+ CSSValueID id = range.peek().id();
+ /* FIXME-NEWPARSER: We don't support this yet.
+ if (!hasEachLine && id == CSSValueEachLine) {
+ list->append(*consumeIdent(range));
+ hasEachLine = true;
+ continue;
</ins><span class="cx"> }
</span><ins>+*/
+
+ if (!hasHanging && id == CSSValueHanging) {
+ list->append(consumeIdent(range).releaseNonNull());
+ hasHanging = true;
+ continue;
+ }
+
</ins><span class="cx"> return nullptr;
</span><span class="cx"> } while (!range.atEnd());
</span><span class="cx">
</span><span class="lines">@@ -985,48 +884,31 @@
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool validWidthOrHeightKeyword(CSSValueID id, const CSSParserContext& context)
</del><ins>+// FIXME-NEWPARSER: Drop the prefix on min-content, max-content and fit-content.
+static bool validWidthOrHeightKeyword(CSSValueID id, const CSSParserContext& /*context*/)
</ins><span class="cx"> {
</span><span class="cx"> if (id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent
</span><del>- || id == CSSValueMinContent || id == CSSValueMaxContent || id == CSSValueFitContent) {
- if (context.useCounter()) {
- switch (id) {
- case CSSValueWebkitMinContent:
- context.useCounter()->count(UseCounter::CSSValuePrefixedMinContent);
- break;
- case CSSValueWebkitMaxContent:
- context.useCounter()->count(UseCounter::CSSValuePrefixedMaxContent);
- break;
- case CSSValueWebkitFillAvailable:
- context.useCounter()->count(UseCounter::CSSValuePrefixedFillAvailable);
- break;
- case CSSValueWebkitFitContent:
- context.useCounter()->count(UseCounter::CSSValuePrefixedFitContent);
- break;
- default:
- break;
- }
- }
</del><ins>+ || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFitContent) {
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeMaxWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
</del><ins>+static RefPtr<CSSValue> consumeMaxWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone || validWidthOrHeightKeyword(range.peek().id(), context))
</span><span class="cx"> return consumeIdent(range);
</span><del>- return consumeLengthOrPercent(range, context.mode(), ValueRangeNonNegative, unitless);
</del><ins>+ return consumeLengthOrPercent(range, context.mode, ValueRangeNonNegative, unitless);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
</del><ins>+static RefPtr<CSSValue> consumeWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto || validWidthOrHeightKeyword(range.peek().id(), context))
</span><span class="cx"> return consumeIdent(range);
</span><del>- return consumeLengthOrPercent(range, context.mode(), ValueRangeNonNegative, unitless);
</del><ins>+ return consumeLengthOrPercent(range, context.mode, ValueRangeNonNegative, unitless);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeMarginOrOffset(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</del><ins>+static RefPtr<CSSValue> consumeMarginOrOffset(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1033,7 +915,7 @@
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, unitless);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeClipComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeClipComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1040,7 +922,7 @@
</span><span class="cx"> return consumeLength(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeClip(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeClip(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1050,67 +932,47 @@
</span><span class="cx">
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(range);
</span><span class="cx"> // rect(t, r, b, l) || rect(t r b l)
</span><del>- CSSPrimitiveValue* top = consumeClipComponent(args, cssParserMode);
</del><ins>+ RefPtr<CSSPrimitiveValue> top = consumeClipComponent(args, cssParserMode);
</ins><span class="cx"> if (!top)
</span><span class="cx"> return nullptr;
</span><span class="cx"> bool needsComma = consumeCommaIncludingWhitespace(args);
</span><del>- CSSPrimitiveValue* right = consumeClipComponent(args, cssParserMode);
</del><ins>+ RefPtr<CSSPrimitiveValue> right = consumeClipComponent(args, cssParserMode);
</ins><span class="cx"> if (!right || (needsComma && !consumeCommaIncludingWhitespace(args)))
</span><span class="cx"> return nullptr;
</span><del>- CSSPrimitiveValue* bottom = consumeClipComponent(args, cssParserMode);
</del><ins>+ RefPtr<CSSPrimitiveValue> bottom = consumeClipComponent(args, cssParserMode);
</ins><span class="cx"> if (!bottom || (needsComma && !consumeCommaIncludingWhitespace(args)))
</span><span class="cx"> return nullptr;
</span><del>- CSSPrimitiveValue* left = consumeClipComponent(args, cssParserMode);
</del><ins>+ RefPtr<CSSPrimitiveValue> left = consumeClipComponent(args, cssParserMode);
</ins><span class="cx"> if (!left || !args.atEnd())
</span><span class="cx"> return nullptr;
</span><del>- return CSSQuadValue::create(top, right, bottom, left, CSSQuadValue::SerializeAsRect);
</del><ins>+
+ auto rect = Rect::create();
+ rect->setLeft(left.releaseNonNull());
+ rect->setTop(top.releaseNonNull());
+ rect->setRight(right.releaseNonNull());
+ rect->setBottom(bottom.releaseNonNull());
+ return CSSValuePool::singleton().createValue(WTFMove(rect));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumePan(CSSParserTokenRange& range, CSSValue*& panX, CSSValue*& panY)
</del><ins>+#if ENABLE(TOUCH_EVENTS)
+static RefPtr<CSSValue> consumeTouchAction(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> CSSValueID id = range.peek().id();
</span><del>- if ((id == CSSValuePanX || id == CSSValuePanRight || id == CSSValuePanLeft) && !panX) {
- if (id != CSSValuePanX && !RuntimeEnabledFeatures::cssTouchActionPanDirectionsEnabled())
- return false;
- panX = consumeIdent(range);
- } else if ((id == CSSValuePanY || id == CSSValuePanDown || id == CSSValuePanUp) && !panY) {
- if (id != CSSValuePanY && !RuntimeEnabledFeatures::cssTouchActionPanDirectionsEnabled())
- return false;
- panY = consumeIdent(range);
- } else {
- return false;
- }
- return true;
-}
-
-static CSSValue* consumeTouchAction(CSSParserTokenRange& range)
-{
- CSSValueList* list = CSSValueList::createSpaceSeparated();
- CSSValueID id = range.peek().id();
</del><span class="cx"> if (id == CSSValueAuto || id == CSSValueNone || id == CSSValueManipulation) {
</span><del>- list->append(*consumeIdent(range));
</del><ins>+ list->append(consumeIdent(range).releaseNonNull());
</ins><span class="cx"> return list;
</span><span class="cx"> }
</span><del>-
- CSSValue* panX = nullptr;
- CSSValue* panY = nullptr;
- if (!consumePan(range, panX, panY))
- return nullptr;
- if (!range.atEnd() && !consumePan(range, panX, panY))
- return nullptr;
-
- if (panX)
- list->append(*panX);
- if (panY)
- list->append(*panY);
- return list;
</del><ins>+ // FIXME-NEWPARSER: Support pan.
+ return nullptr;
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeLineClamp(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeLineClamp(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().type() != PercentageToken && range.peek().type() != NumberToken)
</span><span class="cx"> return nullptr;
</span><del>- CSSPrimitiveValue* clampValue = consumePercent(range, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> clampValue = consumePercent(range, ValueRangeNonNegative);
</ins><span class="cx"> if (clampValue)
</span><span class="cx"> return clampValue;
</span><span class="cx"> // When specifying number of lines, don't allow 0 as a valid value.
</span><span class="lines">@@ -1117,7 +979,7 @@
</span><span class="cx"> return consumePositiveInteger(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeLocale(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeLocale(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1124,19 +986,19 @@
</span><span class="cx"> return consumeString(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeColumnWidth(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeColumnWidth(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx"> // Always parse lengths in strict mode here, since it would be ambiguous otherwise when used in
</span><span class="cx"> // the 'columns' shorthand property.
</span><del>- CSSPrimitiveValue* columnWidth = consumeLength(range, HTMLStandardMode, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> columnWidth = consumeLength(range, HTMLStandardMode, ValueRangeNonNegative);
</ins><span class="cx"> if (!columnWidth || (!columnWidth->isCalculated() && columnWidth->doubleValue() == 0))
</span><span class="cx"> return nullptr;
</span><span class="cx"> return columnWidth;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeColumnCount(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeColumnCount(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1143,7 +1005,7 @@
</span><span class="cx"> return consumePositiveInteger(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeColumnGap(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeColumnGap(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNormal)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1150,31 +1012,26 @@
</span><span class="cx"> return consumeLength(range, cssParserMode, ValueRangeNonNegative);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeColumnSpan(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeColumnSpan(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdent<CSSValueAll, CSSValueNone>(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeZoom(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeZoom(CSSParserTokenRange& range, const CSSParserContext& /*context*/)
</ins><span class="cx"> {
</span><span class="cx"> const CSSParserToken& token = range.peek();
</span><del>- CSSPrimitiveValue* zoom = nullptr;
- if (token.type() == IdentToken) {
</del><ins>+ RefPtr<CSSPrimitiveValue> zoom;
+ if (token.type() == IdentToken)
</ins><span class="cx"> zoom = consumeIdent<CSSValueNormal, CSSValueReset, CSSValueDocument>(range);
</span><del>- } else {
</del><ins>+ else {
</ins><span class="cx"> zoom = consumePercent(range, ValueRangeNonNegative);
</span><span class="cx"> if (!zoom)
</span><span class="cx"> zoom = consumeNumber(range, ValueRangeNonNegative);
</span><span class="cx"> }
</span><del>- if (zoom && context.useCounter()
- && !(token.id() == CSSValueNormal
- || (token.type() == NumberToken && zoom->doubleValue() == 1)
- || (token.type() == PercentageToken && zoom->doubleValue() == 100)))
- context.useCounter()->count(UseCounter::CSSZoomNotEqualToOne);
</del><span class="cx"> return zoom;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeAnimationIterationCount(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeAnimationIterationCount(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueInfinite)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1181,19 +1038,15 @@
</span><span class="cx"> return consumeNumber(range, ValueRangeNonNegative);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeAnimationName(CSSParserTokenRange& range, const CSSParserContext& context, bool allowQuotedName)
</del><ins>+static RefPtr<CSSValue> consumeAnimationName(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- if (allowQuotedName && range.peek().type() == StringToken) {
- // Legacy support for strings in prefixed animations.
- if (context.useCounter())
- context.useCounter()->count(UseCounter::QuotedAnimationName);
-
</del><ins>+ if (range.peek().type() == StringToken) {
</ins><span class="cx"> const CSSParserToken& token = range.consumeIncludingWhitespace();
</span><span class="cx"> if (equalIgnoringASCIICase(token.value(), "none"))
</span><del>- return CSSPrimitiveValue::createIdentifier(CSSValueNone);
</del><ins>+ return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
</ins><span class="cx"> return CSSCustomIdentValue::create(token.value().toString());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1200,7 +1053,7 @@
</span><span class="cx"> return consumeCustomIdent(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeTransitionProperty(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeTransitionProperty(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> const CSSParserToken& token = range.peek();
</span><span class="cx"> if (token.type() != IdentToken)
</span><span class="lines">@@ -1208,8 +1061,7 @@
</span><span class="cx"> if (token.id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- if (CSSPropertyID property = token.parseAsUnresolvedCSSPropertyID()) {
- ASSERT(CSSPropertyMetadata::isEnabledProperty(property));
</del><ins>+ if (CSSPropertyID property = token.parseAsCSSPropertyID()) {
</ins><span class="cx"> range.consumeIncludingWhitespace();
</span><span class="cx"> return CSSCustomIdentValue::create(property);
</span><span class="cx"> }
</span><span class="lines">@@ -1216,43 +1068,39 @@
</span><span class="cx"> return consumeCustomIdent(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeSteps(CSSParserTokenRange& range)
-{
</del><ins>+
+static RefPtr<CSSValue> consumeSteps(CSSParserTokenRange& range) {
</ins><span class="cx"> ASSERT(range.peek().functionId() == CSSValueSteps);
</span><span class="cx"> CSSParserTokenRange rangeCopy = range;
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(rangeCopy);
</span><del>-
- CSSPrimitiveValue* steps = consumePositiveInteger(args);
</del><ins>+
+ RefPtr<CSSPrimitiveValue> steps = consumePositiveInteger(args);
</ins><span class="cx"> if (!steps)
</span><span class="cx"> return nullptr;
</span><del>-
- StepsTimingFunction::StepPosition position = StepsTimingFunction::StepPosition::END;
</del><ins>+
+ // FIXME-NEWPARSER: Support the middle value and change from a boolean to an enum.
+ bool stepAtStart = false;
</ins><span class="cx"> if (consumeCommaIncludingWhitespace(args)) {
</span><span class="cx"> switch (args.consumeIncludingWhitespace().id()) {
</span><del>- case CSSValueMiddle:
- if (!RuntimeEnabledFeatures::webAnimationsAPIEnabled())
</del><ins>+ case CSSValueStart:
+ stepAtStart = true;
+ break;
+ case CSSValueEnd:
+ stepAtStart = false;
+ break;
+ default:
</ins><span class="cx"> return nullptr;
</span><del>- position = StepsTimingFunction::StepPosition::MIDDLE;
- break;
- case CSSValueStart:
- position = StepsTimingFunction::StepPosition::START;
- break;
- case CSSValueEnd:
- position = StepsTimingFunction::StepPosition::END;
- break;
- default:
- return nullptr;
</del><span class="cx"> }
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!args.atEnd())
</span><span class="cx"> return nullptr;
</span><del>-
</del><ins>+
</ins><span class="cx"> range = rangeCopy;
</span><del>- return CSSStepsTimingFunctionValue::create(steps->intValue(), position);
</del><ins>+ return CSSStepsTimingFunctionValue::create(steps->intValue(), stepAtStart);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeCubicBezier(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeCubicBezier(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(range.peek().functionId() == CSSValueCubicBezier);
</span><span class="cx"> CSSParserTokenRange rangeCopy = range;
</span><span class="lines">@@ -1276,39 +1124,38 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeAnimationTimingFunction(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeAnimationTimingFunction(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueEase || id == CSSValueLinear || id == CSSValueEaseIn
</span><del>- || id == CSSValueEaseOut || id == CSSValueEaseInOut || id == CSSValueStepStart
- || id == CSSValueStepEnd || id == CSSValueStepMiddle)
</del><ins>+ || id == CSSValueEaseOut || id == CSSValueEaseInOut || id == CSSValueStepStart || id == CSSValueStepEnd)
</ins><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><span class="cx"> CSSValueID function = range.peek().functionId();
</span><ins>+ if (function == CSSValueCubicBezier)
+ return consumeCubicBezier(range);
</ins><span class="cx"> if (function == CSSValueSteps)
</span><span class="cx"> return consumeSteps(range);
</span><del>- if (function == CSSValueCubicBezier)
- return consumeCubicBezier(range);
</del><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeAnimationValue(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, bool useLegacyParsing)
</del><ins>+static RefPtr<CSSValue> consumeAnimationValue(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> switch (property) {
</span><span class="cx"> case CSSPropertyAnimationDelay:
</span><span class="cx"> case CSSPropertyTransitionDelay:
</span><del>- return consumeTime(range, ValueRangeAll);
</del><ins>+ return consumeTime(range, context.mode, ValueRangeAll, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyAnimationDirection:
</span><span class="cx"> return consumeIdent<CSSValueNormal, CSSValueAlternate, CSSValueReverse, CSSValueAlternateReverse>(range);
</span><span class="cx"> case CSSPropertyAnimationDuration:
</span><span class="cx"> case CSSPropertyTransitionDuration:
</span><del>- return consumeTime(range, ValueRangeNonNegative);
</del><ins>+ return consumeTime(range, context.mode, ValueRangeNonNegative, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyAnimationFillMode:
</span><span class="cx"> return consumeIdent<CSSValueNone, CSSValueForwards, CSSValueBackwards, CSSValueBoth>(range);
</span><span class="cx"> case CSSPropertyAnimationIterationCount:
</span><span class="cx"> return consumeAnimationIterationCount(range);
</span><span class="cx"> case CSSPropertyAnimationName:
</span><del>- return consumeAnimationName(range, context, useLegacyParsing);
</del><ins>+ return consumeAnimationName(range);
</ins><span class="cx"> case CSSPropertyAnimationPlayState:
</span><span class="cx"> return consumeIdent<CSSValueRunning, CSSValuePaused>(range);
</span><span class="cx"> case CSSPropertyTransitionProperty:
</span><span class="lines">@@ -1327,21 +1174,21 @@
</span><span class="cx"> if (property != CSSPropertyTransitionProperty || valueList.length() < 2)
</span><span class="cx"> return true;
</span><span class="cx"> for (auto& value : valueList) {
</span><del>- if (value->isPrimitiveValue() && toCSSPrimitiveValue(*value).isValueID()
- && toCSSPrimitiveValue(*value).valueID() == CSSValueNone)
</del><ins>+ if (value->isPrimitiveValue() && downcast<CSSPrimitiveValue>(value.get()).isValueID()
+ && downcast<CSSPrimitiveValue>(value.get()).valueID() == CSSValueNone)
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeAnimationPropertyList(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, bool useLegacyParsing)
</del><ins>+static RefPtr<CSSValueList> consumeAnimationPropertyList(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSValueList* list = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
</ins><span class="cx"> do {
</span><del>- CSSValue* value = consumeAnimationValue(property, range, context, useLegacyParsing);
</del><ins>+ RefPtr<CSSValue> value = consumeAnimationValue(property, range, context);
</ins><span class="cx"> if (!value)
</span><span class="cx"> return nullptr;
</span><del>- list->append(*value);
</del><ins>+ list->append(value.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx"> if (!isValidAnimationPropertyList(property, *list))
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -1349,10 +1196,10 @@
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSPropertyParser::consumeAnimationShorthand(const StylePropertyShorthand& shorthand, bool useLegacyParsing, bool important)
</del><ins>+bool CSSPropertyParser::consumeAnimationShorthand(const StylePropertyShorthand& shorthand, bool important)
</ins><span class="cx"> {
</span><span class="cx"> const unsigned longhandCount = shorthand.length();
</span><del>- CSSValueList* longhands[8];
</del><ins>+ RefPtr<CSSValueList> longhands[8];
</ins><span class="cx"> ASSERT(longhandCount <= 8);
</span><span class="cx"> for (size_t i = 0; i < longhandCount; ++i)
</span><span class="cx"> longhands[i] = CSSValueList::createCommaSeparated();
</span><span class="lines">@@ -1365,7 +1212,7 @@
</span><span class="cx"> if (parsedLonghand[i])
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (CSSValue* value = consumeAnimationValue(shorthand.properties()[i], m_range, m_context, useLegacyParsing)) {
</del><ins>+ if (RefPtr<CSSValue> value = consumeAnimationValue(shorthand.properties()[i], m_range, m_context)) {
</ins><span class="cx"> parsedLonghand[i] = true;
</span><span class="cx"> foundProperty = true;
</span><span class="cx"> longhands[i]->append(*value);
</span><span class="lines">@@ -1379,7 +1226,7 @@
</span><span class="cx"> // FIXME: This will make invalid longhands, see crbug.com/386459
</span><span class="cx"> for (size_t i = 0; i < longhandCount; ++i) {
</span><span class="cx"> if (!parsedLonghand[i])
</span><del>- longhands[i]->append(*CSSInitialValue::createLegacyImplicit());
</del><ins>+ longhands[i]->append(CSSValuePool::singleton().createImplicitInitialValue());
</ins><span class="cx"> parsedLonghand[i] = false;
</span><span class="cx"> }
</span><span class="cx"> } while (consumeCommaIncludingWhitespace(m_range));
</span><span class="lines">@@ -1395,7 +1242,7 @@
</span><span class="cx"> return m_range.atEnd();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeZIndex(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeZIndex(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1402,10 +1249,10 @@
</span><span class="cx"> return consumeInteger(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSShadowValue* parseSingleShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool allowInset, bool allowSpread)
</del><ins>+static RefPtr<CSSShadowValue> parseSingleShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool allowInset, bool allowSpread)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* style = nullptr;
- CSSValue* color = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> style;
+ RefPtr<CSSPrimitiveValue> color;
</ins><span class="cx">
</span><span class="cx"> if (range.atEnd())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -1416,16 +1263,16 @@
</span><span class="cx"> }
</span><span class="cx"> color = consumeColor(range, cssParserMode);
</span><span class="cx">
</span><del>- CSSPrimitiveValue* horizontalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
</del><ins>+ RefPtr<CSSPrimitiveValue> horizontalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
</ins><span class="cx"> if (!horizontalOffset)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- CSSPrimitiveValue* verticalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
</del><ins>+ RefPtr<CSSPrimitiveValue> verticalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
</ins><span class="cx"> if (!verticalOffset)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- CSSPrimitiveValue* blurRadius = consumeLength(range, cssParserMode, ValueRangeAll);
- CSSPrimitiveValue* spreadDistance = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> blurRadius = consumeLength(range, cssParserMode, ValueRangeAll);
+ RefPtr<CSSPrimitiveValue> spreadDistance;
</ins><span class="cx"> if (blurRadius) {
</span><span class="cx"> // Blur radius must be non-negative.
</span><span class="cx"> if (blurRadius->doubleValue() < 0)
</span><span class="lines">@@ -1443,18 +1290,18 @@
</span><span class="cx"> style = consumeIdent(range);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- return CSSShadowValue::create(horizontalOffset, verticalOffset, blurRadius,
- spreadDistance, style, color);
</del><ins>+ return CSSShadowValue::create(horizontalOffset.releaseNonNull(), verticalOffset.releaseNonNull(), blurRadius.releaseNonNull(),
+ spreadDistance.releaseNonNull(), style.releaseNonNull(), color.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool isBoxShadowProperty)
</del><ins>+static RefPtr<CSSValue> consumeShadow(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool isBoxShadowProperty)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* shadowValueList = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> shadowValueList = CSSValueList::createCommaSeparated();
</ins><span class="cx"> do {
</span><del>- if (CSSShadowValue* shadowValue = parseSingleShadow(range, cssParserMode, isBoxShadowProperty, isBoxShadowProperty))
</del><ins>+ if (RefPtr<CSSShadowValue> shadowValue = parseSingleShadow(range, cssParserMode, isBoxShadowProperty, isBoxShadowProperty))
</ins><span class="cx"> shadowValueList->append(*shadowValue);
</span><span class="cx"> else
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -1462,31 +1309,28 @@
</span><span class="cx"> return shadowValueList;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSFunctionValue* consumeFilterFunction(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSFunctionValue> consumeFilterFunction(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID filterType = range.peek().functionId();
</span><span class="cx"> if (filterType < CSSValueInvert || filterType > CSSValueDropShadow)
</span><span class="cx"> return nullptr;
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(range);
</span><del>- CSSFunctionValue* filterValue = CSSFunctionValue::create(filterType);
- CSSValue* parsedValue = nullptr;
</del><ins>+ RefPtr<CSSFunctionValue>filterValue = CSSFunctionValue::create(filterType);
+ RefPtr<CSSValue> parsedValue;
</ins><span class="cx">
</span><del>- if (filterType == CSSValueDropShadow) {
- parsedValue = parseSingleShadow(args, context.mode(), false, false);
- } else {
- if (args.atEnd()) {
- if (context.useCounter())
- context.useCounter()->count(UseCounter::CSSFilterFunctionNoArguments);
</del><ins>+ if (filterType == CSSValueDropShadow)
+ parsedValue = parseSingleShadow(args, context.mode, false, false);
+ else {
+ if (args.atEnd())
</ins><span class="cx"> return filterValue;
</span><del>- }
</del><span class="cx"> if (filterType == CSSValueBrightness) {
</span><span class="cx"> // FIXME (crbug.com/397061): Support calc expressions like calc(10% + 0.5)
</span><span class="cx"> parsedValue = consumePercent(args, ValueRangeAll);
</span><span class="cx"> if (!parsedValue)
</span><span class="cx"> parsedValue = consumeNumber(args, ValueRangeAll);
</span><del>- } else if (filterType == CSSValueHueRotate) {
- parsedValue = consumeAngle(args);
- } else if (filterType == CSSValueBlur) {
</del><ins>+ } else if (filterType == CSSValueHueRotate)
+ parsedValue = consumeAngle(args, context.mode, UnitlessQuirk::Forbid);
+ else if (filterType == CSSValueBlur) {
</ins><span class="cx"> parsedValue = consumeLength(args, HTMLStandardMode, ValueRangeNonNegative);
</span><span class="cx"> } else {
</span><span class="cx"> // FIXME (crbug.com/397061): Support calc expressions like calc(10% + 0.5)
</span><span class="lines">@@ -1494,12 +1338,10 @@
</span><span class="cx"> if (!parsedValue)
</span><span class="cx"> parsedValue = consumeNumber(args, ValueRangeNonNegative);
</span><span class="cx"> if (parsedValue && filterType != CSSValueSaturate && filterType != CSSValueContrast) {
</span><del>- bool isPercentage = toCSSPrimitiveValue(parsedValue)->isPercentage();
</del><ins>+ bool isPercentage = downcast<CSSPrimitiveValue>(*parsedValue).isPercentage();
</ins><span class="cx"> double maxAllowed = isPercentage ? 100.0 : 1.0;
</span><del>- if (toCSSPrimitiveValue(parsedValue)->doubleValue() > maxAllowed) {
- parsedValue = CSSPrimitiveValue::create(
- maxAllowed,
- isPercentage ? CSSPrimitiveValue::UnitType::Percentage : CSSPrimitiveValue::UnitType::Number);
</del><ins>+ if (downcast<CSSPrimitiveValue>(*parsedValue).doubleValue() > maxAllowed) {
+ parsedValue = CSSPrimitiveValue::create(maxAllowed, isPercentage ? CSSPrimitiveValue::UnitTypes::CSS_PERCENTAGE : CSSPrimitiveValue::UnitTypes::CSS_NUMBER);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -1510,38 +1352,38 @@
</span><span class="cx"> return filterValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFilter(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeFilter(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> do {
</span><del>- CSSValue* filterValue = consumeUrl(range);
</del><ins>+ RefPtr<CSSValue> filterValue = consumeUrl(range);
</ins><span class="cx"> if (!filterValue) {
</span><span class="cx"> filterValue = consumeFilterFunction(range, context);
</span><span class="cx"> if (!filterValue)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- list->append(*filterValue);
</del><ins>+ list->append(filterValue.releaseNonNull());
</ins><span class="cx"> } while (!range.atEnd());
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeTextDecorationLine(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeTextDecorationLine(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> while (true) {
</span><del>- CSSPrimitiveValue* ident = consumeIdent<CSSValueBlink, CSSValueUnderline, CSSValueOverline, CSSValueLineThrough>(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> ident = consumeIdent<CSSValueBlink, CSSValueUnderline, CSSValueOverline, CSSValueLineThrough>(range);
</ins><span class="cx"> if (!ident)
</span><span class="cx"> break;
</span><del>- if (list->hasValue(*ident))
</del><ins>+ if (list->hasValue(ident.get()))
</ins><span class="cx"> return nullptr;
</span><del>- list->append(*ident);
</del><ins>+ list->append(ident.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!list->length())
</span><span class="lines">@@ -1549,100 +1391,23 @@
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// none | strict | content | [ layout || style || paint || size ]
-static CSSValue* consumeContain(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeTextEmphasisStyle(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
- if (id == CSSValueStrict || id == CSSValueContent) {
- list->append(*consumeIdent(range));
- return list;
- }
- while (true) {
- CSSPrimitiveValue* ident = consumeIdent<CSSValuePaint, CSSValueLayout, CSSValueStyle, CSSValueSize>(range);
- if (!ident)
- break;
- if (list->hasValue(*ident))
- return nullptr;
- list->append(*ident);
- }
-
- if (!list->length())
- return nullptr;
- return list;
-}
-
-static CSSValue* consumePath(CSSParserTokenRange& range)
-{
- // FIXME: Add support for <url>, <basic-shape>, <geometry-box>.
- if (range.peek().functionId() != CSSValuePath)
- return nullptr;
-
- CSSParserTokenRange functionRange = range;
- CSSParserTokenRange functionArgs = consumeFunction(functionRange);
-
- if (functionArgs.peek().type() != StringToken)
- return nullptr;
- String pathString = functionArgs.consumeIncludingWhitespace().value().toString();
-
- std::unique_ptr<SVGPathByteStream> byteStream = SVGPathByteStream::create();
- if (buildByteStreamFromString(pathString, *byteStream) != SVGParseStatus::NoError
- || !functionArgs.atEnd())
- return nullptr;
-
- range = functionRange;
- if (byteStream->isEmpty())
- return CSSPrimitiveValue::createIdentifier(CSSValueNone);
- return CSSPathValue::create(std::move(byteStream));
-}
-
-static CSSValue* consumePathOrNone(CSSParserTokenRange& range)
-{
- CSSValueID id = range.peek().id();
- if (id == CSSValueNone)
- return consumeIdent(range);
-
- return consumePath(range);
-}
-
-static CSSValue* consumeMotionRotation(CSSParserTokenRange& range)
-{
- CSSValue* angle = consumeAngle(range);
- CSSValue* keyword = consumeIdent<CSSValueAuto, CSSValueReverse>(range);
- if (!angle && !keyword)
- return nullptr;
-
- if (!angle)
- angle = consumeAngle(range);
-
- CSSValueList* list = CSSValueList::createSpaceSeparated();
- if (keyword)
- list->append(*keyword);
- if (angle)
- list->append(*angle);
- return list;
-}
-
-static CSSValue* consumeTextEmphasisStyle(CSSParserTokenRange& range)
-{
- CSSValueID id = range.peek().id();
- if (id == CSSValueNone)
- return consumeIdent(range);
-
- if (CSSValue* textEmphasisStyle = consumeString(range))
</del><ins>+ if (RefPtr<CSSValue> textEmphasisStyle = consumeString(range))
</ins><span class="cx"> return textEmphasisStyle;
</span><span class="cx">
</span><del>- CSSPrimitiveValue* fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range);
- CSSPrimitiveValue* shape = consumeIdent<CSSValueDot, CSSValueCircle, CSSValueDoubleCircle, CSSValueTriangle, CSSValueSesame>(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range);
+ RefPtr<CSSPrimitiveValue> shape = consumeIdent<CSSValueDot, CSSValueCircle, CSSValueDoubleCircle, CSSValueTriangle, CSSValueSesame>(range);
</ins><span class="cx"> if (!fill)
</span><span class="cx"> fill = consumeIdent<CSSValueFilled, CSSValueOpen>(range);
</span><span class="cx"> if (fill && shape) {
</span><del>- CSSValueList* parsedValues = CSSValueList::createSpaceSeparated();
- parsedValues->append(*fill);
- parsedValues->append(*shape);
</del><ins>+ RefPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated();
+ parsedValues->append(fill.releaseNonNull());
+ parsedValues->append(shape.releaseNonNull());
</ins><span class="cx"> return parsedValues;
</span><span class="cx"> }
</span><span class="cx"> if (fill)
</span><span class="lines">@@ -1652,7 +1417,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeOutlineColor(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeOutlineColor(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> // Allow the special focus color even in HTML Standard parsing mode.
</span><span class="cx"> if (range.peek().id() == CSSValueWebkitFocusRingColor)
</span><span class="lines">@@ -1660,7 +1425,7 @@
</span><span class="cx"> return consumeColor(range, cssParserMode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeLineWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeLineWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
</span><span class="lines">@@ -1668,25 +1433,25 @@
</span><span class="cx"> return consumeLength(range, cssParserMode, ValueRangeNonNegative, unitless);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeBorderWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBorderWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</ins><span class="cx"> {
</span><span class="cx"> return consumeLineWidth(range, cssParserMode, unitless);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeTextStrokeWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeTextStrokeWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> return consumeLineWidth(range, cssParserMode, UnitlessQuirk::Forbid);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeColumnRuleWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeColumnRuleWidth(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> return consumeLineWidth(range, cssParserMode, UnitlessQuirk::Forbid);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeTranslate3d(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSFunctionValue*& transformValue)
</del><ins>+static bool consumeTranslate3d(CSSParserTokenRange& args, CSSParserMode cssParserMode, RefPtr<CSSFunctionValue>& transformValue)
</ins><span class="cx"> {
</span><span class="cx"> unsigned numberOfArguments = 2;
</span><del>- CSSValue* parsedValue = nullptr;
</del><ins>+ RefPtr<CSSValue> parsedValue;
</ins><span class="cx"> do {
</span><span class="cx"> parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll);
</span><span class="cx"> if (!parsedValue)
</span><span class="lines">@@ -1702,13 +1467,13 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeNumbers(CSSParserTokenRange& args, CSSFunctionValue*& transformValue, unsigned numberOfArguments)
</del><ins>+static bool consumeNumbers(CSSParserTokenRange& args, RefPtr<CSSFunctionValue>& transformValue, unsigned numberOfArguments)
</ins><span class="cx"> {
</span><span class="cx"> do {
</span><del>- CSSValue* parsedValue = consumeNumber(args, ValueRangeAll);
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue = consumeNumber(args, ValueRangeAll);
</ins><span class="cx"> if (!parsedValue)
</span><span class="cx"> return false;
</span><del>- transformValue->append(*parsedValue);
</del><ins>+ transformValue->append(parsedValue.releaseNonNull());
</ins><span class="cx"> if (--numberOfArguments && !consumeCommaIncludingWhitespace(args))
</span><span class="cx"> return false;
</span><span class="cx"> } while (numberOfArguments);
</span><span class="lines">@@ -1715,22 +1480,22 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumePerspective(CSSParserTokenRange& args, CSSParserMode cssParserMode, CSSFunctionValue*& transformValue, bool useLegacyParsing)
</del><ins>+static bool consumePerspective(CSSParserTokenRange& args, CSSParserMode cssParserMode, RefPtr<CSSFunctionValue>& transformValue)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* parsedValue = consumeLength(args, cssParserMode, ValueRangeNonNegative);
- if (!parsedValue && useLegacyParsing) {
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue = consumeLength(args, cssParserMode, ValueRangeNonNegative);
+ if (!parsedValue) {
</ins><span class="cx"> double perspective;
</span><span class="cx"> if (!consumeNumberRaw(args, perspective) || perspective < 0)
</span><span class="cx"> return false;
</span><del>- parsedValue = CSSPrimitiveValue::create(perspective, CSSPrimitiveValue::UnitType::Pixels);
</del><ins>+ parsedValue = CSSPrimitiveValue::create(perspective, CSSPrimitiveValue::UnitTypes::CSS_PX);
</ins><span class="cx"> }
</span><span class="cx"> if (!parsedValue)
</span><span class="cx"> return false;
</span><del>- transformValue->append(*parsedValue);
</del><ins>+ transformValue->append(parsedValue.releaseNonNull());
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeTransformValue(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing)
</del><ins>+static RefPtr<CSSValue> consumeTransformValue(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID functionId = range.peek().functionId();
</span><span class="cx"> if (functionId == CSSValueInvalid)
</span><span class="lines">@@ -1738,29 +1503,29 @@
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(range);
</span><span class="cx"> if (args.atEnd())
</span><span class="cx"> return nullptr;
</span><del>- CSSFunctionValue* transformValue = CSSFunctionValue::create(functionId);
- CSSValue* parsedValue = nullptr;
</del><ins>+ RefPtr<CSSFunctionValue> transformValue = CSSFunctionValue::create(functionId);
+ RefPtr<CSSValue> parsedValue;
</ins><span class="cx"> switch (functionId) {
</span><span class="cx"> case CSSValueRotate:
</span><del>- case CSSValueRotateX:
- case CSSValueRotateY:
- case CSSValueRotateZ:
- case CSSValueSkewX:
- case CSSValueSkewY:
</del><ins>+ case CSSValueRotatex:
+ case CSSValueRotatey:
+ case CSSValueRotatez:
+ case CSSValueSkewx:
+ case CSSValueSkewy:
</ins><span class="cx"> case CSSValueSkew:
</span><del>- parsedValue = consumeAngle(args);
</del><ins>+ parsedValue = consumeAngle(args, cssParserMode, UnitlessQuirk::Forbid);
</ins><span class="cx"> if (!parsedValue)
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (functionId == CSSValueSkew && consumeCommaIncludingWhitespace(args)) {
</span><span class="cx"> transformValue->append(*parsedValue);
</span><del>- parsedValue = consumeAngle(args);
</del><ins>+ parsedValue = consumeAngle(args, cssParserMode, UnitlessQuirk::Forbid);
</ins><span class="cx"> if (!parsedValue)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><del>- case CSSValueScaleX:
- case CSSValueScaleY:
- case CSSValueScaleZ:
</del><ins>+ case CSSValueScalex:
+ case CSSValueScaley:
+ case CSSValueScalez:
</ins><span class="cx"> case CSSValueScale:
</span><span class="cx"> parsedValue = consumeNumber(args, ValueRangeAll);
</span><span class="cx"> if (!parsedValue)
</span><span class="lines">@@ -1773,11 +1538,11 @@
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSValuePerspective:
</span><del>- if (!consumePerspective(args, cssParserMode, transformValue, useLegacyParsing))
</del><ins>+ if (!consumePerspective(args, cssParserMode, transformValue))
</ins><span class="cx"> return nullptr;
</span><span class="cx"> break;
</span><del>- case CSSValueTranslateX:
- case CSSValueTranslateY:
</del><ins>+ case CSSValueTranslatex:
+ case CSSValueTranslatey:
</ins><span class="cx"> case CSSValueTranslate:
</span><span class="cx"> parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll);
</span><span class="cx"> if (!parsedValue)
</span><span class="lines">@@ -1789,7 +1554,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><del>- case CSSValueTranslateZ:
</del><ins>+ case CSSValueTranslatez:
</ins><span class="cx"> parsedValue = consumeLength(args, cssParserMode, ValueRangeAll);
</span><span class="cx"> break;
</span><span class="cx"> case CSSValueMatrix:
</span><span class="lines">@@ -1804,7 +1569,7 @@
</span><span class="cx"> case CSSValueRotate3d:
</span><span class="cx"> if (!consumeNumbers(args, transformValue, 3) || !consumeCommaIncludingWhitespace(args))
</span><span class="cx"> return nullptr;
</span><del>- parsedValue = consumeAngle(args);
</del><ins>+ parsedValue = consumeAngle(args, cssParserMode, UnitlessQuirk::Forbid);
</ins><span class="cx"> if (!parsedValue)
</span><span class="cx"> return nullptr;
</span><span class="cx"> break;
</span><span class="lines">@@ -1822,17 +1587,17 @@
</span><span class="cx"> return transformValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeTransform(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing)
</del><ins>+static RefPtr<CSSValue> consumeTransform(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> do {
</span><del>- CSSValue* parsedTransformValue = consumeTransformValue(range, cssParserMode, useLegacyParsing);
</del><ins>+ RefPtr<CSSValue> parsedTransformValue = consumeTransformValue(range, cssParserMode);
</ins><span class="cx"> if (!parsedTransformValue)
</span><span class="cx"> return nullptr;
</span><del>- list->append(*parsedTransformValue);
</del><ins>+ list->append(parsedTransformValue.releaseNonNull());
</ins><span class="cx"> } while (!range.atEnd());
</span><span class="cx">
</span><span class="cx"> return list;
</span><span class="lines">@@ -1839,7 +1604,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <CSSValueID start, CSSValueID end>
</span><del>-static CSSValue* consumePositionLonghand(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumePositionLonghand(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().type() == IdentToken) {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="lines">@@ -1853,36 +1618,36 @@
</span><span class="cx"> else
</span><span class="cx"> return nullptr;
</span><span class="cx"> range.consumeIncludingWhitespace();
</span><del>- return CSSPrimitiveValue::create(percent, CSSPrimitiveValue::UnitType::Percentage);
</del><ins>+ return CSSPrimitiveValue::create(percent, CSSPrimitiveValue::UnitTypes::CSS_PERCENTAGE);
</ins><span class="cx"> }
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRangeAll);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumePositionX(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumePositionX(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> return consumePositionLonghand<CSSValueLeft, CSSValueRight>(range, cssParserMode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumePositionY(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumePositionY(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> return consumePositionLonghand<CSSValueTop, CSSValueBottom>(range, cssParserMode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumePaintStroke(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumePaintStroke(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><del>- CSSURIValue* url = consumeUrl(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> url = consumeUrl(range);
</ins><span class="cx"> if (url) {
</span><del>- CSSValue* parsedValue = nullptr;
</del><ins>+ RefPtr<CSSValue> parsedValue;
</ins><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> parsedValue = consumeIdent(range);
</span><span class="cx"> else
</span><span class="cx"> parsedValue = consumeColor(range, cssParserMode);
</span><span class="cx"> if (parsedValue) {
</span><del>- CSSValueList* values = CSSValueList::createSpaceSeparated();
- values->append(*url);
- values->append(*parsedValue);
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
+ values->append(url.releaseNonNull());
+ values->append(parsedValue.releaseNonNull());
</ins><span class="cx"> return values;
</span><span class="cx"> }
</span><span class="cx"> return url;
</span><span class="lines">@@ -1890,15 +1655,15 @@
</span><span class="cx"> return consumeColor(range, cssParserMode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumePaintOrder(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumePaintOrder(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNormal)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><span class="cx"> Vector<CSSValueID, 3> paintTypeList;
</span><del>- CSSPrimitiveValue* fill = nullptr;
- CSSPrimitiveValue* stroke = nullptr;
- CSSPrimitiveValue* markers = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> fill;
+ RefPtr<CSSPrimitiveValue> stroke;
+ RefPtr<CSSPrimitiveValue> markers;
</ins><span class="cx"> do {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueFill && !fill)
</span><span class="lines">@@ -1916,21 +1681,21 @@
</span><span class="cx"> // pop a last list items from CSSValueList without bigger cost, we create the
</span><span class="cx"> // list after parsing.
</span><span class="cx"> CSSValueID firstPaintOrderType = paintTypeList.at(0);
</span><del>- CSSValueList* paintOrderList = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> paintOrderList = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> switch (firstPaintOrderType) {
</span><span class="cx"> case CSSValueFill:
</span><span class="cx"> case CSSValueStroke:
</span><del>- paintOrderList->append(firstPaintOrderType == CSSValueFill ? *fill : *stroke);
</del><ins>+ paintOrderList->append(firstPaintOrderType == CSSValueFill ? fill.releaseNonNull() : stroke.releaseNonNull());
</ins><span class="cx"> if (paintTypeList.size() > 1) {
</span><span class="cx"> if (paintTypeList.at(1) == CSSValueMarkers)
</span><del>- paintOrderList->append(*markers);
</del><ins>+ paintOrderList->append(markers.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case CSSValueMarkers:
</span><del>- paintOrderList->append(*markers);
</del><ins>+ paintOrderList->append(markers.releaseNonNull());
</ins><span class="cx"> if (paintTypeList.size() > 1) {
</span><span class="cx"> if (paintTypeList.at(1) == CSSValueStroke)
</span><del>- paintOrderList->append(*stroke);
</del><ins>+ paintOrderList->append(stroke.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="lines">@@ -1940,7 +1705,7 @@
</span><span class="cx"> return paintOrderList;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeNoneOrURI(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeNoneOrURI(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1947,7 +1712,7 @@
</span><span class="cx"> return consumeUrl(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFlexBasis(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeFlexBasis(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: Support intrinsic dimensions too.
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="lines">@@ -1955,23 +1720,23 @@
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeStrokeDasharray(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeStrokeDasharray(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* dashes = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> dashes = CSSValueList::createCommaSeparated();
</ins><span class="cx"> do {
</span><del>- CSSPrimitiveValue* dash = consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> dash = consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeNonNegative);
</ins><span class="cx"> if (!dash || (consumeCommaIncludingWhitespace(range) && range.atEnd()))
</span><span class="cx"> return nullptr;
</span><del>- dashes->append(*dash);
</del><ins>+ dashes->append(dash.releaseNonNull());
</ins><span class="cx"> } while (!range.atEnd());
</span><span class="cx"> return dashes;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeBaselineShift(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBaselineShift(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueBaseline || id == CSSValueSub || id == CSSValueSuper)
</span><span class="lines">@@ -1979,7 +1744,7 @@
</span><span class="cx"> return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeRxOrRy(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeRxOrRy(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -1986,10 +1751,10 @@
</span><span class="cx"> return consumeLengthOrPercent(range, SVGAttributeMode, ValueRangeAll, UnitlessQuirk::Forbid);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeCursor(CSSParserTokenRange& range, const CSSParserContext& context, bool inQuirksMode)
</del><ins>+static RefPtr<CSSValue> consumeCursor(CSSParserTokenRange& range, const CSSParserContext& context, bool inQuirksMode)
</ins><span class="cx"> {
</span><del>- CSSValueList* list = nullptr;
- while (CSSValue* image = consumeImage(range, context, ConsumeGeneratedImage::Forbid)) {
</del><ins>+ RefPtr<CSSValueList> list;
+ while (RefPtr<CSSValue> image = consumeImage(range, context, ConsumeGeneratedImage::Forbid)) {
</ins><span class="cx"> double num;
</span><span class="cx"> IntPoint hotSpot(-1, -1);
</span><span class="cx"> bool hotSpotSpecified = false;
</span><span class="lines">@@ -2004,23 +1769,17 @@
</span><span class="cx"> if (!list)
</span><span class="cx"> list = CSSValueList::createCommaSeparated();
</span><span class="cx">
</span><del>- list->append(*CSSCursorImageValue::create(image, hotSpotSpecified, hotSpot));
</del><ins>+ list->append(CSSCursorImageValue::create(image.releaseNonNull(), hotSpotSpecified, hotSpot));
</ins><span class="cx"> if (!consumeCommaIncludingWhitespace(range))
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><del>- if (!range.atEnd() && context.useCounter()) {
- if (id == CSSValueWebkitZoomIn)
- context.useCounter()->count(UseCounter::PrefixedCursorZoomIn);
- else if (id == CSSValueWebkitZoomOut)
- context.useCounter()->count(UseCounter::PrefixedCursorZoomOut);
- }
- CSSValue* cursorType = nullptr;
</del><ins>+ RefPtr<CSSValue> cursorType;
</ins><span class="cx"> if (id == CSSValueHand) {
</span><span class="cx"> if (!inQuirksMode) // Non-standard behavior
</span><span class="cx"> return nullptr;
</span><del>- cursorType = CSSPrimitiveValue::createIdentifier(CSSValuePointer);
</del><ins>+ cursorType = CSSValuePool::singleton().createIdentifierValue(CSSValuePointer);
</ins><span class="cx"> range.consumeIncludingWhitespace();
</span><span class="cx"> } else if ((id >= CSSValueAuto && id <= CSSValueWebkitZoomOut) || id == CSSValueCopy || id == CSSValueNone) {
</span><span class="cx"> cursorType = consumeIdent(range);
</span><span class="lines">@@ -2030,66 +1789,68 @@
</span><span class="cx">
</span><span class="cx"> if (!list)
</span><span class="cx"> return cursorType;
</span><del>- list->append(*cursorType);
</del><ins>+ list->append(cursorType.releaseNonNull());
</ins><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeAttr(CSSParserTokenRange args, CSSParserContext context)
</del><ins>+static RefPtr<CSSValue> consumeAttr(CSSParserTokenRange args, CSSParserContext context)
</ins><span class="cx"> {
</span><span class="cx"> if (args.peek().type() != IdentToken)
</span><span class="cx"> return nullptr;
</span><ins>+
+ StringView stringView = args.consumeIncludingWhitespace().value();
+ if (context.isHTMLDocument)
+ convertToASCIILowercaseInPlace(stringView);
</ins><span class="cx">
</span><del>- String attrName = args.consumeIncludingWhitespace().value().toString();
</del><ins>+ String attrName = stringView.toString();
</ins><span class="cx"> if (!args.atEnd())
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- if (context.isHTMLDocument())
- attrName = attrName.lower();
-
- CSSFunctionValue* attrValue = CSSFunctionValue::create(CSSValueAttr);
- attrValue->append(*CSSCustomIdentValue::create(attrName));
</del><ins>+ RefPtr<CSSFunctionValue> attrValue = CSSFunctionValue::create(CSSValueAttr);
+ attrValue->append(CSSCustomIdentValue::create(attrName));
</ins><span class="cx"> return attrValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeCounterContent(CSSParserTokenRange args, bool counters)
</del><ins>+static RefPtr<CSSValue> consumeCounterContent(CSSParserTokenRange args, bool counters)
</ins><span class="cx"> {
</span><del>- CSSCustomIdentValue* identifier = consumeCustomIdent(args);
</del><ins>+ RefPtr<CSSPrimitiveValue> identifier = consumeCustomIdent(args);
</ins><span class="cx"> if (!identifier)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- CSSStringValue* separator = nullptr;
- if (!counters) {
- separator = CSSStringValue::create(String());
- } else {
</del><ins>+ RefPtr<CSSPrimitiveValue> separator;
+ if (!counters)
+ separator = CSSPrimitiveValue::create(String(), CSSPrimitiveValue::UnitTypes::CSS_STRING);
+ else {
</ins><span class="cx"> if (!consumeCommaIncludingWhitespace(args) || args.peek().type() != StringToken)
</span><span class="cx"> return nullptr;
</span><del>- separator = CSSStringValue::create(args.consumeIncludingWhitespace().value().toString());
</del><ins>+ separator = CSSPrimitiveValue::create(args.consumeIncludingWhitespace().value().toString(), CSSPrimitiveValue::UnitTypes::CSS_STRING);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- CSSPrimitiveValue* listStyle = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> listStyle;
</ins><span class="cx"> if (consumeCommaIncludingWhitespace(args)) {
</span><span class="cx"> CSSValueID id = args.peek().id();
</span><span class="cx"> if ((id != CSSValueNone && (id < CSSValueDisc || id > CSSValueKatakanaIroha)))
</span><span class="cx"> return nullptr;
</span><span class="cx"> listStyle = consumeIdent(args);
</span><del>- } else {
- listStyle = CSSPrimitiveValue::createIdentifier(CSSValueDecimal);
- }
</del><ins>+ } else
+ listStyle = CSSValuePool::singleton().createIdentifierValue(CSSValueDecimal);
</ins><span class="cx">
</span><span class="cx"> if (!args.atEnd())
</span><span class="cx"> return nullptr;
</span><del>- return CSSCounterValue::create(identifier, listStyle, separator);
</del><ins>+
+ // FIXME-NEWPARSER: Should just have a CSSCounterValue.
+ return CSSValuePool::singleton().createValue(Counter::create(identifier.releaseNonNull(), listStyle.releaseNonNull(), separator.releaseNonNull()));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeContent(CSSParserTokenRange& range, CSSParserContext context)
</del><ins>+static RefPtr<CSSValue> consumeContent(CSSParserTokenRange& range, CSSParserContext context)
</ins><span class="cx"> {
</span><span class="cx"> if (identMatches<CSSValueNone, CSSValueNormal>(range.peek().id()))
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSValueList* values = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
</ins><span class="cx">
</span><span class="cx"> do {
</span><del>- CSSValue* parsedValue = consumeImage(range, context);
</del><ins>+ RefPtr<CSSValue> parsedValue = consumeImage(range, context);
</ins><span class="cx"> if (!parsedValue)
</span><span class="cx"> parsedValue = consumeIdent<CSSValueOpenQuote, CSSValueCloseQuote, CSSValueNoOpenQuote, CSSValueNoCloseQuote>(range);
</span><span class="cx"> if (!parsedValue)
</span><span class="lines">@@ -2104,22 +1865,23 @@
</span><span class="cx"> if (!parsedValue)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- values->append(*parsedValue);
</del><ins>+ values->append(parsedValue.releaseNonNull());
</ins><span class="cx"> } while (!range.atEnd());
</span><span class="cx">
</span><span class="cx"> return values;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumePerspective(CSSParserTokenRange& range, CSSParserMode cssParserMode, CSSPropertyID unresolvedProperty)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumePerspective(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><del>- CSSPrimitiveValue* parsedValue = consumeLength(range, cssParserMode, ValueRangeAll);
- if (!parsedValue && (unresolvedProperty == CSSPropertyAliasWebkitPerspective)) {
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue = consumeLength(range, cssParserMode, ValueRangeAll);
+ if (!parsedValue) {
+ // FIXME: Make this quirk only apply to the webkit prefixed version of the property.
</ins><span class="cx"> double perspective;
</span><span class="cx"> if (!consumeNumberRaw(range, perspective))
</span><span class="cx"> return nullptr;
</span><del>- parsedValue = CSSPrimitiveValue::create(perspective, CSSPrimitiveValue::UnitType::Pixels);
</del><ins>+ parsedValue = CSSPrimitiveValue::create(perspective, CSSPrimitiveValue::UnitTypes::CSS_PX);
</ins><span class="cx"> }
</span><span class="cx"> if (parsedValue && (parsedValue->isCalculated() || parsedValue->doubleValue() > 0))
</span><span class="cx"> return parsedValue;
</span><span class="lines">@@ -2126,19 +1888,19 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumePositionList(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValueList> consumePositionList(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><del>- CSSValueList* positions = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> positions = CSSValueList::createCommaSeparated();
</ins><span class="cx"> do {
</span><del>- CSSValue* position = consumePosition(range, cssParserMode, UnitlessQuirk::Forbid);
</del><ins>+ RefPtr<CSSValue> position = consumePosition(range, cssParserMode, UnitlessQuirk::Forbid);
</ins><span class="cx"> if (!position)
</span><span class="cx"> return nullptr;
</span><del>- positions->append(*position);
</del><ins>+ positions->append(position.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx"> return positions;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeScrollSnapCoordinate(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeScrollSnapCoordinate(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -2145,16 +1907,16 @@
</span><span class="cx"> return consumePositionList(range, cssParserMode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeScrollSnapPoints(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeScrollSnapPoints(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx"> if (range.peek().functionId() == CSSValueRepeat) {
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(range);
</span><del>- CSSPrimitiveValue* parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative);
</ins><span class="cx"> if (args.atEnd() && parsedValue && (parsedValue->isCalculated() || parsedValue->doubleValue() > 0)) {
</span><del>- CSSFunctionValue* result = CSSFunctionValue::create(CSSValueRepeat);
- result->append(*parsedValue);
</del><ins>+ RefPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueRepeat);
+ result->append(parsedValue.releaseNonNull());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2161,26 +1923,26 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><del>- CSSValue* parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
</ins><span class="cx"> if (!parsedValue1)
</span><span class="cx"> return nullptr;
</span><del>- CSSValue* parsedValue2 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue2 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
</ins><span class="cx"> if (!parsedValue2)
</span><span class="cx"> parsedValue2 = parsedValue1;
</span><del>- return CSSValuePair::create(parsedValue1, parsedValue2, CSSValuePair::DropIdenticalValues);
</del><ins>+ return createPrimitiveValuePair(parsedValue1.releaseNonNull(), parsedValue2.releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeVerticalAlign(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeVerticalAlign(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* parsedValue = consumeIdentRange(range, CSSValueBaseline, CSSValueWebkitBaselineMiddle);
</del><ins>+ RefPtr<CSSPrimitiveValue> parsedValue = consumeIdentRange(range, CSSValueBaseline, CSSValueWebkitBaselineMiddle);
</ins><span class="cx"> if (!parsedValue)
</span><span class="cx"> parsedValue = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow);
</span><span class="cx"> return parsedValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeShapeRadius(CSSParserTokenRange& args, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeShapeRadius(CSSParserTokenRange& args, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (identMatches<CSSValueClosestSide, CSSValueFarthestSide>(args.peek().id()))
</span><span class="cx"> return consumeIdent(args);
</span><span class="lines">@@ -2187,48 +1949,48 @@
</span><span class="cx"> return consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSBasicShapeCircleValue* consumeBasicShapeCircle(CSSParserTokenRange& args, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSBasicShapeCircle> consumeBasicShapeCircle(CSSParserTokenRange& args, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> // spec: https://drafts.csswg.org/css-shapes/#supported-basic-shapes
</span><span class="cx"> // circle( [<shape-radius>]? [at <position>]? )
</span><del>- CSSBasicShapeCircleValue* shape = CSSBasicShapeCircleValue::create();
- if (CSSPrimitiveValue* radius = consumeShapeRadius(args, context.mode()))
- shape->setRadius(radius);
</del><ins>+ RefPtr<CSSBasicShapeCircle> shape = CSSBasicShapeCircle::create();
+ if (RefPtr<CSSPrimitiveValue> radius = consumeShapeRadius(args, context.mode))
+ shape->setRadius(radius.releaseNonNull());
</ins><span class="cx"> if (consumeIdent<CSSValueAt>(args)) {
</span><del>- CSSValue* centerX = nullptr;
- CSSValue* centerY = nullptr;
- if (!consumePosition(args, context.mode(), UnitlessQuirk::Forbid, centerX, centerY))
</del><ins>+ RefPtr<CSSPrimitiveValue> centerX;
+ RefPtr<CSSPrimitiveValue> centerY;
+ if (!consumePosition(args, context.mode, UnitlessQuirk::Forbid, centerX, centerY))
</ins><span class="cx"> return nullptr;
</span><del>- shape->setCenterX(centerX);
- shape->setCenterY(centerY);
</del><ins>+ shape->setCenterX(centerX.releaseNonNull());
+ shape->setCenterY(centerY.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> return shape;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSBasicShapeEllipseValue* consumeBasicShapeEllipse(CSSParserTokenRange& args, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSBasicShapeEllipse> consumeBasicShapeEllipse(CSSParserTokenRange& args, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> // spec: https://drafts.csswg.org/css-shapes/#supported-basic-shapes
</span><span class="cx"> // ellipse( [<shape-radius>{2}]? [at <position>]? )
</span><del>- CSSBasicShapeEllipseValue* shape = CSSBasicShapeEllipseValue::create();
- if (CSSPrimitiveValue* radiusX = consumeShapeRadius(args, context.mode())) {
- shape->setRadiusX(radiusX);
- if (CSSPrimitiveValue* radiusY = consumeShapeRadius(args, context.mode()))
- shape->setRadiusY(radiusY);
</del><ins>+ RefPtr<CSSBasicShapeEllipse> shape = CSSBasicShapeEllipse::create();
+ if (RefPtr<CSSPrimitiveValue> radiusX = consumeShapeRadius(args, context.mode)) {
+ shape->setRadiusX(radiusX.releaseNonNull());
+ if (RefPtr<CSSPrimitiveValue> radiusY = consumeShapeRadius(args, context.mode))
+ shape->setRadiusY(radiusY.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> if (consumeIdent<CSSValueAt>(args)) {
</span><del>- CSSValue* centerX = nullptr;
- CSSValue* centerY = nullptr;
- if (!consumePosition(args, context.mode(), UnitlessQuirk::Forbid, centerX, centerY))
</del><ins>+ RefPtr<CSSPrimitiveValue> centerX;
+ RefPtr<CSSPrimitiveValue> centerY;
+ if (!consumePosition(args, context.mode, UnitlessQuirk::Forbid, centerX, centerY))
</ins><span class="cx"> return nullptr;
</span><del>- shape->setCenterX(centerX);
- shape->setCenterY(centerY);
</del><ins>+ shape->setCenterX(centerX.releaseNonNull());
+ shape->setCenterY(centerY.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> return shape;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSBasicShapePolygonValue* consumeBasicShapePolygon(CSSParserTokenRange& args, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSBasicShapePolygon> consumeBasicShapePolygon(CSSParserTokenRange& args, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSBasicShapePolygonValue* shape = CSSBasicShapePolygonValue::create();
</del><ins>+ RefPtr<CSSBasicShapePolygon> shape = CSSBasicShapePolygon::create();
</ins><span class="cx"> if (identMatches<CSSValueEvenodd, CSSValueNonzero>(args.peek().id())) {
</span><span class="cx"> shape->setWindRule(args.consumeIncludingWhitespace().id() == CSSValueEvenodd ? RULE_EVENODD : RULE_NONZERO);
</span><span class="cx"> if (!consumeCommaIncludingWhitespace(args))
</span><span class="lines">@@ -2236,18 +1998,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> do {
</span><del>- CSSPrimitiveValue* xLength = consumeLengthOrPercent(args, context.mode(), ValueRangeAll);
</del><ins>+ RefPtr<CSSPrimitiveValue> xLength = consumeLengthOrPercent(args, context.mode, ValueRangeAll);
</ins><span class="cx"> if (!xLength)
</span><span class="cx"> return nullptr;
</span><del>- CSSPrimitiveValue* yLength = consumeLengthOrPercent(args, context.mode(), ValueRangeAll);
</del><ins>+ RefPtr<CSSPrimitiveValue> yLength = consumeLengthOrPercent(args, context.mode, ValueRangeAll);
</ins><span class="cx"> if (!yLength)
</span><span class="cx"> return nullptr;
</span><del>- shape->appendPoint(xLength, yLength);
</del><ins>+ shape->appendPoint(xLength.releaseNonNull(), yLength.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(args));
</span><span class="cx"> return shape;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void complete4Sides(CSSPrimitiveValue* side[4])
</del><ins>+static void complete4Sides(RefPtr<CSSPrimitiveValue> side[4])
</ins><span class="cx"> {
</span><span class="cx"> if (side[3])
</span><span class="cx"> return;
</span><span class="lines">@@ -2259,7 +2021,7 @@
</span><span class="cx"> side[3] = side[1];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeRadii(CSSPrimitiveValue* horizontalRadii[4], CSSPrimitiveValue* verticalRadii[4], CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing)
</del><ins>+static bool consumeRadii(RefPtr<CSSPrimitiveValue> horizontalRadii[4], RefPtr<CSSPrimitiveValue> verticalRadii[4], CSSParserTokenRange& range, CSSParserMode cssParserMode, bool useLegacyParsing)
</ins><span class="cx"> {
</span><span class="cx"> unsigned i = 0;
</span><span class="cx"> for (; i < 4 && !range.atEnd() && range.peek().type() != DelimiterToken; ++i) {
</span><span class="lines">@@ -2296,50 +2058,53 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSBasicShapeInsetValue* consumeBasicShapeInset(CSSParserTokenRange& args, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSBasicShapeInset> consumeBasicShapeInset(CSSParserTokenRange& args, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSBasicShapeInsetValue* shape = CSSBasicShapeInsetValue::create();
- CSSPrimitiveValue* top = consumeLengthOrPercent(args, context.mode(), ValueRangeAll);
</del><ins>+ RefPtr<CSSBasicShapeInset> shape = CSSBasicShapeInset::create();
+ RefPtr<CSSPrimitiveValue> top = consumeLengthOrPercent(args, context.mode, ValueRangeAll);
</ins><span class="cx"> if (!top)
</span><span class="cx"> return nullptr;
</span><del>- CSSPrimitiveValue* right = consumeLengthOrPercent(args, context.mode(), ValueRangeAll);
- CSSPrimitiveValue* bottom = nullptr;
- CSSPrimitiveValue* left = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> right = consumeLengthOrPercent(args, context.mode, ValueRangeAll);
+ RefPtr<CSSPrimitiveValue> bottom;
+ RefPtr<CSSPrimitiveValue> left;
</ins><span class="cx"> if (right) {
</span><del>- bottom = consumeLengthOrPercent(args, context.mode(), ValueRangeAll);
</del><ins>+ bottom = consumeLengthOrPercent(args, context.mode, ValueRangeAll);
</ins><span class="cx"> if (bottom)
</span><del>- left = consumeLengthOrPercent(args, context.mode(), ValueRangeAll);
</del><ins>+ left = consumeLengthOrPercent(args, context.mode, ValueRangeAll);
</ins><span class="cx"> }
</span><span class="cx"> if (left)
</span><del>- shape->updateShapeSize4Values(top, right, bottom, left);
</del><ins>+ shape->updateShapeSize4Values(top.releaseNonNull(), right.releaseNonNull(), bottom.releaseNonNull(), left.releaseNonNull());
</ins><span class="cx"> else if (bottom)
</span><del>- shape->updateShapeSize3Values(top, right, bottom);
</del><ins>+ shape->updateShapeSize3Values(top.releaseNonNull(), right.releaseNonNull(), bottom.releaseNonNull());
</ins><span class="cx"> else if (right)
</span><del>- shape->updateShapeSize2Values(top, right);
</del><ins>+ shape->updateShapeSize2Values(top.releaseNonNull(), right.releaseNonNull());
</ins><span class="cx"> else
</span><del>- shape->updateShapeSize1Value(top);
</del><ins>+ shape->updateShapeSize1Value(top.releaseNonNull());
</ins><span class="cx">
</span><span class="cx"> if (consumeIdent<CSSValueRound>(args)) {
</span><del>- CSSPrimitiveValue* horizontalRadii[4] = { 0 };
- CSSPrimitiveValue* verticalRadii[4] = { 0 };
- if (!consumeRadii(horizontalRadii, verticalRadii, args, context.mode(), false))
</del><ins>+ RefPtr<CSSPrimitiveValue> horizontalRadii[4] = { 0 };
+ RefPtr<CSSPrimitiveValue> verticalRadii[4] = { 0 };
+ if (!consumeRadii(horizontalRadii, verticalRadii, args, context.mode, false))
</ins><span class="cx"> return nullptr;
</span><del>- shape->setTopLeftRadius(CSSValuePair::create(horizontalRadii[0], verticalRadii[0], CSSValuePair::DropIdenticalValues));
- shape->setTopRightRadius(CSSValuePair::create(horizontalRadii[1], verticalRadii[1], CSSValuePair::DropIdenticalValues));
- shape->setBottomRightRadius(CSSValuePair::create(horizontalRadii[2], verticalRadii[2], CSSValuePair::DropIdenticalValues));
- shape->setBottomLeftRadius(CSSValuePair::create(horizontalRadii[3], verticalRadii[3], CSSValuePair::DropIdenticalValues));
</del><ins>+ shape->setTopLeftRadius(createPrimitiveValuePair(horizontalRadii[0].releaseNonNull(), verticalRadii[0].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce));
+ shape->setTopRightRadius(createPrimitiveValuePair(horizontalRadii[1].releaseNonNull(), verticalRadii[1].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce));
+ shape->setBottomRightRadius(createPrimitiveValuePair(horizontalRadii[2].releaseNonNull(), verticalRadii[2].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce));
+ shape->setBottomLeftRadius(createPrimitiveValuePair(horizontalRadii[3].releaseNonNull(), verticalRadii[3].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce));
</ins><span class="cx"> }
</span><span class="cx"> return shape;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBasicShape(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeBasicShape(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSValue* shape = nullptr;
</del><ins>+ RefPtr<CSSValue> result;
</ins><span class="cx"> if (range.peek().type() != FunctionToken)
</span><span class="cx"> return nullptr;
</span><span class="cx"> CSSValueID id = range.peek().functionId();
</span><span class="cx"> CSSParserTokenRange rangeCopy = range;
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(rangeCopy);
</span><ins>+
+ // FIXME-NEWPARSER: CSSBasicShape should be a CSSValue, and shapes should not be primitive values.
+ RefPtr<CSSBasicShape> shape;
</ins><span class="cx"> if (id == CSSValueCircle)
</span><span class="cx"> shape = consumeBasicShapeCircle(args, context);
</span><span class="cx"> else if (id == CSSValueEllipse)
</span><span class="lines">@@ -2351,30 +2116,31 @@
</span><span class="cx"> if (!shape || !args.atEnd())
</span><span class="cx"> return nullptr;
</span><span class="cx"> range = rangeCopy;
</span><del>- return shape;
</del><ins>+
+ return CSSValuePool::singleton().createValue(shape.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeWebkitClipPath(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeWebkitClipPath(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><del>- if (CSSURIValue* url = consumeUrl(range))
</del><ins>+ if (RefPtr<CSSPrimitiveValue> url = consumeUrl(range))
</ins><span class="cx"> return url;
</span><span class="cx"> return consumeBasicShape(range, context);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeShapeOutside(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeShapeOutside(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- if (CSSValue* imageValue = consumeImageOrNone(range, context))
</del><ins>+ if (RefPtr<CSSValue> imageValue = consumeImageOrNone(range, context))
</ins><span class="cx"> return imageValue;
</span><del>- CSSValueList* list = CSSValueList::createSpaceSeparated();
- if (CSSValue* boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range))
- list->append(*boxValue);
- if (CSSValue* shapeValue = consumeBasicShape(range, context)) {
- list->append(*shapeValue);
</del><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ if (RefPtr<CSSValue> boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range))
+ list->append(boxValue.releaseNonNull());
+ if (RefPtr<CSSValue> shapeValue = consumeBasicShape(range, context)) {
+ list->append(shapeValue.releaseNonNull());
</ins><span class="cx"> if (list->length() < 2) {
</span><del>- if (CSSValue* boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range))
- list->append(*boxValue);
</del><ins>+ if (RefPtr<CSSValue> boxValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox>(range))
+ list->append(boxValue.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> if (!list->length())
</span><span class="lines">@@ -2382,7 +2148,7 @@
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeContentDistributionOverflowPosition(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeContentDistributionOverflowPosition(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (identMatches<CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline>(range.peek().id()))
</span><span class="cx"> return CSSContentDistributionValue::create(CSSValueInvalid, range.consumeIncludingWhitespace().id(), CSSValueInvalid);
</span><span class="lines">@@ -2421,29 +2187,29 @@
</span><span class="cx"> return CSSContentDistributionValue::create(distribution, position, overflow);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeBorderImageRepeatKeyword(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBorderImageRepeatKeyword(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdent<CSSValueStretch, CSSValueRepeat, CSSValueSpace, CSSValueRound>(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBorderImageRepeat(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeBorderImageRepeat(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* horizontal = consumeBorderImageRepeatKeyword(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> horizontal = consumeBorderImageRepeatKeyword(range);
</ins><span class="cx"> if (!horizontal)
</span><span class="cx"> return nullptr;
</span><del>- CSSPrimitiveValue* vertical = consumeBorderImageRepeatKeyword(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> vertical = consumeBorderImageRepeatKeyword(range);
</ins><span class="cx"> if (!vertical)
</span><span class="cx"> vertical = horizontal;
</span><del>- return CSSValuePair::create(horizontal, vertical, CSSValuePair::DropIdenticalValues);
</del><ins>+ return createPrimitiveValuePair(horizontal.releaseNonNull(), vertical.releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBorderImageSlice(CSSPropertyID property, CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeBorderImageSlice(CSSPropertyID property, CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> bool fill = consumeIdent<CSSValueFill>(range);
</span><del>- CSSPrimitiveValue* slices[4] = { 0 };
</del><ins>+ RefPtr<CSSPrimitiveValue> slices[4] = { 0 };
</ins><span class="cx">
</span><span class="cx"> for (size_t index = 0; index < 4; ++index) {
</span><del>- CSSPrimitiveValue* value = consumePercent(range, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSPrimitiveValue> value = consumePercent(range, ValueRangeNonNegative);
</ins><span class="cx"> if (!value)
</span><span class="cx"> value = consumeNumber(range, ValueRangeNonNegative);
</span><span class="cx"> if (!value)
</span><span class="lines">@@ -2462,14 +2228,24 @@
</span><span class="cx"> // FIXME: What do we do with -webkit-box-reflect and -webkit-mask-box-image? Probably just have to leave them filling...
</span><span class="cx"> if (property == CSSPropertyWebkitBorderImage || property == CSSPropertyWebkitMaskBoxImage || property == CSSPropertyWebkitBoxReflect)
</span><span class="cx"> fill = true;
</span><del>- return CSSBorderImageSliceValue::create(CSSQuadValue::create(slices[0], slices[1], slices[2], slices[3], CSSQuadValue::SerializeAsQuad), fill);
</del><ins>+
+ // Now build a rect value to hold all four of our primitive values.
+ // FIXME-NEWPARSER: Should just have a CSSQuadValue.
+ auto quad = Quad::create();
+ quad->setTop(slices[0].releaseNonNull());
+ quad->setRight(slices[1].releaseNonNull());
+ quad->setBottom(slices[2].releaseNonNull());
+ quad->setLeft(slices[3].releaseNonNull());
+
+ // Make our new border image value now.
+ return CSSBorderImageSliceValue::create(CSSValuePool::singleton().createValue(WTFMove(quad)), fill);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBorderImageOutset(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeBorderImageOutset(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* outsets[4] = { 0 };
</del><ins>+ RefPtr<CSSPrimitiveValue> outsets[4] = { 0 };
</ins><span class="cx">
</span><del>- CSSPrimitiveValue* value = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> value;
</ins><span class="cx"> for (size_t index = 0; index < 4; ++index) {
</span><span class="cx"> value = consumeNumber(range, ValueRangeNonNegative);
</span><span class="cx"> if (!value)
</span><span class="lines">@@ -2481,14 +2257,22 @@
</span><span class="cx"> if (!outsets[0])
</span><span class="cx"> return nullptr;
</span><span class="cx"> complete4Sides(outsets);
</span><del>- return CSSQuadValue::create(outsets[0], outsets[1], outsets[2], outsets[3], CSSQuadValue::SerializeAsQuad);
</del><ins>+
+ // FIXME-NEWPARSER: Should just have a CSSQuadValue.
+ auto quad = Quad::create();
+ quad->setTop(outsets[0].releaseNonNull());
+ quad->setRight(outsets[1].releaseNonNull());
+ quad->setBottom(outsets[2].releaseNonNull());
+ quad->setLeft(outsets[3].releaseNonNull());
+
+ return CSSValuePool::singleton().createValue(WTFMove(quad));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBorderImageWidth(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeBorderImageWidth(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* widths[4] = { 0 };
</del><ins>+ RefPtr<CSSPrimitiveValue> widths[4];
</ins><span class="cx">
</span><del>- CSSPrimitiveValue* value = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> value;
</ins><span class="cx"> for (size_t index = 0; index < 4; ++index) {
</span><span class="cx"> value = consumeNumber(range, ValueRangeNonNegative);
</span><span class="cx"> if (!value)
</span><span class="lines">@@ -2502,11 +2286,19 @@
</span><span class="cx"> if (!widths[0])
</span><span class="cx"> return nullptr;
</span><span class="cx"> complete4Sides(widths);
</span><del>- return CSSQuadValue::create(widths[0], widths[1], widths[2], widths[3], CSSQuadValue::SerializeAsQuad);
</del><ins>+
+ // FIXME-NEWPARSER: Should just have a CSSQuadValue.
+ auto quad = Quad::create();
+ quad->setTop(widths[0].releaseNonNull());
+ quad->setRight(widths[1].releaseNonNull());
+ quad->setBottom(widths[2].releaseNonNull());
+ quad->setLeft(widths[3].releaseNonNull());
+
+ return CSSValuePool::singleton().createValue(WTFMove(quad));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeBorderImageComponents(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, CSSValue*& source,
- CSSValue*& slice, CSSValue*& width, CSSValue*& outset, CSSValue*& repeat)
</del><ins>+static bool consumeBorderImageComponents(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context, RefPtr<CSSValue>& source,
+ RefPtr<CSSValue>& slice, RefPtr<CSSValue>& width, RefPtr<CSSValue>& outset, RefPtr<CSSValue>& repeat)
</ins><span class="cx"> {
</span><span class="cx"> do {
</span><span class="cx"> if (!source) {
</span><span class="lines">@@ -2543,62 +2335,55 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeWebkitBorderImage(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeWebkitBorderImage(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSValue* source = nullptr;
- CSSValue* slice = nullptr;
- CSSValue* width = nullptr;
- CSSValue* outset = nullptr;
- CSSValue* repeat = nullptr;
</del><ins>+ RefPtr<CSSValue> source;
+ RefPtr<CSSValue> slice;
+ RefPtr<CSSValue> width;
+ RefPtr<CSSValue> outset;
+ RefPtr<CSSValue> repeat;
</ins><span class="cx"> if (consumeBorderImageComponents(property, range, context, source, slice, width, outset, repeat))
</span><del>- return createBorderImageValue(source, slice, width, outset, repeat);
</del><ins>+ return createBorderImageValue(WTFMove(source), WTFMove(slice), WTFMove(width), WTFMove(outset), WTFMove(repeat));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeReflect(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeReflect(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* direction = consumeIdent<CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> direction = consumeIdent<CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range);
</ins><span class="cx"> if (!direction)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- CSSPrimitiveValue* offset = nullptr;
- if (range.atEnd()) {
- offset = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pixels);
- } else {
- offset = consumeLengthOrPercent(range, context.mode(), ValueRangeAll, UnitlessQuirk::Forbid);
</del><ins>+ RefPtr<CSSPrimitiveValue> offset;
+ if (range.atEnd())
+ offset = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitTypes::CSS_PX);
+ else {
+ offset = consumeLengthOrPercent(range, context.mode, ValueRangeAll, UnitlessQuirk::Forbid);
</ins><span class="cx"> if (!offset)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- CSSValue* mask = nullptr;
</del><ins>+ RefPtr<CSSValue> mask;
</ins><span class="cx"> if (!range.atEnd()) {
</span><span class="cx"> mask = consumeWebkitBorderImage(CSSPropertyWebkitBoxReflect, range, context);
</span><span class="cx"> if (!mask)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- return CSSReflectValue::create(direction, offset, mask);
</del><ins>+ return CSSReflectValue::create(direction.releaseNonNull(), offset.releaseNonNull(), mask.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFontSizeAdjust(CSSParserTokenRange& range)
</del><ins>+#if ENABLE(CSS_IMAGE_ORIENTATION)
+static RefPtr<CSSValue> consumeImageOrientation(CSSParserTokenRange& range, CSSParserMode cssParserMode, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
</ins><span class="cx"> {
</span><del>- if (range.peek().id() == CSSValueNone)
- return consumeIdent(range);
- return consumeNumber(range, ValueRangeNonNegative);
-}
-
-static CSSValue* consumeImageOrientation(CSSParserTokenRange& range)
-{
- if (range.peek().id() == CSSValueFromImage)
- return consumeIdent(range);
</del><span class="cx"> if (range.peek().type() != NumberToken) {
</span><del>- CSSPrimitiveValue* angle = consumeAngle(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> angle = consumeAngle(range, cssParserMode, unitless);
</ins><span class="cx"> if (angle && angle->doubleValue() == 0)
</span><span class="cx"> return angle;
</span><span class="cx"> }
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx">
</span><del>-static CSSValue* consumeBackgroundBlendMode(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBackgroundBlendMode(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueNormal || id == CSSValueOverlay || (id >= CSSValueMultiply && id <= CSSValueLuminosity))
</span><span class="lines">@@ -2606,31 +2391,25 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBackgroundAttachment(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBackgroundAttachment(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdent<CSSValueScroll, CSSValueFixed, CSSValueLocal>(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBackgroundBox(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBackgroundBox(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdent<CSSValueBorderBox, CSSValuePaddingBox, CSSValueContentBox>(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBackgroundComposite(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBackgroundComposite(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> return consumeIdentRange(range, CSSValueClear, CSSValuePlusLighter);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeMaskSourceType(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumePrefixedBackgroundBox(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& /*context*/)
</ins><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssMaskSourceTypeEnabled());
- return consumeIdent<CSSValueAuto, CSSValueAlpha, CSSValueLuminance>(range);
-}
-
-static CSSValue* consumePrefixedBackgroundBox(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
-{
</del><span class="cx"> // The values 'border', 'padding' and 'content' are deprecated and do not apply to the version of the property that has the -webkit- prefix removed.
</span><del>- if (CSSValue* value = consumeIdentRange(range, CSSValueBorder, CSSValuePaddingBox))
</del><ins>+ if (RefPtr<CSSPrimitiveValue> value = consumeIdentRange(range, CSSValueBorder, CSSValuePaddingBox))
</ins><span class="cx"> return value;
</span><span class="cx"> if ((property == CSSPropertyWebkitBackgroundClip || property == CSSPropertyWebkitMaskClip) && range.peek().id() == CSSValueText)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -2637,50 +2416,50 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBackgroundSize(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeBackgroundSize(CSSPropertyID property, CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (identMatches<CSSValueContain, CSSValueCover>(range.peek().id()))
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSPrimitiveValue* horizontal = consumeIdent<CSSValueAuto>(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> horizontal = consumeIdent<CSSValueAuto>(range);
</ins><span class="cx"> if (!horizontal)
</span><span class="cx"> horizontal = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Forbid);
</span><span class="cx">
</span><del>- CSSPrimitiveValue* vertical = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> vertical;
</ins><span class="cx"> if (!range.atEnd()) {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto) // `auto' is the default
</span><span class="cx"> range.consumeIncludingWhitespace();
</span><span class="cx"> else
</span><span class="cx"> vertical = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Forbid);
</span><del>- } else if (unresolvedProperty == CSSPropertyAliasWebkitBackgroundSize) {
</del><ins>+ } else if (!vertical && property == CSSPropertyWebkitBackgroundSize) {
</ins><span class="cx"> // Legacy syntax: "-webkit-background-size: 10px" is equivalent to "background-size: 10px 10px".
</span><span class="cx"> vertical = horizontal;
</span><span class="cx"> }
</span><span class="cx"> if (!vertical)
</span><span class="cx"> return horizontal;
</span><del>- return CSSValuePair::create(horizontal, vertical, CSSValuePair::KeepIdenticalValues);
</del><ins>+ return createPrimitiveValuePair(horizontal.releaseNonNull(), vertical.releaseNonNull(), Pair::IdenticalValueEncoding::DoNotCoalesce);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeGridAutoFlow(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValueList> consumeGridAutoFlow(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><del>- CSSPrimitiveValue* rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range);
- CSSPrimitiveValue* denseAlgorithm = consumeIdent<CSSValueDense>(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range);
+ RefPtr<CSSPrimitiveValue> denseAlgorithm = consumeIdent<CSSValueDense>(range);
</ins><span class="cx"> if (!rowOrColumnValue) {
</span><span class="cx"> rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range);
</span><span class="cx"> if (!rowOrColumnValue && !denseAlgorithm)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- CSSValueList* parsedValues = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> if (rowOrColumnValue)
</span><del>- parsedValues->append(*rowOrColumnValue);
</del><ins>+ parsedValues->append(rowOrColumnValue.releaseNonNull());
</ins><span class="cx"> if (denseAlgorithm)
</span><del>- parsedValues->append(*denseAlgorithm);
</del><ins>+ parsedValues->append(denseAlgorithm.releaseNonNull());
</ins><span class="cx"> return parsedValues;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeBackgroundComponent(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeBackgroundComponent(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- switch (unresolvedProperty) {
</del><ins>+ switch (property) {
</ins><span class="cx"> case CSSPropertyBackgroundClip:
</span><span class="cx"> return consumeBackgroundBox(range);
</span><span class="cx"> case CSSPropertyBackgroundBlendMode:
</span><span class="lines">@@ -2691,28 +2470,26 @@
</span><span class="cx"> return consumeBackgroundBox(range);
</span><span class="cx"> case CSSPropertyWebkitMaskComposite:
</span><span class="cx"> return consumeBackgroundComposite(range);
</span><del>- case CSSPropertyMaskSourceType:
- return consumeMaskSourceType(range);
</del><span class="cx"> case CSSPropertyWebkitBackgroundClip:
</span><span class="cx"> case CSSPropertyWebkitBackgroundOrigin:
</span><span class="cx"> case CSSPropertyWebkitMaskClip:
</span><span class="cx"> case CSSPropertyWebkitMaskOrigin:
</span><del>- return consumePrefixedBackgroundBox(unresolvedProperty, range, context);
</del><ins>+ return consumePrefixedBackgroundBox(property, range, context);
</ins><span class="cx"> case CSSPropertyBackgroundImage:
</span><span class="cx"> case CSSPropertyWebkitMaskImage:
</span><span class="cx"> return consumeImageOrNone(range, context);
</span><span class="cx"> case CSSPropertyBackgroundPositionX:
</span><span class="cx"> case CSSPropertyWebkitMaskPositionX:
</span><del>- return consumePositionX(range, context.mode());
</del><ins>+ return consumePositionX(range, context.mode);
</ins><span class="cx"> case CSSPropertyBackgroundPositionY:
</span><span class="cx"> case CSSPropertyWebkitMaskPositionY:
</span><del>- return consumePositionY(range, context.mode());
</del><ins>+ return consumePositionY(range, context.mode);
</ins><span class="cx"> case CSSPropertyBackgroundSize:
</span><del>- case CSSPropertyAliasWebkitBackgroundSize:
</del><ins>+ case CSSPropertyWebkitBackgroundSize:
</ins><span class="cx"> case CSSPropertyWebkitMaskSize:
</span><del>- return consumeBackgroundSize(unresolvedProperty, range, context.mode());
</del><ins>+ return consumeBackgroundSize(property, range, context.mode);
</ins><span class="cx"> case CSSPropertyBackgroundColor:
</span><del>- return consumeColor(range, context.mode());
</del><ins>+ return consumeColor(range, context.mode);
</ins><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> };
</span><span class="lines">@@ -2719,34 +2496,34 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void addBackgroundValue(CSSValue*& list, CSSValue* value)
</del><ins>+static void addBackgroundValue(RefPtr<CSSValue>& list, Ref<CSSValue>&& value)
</ins><span class="cx"> {
</span><span class="cx"> if (list) {
</span><span class="cx"> if (!list->isBaseValueList()) {
</span><del>- CSSValue* firstValue = list;
</del><ins>+ RefPtr<CSSValue> firstValue = list;
</ins><span class="cx"> list = CSSValueList::createCommaSeparated();
</span><del>- toCSSValueList(list)->append(*firstValue);
</del><ins>+ downcast<CSSValueList>(*list).append(firstValue.releaseNonNull());
</ins><span class="cx"> }
</span><del>- toCSSValueList(list)->append(*value);
</del><ins>+ downcast<CSSValueList>(*list).append(WTFMove(value));
</ins><span class="cx"> } else {
</span><span class="cx"> // To conserve memory we don't actually wrap a single value in a list.
</span><del>- list = value;
</del><ins>+ list = WTFMove(value);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeCommaSeparatedBackgroundComponent(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeCommaSeparatedBackgroundComponent(CSSPropertyID property, CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSValue* result = nullptr;
</del><ins>+ RefPtr<CSSValue> result;
</ins><span class="cx"> do {
</span><del>- CSSValue* value = consumeBackgroundComponent(unresolvedProperty, range, context);
</del><ins>+ RefPtr<CSSValue> value = consumeBackgroundComponent(property, range, context);
</ins><span class="cx"> if (!value)
</span><span class="cx"> return nullptr;
</span><del>- addBackgroundValue(result, value);
</del><ins>+ addBackgroundValue(result, value.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeSelfPositionKeyword(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeSelfPositionKeyword(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> if (id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter
</span><span class="lines">@@ -2756,23 +2533,23 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeSelfPositionOverflowPosition(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeSelfPositionOverflowPosition(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (identMatches<CSSValueAuto, CSSValueNormal, CSSValueStretch, CSSValueBaseline, CSSValueLastBaseline>(range.peek().id()))
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSPrimitiveValue* overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range);
- CSSPrimitiveValue* selfPosition = consumeSelfPositionKeyword(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range);
+ RefPtr<CSSPrimitiveValue> selfPosition = consumeSelfPositionKeyword(range);
</ins><span class="cx"> if (!selfPosition)
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (!overflowPosition)
</span><span class="cx"> overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range);
</span><span class="cx"> if (overflowPosition)
</span><del>- return CSSValuePair::create(selfPosition, overflowPosition, CSSValuePair::DropIdenticalValues);
</del><ins>+ return createPrimitiveValuePair(selfPosition.releaseNonNull(), overflowPosition.releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce);
</ins><span class="cx"> return selfPosition;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeAlignItems(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeAlignItems(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> // align-items property does not allow the 'auto' value.
</span><span class="cx"> if (identMatches<CSSValueAuto>(range.peek().id()))
</span><span class="lines">@@ -2780,34 +2557,34 @@
</span><span class="cx"> return consumeSelfPositionOverflowPosition(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeJustifyItems(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeJustifyItems(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSParserTokenRange rangeCopy = range;
</span><del>- CSSPrimitiveValue* legacy = consumeIdent<CSSValueLegacy>(rangeCopy);
- CSSPrimitiveValue* positionKeyword = consumeIdent<CSSValueCenter, CSSValueLeft, CSSValueRight>(rangeCopy);
</del><ins>+ RefPtr<CSSPrimitiveValue> legacy = consumeIdent<CSSValueLegacy>(rangeCopy);
+ RefPtr<CSSPrimitiveValue> positionKeyword = consumeIdent<CSSValueCenter, CSSValueLeft, CSSValueRight>(rangeCopy);
</ins><span class="cx"> if (!legacy)
</span><span class="cx"> legacy = consumeIdent<CSSValueLegacy>(rangeCopy);
</span><span class="cx"> if (legacy && positionKeyword) {
</span><span class="cx"> range = rangeCopy;
</span><del>- return CSSValuePair::create(legacy, positionKeyword, CSSValuePair::DropIdenticalValues);
</del><ins>+ return createPrimitiveValuePair(legacy.releaseNonNull(), positionKeyword.releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce);
</ins><span class="cx"> }
</span><span class="cx"> return consumeSelfPositionOverflowPosition(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFitContent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeFitContent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> CSSParserTokenRange rangeCopy = range;
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(rangeCopy);
</span><del>- CSSPrimitiveValue* length = consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative, UnitlessQuirk::Allow);
</del><ins>+ RefPtr<CSSPrimitiveValue> length = consumeLengthOrPercent(args, cssParserMode, ValueRangeNonNegative, UnitlessQuirk::Allow);
</ins><span class="cx"> if (!length || !args.atEnd())
</span><span class="cx"> return nullptr;
</span><span class="cx"> range = rangeCopy;
</span><del>- CSSFunctionValue* result = CSSFunctionValue::create(CSSValueFitContent);
- result->append(*length);
</del><ins>+ RefPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueWebkitFitContent);
+ result->append(length.releaseNonNull());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSCustomIdentValue* consumeCustomIdentForGridLine(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeCustomIdentForGridLine(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto || range.peek().id() == CSSValueSpan)
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -2814,14 +2591,14 @@
</span><span class="cx"> return consumeCustomIdent(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeGridLine(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeGridLine(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx">
</span><del>- CSSPrimitiveValue* spanValue = nullptr;
- CSSCustomIdentValue* gridLineName = nullptr;
- CSSPrimitiveValue* numericValue = consumeInteger(range);
</del><ins>+ RefPtr<CSSPrimitiveValue> spanValue;
+ RefPtr<CSSPrimitiveValue> gridLineName;
+ RefPtr<CSSPrimitiveValue> numericValue = consumeInteger(range);
</ins><span class="cx"> if (numericValue) {
</span><span class="cx"> gridLineName = consumeCustomIdentForGridLine(range);
</span><span class="cx"> spanValue = consumeIdent<CSSValueSpan>(range);
</span><span class="lines">@@ -2852,13 +2629,13 @@
</span><span class="cx"> if (numericValue && numericValue->intValue() == 0)
</span><span class="cx"> return nullptr; // An <integer> value of zero makes the declaration invalid.
</span><span class="cx">
</span><del>- CSSValueList* values = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
</ins><span class="cx"> if (spanValue)
</span><del>- values->append(*spanValue);
</del><ins>+ values->append(spanValue.releaseNonNull());
</ins><span class="cx"> if (numericValue)
</span><del>- values->append(*numericValue);
</del><ins>+ values->append(numericValue.releaseNonNull());
</ins><span class="cx"> if (gridLineName)
</span><del>- values->append(*gridLineName);
</del><ins>+ values->append(gridLineName.releaseNonNull());
</ins><span class="cx"> ASSERT(values->length());
</span><span class="cx"> return values;
</span><span class="cx"> }
</span><span class="lines">@@ -2866,7 +2643,7 @@
</span><span class="cx"> static bool isGridTrackFixedSized(const CSSPrimitiveValue& primitiveValue)
</span><span class="cx"> {
</span><span class="cx"> CSSValueID valueID = primitiveValue.valueID();
</span><del>- if (valueID == CSSValueMinContent || valueID == CSSValueMaxContent || valueID == CSSValueAuto || primitiveValue.isFlex())
</del><ins>+ if (valueID == CSSValueWebkitMinContent || valueID == CSSValueWebkitMaxContent || valueID == CSSValueAuto || primitiveValue.isFlex())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="lines">@@ -2875,16 +2652,16 @@
</span><span class="cx"> static bool isGridTrackFixedSized(const CSSValue& value)
</span><span class="cx"> {
</span><span class="cx"> if (value.isPrimitiveValue())
</span><del>- return isGridTrackFixedSized(toCSSPrimitiveValue(value));
</del><ins>+ return isGridTrackFixedSized(downcast<CSSPrimitiveValue>(value));
</ins><span class="cx">
</span><span class="cx"> ASSERT(value.isFunctionValue());
</span><del>- auto& function = toCSSFunctionValue(value);
- if (function.functionType() == CSSValueFitContent)
</del><ins>+ auto& function = downcast<CSSFunctionValue>(value);
+ if (function.name() == CSSValueWebkitFitContent || function.arguments() == nullptr || function.arguments()->length() < 2)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- const CSSPrimitiveValue& minPrimitiveValue = toCSSPrimitiveValue(function.item(0));
- const CSSPrimitiveValue& maxPrimitiveValue = toCSSPrimitiveValue(function.item(1));
- return isGridTrackFixedSized(minPrimitiveValue) || isGridTrackFixedSized(maxPrimitiveValue);
</del><ins>+ CSSValue* minPrimitiveValue = downcast<CSSPrimitiveValue>(function.arguments()->item(0));
+ CSSValue* maxPrimitiveValue = downcast<CSSPrimitiveValue>(function.arguments()->item(1));
+ return isGridTrackFixedSized(*minPrimitiveValue) || isGridTrackFixedSized(*maxPrimitiveValue);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Vector<String> parseGridTemplateAreasColumnNames(const String& gridRowNames)
</span><span class="lines">@@ -2981,20 +2758,20 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeGridBreadth(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSPrimitiveValue> consumeGridBreadth(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> const CSSParserToken& token = range.peek();
</span><del>- if (identMatches<CSSValueMinContent, CSSValueMaxContent, CSSValueAuto>(token.id()))
</del><ins>+ if (identMatches<CSSValueWebkitMinContent, CSSValueWebkitMaxContent, CSSValueAuto>(token.id()))
</ins><span class="cx"> return consumeIdent(range);
</span><del>- if (token.type() == DimensionToken && token.unitType() == CSSPrimitiveValue::UnitType::Fraction) {
</del><ins>+ if (token.type() == DimensionToken && token.unitType() == CSSPrimitiveValue::UnitTypes::CSS_FR) {
</ins><span class="cx"> if (range.peek().numericValue() < 0)
</span><span class="cx"> return nullptr;
</span><del>- return CSSPrimitiveValue::create(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitType::Fraction);
</del><ins>+ return CSSPrimitiveValue::create(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitTypes::CSS_FR);
</ins><span class="cx"> }
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative, UnitlessQuirk::Allow);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> const CSSParserToken& token = range.peek();
</span><span class="cx"> if (identMatches<CSSValueAuto>(token.id()))
</span><span class="lines">@@ -3003,20 +2780,20 @@
</span><span class="cx"> if (token.functionId() == CSSValueMinmax) {
</span><span class="cx"> CSSParserTokenRange rangeCopy = range;
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(rangeCopy);
</span><del>- CSSPrimitiveValue* minTrackBreadth = consumeGridBreadth(args, cssParserMode);
</del><ins>+ RefPtr<CSSPrimitiveValue> minTrackBreadth = consumeGridBreadth(args, cssParserMode);
</ins><span class="cx"> if (!minTrackBreadth || minTrackBreadth->isFlex() || !consumeCommaIncludingWhitespace(args))
</span><span class="cx"> return nullptr;
</span><del>- CSSPrimitiveValue* maxTrackBreadth = consumeGridBreadth(args, cssParserMode);
</del><ins>+ RefPtr<CSSPrimitiveValue> maxTrackBreadth = consumeGridBreadth(args, cssParserMode);
</ins><span class="cx"> if (!maxTrackBreadth || !args.atEnd())
</span><span class="cx"> return nullptr;
</span><span class="cx"> range = rangeCopy;
</span><del>- CSSFunctionValue* result = CSSFunctionValue::create(CSSValueMinmax);
- result->append(*minTrackBreadth);
- result->append(*maxTrackBreadth);
</del><ins>+ RefPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueMinmax);
+ result->append(minTrackBreadth.releaseNonNull());
+ result->append(maxTrackBreadth.releaseNonNull());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (token.functionId() == CSSValueFitContent)
</del><ins>+ if (token.functionId() == CSSValueWebkitFitContent)
</ins><span class="cx"> return consumeFitContent(range, cssParserMode);
</span><span class="cx">
</span><span class="cx"> return consumeGridBreadth(range, cssParserMode);
</span><span class="lines">@@ -3023,19 +2800,21 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Appends to the passed in CSSGridLineNamesValue if any, otherwise creates a new one.
</span><del>-static CSSGridLineNamesValue* consumeGridLineNames(CSSParserTokenRange& range, CSSGridLineNamesValue* lineNames = nullptr)
</del><ins>+static RefPtr<CSSGridLineNamesValue> consumeGridLineNames(CSSParserTokenRange& range, CSSGridLineNamesValue* lineNames = nullptr)
</ins><span class="cx"> {
</span><span class="cx"> CSSParserTokenRange rangeCopy = range;
</span><span class="cx"> if (rangeCopy.consumeIncludingWhitespace().type() != LeftBracketToken)
</span><span class="cx"> return nullptr;
</span><del>- if (!lineNames)
- lineNames = CSSGridLineNamesValue::create();
- while (CSSCustomIdentValue* lineName = consumeCustomIdentForGridLine(rangeCopy))
- lineNames->append(*lineName);
</del><ins>+
+ RefPtr<CSSGridLineNamesValue> result = lineNames;
+ if (!result)
+ result = CSSGridLineNamesValue::create();
+ while (RefPtr<CSSPrimitiveValue> lineName = consumeCustomIdentForGridLine(rangeCopy))
+ result->append(lineName.releaseNonNull());
</ins><span class="cx"> if (rangeCopy.consumeIncludingWhitespace().type() != RightBracketToken)
</span><span class="cx"> return nullptr;
</span><span class="cx"> range = rangeCopy;
</span><del>- return lineNames;
</del><ins>+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool consumeGridTrackRepeatFunction(CSSParserTokenRange& range, CSSParserMode cssParserMode, CSSValueList& list, bool& isAutoRepeat, bool& allTracksAreFixedSized)
</span><span class="lines">@@ -3045,12 +2824,12 @@
</span><span class="cx"> // because it will be computed later, let's set it to 1.
</span><span class="cx"> size_t repetitions = 1;
</span><span class="cx"> isAutoRepeat = identMatches<CSSValueAutoFill, CSSValueAutoFit>(args.peek().id());
</span><del>- CSSValueList* repeatedValues;
- if (isAutoRepeat) {
</del><ins>+ RefPtr<CSSValueList> repeatedValues;
+ if (isAutoRepeat)
</ins><span class="cx"> repeatedValues = CSSGridAutoRepeatValue::create(args.consumeIncludingWhitespace().id());
</span><del>- } else {
</del><ins>+ else {
</ins><span class="cx"> // FIXME: a consumeIntegerRaw would be more efficient here.
</span><del>- CSSPrimitiveValue* repetition = consumePositiveInteger(args);
</del><ins>+ RefPtr<CSSPrimitiveValue> repetition = consumePositiveInteger(args);
</ins><span class="cx"> if (!repetition)
</span><span class="cx"> return false;
</span><span class="cx"> repetitions = clampTo<size_t>(repetition->doubleValue(), 0, kGridMaxTracks);
</span><span class="lines">@@ -3058,13 +2837,13 @@
</span><span class="cx"> }
</span><span class="cx"> if (!consumeCommaIncludingWhitespace(args))
</span><span class="cx"> return false;
</span><del>- CSSGridLineNamesValue* lineNames = consumeGridLineNames(args);
</del><ins>+ RefPtr<CSSGridLineNamesValue> lineNames = consumeGridLineNames(args);
</ins><span class="cx"> if (lineNames)
</span><del>- repeatedValues->append(*lineNames);
</del><ins>+ repeatedValues->append(lineNames.releaseNonNull());
</ins><span class="cx">
</span><span class="cx"> size_t numberOfTracks = 0;
</span><span class="cx"> while (!args.atEnd()) {
</span><del>- CSSValue* trackSize = consumeGridTrackSize(args, cssParserMode);
</del><ins>+ RefPtr<CSSValue> trackSize = consumeGridTrackSize(args, cssParserMode);
</ins><span class="cx"> if (!trackSize)
</span><span class="cx"> return false;
</span><span class="cx"> if (allTracksAreFixedSized)
</span><span class="lines">@@ -3073,20 +2852,20 @@
</span><span class="cx"> ++numberOfTracks;
</span><span class="cx"> lineNames = consumeGridLineNames(args);
</span><span class="cx"> if (lineNames)
</span><del>- repeatedValues->append(*lineNames);
</del><ins>+ repeatedValues->append(lineNames.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> // We should have found at least one <track-size> or else it is not a valid <track-list>.
</span><span class="cx"> if (!numberOfTracks)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (isAutoRepeat) {
- list.append(*repeatedValues);
- } else {
</del><ins>+ if (isAutoRepeat)
+ list.append(repeatedValues.releaseNonNull());
+ else {
</ins><span class="cx"> // We clamp the repetitions to a multiple of the repeat() track list's size, while staying below the max grid size.
</span><span class="cx"> repetitions = std::min(repetitions, kGridMaxTracks / numberOfTracks);
</span><span class="cx"> for (size_t i = 0; i < repetitions; ++i) {
</span><span class="cx"> for (size_t j = 0; j < repeatedValues->length(); ++j)
</span><del>- list.append(repeatedValues->item(j));
</del><ins>+ list.append(adoptRef(*repeatedValues->item(j)));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="lines">@@ -3094,15 +2873,15 @@
</span><span class="cx">
</span><span class="cx"> enum TrackListType { GridTemplate, GridTemplateNoRepeat, GridAuto };
</span><span class="cx">
</span><del>-static CSSValue* consumeGridTrackList(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackListType trackListType)
</del><ins>+static RefPtr<CSSValue> consumeGridTrackList(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackListType trackListType)
</ins><span class="cx"> {
</span><span class="cx"> bool allowGridLineNames = trackListType != GridAuto;
</span><del>- CSSValueList* values = CSSValueList::createSpaceSeparated();
- CSSGridLineNamesValue* lineNames = consumeGridLineNames(range);
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
+ RefPtr<CSSGridLineNamesValue> lineNames = consumeGridLineNames(range);
</ins><span class="cx"> if (lineNames) {
</span><span class="cx"> if (!allowGridLineNames)
</span><span class="cx"> return nullptr;
</span><del>- values->append(*lineNames);
</del><ins>+ values->append(lineNames.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool allowRepeat = trackListType == GridTemplate;
</span><span class="lines">@@ -3118,10 +2897,10 @@
</span><span class="cx"> if (isAutoRepeat && seenAutoRepeat)
</span><span class="cx"> return nullptr;
</span><span class="cx"> seenAutoRepeat = seenAutoRepeat || isAutoRepeat;
</span><del>- } else if (CSSValue* value = consumeGridTrackSize(range, cssParserMode)) {
</del><ins>+ } else if (RefPtr<CSSValue> value = consumeGridTrackSize(range, cssParserMode)) {
</ins><span class="cx"> if (allTracksAreFixedSized)
</span><span class="cx"> allTracksAreFixedSized = isGridTrackFixedSized(*value);
</span><del>- values->append(*value);
</del><ins>+ values->append(value.releaseNonNull());
</ins><span class="cx"> } else {
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -3137,7 +2916,7 @@
</span><span class="cx"> return values;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeGridTemplatesRowsOrColumns(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</del><ins>+static RefPtr<CSSValue> consumeGridTemplatesRowsOrColumns(CSSParserTokenRange& range, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -3144,7 +2923,7 @@
</span><span class="cx"> return consumeGridTrackList(range, cssParserMode, GridTemplate);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeGridTemplateAreas(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValue> consumeGridTemplateAreas(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueNone)
</span><span class="cx"> return consumeIdent(range);
</span><span class="lines">@@ -3165,51 +2944,11 @@
</span><span class="cx"> return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void countKeywordOnlyPropertyUsage(CSSPropertyID property, UseCounter* counter, CSSValueID valueID)
</del><ins>+RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSSPropertyID currentShorthand)
</ins><span class="cx"> {
</span><del>- if (!counter)
- return;
- switch (property) {
- case CSSPropertyWebkitAppearance:
- if (valueID == CSSValueNone) {
- counter->count(UseCounter::CSSValueAppearanceNone);
- } else {
- counter->count(UseCounter::CSSValueAppearanceNotNone);
- if (valueID == CSSValueButton)
- counter->count(UseCounter::CSSValueAppearanceButton);
- else if (valueID == CSSValueCaret)
- counter->count(UseCounter::CSSValueAppearanceCaret);
- else if (valueID == CSSValueCheckbox)
- counter->count(UseCounter::CSSValueAppearanceCheckbox);
- else if (valueID == CSSValueMenulist)
- counter->count(UseCounter::CSSValueAppearanceMenulist);
- else if (valueID == CSSValueMenulistButton)
- counter->count(UseCounter::CSSValueAppearanceMenulistButton);
- else if (valueID == CSSValueListbox)
- counter->count(UseCounter::CSSValueAppearanceListbox);
- else if (valueID == CSSValueRadio)
- counter->count(UseCounter::CSSValueAppearanceRadio);
- else if (valueID == CSSValueSearchfield)
- counter->count(UseCounter::CSSValueAppearanceSearchField);
- else if (valueID == CSSValueTextfield)
- counter->count(UseCounter::CSSValueAppearanceTextField);
- else
- counter->count(UseCounter::CSSValueAppearanceOthers);
- }
- break;
-
- default:
- break;
- }
-}
-
-const CSSValue* CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty, CSSPropertyID currentShorthand)
-{
- CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
</del><span class="cx"> if (CSSParserFastPaths::isKeywordPropertyID(property)) {
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode()))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode))
</ins><span class="cx"> return nullptr;
</span><del>- countKeywordOnlyPropertyUsage(property, m_context.useCounter(), m_range.peek().id());
</del><span class="cx"> return consumeIdent(m_range);
</span><span class="cx"> }
</span><span class="cx"> switch (property) {
</span><span class="lines">@@ -3219,8 +2958,6 @@
</span><span class="cx"> return consumePage(m_range);
</span><span class="cx"> case CSSPropertyQuotes:
</span><span class="cx"> return consumeQuotes(m_range);
</span><del>- case CSSPropertyWebkitHighlight:
- return consumeWebkitHighlight(m_range);
</del><span class="cx"> case CSSPropertyFontVariantCaps:
</span><span class="cx"> return consumeFontVariantCaps(m_range);
</span><span class="cx"> case CSSPropertyFontVariantLigatures:
</span><span class="lines">@@ -3235,33 +2972,25 @@
</span><span class="cx"> return consumeFontWeight(m_range);
</span><span class="cx"> case CSSPropertyLetterSpacing:
</span><span class="cx"> case CSSPropertyWordSpacing:
</span><del>- return consumeSpacing(m_range, m_context.mode());
</del><ins>+ return consumeSpacing(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyTabSize:
</span><del>- return consumeTabSize(m_range, m_context.mode());
- case CSSPropertyTextSizeAdjust:
- return consumeTextSizeAdjust(m_range, m_context.mode());
</del><ins>+ return consumeTabSize(m_range, m_context.mode);
+ case CSSPropertyWebkitTextSizeAdjust:
+ return consumeTextSizeAdjust(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyFontSize:
</span><del>- return consumeFontSize(m_range, m_context.mode(), UnitlessQuirk::Allow);
</del><ins>+ return consumeFontSize(m_range, m_context.mode, UnitlessQuirk::Allow);
</ins><span class="cx"> case CSSPropertyLineHeight:
</span><del>- return consumeLineHeight(m_range, m_context.mode());
- case CSSPropertyRotate:
- return consumeRotation(m_range);
- case CSSPropertyScale:
- return consumeScale(m_range);
- case CSSPropertyTranslate:
- return consumeTranslate(m_range, m_context.mode());
</del><ins>+ return consumeLineHeight(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyWebkitBorderHorizontalSpacing:
</span><span class="cx"> case CSSPropertyWebkitBorderVerticalSpacing:
</span><del>- return consumeLength(m_range, m_context.mode(), ValueRangeNonNegative);
</del><ins>+ return consumeLength(m_range, m_context.mode, ValueRangeNonNegative);
</ins><span class="cx"> case CSSPropertyCounterIncrement:
</span><span class="cx"> case CSSPropertyCounterReset:
</span><span class="cx"> return consumeCounter(m_range, property == CSSPropertyCounterIncrement ? 1 : 0);
</span><span class="cx"> case CSSPropertySize:
</span><del>- return consumeSize(m_range, m_context.mode());
- case CSSPropertySnapHeight:
- return consumeSnapHeight(m_range, m_context.mode());
</del><ins>+ return consumeSize(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyTextIndent:
</span><del>- return consumeTextIndent(m_range, m_context.mode());
</del><ins>+ return consumeTextIndent(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyMaxWidth:
</span><span class="cx"> case CSSPropertyMaxHeight:
</span><span class="cx"> return consumeMaxWidthOrHeight(m_range, m_context, UnitlessQuirk::Allow);
</span><span class="lines">@@ -3286,34 +3015,35 @@
</span><span class="cx"> case CSSPropertyLeft:
</span><span class="cx"> case CSSPropertyRight:
</span><span class="cx"> case CSSPropertyTop:
</span><del>- return consumeMarginOrOffset(m_range, m_context.mode(), UnitlessQuirk::Allow);
</del><ins>+ return consumeMarginOrOffset(m_range, m_context.mode, UnitlessQuirk::Allow);
</ins><span class="cx"> case CSSPropertyWebkitMarginStart:
</span><span class="cx"> case CSSPropertyWebkitMarginEnd:
</span><span class="cx"> case CSSPropertyWebkitMarginBefore:
</span><span class="cx"> case CSSPropertyWebkitMarginAfter:
</span><del>- return consumeMarginOrOffset(m_range, m_context.mode(), UnitlessQuirk::Forbid);
</del><ins>+ return consumeMarginOrOffset(m_range, m_context.mode, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyPaddingTop:
</span><span class="cx"> case CSSPropertyPaddingRight:
</span><span class="cx"> case CSSPropertyPaddingBottom:
</span><span class="cx"> case CSSPropertyPaddingLeft:
</span><del>- return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow);
</del><ins>+ return consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative, UnitlessQuirk::Allow);
</ins><span class="cx"> case CSSPropertyWebkitPaddingStart:
</span><span class="cx"> case CSSPropertyWebkitPaddingEnd:
</span><span class="cx"> case CSSPropertyWebkitPaddingBefore:
</span><span class="cx"> case CSSPropertyWebkitPaddingAfter:
</span><del>- return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Forbid);
</del><ins>+ return consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyClip:
</span><del>- return consumeClip(m_range, m_context.mode());
</del><ins>+ return consumeClip(m_range, m_context.mode);
+#if ENABLE(TOUCH_EVENTS)
</ins><span class="cx"> case CSSPropertyTouchAction:
</span><span class="cx"> return consumeTouchAction(m_range);
</span><del>- case CSSPropertyScrollSnapDestination:
</del><ins>+#endif
</ins><span class="cx"> case CSSPropertyObjectPosition:
</span><span class="cx"> case CSSPropertyPerspectiveOrigin:
</span><del>- return consumePosition(m_range, m_context.mode(), UnitlessQuirk::Forbid);
</del><ins>+ return consumePosition(m_range, m_context.mode, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyWebkitLineClamp:
</span><span class="cx"> return consumeLineClamp(m_range);
</span><span class="cx"> case CSSPropertyWebkitFontSizeDelta:
</span><del>- return consumeLength(m_range, m_context.mode(), ValueRangeAll, UnitlessQuirk::Allow);
</del><ins>+ return consumeLength(m_range, m_context.mode, ValueRangeAll, UnitlessQuirk::Allow);
</ins><span class="cx"> case CSSPropertyWebkitHyphenateCharacter:
</span><span class="cx"> case CSSPropertyWebkitLocale:
</span><span class="cx"> return consumeLocale(m_range);
</span><span class="lines">@@ -3322,7 +3052,7 @@
</span><span class="cx"> case CSSPropertyColumnCount:
</span><span class="cx"> return consumeColumnCount(m_range);
</span><span class="cx"> case CSSPropertyColumnGap:
</span><del>- return consumeColumnGap(m_range, m_context.mode());
</del><ins>+ return consumeColumnGap(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyColumnSpan:
</span><span class="cx"> return consumeColumnSpan(m_range);
</span><span class="cx"> case CSSPropertyZoom:
</span><span class="lines">@@ -3339,25 +3069,26 @@
</span><span class="cx"> case CSSPropertyTransitionProperty:
</span><span class="cx"> case CSSPropertyAnimationTimingFunction:
</span><span class="cx"> case CSSPropertyTransitionTimingFunction:
</span><del>- return consumeAnimationPropertyList(property, m_range, m_context, unresolvedProperty == CSSPropertyAliasWebkitAnimationName);
</del><ins>+ return consumeAnimationPropertyList(property, m_range, m_context);
</ins><span class="cx"> case CSSPropertyGridColumnGap:
</span><span class="cx"> case CSSPropertyGridRowGap:
</span><del>- return consumeLength(m_range, m_context.mode(), ValueRangeNonNegative);
- case CSSPropertyShapeMargin:
- return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNegative);
- case CSSPropertyShapeImageThreshold:
</del><ins>+ return consumeLength(m_range, m_context.mode, ValueRangeNonNegative);
+ case CSSPropertyWebkitShapeMargin:
+ return consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
+ case CSSPropertyWebkitShapeImageThreshold:
</ins><span class="cx"> return consumeNumber(m_range, ValueRangeAll);
</span><span class="cx"> case CSSPropertyWebkitBoxOrdinalGroup:
</span><span class="cx"> case CSSPropertyOrphans:
</span><span class="cx"> case CSSPropertyWidows:
</span><span class="cx"> return consumePositiveInteger(m_range);
</span><del>- case CSSPropertyTextDecorationColor:
- ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled());
- return consumeColor(m_range, m_context.mode());
</del><ins>+ case CSSPropertyWebkitTextDecorationColor:
+ return consumeColor(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyWebkitTextStrokeWidth:
</span><del>- return consumeTextStrokeWidth(m_range, m_context.mode());
</del><ins>+ return consumeTextStrokeWidth(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyWebkitTextFillColor:
</span><ins>+#if ENABLE(TOUCH_EVENTS)
</ins><span class="cx"> case CSSPropertyWebkitTapHighlightColor:
</span><ins>+#endif
</ins><span class="cx"> case CSSPropertyWebkitTextEmphasisColor:
</span><span class="cx"> case CSSPropertyWebkitBorderStartColor:
</span><span class="cx"> case CSSPropertyWebkitBorderEndColor:
</span><span class="lines">@@ -3368,15 +3099,15 @@
</span><span class="cx"> case CSSPropertyFloodColor:
</span><span class="cx"> case CSSPropertyLightingColor:
</span><span class="cx"> case CSSPropertyColumnRuleColor:
</span><del>- return consumeColor(m_range, m_context.mode());
</del><ins>+ return consumeColor(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyColor:
</span><span class="cx"> case CSSPropertyBackgroundColor:
</span><del>- return consumeColor(m_range, m_context.mode(), inQuirksMode());
</del><ins>+ return consumeColor(m_range, m_context.mode, inQuirksMode());
</ins><span class="cx"> case CSSPropertyWebkitBorderStartWidth:
</span><span class="cx"> case CSSPropertyWebkitBorderEndWidth:
</span><span class="cx"> case CSSPropertyWebkitBorderBeforeWidth:
</span><span class="cx"> case CSSPropertyWebkitBorderAfterWidth:
</span><del>- return consumeBorderWidth(m_range, m_context.mode(), UnitlessQuirk::Forbid);
</del><ins>+ return consumeBorderWidth(m_range, m_context.mode, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyBorderBottomColor:
</span><span class="cx"> case CSSPropertyBorderLeftColor:
</span><span class="cx"> case CSSPropertyBorderRightColor:
</span><span class="lines">@@ -3383,7 +3114,7 @@
</span><span class="cx"> case CSSPropertyBorderTopColor: {
</span><span class="cx"> bool allowQuirkyColors = inQuirksMode()
</span><span class="cx"> && (currentShorthand == CSSPropertyInvalid || currentShorthand == CSSPropertyBorderColor);
</span><del>- return consumeColor(m_range, m_context.mode(), allowQuirkyColors);
</del><ins>+ return consumeColor(m_range, m_context.mode, allowQuirkyColors);
</ins><span class="cx"> }
</span><span class="cx"> case CSSPropertyBorderBottomWidth:
</span><span class="cx"> case CSSPropertyBorderLeftWidth:
</span><span class="lines">@@ -3392,50 +3123,41 @@
</span><span class="cx"> bool allowQuirkyLengths = inQuirksMode()
</span><span class="cx"> && (currentShorthand == CSSPropertyInvalid || currentShorthand == CSSPropertyBorderWidth);
</span><span class="cx"> UnitlessQuirk unitless = allowQuirkyLengths ? UnitlessQuirk::Allow : UnitlessQuirk::Forbid;
</span><del>- return consumeBorderWidth(m_range, m_context.mode(), unitless);
</del><ins>+ return consumeBorderWidth(m_range, m_context.mode, unitless);
</ins><span class="cx"> }
</span><span class="cx"> case CSSPropertyZIndex:
</span><span class="cx"> return consumeZIndex(m_range);
</span><span class="cx"> case CSSPropertyTextShadow: // CSS2 property, dropped in CSS2.1, back in CSS3, so treat as CSS3
</span><span class="cx"> case CSSPropertyBoxShadow:
</span><del>- return consumeShadow(m_range, m_context.mode(), property == CSSPropertyBoxShadow);
</del><ins>+ return consumeShadow(m_range, m_context.mode, property == CSSPropertyBoxShadow);
</ins><span class="cx"> case CSSPropertyFilter:
</span><del>- case CSSPropertyBackdropFilter:
</del><ins>+ case CSSPropertyWebkitBackdropFilter:
</ins><span class="cx"> return consumeFilter(m_range, m_context);
</span><span class="cx"> case CSSPropertyTextDecoration:
</span><del>- ASSERT(!RuntimeEnabledFeatures::css3TextDecorationsEnabled());
- // fallthrough
</del><span class="cx"> case CSSPropertyWebkitTextDecorationsInEffect:
</span><del>- case CSSPropertyTextDecorationLine:
</del><ins>+ case CSSPropertyWebkitTextDecorationLine:
</ins><span class="cx"> return consumeTextDecorationLine(m_range);
</span><del>- case CSSPropertyD:
- case CSSPropertyMotionPath:
- return consumePathOrNone(m_range);
- case CSSPropertyMotionOffset:
- return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeAll);
- case CSSPropertyMotionRotation:
- return consumeMotionRotation(m_range);
</del><span class="cx"> case CSSPropertyWebkitTextEmphasisStyle:
</span><span class="cx"> return consumeTextEmphasisStyle(m_range);
</span><span class="cx"> case CSSPropertyOutlineColor:
</span><del>- return consumeOutlineColor(m_range, m_context.mode());
</del><ins>+ return consumeOutlineColor(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyOutlineOffset:
</span><del>- return consumeLength(m_range, m_context.mode(), ValueRangeAll);
</del><ins>+ return consumeLength(m_range, m_context.mode, ValueRangeAll);
</ins><span class="cx"> case CSSPropertyOutlineWidth:
</span><del>- return consumeLineWidth(m_range, m_context.mode(), UnitlessQuirk::Forbid);
</del><ins>+ return consumeLineWidth(m_range, m_context.mode, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyTransform:
</span><del>- return consumeTransform(m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitTransform);
- case CSSPropertyWebkitTransformOriginX:
- case CSSPropertyWebkitPerspectiveOriginX:
- return consumePositionX(m_range, m_context.mode());
- case CSSPropertyWebkitTransformOriginY:
- case CSSPropertyWebkitPerspectiveOriginY:
- return consumePositionY(m_range, m_context.mode());
- case CSSPropertyWebkitTransformOriginZ:
- return consumeLength(m_range, m_context.mode(), ValueRangeAll);
</del><ins>+ return consumeTransform(m_range, m_context.mode);
+ case CSSPropertyTransformOriginX:
+ case CSSPropertyPerspectiveOriginX:
+ return consumePositionX(m_range, m_context.mode);
+ case CSSPropertyTransformOriginY:
+ case CSSPropertyPerspectiveOriginY:
+ return consumePositionY(m_range, m_context.mode);
+ case CSSPropertyTransformOriginZ:
+ return consumeLength(m_range, m_context.mode, ValueRangeAll);
</ins><span class="cx"> case CSSPropertyFill:
</span><span class="cx"> case CSSPropertyStroke:
</span><del>- return consumePaintStroke(m_range, m_context.mode());
</del><ins>+ return consumePaintStroke(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyPaintOrder:
</span><span class="cx"> return consumePaintOrder(m_range);
</span><span class="cx"> case CSSPropertyMarkerStart:
</span><span class="lines">@@ -3445,7 +3167,7 @@
</span><span class="cx"> case CSSPropertyMask:
</span><span class="cx"> return consumeNoneOrURI(m_range);
</span><span class="cx"> case CSSPropertyFlexBasis:
</span><del>- return consumeFlexBasis(m_range, m_context.mode());
</del><ins>+ return consumeFlexBasis(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyFlexGrow:
</span><span class="cx"> case CSSPropertyFlexShrink:
</span><span class="cx"> return consumeNumber(m_range, ValueRangeNonNegative);
</span><span class="lines">@@ -3452,7 +3174,7 @@
</span><span class="cx"> case CSSPropertyStrokeDasharray:
</span><span class="cx"> return consumeStrokeDasharray(m_range);
</span><span class="cx"> case CSSPropertyColumnRuleWidth:
</span><del>- return consumeColumnRuleWidth(m_range, m_context.mode());
</del><ins>+ return consumeColumnRuleWidth(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyStrokeOpacity:
</span><span class="cx"> case CSSPropertyFillOpacity:
</span><span class="cx"> case CSSPropertyStopOpacity:
</span><span class="lines">@@ -3477,10 +3199,8 @@
</span><span class="cx"> return consumeRxOrRy(m_range);
</span><span class="cx"> case CSSPropertyCursor:
</span><span class="cx"> return consumeCursor(m_range, m_context, inQuirksMode());
</span><del>- case CSSPropertyContain:
- return consumeContain(m_range);
</del><span class="cx"> case CSSPropertyTransformOrigin:
</span><del>- return consumeTransformOrigin(m_range, m_context.mode(), UnitlessQuirk::Forbid);
</del><ins>+ return consumeTransformOrigin(m_range, m_context.mode, UnitlessQuirk::Forbid);
</ins><span class="cx"> case CSSPropertyContent:
</span><span class="cx"> return consumeContent(m_range, m_context);
</span><span class="cx"> case CSSPropertyListStyleImage:
</span><span class="lines">@@ -3488,34 +3208,32 @@
</span><span class="cx"> case CSSPropertyWebkitMaskBoxImageSource:
</span><span class="cx"> return consumeImageOrNone(m_range, m_context);
</span><span class="cx"> case CSSPropertyPerspective:
</span><del>- return consumePerspective(m_range, m_context.mode(), unresolvedProperty);
- case CSSPropertyScrollSnapCoordinate:
- return consumeScrollSnapCoordinate(m_range, m_context.mode());
- case CSSPropertyScrollSnapPointsX:
- case CSSPropertyScrollSnapPointsY:
- return consumeScrollSnapPoints(m_range, m_context.mode());
</del><ins>+ return consumePerspective(m_range, m_context.mode);
+ case CSSPropertyWebkitScrollSnapCoordinate:
+ return consumeScrollSnapCoordinate(m_range, m_context.mode);
+ case CSSPropertyWebkitScrollSnapPointsX:
+ case CSSPropertyWebkitScrollSnapPointsY:
+ return consumeScrollSnapPoints(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyBorderTopRightRadius:
</span><span class="cx"> case CSSPropertyBorderTopLeftRadius:
</span><span class="cx"> case CSSPropertyBorderBottomLeftRadius:
</span><span class="cx"> case CSSPropertyBorderBottomRightRadius:
</span><del>- return consumeBorderRadiusCorner(m_range, m_context.mode());
</del><ins>+ return consumeBorderRadiusCorner(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyWebkitBoxFlexGroup:
</span><span class="cx"> return consumeInteger(m_range, 0);
</span><span class="cx"> case CSSPropertyOrder:
</span><span class="cx"> return consumeInteger(m_range);
</span><del>- case CSSPropertyTextUnderlinePosition:
</del><ins>+ case CSSPropertyWebkitTextUnderlinePosition:
</ins><span class="cx"> // auto | [ under || [ left | right ] ], but we only support auto | under for now
</span><del>- ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled());
</del><span class="cx"> return consumeIdent<CSSValueAuto, CSSValueUnder>(m_range);
</span><span class="cx"> case CSSPropertyVerticalAlign:
</span><del>- return consumeVerticalAlign(m_range, m_context.mode());
- case CSSPropertyShapeOutside:
</del><ins>+ return consumeVerticalAlign(m_range, m_context.mode);
+ case CSSPropertyWebkitShapeOutside:
</ins><span class="cx"> return consumeShapeOutside(m_range, m_context);
</span><span class="cx"> case CSSPropertyWebkitClipPath:
</span><span class="cx"> return consumeWebkitClipPath(m_range, m_context);
</span><span class="cx"> case CSSPropertyJustifyContent:
</span><span class="cx"> case CSSPropertyAlignContent:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> return consumeContentDistributionOverflowPosition(m_range);
</span><span class="cx"> case CSSPropertyBorderImageRepeat:
</span><span class="cx"> case CSSPropertyWebkitMaskBoxImageRepeat:
</span><span class="lines">@@ -3533,12 +3251,10 @@
</span><span class="cx"> return consumeWebkitBorderImage(property, m_range, m_context);
</span><span class="cx"> case CSSPropertyWebkitBoxReflect:
</span><span class="cx"> return consumeReflect(m_range, m_context);
</span><del>- case CSSPropertyFontSizeAdjust:
- ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled());
- return consumeFontSizeAdjust(m_range);
</del><ins>+#if ENABLE(CSS_IMAGE_ORIENTATION)
</ins><span class="cx"> case CSSPropertyImageOrientation:
</span><del>- ASSERT(RuntimeEnabledFeatures::imageOrientationEnabled());
</del><span class="cx"> return consumeImageOrientation(m_range);
</span><ins>+#endif
</ins><span class="cx"> case CSSPropertyBackgroundAttachment:
</span><span class="cx"> case CSSPropertyBackgroundBlendMode:
</span><span class="cx"> case CSSPropertyBackgroundClip:
</span><span class="lines">@@ -3547,7 +3263,6 @@
</span><span class="cx"> case CSSPropertyBackgroundPositionX:
</span><span class="cx"> case CSSPropertyBackgroundPositionY:
</span><span class="cx"> case CSSPropertyBackgroundSize:
</span><del>- case CSSPropertyMaskSourceType:
</del><span class="cx"> case CSSPropertyWebkitBackgroundClip:
</span><span class="cx"> case CSSPropertyWebkitBackgroundOrigin:
</span><span class="cx"> case CSSPropertyWebkitMaskClip:
</span><span class="lines">@@ -3557,39 +3272,31 @@
</span><span class="cx"> case CSSPropertyWebkitMaskPositionX:
</span><span class="cx"> case CSSPropertyWebkitMaskPositionY:
</span><span class="cx"> case CSSPropertyWebkitMaskSize:
</span><del>- return consumeCommaSeparatedBackgroundComponent(unresolvedProperty, m_range, m_context);
</del><ins>+ return consumeCommaSeparatedBackgroundComponent(property, m_range, m_context);
</ins><span class="cx"> case CSSPropertyWebkitMaskRepeatX:
</span><span class="cx"> case CSSPropertyWebkitMaskRepeatY:
</span><span class="cx"> return nullptr;
</span><span class="cx"> case CSSPropertyAlignItems:
</span><del>- DCHECK(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> return consumeAlignItems(m_range);
</span><span class="cx"> case CSSPropertyJustifySelf:
</span><span class="cx"> case CSSPropertyAlignSelf:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> return consumeSelfPositionOverflowPosition(m_range);
</span><span class="cx"> case CSSPropertyJustifyItems:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> return consumeJustifyItems(m_range);
</span><span class="cx"> case CSSPropertyGridColumnEnd:
</span><span class="cx"> case CSSPropertyGridColumnStart:
</span><span class="cx"> case CSSPropertyGridRowEnd:
</span><span class="cx"> case CSSPropertyGridRowStart:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> return consumeGridLine(m_range);
</span><span class="cx"> case CSSPropertyGridAutoColumns:
</span><span class="cx"> case CSSPropertyGridAutoRows:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
- return consumeGridTrackList(m_range, m_context.mode(), GridAuto);
</del><ins>+ return consumeGridTrackList(m_range, m_context.mode, GridAuto);
</ins><span class="cx"> case CSSPropertyGridTemplateColumns:
</span><span class="cx"> case CSSPropertyGridTemplateRows:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
- return consumeGridTemplatesRowsOrColumns(m_range, m_context.mode());
</del><ins>+ return consumeGridTemplatesRowsOrColumns(m_range, m_context.mode);
</ins><span class="cx"> case CSSPropertyGridTemplateAreas:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> return consumeGridTemplateAreas(m_range);
</span><span class="cx"> case CSSPropertyGridAutoFlow:
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> return consumeGridAutoFlow(m_range);
</span><span class="cx"> default:
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -3596,15 +3303,10 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSPrimitiveValue* consumeFontDisplay(CSSParserTokenRange& range)
</del><ins>+static RefPtr<CSSValueList> consumeFontFaceUnicodeRange(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><del>- return consumeIdent<CSSValueAuto, CSSValueBlock, CSSValueSwap, CSSValueFallback, CSSValueOptional>(range);
-}
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
</ins><span class="cx">
</span><del>-static CSSValueList* consumeFontFaceUnicodeRange(CSSParserTokenRange& range)
-{
- CSSValueList* values = CSSValueList::createCommaSeparated();
-
</del><span class="cx"> do {
</span><span class="cx"> const CSSParserToken& token = range.consumeIncludingWhitespace();
</span><span class="cx"> if (token.type() != UnicodeRangeToken)
</span><span class="lines">@@ -3614,19 +3316,19 @@
</span><span class="cx"> UChar32 end = token.unicodeRangeEnd();
</span><span class="cx"> if (start > end)
</span><span class="cx"> return nullptr;
</span><del>- values->append(*CSSUnicodeRangeValue::create(start, end));
</del><ins>+ values->append(CSSUnicodeRangeValue::create(start, end));
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx">
</span><span class="cx"> return values;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFontFaceSrcURI(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeFontFaceSrcURI(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><span class="cx"> String url = consumeUrlAsStringView(range).toString();
</span><span class="cx"> if (url.isNull())
</span><span class="cx"> return nullptr;
</span><del>- CSSFontFaceSrcValue* uriValue(CSSFontFaceSrcValue::create(url, context.completeURL(url), context.shouldCheckContentSecurityPolicy()));
- uriValue->setReferrer(context.referrer());
</del><ins>+
+ RefPtr<CSSFontFaceSrcValue> uriValue = CSSFontFaceSrcValue::create(context.completeURL(url));
</ins><span class="cx">
</span><span class="cx"> if (range.peek().functionId() != CSSValueFormat)
</span><span class="cx"> return uriValue;
</span><span class="lines">@@ -3641,39 +3343,38 @@
</span><span class="cx"> return uriValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeFontFaceSrcLocal(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValue> consumeFontFaceSrcLocal(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> CSSParserTokenRange args = consumeFunction(range);
</span><del>- ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy = context.shouldCheckContentSecurityPolicy();
</del><span class="cx"> if (args.peek().type() == StringToken) {
</span><span class="cx"> const CSSParserToken& arg = args.consumeIncludingWhitespace();
</span><span class="cx"> if (!args.atEnd())
</span><span class="cx"> return nullptr;
</span><del>- return CSSFontFaceSrcValue::createLocal(arg.value().toString(), shouldCheckContentSecurityPolicy);
</del><ins>+ return CSSFontFaceSrcValue::createLocal(arg.value().toString());
</ins><span class="cx"> }
</span><span class="cx"> if (args.peek().type() == IdentToken) {
</span><span class="cx"> String familyName = concatenateFamilyName(args);
</span><span class="cx"> if (!args.atEnd())
</span><span class="cx"> return nullptr;
</span><del>- return CSSFontFaceSrcValue::createLocal(familyName, shouldCheckContentSecurityPolicy);
</del><ins>+ return CSSFontFaceSrcValue::createLocal(familyName);
</ins><span class="cx"> }
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValueList* consumeFontFaceSrc(CSSParserTokenRange& range, const CSSParserContext& context)
</del><ins>+static RefPtr<CSSValueList> consumeFontFaceSrc(CSSParserTokenRange& range, const CSSParserContext& context)
</ins><span class="cx"> {
</span><del>- CSSValueList* values = CSSValueList::createCommaSeparated();
</del><ins>+ RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
</ins><span class="cx">
</span><span class="cx"> do {
</span><span class="cx"> const CSSParserToken& token = range.peek();
</span><del>- CSSValue* parsedValue = nullptr;
</del><ins>+ RefPtr<CSSValue> parsedValue;
</ins><span class="cx"> if (token.functionId() == CSSValueLocal)
</span><del>- parsedValue = consumeFontFaceSrcLocal(range, context);
</del><ins>+ parsedValue = consumeFontFaceSrcLocal(range);
</ins><span class="cx"> else
</span><span class="cx"> parsedValue = consumeFontFaceSrcURI(range, context);
</span><span class="cx"> if (!parsedValue)
</span><span class="cx"> return nullptr;
</span><del>- values->append(*parsedValue);
</del><ins>+ values->append(parsedValue.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx"> return values;
</span><span class="cx"> }
</span><span class="lines">@@ -3680,7 +3381,7 @@
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId)
</span><span class="cx"> {
</span><del>- CSSValue* parsedValue = nullptr;
</del><ins>+ RefPtr<CSSValue> parsedValue;
</ins><span class="cx"> switch (propId) {
</span><span class="cx"> case CSSPropertyFontFamily:
</span><span class="cx"> if (consumeGenericFamily(m_range))
</span><span class="lines">@@ -3693,15 +3394,12 @@
</span><span class="cx"> case CSSPropertyUnicodeRange:
</span><span class="cx"> parsedValue = consumeFontFaceUnicodeRange(m_range);
</span><span class="cx"> break;
</span><del>- case CSSPropertyFontDisplay:
- parsedValue = consumeFontDisplay(m_range);
- break;
</del><span class="cx"> case CSSPropertyFontStretch:
</span><span class="cx"> case CSSPropertyFontStyle: {
</span><span class="cx"> CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id, m_context.mode()))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id, m_context.mode))
</ins><span class="cx"> return false;
</span><del>- parsedValue = CSSPrimitiveValue::createIdentifier(id);
</del><ins>+ parsedValue = CSSValuePool::singleton().createIdentifierValue(id);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyFontVariant:
</span><span class="lines">@@ -3730,25 +3428,23 @@
</span><span class="cx"> ASSERT(systemFontID >= CSSValueCaption && systemFontID <= CSSValueStatusBar);
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="cx"> return false;
</span><ins>+
+ FontCascadeDescription fontDescription;
+ RenderTheme::defaultTheme()->systemFont(systemFontID, fontDescription);
+ if (!fontDescription.isAbsoluteSize())
+ return false;
+
+ addProperty(CSSPropertyFontStyle, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(fontDescription.italic() == FontItalicOn ? CSSValueItalic : CSSValueNormal), important);
+ addProperty(CSSPropertyFontWeight, CSSPropertyFont, CSSValuePool::singleton().createValue(fontDescription.weight()), important);
+ addProperty(CSSPropertyFontSize, CSSPropertyFont, CSSValuePool::singleton().createValue(fontDescription.specifiedSize(), CSSPrimitiveValue::CSS_PX), important);
+ Ref<CSSValueList> fontFamilyList = CSSValueList::createCommaSeparated();
+ fontFamilyList->append(CSSValuePool::singleton().createFontFamilyValue(fontDescription.familyAt(0), FromSystemFontID::Yes));
+ addProperty(CSSPropertyFontFamily, CSSPropertyFont, WTFMove(fontFamilyList), important);
+ addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
+ addProperty(CSSPropertyLineHeight, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
</ins><span class="cx">
</span><del>- FontStyle fontStyle = FontStyleNormal;
- FontWeight fontWeight = FontWeightNormal;
- float fontSize = 0;
- AtomicString fontFamily;
- LayoutTheme::theme().systemFont(systemFontID, fontStyle, fontWeight, fontSize, fontFamily);
</del><ins>+ // FIXME_NEWPARSER: What about FontVariantNumeric and FontVariantLigatures?
</ins><span class="cx">
</span><del>- addProperty(CSSPropertyFontStyle, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(fontStyle == FontStyleItalic ? CSSValueItalic : CSSValueNormal), important);
- addProperty(CSSPropertyFontWeight, CSSPropertyFont, *CSSPrimitiveValue::create(fontWeight), important);
- addProperty(CSSPropertyFontSize, CSSPropertyFont, *CSSPrimitiveValue::create(fontSize, CSSPrimitiveValue::UnitType::Pixels), important);
- CSSValueList* fontFamilyList = CSSValueList::createCommaSeparated();
- fontFamilyList->append(*CSSFontFamilyValue::create(fontFamily));
- addProperty(CSSPropertyFontFamily, CSSPropertyFont, *fontFamilyList, important);
-
- addProperty(CSSPropertyFontStretch, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyLineHeight, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
</del><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3762,13 +3458,13 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> // Optional font-style, font-variant, font-stretch and font-weight.
</span><del>- CSSPrimitiveValue* fontStyle = nullptr;
- CSSPrimitiveValue* fontVariantCaps = nullptr;
- CSSPrimitiveValue* fontWeight = nullptr;
- CSSPrimitiveValue* fontStretch = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> fontStyle;
+ RefPtr<CSSPrimitiveValue> fontVariantCaps;
+ RefPtr<CSSPrimitiveValue> fontWeight;
+ RefPtr<CSSPrimitiveValue> fontStretch;
</ins><span class="cx"> while (!m_range.atEnd()) {
</span><span class="cx"> CSSValueID id = m_range.peek().id();
</span><del>- if (!fontStyle && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id, m_context.mode())) {
</del><ins>+ if (!fontStyle && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id, m_context.mode)) {
</ins><span class="cx"> fontStyle = consumeIdent(m_range);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="lines">@@ -3784,7 +3480,7 @@
</span><span class="cx"> if (fontWeight)
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (!fontStretch && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStretch, id, m_context.mode()))
</del><ins>+ if (!fontStretch && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStretch, id, m_context.mode))
</ins><span class="cx"> fontStretch = consumeIdent(m_range);
</span><span class="cx"> else
</span><span class="cx"> break;
</span><span class="lines">@@ -3793,16 +3489,16 @@
</span><span class="cx"> if (m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- addProperty(CSSPropertyFontStyle, CSSPropertyFont, fontStyle ? *fontStyle : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, fontVariantCaps ? *fontVariantCaps : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
</del><ins>+ addProperty(CSSPropertyFontStyle, CSSPropertyFont, fontStyle ? fontStyle.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
+ addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, fontVariantCaps ? fontVariantCaps.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
+ addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
+ addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
</ins><span class="cx">
</span><del>- addProperty(CSSPropertyFontWeight, CSSPropertyFont, fontWeight ? *fontWeight : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
- addProperty(CSSPropertyFontStretch, CSSPropertyFont, fontStretch ? *fontStretch : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
</del><ins>+ addProperty(CSSPropertyFontWeight, CSSPropertyFont, fontWeight ? fontWeight.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
+ addProperty(CSSPropertyFontStretch, CSSPropertyFont, fontStretch ? fontStretch.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
</ins><span class="cx">
</span><span class="cx"> // Now a font size _must_ come.
</span><del>- CSSValue* fontSize = consumeFontSize(m_range, m_context.mode());
</del><ins>+ RefPtr<CSSValue> fontSize = consumeFontSize(m_range, m_context.mode);
</ins><span class="cx"> if (!fontSize || m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -3809,20 +3505,20 @@
</span><span class="cx"> addProperty(CSSPropertyFontSize, CSSPropertyFont, *fontSize, important);
</span><span class="cx">
</span><span class="cx"> if (consumeSlashIncludingWhitespace(m_range)) {
</span><del>- CSSPrimitiveValue* lineHeight = consumeLineHeight(m_range, m_context.mode());
</del><ins>+ RefPtr<CSSPrimitiveValue> lineHeight = consumeLineHeight(m_range, m_context.mode);
</ins><span class="cx"> if (!lineHeight)
</span><span class="cx"> return false;
</span><del>- addProperty(CSSPropertyLineHeight, CSSPropertyFont, *lineHeight, important);
</del><ins>+ addProperty(CSSPropertyLineHeight, CSSPropertyFont, lineHeight.releaseNonNull(), important);
</ins><span class="cx"> } else {
</span><del>- addProperty(CSSPropertyLineHeight, CSSPropertyFont, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
</del><ins>+ addProperty(CSSPropertyLineHeight, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Font family must come now.
</span><del>- CSSValue* parsedFamilyValue = consumeFontFamily(m_range);
</del><ins>+ RefPtr<CSSValue> parsedFamilyValue = consumeFontFamily(m_range);
</ins><span class="cx"> if (!parsedFamilyValue)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- addProperty(CSSPropertyFontFamily, CSSPropertyFont, *parsedFamilyValue, important);
</del><ins>+ addProperty(CSSPropertyFontFamily, CSSPropertyFont, parsedFamilyValue.releaseNonNull(), important);
</ins><span class="cx">
</span><span class="cx"> // FIXME: http://www.w3.org/TR/2011/WD-css3-fonts-20110324/#font-prop requires that
</span><span class="cx"> // "font-stretch", "font-size-adjust", and "font-kerning" be reset to their initial values
</span><span class="lines">@@ -3833,12 +3529,12 @@
</span><span class="cx"> bool CSSPropertyParser::consumeFontVariantShorthand(bool important)
</span><span class="cx"> {
</span><span class="cx"> if (identMatches<CSSValueNormal, CSSValueNone>(m_range.peek().id())) {
</span><del>- addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFontVariant, *consumeIdent(m_range), important);
- addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
</del><ins>+ addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFontVariant, consumeIdent(m_range).releaseNonNull(), important);
+ addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
</ins><span class="cx"> return m_range.atEnd();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- CSSPrimitiveValue* capsValue = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> capsValue;
</ins><span class="cx"> FontVariantLigaturesParser ligaturesParser;
</span><span class="cx"> FontVariantNumericParser numericParser;
</span><span class="cx"> do {
</span><span class="lines">@@ -3870,28 +3566,30 @@
</span><span class="cx"> }
</span><span class="cx"> } while (!m_range.atEnd());
</span><span class="cx">
</span><del>- addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFontVariant, *ligaturesParser.finalizeValue(), important);
- addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFontVariant, *numericParser.finalizeValue(), important);
- addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, capsValue ? *capsValue : *CSSPrimitiveValue::createIdentifier(CSSValueNormal), important);
</del><ins>+ addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFontVariant, ligaturesParser.finalizeValue().releaseNonNull(), important);
+ addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFontVariant, numericParser.finalizeValue().releaseNonNull(), important);
+ addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, capsValue ? capsValue.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeBorderSpacing(bool important)
</span><span class="cx"> {
</span><del>- CSSValue* horizontalSpacing = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow);
</del><ins>+ RefPtr<CSSValue> horizontalSpacing = consumeLength(m_range, m_context.mode, ValueRangeNonNegative, UnitlessQuirk::Allow);
</ins><span class="cx"> if (!horizontalSpacing)
</span><span class="cx"> return false;
</span><del>- CSSValue* verticalSpacing = horizontalSpacing;
</del><ins>+ RefPtr<CSSValue> verticalSpacing = horizontalSpacing;
</ins><span class="cx"> if (!m_range.atEnd())
</span><del>- verticalSpacing = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow);
</del><ins>+ verticalSpacing = consumeLength(m_range, m_context.mode, ValueRangeNonNegative, UnitlessQuirk::Allow);
</ins><span class="cx"> if (!verticalSpacing || !m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- addProperty(CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyBorderSpacing, *horizontalSpacing, important);
- addProperty(CSSPropertyWebkitBorderVerticalSpacing, CSSPropertyBorderSpacing, *verticalSpacing, important);
</del><ins>+ addProperty(CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyBorderSpacing, horizontalSpacing.releaseNonNull(), important);
+ addProperty(CSSPropertyWebkitBorderVerticalSpacing, CSSPropertyBorderSpacing, verticalSpacing.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static CSSValue* consumeSingleViewportDescriptor(CSSParserTokenRange& range, CSSPropertyID propId, CSSParserMode cssParserMode)
</del><ins>+#if ENABLE(CSS_DEVICE_ADAPTATION)
+
+static RefPtr<CSSValue> consumeSingleViewportDescriptor(CSSParserTokenRange& range, CSSPropertyID propId, CSSParserMode cssParserMode)
</ins><span class="cx"> {
</span><span class="cx"> CSSValueID id = range.peek().id();
</span><span class="cx"> switch (propId) {
</span><span class="lines">@@ -3899,7 +3597,7 @@
</span><span class="cx"> case CSSPropertyMaxWidth:
</span><span class="cx"> case CSSPropertyMinHeight:
</span><span class="cx"> case CSSPropertyMaxHeight:
</span><del>- if (id == CSSValueAuto || id == CSSValueInternalExtendToZoom)
</del><ins>+ if (id == CSSValueAuto)
</ins><span class="cx"> return consumeIdent(range);
</span><span class="cx"> return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
</span><span class="cx"> case CSSPropertyMinZoom:
</span><span class="lines">@@ -3907,7 +3605,7 @@
</span><span class="cx"> case CSSPropertyZoom: {
</span><span class="cx"> if (id == CSSValueAuto)
</span><span class="cx"> return consumeIdent(range);
</span><del>- CSSValue* parsedValue = consumeNumber(range, ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSValue> parsedValue = consumeNumber(range, ValueRangeNonNegative);
</ins><span class="cx"> if (parsedValue)
</span><span class="cx"> return parsedValue;
</span><span class="cx"> return consumePercent(range, ValueRangeNonNegative);
</span><span class="lines">@@ -3927,16 +3625,14 @@
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::parseViewportDescriptor(CSSPropertyID propId, bool important)
</span><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssViewportEnabled() || isUASheetBehavior(m_context.mode()));
-
</del><span class="cx"> switch (propId) {
</span><span class="cx"> case CSSPropertyWidth: {
</span><del>- CSSValue* minWidth = consumeSingleViewportDescriptor(m_range, CSSPropertyMinWidth, m_context.mode());
</del><ins>+ RefPtr<CSSValue> minWidth = consumeSingleViewportDescriptor(m_range, CSSPropertyMinWidth, m_context.mode);
</ins><span class="cx"> if (!minWidth)
</span><span class="cx"> return false;
</span><del>- CSSValue* maxWidth = minWidth;
</del><ins>+ RefPtr<CSSValue> maxWidth = minWidth;
</ins><span class="cx"> if (!m_range.atEnd())
</span><del>- maxWidth = consumeSingleViewportDescriptor(m_range, CSSPropertyMaxWidth, m_context.mode());
</del><ins>+ maxWidth = consumeSingleViewportDescriptor(m_range, CSSPropertyMaxWidth, m_context.mode);
</ins><span class="cx"> if (!maxWidth || !m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx"> addProperty(CSSPropertyMinWidth, CSSPropertyInvalid, *minWidth, important);
</span><span class="lines">@@ -3944,12 +3640,12 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyHeight: {
</span><del>- CSSValue* minHeight = consumeSingleViewportDescriptor(m_range, CSSPropertyMinHeight, m_context.mode());
</del><ins>+ RefPtr<CSSValue> minHeight = consumeSingleViewportDescriptor(m_range, CSSPropertyMinHeight, m_context.mode);
</ins><span class="cx"> if (!minHeight)
</span><span class="cx"> return false;
</span><del>- CSSValue* maxHeight = minHeight;
</del><ins>+ RefPtr<CSSValue> maxHeight = minHeight;
</ins><span class="cx"> if (!m_range.atEnd())
</span><del>- maxHeight = consumeSingleViewportDescriptor(m_range, CSSPropertyMaxHeight, m_context.mode());
</del><ins>+ maxHeight = consumeSingleViewportDescriptor(m_range, CSSPropertyMaxHeight, m_context.mode);
</ins><span class="cx"> if (!maxHeight || !m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx"> addProperty(CSSPropertyMinHeight, CSSPropertyInvalid, *minHeight, important);
</span><span class="lines">@@ -3965,10 +3661,10 @@
</span><span class="cx"> case CSSPropertyZoom:
</span><span class="cx"> case CSSPropertyUserZoom:
</span><span class="cx"> case CSSPropertyOrientation: {
</span><del>- CSSValue* parsedValue = consumeSingleViewportDescriptor(m_range, propId, m_context.mode());
</del><ins>+ RefPtr<CSSValue> parsedValue = consumeSingleViewportDescriptor(m_range, propId, m_context.mode);
</ins><span class="cx"> if (!parsedValue || !m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- addProperty(propId, CSSPropertyInvalid, *parsedValue, important);
</del><ins>+ addProperty(propId, CSSPropertyInvalid, parsedValue.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> default:
</span><span class="lines">@@ -3976,7 +3672,9 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeColumnWidthOrCount(CSSParserTokenRange& range, CSSValue*& columnWidth, CSSValue*& columnCount)
</del><ins>+#endif
+
+static bool consumeColumnWidthOrCount(CSSParserTokenRange& range, RefPtr<CSSValue>& columnWidth, RefPtr<CSSValue>& columnCount)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().id() == CSSValueAuto) {
</span><span class="cx"> consumeIdent(range);
</span><span class="lines">@@ -3994,8 +3692,8 @@
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeColumns(bool important)
</span><span class="cx"> {
</span><del>- CSSValue* columnWidth = nullptr;
- CSSValue* columnCount = nullptr;
</del><ins>+ RefPtr<CSSValue> columnWidth;
+ RefPtr<CSSValue> columnCount;
</ins><span class="cx"> if (!consumeColumnWidthOrCount(m_range, columnWidth, columnCount))
</span><span class="cx"> return false;
</span><span class="cx"> consumeColumnWidthOrCount(m_range, columnWidth, columnCount);
</span><span class="lines">@@ -4002,11 +3700,11 @@
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx"> if (!columnWidth)
</span><del>- columnWidth = CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ columnWidth = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> if (!columnCount)
</span><del>- columnCount = CSSPrimitiveValue::createIdentifier(CSSValueAuto);
- addProperty(CSSPropertyColumnWidth, CSSPropertyInvalid, *columnWidth, important);
- addProperty(CSSPropertyColumnCount, CSSPropertyInvalid, *columnCount, important);
</del><ins>+ columnCount = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
+ addProperty(CSSPropertyColumnWidth, CSSPropertyInvalid, columnWidth.releaseNonNull(), important);
+ addProperty(CSSPropertyColumnCount, CSSPropertyInvalid, columnCount.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4013,7 +3711,7 @@
</span><span class="cx"> bool CSSPropertyParser::consumeShorthandGreedily(const StylePropertyShorthand& shorthand, bool important)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(shorthand.length() <= 6); // Existing shorthands have at most 6 longhands.
</span><del>- const CSSValue* longhands[6] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
</del><ins>+ RefPtr<CSSValue> longhands[6];
</ins><span class="cx"> const CSSPropertyID* shorthandProperties = shorthand.properties();
</span><span class="cx"> do {
</span><span class="cx"> bool foundLonghand = false;
</span><span class="lines">@@ -4030,9 +3728,9 @@
</span><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < shorthand.length(); ++i) {
</span><span class="cx"> if (longhands[i])
</span><del>- addProperty(shorthandProperties[i], shorthand.id(), *longhands[i], important);
</del><ins>+ addProperty(shorthandProperties[i], shorthand.id(), longhands[i].releaseNonNull(), important);
</ins><span class="cx"> else
</span><del>- addProperty(shorthandProperties[i], shorthand.id(), *CSSInitialValue::createLegacyImplicit(), important);
</del><ins>+ addProperty(shorthandProperties[i], shorthand.id(), CSSValuePool::singleton().createImplicitInitialValue(), important);
</ins><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4042,12 +3740,12 @@
</span><span class="cx"> static const double unsetValue = -1;
</span><span class="cx"> double flexGrow = unsetValue;
</span><span class="cx"> double flexShrink = unsetValue;
</span><del>- CSSPrimitiveValue* flexBasis = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> flexBasis;
</ins><span class="cx">
</span><span class="cx"> if (m_range.peek().id() == CSSValueNone) {
</span><span class="cx"> flexGrow = 0;
</span><span class="cx"> flexShrink = 0;
</span><del>- flexBasis = CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ flexBasis = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> m_range.consumeIncludingWhitespace();
</span><span class="cx"> } else {
</span><span class="cx"> unsigned index = 0;
</span><span class="lines">@@ -4061,7 +3759,7 @@
</span><span class="cx"> else if (flexShrink == unsetValue)
</span><span class="cx"> flexShrink = num;
</span><span class="cx"> else if (!num) // flex only allows a basis of 0 (sans units) if flex-grow and flex-shrink values have already been set.
</span><del>- flexBasis = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Pixels);
</del><ins>+ flexBasis = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitTypes::CSS_PX);
</ins><span class="cx"> else
</span><span class="cx"> return false;
</span><span class="cx"> } else if (!flexBasis) {
</span><span class="lines">@@ -4068,7 +3766,7 @@
</span><span class="cx"> if (m_range.peek().id() == CSSValueAuto)
</span><span class="cx"> flexBasis = consumeIdent(m_range);
</span><span class="cx"> if (!flexBasis)
</span><del>- flexBasis = consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeNonNegative);
</del><ins>+ flexBasis = consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
</ins><span class="cx"> if (index == 2 && !m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -4080,26 +3778,26 @@
</span><span class="cx"> if (flexShrink == unsetValue)
</span><span class="cx"> flexShrink = 1;
</span><span class="cx"> if (!flexBasis)
</span><del>- flexBasis = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::Percentage);
</del><ins>+ flexBasis = CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitTypes::CSS_PERCENTAGE);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- addProperty(CSSPropertyFlexGrow, CSSPropertyFlex, *CSSPrimitiveValue::create(clampTo<float>(flexGrow), CSSPrimitiveValue::UnitType::Number), important);
- addProperty(CSSPropertyFlexShrink, CSSPropertyFlex, *CSSPrimitiveValue::create(clampTo<float>(flexShrink), CSSPrimitiveValue::UnitType::Number), important);
- addProperty(CSSPropertyFlexBasis, CSSPropertyFlex, *flexBasis, important);
</del><ins>+ addProperty(CSSPropertyFlexGrow, CSSPropertyFlex, CSSPrimitiveValue::create(clampTo<float>(flexGrow), CSSPrimitiveValue::UnitTypes::CSS_NUMBER), important);
+ addProperty(CSSPropertyFlexShrink, CSSPropertyFlex, CSSPrimitiveValue::create(clampTo<float>(flexShrink), CSSPrimitiveValue::UnitTypes::CSS_NUMBER), important);
+ addProperty(CSSPropertyFlexBasis, CSSPropertyFlex, flexBasis.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeBorder(bool important)
</span><span class="cx"> {
</span><del>- CSSValue* width = nullptr;
- const CSSValue* style = nullptr;
- CSSValue* color = nullptr;
</del><ins>+ RefPtr<CSSValue> width;
+ RefPtr<CSSValue> style;
+ RefPtr<CSSValue> color;
</ins><span class="cx">
</span><span class="cx"> while (!width || !style || !color) {
</span><span class="cx"> if (!width) {
</span><del>- width = consumeLineWidth(m_range, m_context.mode(), UnitlessQuirk::Forbid);
</del><ins>+ width = consumeLineWidth(m_range, m_context.mode, UnitlessQuirk::Forbid);
</ins><span class="cx"> if (width)
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="lines">@@ -4109,7 +3807,7 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (!color) {
</span><del>- color = consumeColor(m_range, m_context.mode());
</del><ins>+ color = consumeColor(m_range, m_context.mode);
</ins><span class="cx"> if (color)
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="lines">@@ -4120,16 +3818,16 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (!width)
</span><del>- width = CSSInitialValue::createLegacyImplicit();
</del><ins>+ width = CSSValuePool::singleton().createImplicitInitialValue();
</ins><span class="cx"> if (!style)
</span><del>- style = CSSInitialValue::createLegacyImplicit();
</del><ins>+ style = CSSValuePool::singleton().createImplicitInitialValue();
</ins><span class="cx"> if (!color)
</span><del>- color = CSSInitialValue::createLegacyImplicit();
</del><ins>+ color = CSSValuePool::singleton().createImplicitInitialValue();
</ins><span class="cx">
</span><del>- addExpandedPropertyForValue(CSSPropertyBorderWidth, *width, important);
- addExpandedPropertyForValue(CSSPropertyBorderStyle, *style, important);
- addExpandedPropertyForValue(CSSPropertyBorderColor, *color, important);
- addExpandedPropertyForValue(CSSPropertyBorderImage, *CSSInitialValue::createLegacyImplicit(), important);
</del><ins>+ addExpandedPropertyForValue(CSSPropertyBorderWidth, width.releaseNonNull(), important);
+ addExpandedPropertyForValue(CSSPropertyBorderStyle, style.releaseNonNull(), important);
+ addExpandedPropertyForValue(CSSPropertyBorderColor, color.releaseNonNull(), important);
+ addExpandedPropertyForValue(CSSPropertyBorderImage, CSSValuePool::singleton().createImplicitInitialValue(), important);
</ins><span class="cx">
</span><span class="cx"> return m_range.atEnd();
</span><span class="cx"> }
</span><span class="lines">@@ -4138,13 +3836,13 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(shorthand.length() == 4);
</span><span class="cx"> const CSSPropertyID* longhands = shorthand.properties();
</span><del>- const CSSValue* top = parseSingleValue(longhands[0], shorthand.id());
</del><ins>+ RefPtr<CSSValue> top = parseSingleValue(longhands[0], shorthand.id());
</ins><span class="cx"> if (!top)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- const CSSValue* right = parseSingleValue(longhands[1], shorthand.id());
- const CSSValue* bottom = nullptr;
- const CSSValue* left = nullptr;
</del><ins>+ RefPtr<CSSValue> right = parseSingleValue(longhands[1], shorthand.id());
+ RefPtr<CSSValue> bottom;
+ RefPtr<CSSValue> left;
</ins><span class="cx"> if (right) {
</span><span class="cx"> bottom = parseSingleValue(longhands[2], shorthand.id());
</span><span class="cx"> if (bottom)
</span><span class="lines">@@ -4158,10 +3856,10 @@
</span><span class="cx"> if (!left)
</span><span class="cx"> left = right;
</span><span class="cx">
</span><del>- addProperty(longhands[0], shorthand.id(), *top, important);
- addProperty(longhands[1], shorthand.id(), *right, important);
- addProperty(longhands[2], shorthand.id(), *bottom, important);
- addProperty(longhands[3], shorthand.id(), *left, important);
</del><ins>+ addProperty(longhands[0], shorthand.id(), top.releaseNonNull(), important);
+ addProperty(longhands[1], shorthand.id(), right.releaseNonNull(), important);
+ addProperty(longhands[2], shorthand.id(), bottom.releaseNonNull(), important);
+ addProperty(longhands[3], shorthand.id(), left.releaseNonNull(), important);
</ins><span class="cx">
</span><span class="cx"> return m_range.atEnd();
</span><span class="cx"> }
</span><span class="lines">@@ -4168,26 +3866,37 @@
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeBorderImage(CSSPropertyID property, bool important)
</span><span class="cx"> {
</span><del>- CSSValue* source = nullptr;
- CSSValue* slice = nullptr;
- CSSValue* width = nullptr;
- CSSValue* outset = nullptr;
- CSSValue* repeat = nullptr;
</del><ins>+ RefPtr<CSSValue> source;
+ RefPtr<CSSValue> slice;
+ RefPtr<CSSValue> width;
+ RefPtr<CSSValue> outset;
+ RefPtr<CSSValue> repeat;
+
</ins><span class="cx"> if (consumeBorderImageComponents(property, m_range, m_context, source, slice, width, outset, repeat)) {
</span><ins>+ if (!source)
+ source = CSSValuePool::singleton().createImplicitInitialValue();
+ if (!slice)
+ slice = CSSValuePool::singleton().createImplicitInitialValue();
+ if (!width)
+ width = CSSValuePool::singleton().createImplicitInitialValue();
+ if (!outset)
+ outset = CSSValuePool::singleton().createImplicitInitialValue();
+ if (!repeat)
+ repeat = CSSValuePool::singleton().createImplicitInitialValue();
</ins><span class="cx"> switch (property) {
</span><span class="cx"> case CSSPropertyWebkitMaskBoxImage:
</span><del>- addProperty(CSSPropertyWebkitMaskBoxImageSource, CSSPropertyWebkitMaskBoxImage, source ? *source : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyWebkitMaskBoxImageSlice, CSSPropertyWebkitMaskBoxImage, slice ? *slice : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyWebkitMaskBoxImageWidth, CSSPropertyWebkitMaskBoxImage, width ? *width : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyWebkitMaskBoxImageOutset, CSSPropertyWebkitMaskBoxImage, outset ? *outset : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyWebkitMaskBoxImageRepeat, CSSPropertyWebkitMaskBoxImage, repeat ? *repeat : *CSSInitialValue::createLegacyImplicit(), important);
</del><ins>+ addProperty(CSSPropertyWebkitMaskBoxImageSource, CSSPropertyWebkitMaskBoxImage, source.releaseNonNull(), important);
+ addProperty(CSSPropertyWebkitMaskBoxImageSlice, CSSPropertyWebkitMaskBoxImage, slice.releaseNonNull(), important);
+ addProperty(CSSPropertyWebkitMaskBoxImageWidth, CSSPropertyWebkitMaskBoxImage, width.releaseNonNull(), important);
+ addProperty(CSSPropertyWebkitMaskBoxImageOutset, CSSPropertyWebkitMaskBoxImage, outset.releaseNonNull(), important);
+ addProperty(CSSPropertyWebkitMaskBoxImageRepeat, CSSPropertyWebkitMaskBoxImage, repeat.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> case CSSPropertyBorderImage:
</span><del>- addProperty(CSSPropertyBorderImageSource, CSSPropertyBorderImage, source ? *source : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyBorderImageSlice, CSSPropertyBorderImage, slice ? *slice : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyBorderImageWidth, CSSPropertyBorderImage, width ? *width : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyBorderImageOutset, CSSPropertyBorderImage, outset ? *outset : *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyBorderImageRepeat, CSSPropertyBorderImage, repeat ? *repeat : *CSSInitialValue::createLegacyImplicit(), important);
</del><ins>+ addProperty(CSSPropertyBorderImageSource, CSSPropertyBorderImage, source.releaseNonNull(), important);
+ addProperty(CSSPropertyBorderImageSlice, CSSPropertyBorderImage, slice.releaseNonNull(), important);
+ addProperty(CSSPropertyBorderImageWidth, CSSPropertyBorderImage, width.releaseNonNull() , important);
+ addProperty(CSSPropertyBorderImageOutset, CSSPropertyBorderImage, outset.releaseNonNull(), important);
+ addProperty(CSSPropertyBorderImageRepeat, CSSPropertyBorderImage, repeat.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -4237,7 +3946,7 @@
</span><span class="cx"> // The fragmentation spec says that page-break-(after|before|inside) are to be treated as
</span><span class="cx"> // shorthands for their break-(after|before|inside) counterparts. We'll do the same for the
</span><span class="cx"> // non-standard properties -webkit-column-break-(after|before|inside).
</span><del>- CSSPrimitiveValue* keyword = consumeIdent(m_range);
</del><ins>+ RefPtr<CSSPrimitiveValue> keyword = consumeIdent(m_range);
</ins><span class="cx"> if (!keyword)
</span><span class="cx"> return false;
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="lines">@@ -4263,34 +3972,34 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> CSSPropertyID genericBreakProperty = mapFromLegacyBreakProperty(property);
</span><del>- addProperty(genericBreakProperty, property, *CSSPrimitiveValue::createIdentifier(value), important);
</del><ins>+ addProperty(genericBreakProperty, property, CSSValuePool::singleton().createIdentifierValue(value), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeBackgroundPosition(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless, CSSValue*& resultX, CSSValue*& resultY)
</del><ins>+static bool consumeBackgroundPosition(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless, RefPtr<CSSValue>& resultX, RefPtr<CSSValue>& resultY)
</ins><span class="cx"> {
</span><span class="cx"> do {
</span><del>- CSSValue* positionX = nullptr;
- CSSValue* positionY = nullptr;
- if (!consumePosition(range, context.mode(), unitless, positionX, positionY))
</del><ins>+ RefPtr<CSSPrimitiveValue> positionX;
+ RefPtr<CSSPrimitiveValue> positionY;
+ if (!consumePosition(range, context.mode, unitless, positionX, positionY))
</ins><span class="cx"> return false;
</span><del>- addBackgroundValue(resultX, positionX);
- addBackgroundValue(resultY, positionY);
</del><ins>+ addBackgroundValue(resultX, positionX.releaseNonNull());
+ addBackgroundValue(resultY, positionY.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeRepeatStyleComponent(CSSParserTokenRange& range, CSSValue*& value1, CSSValue*& value2, bool& implicit)
</del><ins>+static bool consumeRepeatStyleComponent(CSSParserTokenRange& range, RefPtr<CSSPrimitiveValue>& value1, RefPtr<CSSPrimitiveValue>& value2, bool& implicit)
</ins><span class="cx"> {
</span><span class="cx"> if (consumeIdent<CSSValueRepeatX>(range)) {
</span><del>- value1 = CSSPrimitiveValue::createIdentifier(CSSValueRepeat);
- value2 = CSSPrimitiveValue::createIdentifier(CSSValueNoRepeat);
</del><ins>+ value1 = CSSValuePool::singleton().createIdentifierValue(CSSValueRepeat);
+ value2 = CSSValuePool::singleton().createIdentifierValue(CSSValueNoRepeat);
</ins><span class="cx"> implicit = true;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (consumeIdent<CSSValueRepeatY>(range)) {
</span><del>- value1 = CSSPrimitiveValue::createIdentifier(CSSValueNoRepeat);
- value2 = CSSPrimitiveValue::createIdentifier(CSSValueRepeat);
</del><ins>+ value1 = CSSValuePool::singleton().createIdentifierValue(CSSValueNoRepeat);
+ value2 = CSSValuePool::singleton().createIdentifierValue(CSSValueRepeat);
</ins><span class="cx"> implicit = true;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4306,15 +4015,15 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool consumeRepeatStyle(CSSParserTokenRange& range, CSSValue*& resultX, CSSValue*& resultY, bool& implicit)
</del><ins>+static bool consumeRepeatStyle(CSSParserTokenRange& range, RefPtr<CSSValue>& resultX, RefPtr<CSSValue>& resultY, bool& implicit)
</ins><span class="cx"> {
</span><span class="cx"> do {
</span><del>- CSSValue* repeatX = nullptr;
- CSSValue* repeatY = nullptr;
</del><ins>+ RefPtr<CSSPrimitiveValue> repeatX;
+ RefPtr<CSSPrimitiveValue> repeatY;
</ins><span class="cx"> if (!consumeRepeatStyleComponent(range, repeatX, repeatY, implicit))
</span><span class="cx"> return false;
</span><del>- addBackgroundValue(resultX, repeatX);
- addBackgroundValue(resultY, repeatY);
</del><ins>+ addBackgroundValue(resultX, repeatX.releaseNonNull());
+ addBackgroundValue(resultY, repeatY.releaseNonNull());
</ins><span class="cx"> } while (consumeCommaIncludingWhitespace(range));
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -4324,13 +4033,13 @@
</span><span class="cx"> bool CSSPropertyParser::consumeBackgroundShorthand(const StylePropertyShorthand& shorthand, bool important)
</span><span class="cx"> {
</span><span class="cx"> const unsigned longhandCount = shorthand.length();
</span><del>- CSSValue* longhands[10] = { 0 };
</del><ins>+ RefPtr<CSSValue> longhands[10];
</ins><span class="cx"> ASSERT(longhandCount <= 10);
</span><span class="cx">
</span><span class="cx"> bool implicit = false;
</span><span class="cx"> do {
</span><span class="cx"> bool parsedLonghand[10] = { false };
</span><del>- CSSValue* originValue = nullptr;
</del><ins>+ RefPtr<CSSValue> originValue;
</ins><span class="cx"> do {
</span><span class="cx"> bool foundProperty = false;
</span><span class="cx"> for (size_t i = 0; i < longhandCount; ++i) {
</span><span class="lines">@@ -4337,20 +4046,28 @@
</span><span class="cx"> if (parsedLonghand[i])
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- CSSValue* value = nullptr;
- CSSValue* valueY = nullptr;
</del><ins>+ RefPtr<CSSValue> value;
+ RefPtr<CSSValue> valueY;
</ins><span class="cx"> CSSPropertyID property = shorthand.properties()[i];
</span><span class="cx"> if (property == CSSPropertyBackgroundRepeatX || property == CSSPropertyWebkitMaskRepeatX) {
</span><del>- consumeRepeatStyleComponent(m_range, value, valueY, implicit);
</del><ins>+ RefPtr<CSSPrimitiveValue> primitiveValue;
+ RefPtr<CSSPrimitiveValue> primitiveValueY;
+ consumeRepeatStyleComponent(m_range, primitiveValue, primitiveValueY, implicit);
+ value = primitiveValue;
+ valueY = primitiveValueY;
</ins><span class="cx"> } else if (property == CSSPropertyBackgroundPositionX || property == CSSPropertyWebkitMaskPositionX) {
</span><span class="cx"> CSSParserTokenRange rangeCopy = m_range;
</span><del>- if (!consumePosition(rangeCopy, m_context.mode(), UnitlessQuirk::Forbid, value, valueY))
</del><ins>+ RefPtr<CSSPrimitiveValue> primitiveValue;
+ RefPtr<CSSPrimitiveValue> primitiveValueY;
+ if (!consumePosition(rangeCopy, m_context.mode, UnitlessQuirk::Forbid, primitiveValue, primitiveValueY))
</ins><span class="cx"> continue;
</span><ins>+ value = primitiveValue;
+ valueY = primitiveValueY;
</ins><span class="cx"> m_range = rangeCopy;
</span><span class="cx"> } else if (property == CSSPropertyBackgroundSize || property == CSSPropertyWebkitMaskSize) {
</span><span class="cx"> if (!consumeSlashIncludingWhitespace(m_range))
</span><span class="cx"> continue;
</span><del>- value = consumeBackgroundSize(property, m_range, m_context.mode());
</del><ins>+ value = consumeBackgroundSize(property, m_range, m_context.mode);
</ins><span class="cx"> if (!value || !parsedLonghand[i - 1]) // Position must have been parsed in the current layer.
</span><span class="cx"> return false;
</span><span class="cx"> } else if (property == CSSPropertyBackgroundPositionY || property == CSSPropertyBackgroundRepeatY
</span><span class="lines">@@ -4364,10 +4081,10 @@
</span><span class="cx"> originValue = value;
</span><span class="cx"> parsedLonghand[i] = true;
</span><span class="cx"> foundProperty = true;
</span><del>- addBackgroundValue(longhands[i], value);
</del><ins>+ addBackgroundValue(longhands[i], value.releaseNonNull());
</ins><span class="cx"> if (valueY) {
</span><span class="cx"> parsedLonghand[i + 1] = true;
</span><del>- addBackgroundValue(longhands[i + 1], valueY);
</del><ins>+ addBackgroundValue(longhands[i + 1], valueY.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -4384,11 +4101,11 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if ((property == CSSPropertyBackgroundClip || property == CSSPropertyWebkitMaskClip) && !parsedLonghand[i] && originValue) {
</span><del>- addBackgroundValue(longhands[i], originValue);
</del><ins>+ addBackgroundValue(longhands[i], originValue.releaseNonNull());
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (!parsedLonghand[i])
</span><del>- addBackgroundValue(longhands[i], CSSInitialValue::createLegacyImplicit());
</del><ins>+ addBackgroundValue(longhands[i], CSSValuePool::singleton().createImplicitInitialValue());
</ins><span class="cx"> }
</span><span class="cx"> } while (consumeCommaIncludingWhitespace(m_range));
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="lines">@@ -4396,7 +4113,7 @@
</span><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < longhandCount; ++i) {
</span><span class="cx"> CSSPropertyID property = shorthand.properties()[i];
</span><del>- if (property == CSSPropertyBackgroundSize && longhands[i] && m_context.useLegacyBackgroundSizeShorthandBehavior())
</del><ins>+ if (property == CSSPropertyBackgroundSize && longhands[i] && m_context.useLegacyBackgroundSizeShorthandBehavior)
</ins><span class="cx"> continue;
</span><span class="cx"> addProperty(property, shorthand.id(), *longhands[i], important, implicit);
</span><span class="cx"> }
</span><span class="lines">@@ -4405,38 +4122,35 @@
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeGridItemPositionShorthand(CSSPropertyID shorthandId, bool important)
</span><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> const StylePropertyShorthand& shorthand = shorthandForProperty(shorthandId);
</span><span class="cx"> ASSERT(shorthand.length() == 2);
</span><del>- CSSValue* startValue = consumeGridLine(m_range);
</del><ins>+ RefPtr<CSSValue> startValue = consumeGridLine(m_range);
</ins><span class="cx"> if (!startValue)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- CSSValue* endValue = nullptr;
</del><ins>+ RefPtr<CSSValue> endValue;
</ins><span class="cx"> if (consumeSlashIncludingWhitespace(m_range)) {
</span><span class="cx"> endValue = consumeGridLine(m_range);
</span><span class="cx"> if (!endValue)
</span><span class="cx"> return false;
</span><span class="cx"> } else {
</span><del>- endValue = startValue->isCustomIdentValue() ? startValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ endValue = startValue->isCustomIdentValue() ? startValue : CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> }
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- addProperty(shorthand.properties()[0], shorthandId, *startValue, important);
- addProperty(shorthand.properties()[1], shorthandId, *endValue, important);
</del><ins>+ addProperty(shorthand.properties()[0], shorthandId, startValue.releaseNonNull(), important);
+ addProperty(shorthand.properties()[1], shorthandId, endValue.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeGridAreaShorthand(bool important)
</span><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
- ASSERT(gridAreaShorthand().length() == 4);
- CSSValue* rowStartValue = consumeGridLine(m_range);
</del><ins>+ RefPtr<CSSValue> rowStartValue = consumeGridLine(m_range);
</ins><span class="cx"> if (!rowStartValue)
</span><span class="cx"> return false;
</span><del>- CSSValue* columnStartValue = nullptr;
- CSSValue* rowEndValue = nullptr;
- CSSValue* columnEndValue = nullptr;
</del><ins>+ RefPtr<CSSValue> columnStartValue;
+ RefPtr<CSSValue> rowEndValue;
+ RefPtr<CSSValue> columnEndValue;
</ins><span class="cx"> if (consumeSlashIncludingWhitespace(m_range)) {
</span><span class="cx"> columnStartValue = consumeGridLine(m_range);
</span><span class="cx"> if (!columnStartValue)
</span><span class="lines">@@ -4455,16 +4169,16 @@
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx"> if (!columnStartValue)
</span><del>- columnStartValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ columnStartValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> if (!rowEndValue)
</span><del>- rowEndValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ rowEndValue = rowStartValue->isCustomIdentValue() ? rowStartValue : CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> if (!columnEndValue)
</span><del>- columnEndValue = columnStartValue->isCustomIdentValue() ? columnStartValue : CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ columnEndValue = columnStartValue->isCustomIdentValue() ? columnStartValue : CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx">
</span><del>- addProperty(CSSPropertyGridRowStart, CSSPropertyGridArea, *rowStartValue, important);
- addProperty(CSSPropertyGridColumnStart, CSSPropertyGridArea, *columnStartValue, important);
- addProperty(CSSPropertyGridRowEnd, CSSPropertyGridArea, *rowEndValue, important);
- addProperty(CSSPropertyGridColumnEnd, CSSPropertyGridArea, *columnEndValue, important);
</del><ins>+ addProperty(CSSPropertyGridRowStart, CSSPropertyGridArea, rowStartValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridColumnStart, CSSPropertyGridArea, columnStartValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridRowEnd, CSSPropertyGridArea, rowEndValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridColumnEnd, CSSPropertyGridArea, columnEndValue.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4473,16 +4187,16 @@
</span><span class="cx"> NamedGridAreaMap gridAreaMap;
</span><span class="cx"> size_t rowCount = 0;
</span><span class="cx"> size_t columnCount = 0;
</span><del>- CSSValueList* templateRows = CSSValueList::createSpaceSeparated();
</del><ins>+ RefPtr<CSSValueList> templateRows = CSSValueList::createSpaceSeparated();
</ins><span class="cx">
</span><span class="cx"> // Persists between loop iterations so we can use the same value for
</span><span class="cx"> // consecutive <line-names> values
</span><del>- CSSGridLineNamesValue* lineNames = nullptr;
</del><ins>+ RefPtr<CSSGridLineNamesValue> lineNames;
</ins><span class="cx">
</span><span class="cx"> do {
</span><span class="cx"> // Handle leading <custom-ident>*.
</span><span class="cx"> bool hasPreviousLineNames = lineNames;
</span><del>- lineNames = consumeGridLineNames(m_range, lineNames);
</del><ins>+ lineNames = consumeGridLineNames(m_range, lineNames.get());
</ins><span class="cx"> if (lineNames && !hasPreviousLineNames)
</span><span class="cx"> templateRows->append(*lineNames);
</span><span class="cx">
</span><span class="lines">@@ -4492,63 +4206,60 @@
</span><span class="cx"> ++rowCount;
</span><span class="cx">
</span><span class="cx"> // Handle template-rows's track-size.
</span><del>- CSSValue* value = consumeGridTrackSize(m_range, m_context.mode());
</del><ins>+ RefPtr<CSSValue> value = consumeGridTrackSize(m_range, m_context.mode);
</ins><span class="cx"> if (!value)
</span><del>- value = CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ value = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> templateRows->append(*value);
</span><span class="cx">
</span><span class="cx"> // This will handle the trailing/leading <custom-ident>* in the grammar.
</span><span class="cx"> lineNames = consumeGridLineNames(m_range);
</span><span class="cx"> if (lineNames)
</span><del>- templateRows->append(*lineNames);
</del><ins>+ templateRows->append(lineNames.releaseNonNull());
</ins><span class="cx"> } while (!m_range.atEnd() && !(m_range.peek().type() == DelimiterToken && m_range.peek().delimiter() == '/'));
</span><span class="cx">
</span><del>- CSSValue* columnsValue = nullptr;
</del><ins>+ RefPtr<CSSValue> columnsValue;
</ins><span class="cx"> if (!m_range.atEnd()) {
</span><span class="cx"> if (!consumeSlashIncludingWhitespace(m_range))
</span><span class="cx"> return false;
</span><del>- columnsValue = consumeGridTrackList(m_range, m_context.mode(), GridTemplateNoRepeat);
</del><ins>+ columnsValue = consumeGridTrackList(m_range, m_context.mode, GridTemplateNoRepeat);
</ins><span class="cx"> if (!columnsValue || !m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx"> } else {
</span><del>- columnsValue = CSSPrimitiveValue::createIdentifier(CSSValueNone);
</del><ins>+ columnsValue = CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
</ins><span class="cx"> }
</span><del>- addProperty(CSSPropertyGridTemplateRows, shorthandId, *templateRows, important);
- addProperty(CSSPropertyGridTemplateColumns, shorthandId, *columnsValue, important);
- addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount), important);
</del><ins>+ addProperty(CSSPropertyGridTemplateRows, shorthandId, templateRows.releaseNonNull(), important);
+ addProperty(CSSPropertyGridTemplateColumns, shorthandId, columnsValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridTemplateAreas, shorthandId, CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeGridTemplateShorthand(CSSPropertyID shorthandId, bool important)
</span><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
- ASSERT(gridTemplateShorthand().length() == 3);
-
</del><span class="cx"> CSSParserTokenRange rangeCopy = m_range;
</span><del>- CSSValue* rowsValue = consumeIdent<CSSValueNone>(m_range);
</del><ins>+ RefPtr<CSSValue> rowsValue = consumeIdent<CSSValueNone>(m_range);
</ins><span class="cx">
</span><span class="cx"> // 1- 'none' case.
</span><span class="cx"> if (rowsValue && m_range.atEnd()) {
</span><del>- addProperty(CSSPropertyGridTemplateRows, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important);
- addProperty(CSSPropertyGridTemplateColumns, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important);
- addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important);
</del><ins>+ addProperty(CSSPropertyGridTemplateRows, shorthandId, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
+ addProperty(CSSPropertyGridTemplateColumns, shorthandId, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
+ addProperty(CSSPropertyGridTemplateAreas, shorthandId, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 2- <grid-template-rows> / <grid-template-columns>
</span><span class="cx"> if (!rowsValue)
</span><del>- rowsValue = consumeGridTrackList(m_range, m_context.mode(), GridTemplate);
</del><ins>+ rowsValue = consumeGridTrackList(m_range, m_context.mode, GridTemplate);
</ins><span class="cx">
</span><span class="cx"> if (rowsValue) {
</span><span class="cx"> if (!consumeSlashIncludingWhitespace(m_range))
</span><span class="cx"> return false;
</span><del>- CSSValue* columnsValue = consumeGridTemplatesRowsOrColumns(m_range, m_context.mode());
</del><ins>+ RefPtr<CSSValue> columnsValue = consumeGridTemplatesRowsOrColumns(m_range, m_context.mode);
</ins><span class="cx"> if (!columnsValue || !m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- addProperty(CSSPropertyGridTemplateRows, shorthandId, *rowsValue, important);
- addProperty(CSSPropertyGridTemplateColumns, shorthandId, *columnsValue, important);
- addProperty(CSSPropertyGridTemplateAreas, shorthandId, *CSSPrimitiveValue::createIdentifier(CSSValueNone), important);
</del><ins>+ addProperty(CSSPropertyGridTemplateRows, shorthandId, rowsValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridTemplateColumns, shorthandId, columnsValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridTemplateAreas, shorthandId, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4559,7 +4270,6 @@
</span><span class="cx">
</span><span class="cx"> bool CSSPropertyParser::consumeGridShorthand(bool important)
</span><span class="cx"> {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
</del><span class="cx"> ASSERT(shorthandForProperty(CSSPropertyGrid).length() == 8);
</span><span class="cx">
</span><span class="cx"> CSSParserTokenRange rangeCopy = m_range;
</span><span class="lines">@@ -4568,11 +4278,11 @@
</span><span class="cx"> if (consumeGridTemplateShorthand(CSSPropertyGrid, important)) {
</span><span class="cx"> // It can only be specified the explicit or the implicit grid properties in a single grid declaration.
</span><span class="cx"> // The sub-properties not specified are set to their initial value, as normal for shorthands.
</span><del>- addProperty(CSSPropertyGridAutoFlow, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridColumnGap, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridRowGap, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
</del><ins>+ addProperty(CSSPropertyGridAutoFlow, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridColumnGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridRowGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4579,19 +4289,19 @@
</span><span class="cx"> m_range = rangeCopy;
</span><span class="cx">
</span><span class="cx"> // 2- <grid-auto-flow> [ <grid-auto-rows> [ / <grid-auto-columns> ]? ]
</span><del>- CSSValueList* gridAutoFlow = consumeGridAutoFlow(m_range);
</del><ins>+ RefPtr<CSSValueList> gridAutoFlow = consumeGridAutoFlow(m_range);
</ins><span class="cx"> if (!gridAutoFlow)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- CSSValue* autoColumnsValue = nullptr;
- CSSValue* autoRowsValue = nullptr;
</del><ins>+ RefPtr<CSSValue> autoColumnsValue;
+ RefPtr<CSSValue> autoRowsValue;
</ins><span class="cx">
</span><span class="cx"> if (!m_range.atEnd()) {
</span><del>- autoRowsValue = consumeGridTrackList(m_range, m_context.mode(), GridAuto);
</del><ins>+ autoRowsValue = consumeGridTrackList(m_range, m_context.mode, GridAuto);
</ins><span class="cx"> if (!autoRowsValue)
</span><span class="cx"> return false;
</span><span class="cx"> if (consumeSlashIncludingWhitespace(m_range)) {
</span><del>- autoColumnsValue = consumeGridTrackList(m_range, m_context.mode(), GridAuto);
</del><ins>+ autoColumnsValue = consumeGridTrackList(m_range, m_context.mode, GridAuto);
</ins><span class="cx"> if (!autoColumnsValue)
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -4599,8 +4309,8 @@
</span><span class="cx"> return false;
</span><span class="cx"> } else {
</span><span class="cx"> // Other omitted values are set to their initial values.
</span><del>- autoColumnsValue = CSSInitialValue::createLegacyImplicit();
- autoRowsValue = CSSInitialValue::createLegacyImplicit();
</del><ins>+ autoColumnsValue = CSSValuePool::singleton().createImplicitInitialValue();
+ autoRowsValue = CSSValuePool::singleton().createImplicitInitialValue();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // if <grid-auto-columns> value is omitted, it is set to the value specified for grid-auto-rows.
</span><span class="lines">@@ -4609,54 +4319,51 @@
</span><span class="cx">
</span><span class="cx"> // It can only be specified the explicit or the implicit grid properties in a single grid declaration.
</span><span class="cx"> // The sub-properties not specified are set to their initial value, as normal for shorthands.
</span><del>- addProperty(CSSPropertyGridTemplateColumns, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridTemplateRows, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridTemplateAreas, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridAutoFlow, CSSPropertyGrid, *gridAutoFlow, important);
- addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, *autoColumnsValue, important);
- addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, *autoRowsValue, important);
- addProperty(CSSPropertyGridColumnGap, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
- addProperty(CSSPropertyGridRowGap, CSSPropertyGrid, *CSSInitialValue::createLegacyImplicit(), important);
</del><ins>+ addProperty(CSSPropertyGridTemplateColumns, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridTemplateRows, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridTemplateAreas, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridAutoFlow, CSSPropertyGrid, gridAutoFlow.releaseNonNull(), important);
+ addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, autoColumnsValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, autoRowsValue.releaseNonNull(), important);
+ addProperty(CSSPropertyGridColumnGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
+ addProperty(CSSPropertyGridRowGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool important)
</del><ins>+bool CSSPropertyParser::parseShorthand(CSSPropertyID property, bool important)
</ins><span class="cx"> {
</span><del>- CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
-
</del><span class="cx"> switch (property) {
</span><span class="cx"> case CSSPropertyWebkitMarginCollapse: {
</span><span class="cx"> CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode()))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode))
</ins><span class="cx"> return false;
</span><del>- CSSValue* beforeCollapse = CSSPrimitiveValue::createIdentifier(id);
- addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, *beforeCollapse, important);
</del><ins>+ RefPtr<CSSValue> beforeCollapse = CSSValuePool::singleton().createIdentifierValue(id);
+ addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, beforeCollapse.releaseNonNull(), important);
</ins><span class="cx"> if (m_range.atEnd()) {
</span><del>- addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, *beforeCollapse, important);
</del><ins>+ addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, beforeCollapse.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode()))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode))
</ins><span class="cx"> return false;
</span><del>- addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, *CSSPrimitiveValue::createIdentifier(id), important);
</del><ins>+ addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyOverflow: {
</span><span class="cx"> CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>- if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode()))
</del><ins>+ if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode))
</ins><span class="cx"> return false;
</span><span class="cx"> if (!m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- CSSValue* overflowYValue = CSSPrimitiveValue::createIdentifier(id);
</del><ins>+ RefPtr<CSSValue> overflowYValue = CSSValuePool::singleton().createIdentifierValue(id);
+ RefPtr<CSSValue> overflowXValue;
</ins><span class="cx">
</span><del>- CSSValue* overflowXValue = nullptr;
-
</del><span class="cx"> // FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. If this value has been
</span><span class="cx"> // set using the shorthand, then for now overflow-x will default to auto, but once we implement
</span><span class="cx"> // pagination controls, it should default to hidden. If the overflow-y value is anything but
</span><span class="cx"> // paged-x or paged-y, then overflow-x and overflow-y should have the same value.
</span><span class="cx"> if (id == CSSValueWebkitPagedX || id == CSSValueWebkitPagedY)
</span><del>- overflowXValue = CSSPrimitiveValue::createIdentifier(CSSValueAuto);
</del><ins>+ overflowXValue = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
</ins><span class="cx"> else
</span><span class="cx"> overflowXValue = overflowYValue;
</span><span class="cx"> addProperty(CSSPropertyOverflowX, CSSPropertyOverflow, *overflowXValue, important);
</span><span class="lines">@@ -4676,18 +4383,15 @@
</span><span class="cx"> case CSSPropertyColumns:
</span><span class="cx"> return consumeColumns(important);
</span><span class="cx"> case CSSPropertyAnimation:
</span><del>- return consumeAnimationShorthand(animationShorthandForParsing(), unresolvedProperty == CSSPropertyAliasWebkitAnimation, important);
</del><ins>+ return consumeAnimationShorthand(animationShorthandForParsing(), important);
</ins><span class="cx"> case CSSPropertyTransition:
</span><del>- return consumeAnimationShorthand(transitionShorthandForParsing(), false, important);
</del><ins>+ return consumeAnimationShorthand(transitionShorthandForParsing(), important);
</ins><span class="cx"> case CSSPropertyTextDecoration:
</span><del>- ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled());
- return consumeShorthandGreedily(textDecorationShorthand(), important);
</del><ins>+ return consumeShorthandGreedily(webkitTextDecorationShorthand(), important);
</ins><span class="cx"> case CSSPropertyMargin:
</span><span class="cx"> return consume4Values(marginShorthand(), important);
</span><span class="cx"> case CSSPropertyPadding:
</span><span class="cx"> return consume4Values(paddingShorthand(), important);
</span><del>- case CSSPropertyMotion:
- return consumeShorthandGreedily(motionShorthand(), important);
</del><span class="cx"> case CSSPropertyWebkitTextEmphasis:
</span><span class="cx"> return consumeShorthandGreedily(webkitTextEmphasisShorthand(), important);
</span><span class="cx"> case CSSPropertyOutline:
</span><span class="lines">@@ -4703,12 +4407,12 @@
</span><span class="cx"> case CSSPropertyWebkitTextStroke:
</span><span class="cx"> return consumeShorthandGreedily(webkitTextStrokeShorthand(), important);
</span><span class="cx"> case CSSPropertyMarker: {
</span><del>- const CSSValue* marker = parseSingleValue(CSSPropertyMarkerStart);
</del><ins>+ RefPtr<CSSValue> marker = parseSingleValue(CSSPropertyMarkerStart);
</ins><span class="cx"> if (!marker || !m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- addProperty(CSSPropertyMarkerStart, CSSPropertyMarker, *marker, important);
- addProperty(CSSPropertyMarkerMid, CSSPropertyMarker, *marker, important);
- addProperty(CSSPropertyMarkerEnd, CSSPropertyMarker, *marker, important);
</del><ins>+ addProperty(CSSPropertyMarkerStart, CSSPropertyMarker, marker.releaseNonNull(), important);
+ addProperty(CSSPropertyMarkerMid, CSSPropertyMarker, marker.releaseNonNull(), important);
+ addProperty(CSSPropertyMarkerEnd, CSSPropertyMarker, marker.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyFlex:
</span><span class="lines">@@ -4720,14 +4424,14 @@
</span><span class="cx"> case CSSPropertyListStyle:
</span><span class="cx"> return consumeShorthandGreedily(listStyleShorthand(), important);
</span><span class="cx"> case CSSPropertyBorderRadius: {
</span><del>- CSSPrimitiveValue* horizontalRadii[4] = { 0 };
- CSSPrimitiveValue* verticalRadii[4] = { 0 };
- if (!consumeRadii(horizontalRadii, verticalRadii, m_range, m_context.mode(), unresolvedProperty == CSSPropertyAliasWebkitBorderRadius))
</del><ins>+ RefPtr<CSSPrimitiveValue> horizontalRadii[4];
+ RefPtr<CSSPrimitiveValue> verticalRadii[4];
+ if (!consumeRadii(horizontalRadii, verticalRadii, m_range, m_context.mode, property == CSSPropertyWebkitBorderRadius))
</ins><span class="cx"> return false;
</span><del>- addProperty(CSSPropertyBorderTopLeftRadius, CSSPropertyBorderRadius, *CSSValuePair::create(horizontalRadii[0], verticalRadii[0], CSSValuePair::DropIdenticalValues), important);
- addProperty(CSSPropertyBorderTopRightRadius, CSSPropertyBorderRadius, *CSSValuePair::create(horizontalRadii[1], verticalRadii[1], CSSValuePair::DropIdenticalValues), important);
- addProperty(CSSPropertyBorderBottomRightRadius, CSSPropertyBorderRadius, *CSSValuePair::create(horizontalRadii[2], verticalRadii[2], CSSValuePair::DropIdenticalValues), important);
- addProperty(CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderRadius, *CSSValuePair::create(horizontalRadii[3], verticalRadii[3], CSSValuePair::DropIdenticalValues), important);
</del><ins>+ addProperty(CSSPropertyBorderTopLeftRadius, CSSPropertyBorderRadius, createPrimitiveValuePair(horizontalRadii[0].releaseNonNull(), verticalRadii[0].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce), important);
+ addProperty(CSSPropertyBorderTopRightRadius, CSSPropertyBorderRadius, createPrimitiveValuePair(horizontalRadii[1].releaseNonNull(), verticalRadii[1].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce), important);
+ addProperty(CSSPropertyBorderBottomRightRadius, CSSPropertyBorderRadius, createPrimitiveValuePair(horizontalRadii[2].releaseNonNull(), verticalRadii[2].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce), important);
+ addProperty(CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderRadius, createPrimitiveValuePair(horizontalRadii[3].releaseNonNull(), verticalRadii[3].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyBorderColor:
</span><span class="lines">@@ -4758,23 +4462,23 @@
</span><span class="cx"> return consumeLegacyBreakProperty(property, important);
</span><span class="cx"> case CSSPropertyWebkitMaskPosition:
</span><span class="cx"> case CSSPropertyBackgroundPosition: {
</span><del>- CSSValue* resultX = nullptr;
- CSSValue* resultY = nullptr;
</del><ins>+ RefPtr<CSSValue> resultX;
+ RefPtr<CSSValue> resultY;
</ins><span class="cx"> if (!consumeBackgroundPosition(m_range, m_context, UnitlessQuirk::Allow, resultX, resultY) || !m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- addProperty(property == CSSPropertyBackgroundPosition ? CSSPropertyBackgroundPositionX : CSSPropertyWebkitMaskPositionX, property, *resultX, important);
- addProperty(property == CSSPropertyBackgroundPosition ? CSSPropertyBackgroundPositionY : CSSPropertyWebkitMaskPositionY, property, *resultY, important);
</del><ins>+ addProperty(property == CSSPropertyBackgroundPosition ? CSSPropertyBackgroundPositionX : CSSPropertyWebkitMaskPositionX, property, resultX.releaseNonNull(), important);
+ addProperty(property == CSSPropertyBackgroundPosition ? CSSPropertyBackgroundPositionY : CSSPropertyWebkitMaskPositionY, property, resultY.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyBackgroundRepeat:
</span><span class="cx"> case CSSPropertyWebkitMaskRepeat: {
</span><del>- CSSValue* resultX = nullptr;
- CSSValue* resultY = nullptr;
</del><ins>+ RefPtr<CSSValue> resultX;
+ RefPtr<CSSValue> resultY;
</ins><span class="cx"> bool implicit = false;
</span><span class="cx"> if (!consumeRepeatStyle(m_range, resultX, resultY, implicit) || !m_range.atEnd())
</span><span class="cx"> return false;
</span><del>- addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgroundRepeatX : CSSPropertyWebkitMaskRepeatX, property, *resultX, important, implicit);
- addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgroundRepeatY : CSSPropertyWebkitMaskRepeatY, property, *resultY, important, implicit);
</del><ins>+ addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgroundRepeatX : CSSPropertyWebkitMaskRepeatX, property, resultX.releaseNonNull(), important, implicit);
+ addProperty(property == CSSPropertyBackgroundRepeat ? CSSPropertyBackgroundRepeatY : CSSPropertyWebkitMaskRepeatY, property, resultY.releaseNonNull(), important, implicit);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyBackground:
</span><span class="lines">@@ -4782,15 +4486,14 @@
</span><span class="cx"> case CSSPropertyWebkitMask:
</span><span class="cx"> return consumeBackgroundShorthand(webkitMaskShorthand(), important);
</span><span class="cx"> case CSSPropertyGridGap: {
</span><del>- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled() && shorthandForProperty(CSSPropertyGridGap).length() == 2);
- CSSValue* rowGap = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative);
- CSSValue* columnGap = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative);
</del><ins>+ RefPtr<CSSValue> rowGap = consumeLength(m_range, m_context.mode, ValueRangeNonNegative);
+ RefPtr<CSSValue> columnGap = consumeLength(m_range, m_context.mode, ValueRangeNonNegative);
</ins><span class="cx"> if (!rowGap || !m_range.atEnd())
</span><span class="cx"> return false;
</span><span class="cx"> if (!columnGap)
</span><span class="cx"> columnGap = rowGap;
</span><del>- addProperty(CSSPropertyGridRowGap, CSSPropertyGridGap, *rowGap, important);
- addProperty(CSSPropertyGridColumnGap, CSSPropertyGridGap, *columnGap, important);
</del><ins>+ addProperty(CSSPropertyGridRowGap, CSSPropertyGridGap, rowGap.releaseNonNull(), important);
+ addProperty(CSSPropertyGridColumnGap, CSSPropertyGridGap, columnGap.releaseNonNull(), important);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyGridColumn:
</span><span class="lines">@@ -4806,6 +4509,5 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-*/
</del><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.h (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.h        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> Vector<CSSProperty, 256>&, StyleRule::Type);
</span><span class="cx">
</span><span class="cx"> // Parses a non-shorthand CSS property
</span><del>- static const CSSValue* parseSingleValue(CSSPropertyID, const CSSParserTokenRange&, const CSSParserContext&);
</del><ins>+ static RefPtr<CSSValue> parseSingleValue(CSSPropertyID, const CSSParserTokenRange&, const CSSParserContext&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> CSSPropertyParser(const CSSParserTokenRange&, const CSSParserContext&,
</span><span class="lines">@@ -51,9 +51,9 @@
</span><span class="cx"> Vector<CSSProperty, 256>*);
</span><span class="cx">
</span><span class="cx"> // FIXME: Rename once the CSSParserValue-based parseValue is removed
</span><del>- bool parseValueStart(CSSPropertyID unresolvedProperty, bool important);
- bool consumeCSSWideKeyword(CSSPropertyID unresolvedProperty, bool important);
- const CSSValue* parseSingleValue(CSSPropertyID, CSSPropertyID = CSSPropertyInvalid);
</del><ins>+ bool parseValueStart(CSSPropertyID, bool important);
+ bool consumeCSSWideKeyword(CSSPropertyID, bool important);
+ RefPtr<CSSValue> parseSingleValue(CSSPropertyID, CSSPropertyID = CSSPropertyInvalid);
</ins><span class="cx">
</span><span class="cx"> bool inQuirksMode() const { return m_context.mode == HTMLQuirksMode; }
</span><span class="cx">
</span><span class="lines">@@ -60,8 +60,8 @@
</span><span class="cx"> bool parseViewportDescriptor(CSSPropertyID propId, bool important);
</span><span class="cx"> bool parseFontFaceDescriptor(CSSPropertyID);
</span><span class="cx">
</span><del>- void addProperty(CSSPropertyID, CSSPropertyID, const CSSValue&, bool important, bool implicit = false);
- void addExpandedPropertyForValue(CSSPropertyID propId, const CSSValue&, bool);
</del><ins>+ void addProperty(CSSPropertyID, CSSPropertyID, Ref<CSSValue>&&, bool important, bool implicit = false);
+ void addExpandedPropertyForValue(CSSPropertyID propId, Ref<CSSValue>&&, bool);
</ins><span class="cx">
</span><span class="cx"> bool consumeBorder(bool important);
</span><span class="cx">
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> bool consume4Values(const StylePropertyShorthand&, bool important);
</span><span class="cx">
</span><span class="cx"> // Legacy parsing allows <string>s for animation-name
</span><del>- bool consumeAnimationShorthand(const StylePropertyShorthand&, bool useLegacyParsing, bool important);
</del><ins>+ bool consumeAnimationShorthand(const StylePropertyShorthand&, bool important);
</ins><span class="cx"> bool consumeBackgroundShorthand(const StylePropertyShorthand&, bool important);
</span><span class="cx">
</span><span class="cx"> bool consumeColumns(bool important);
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx"> Vector<CSSProperty, 256>* m_parsedProperties;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-CSSPropertyID unresolvedCSSPropertyID(StringView);
</del><ins>+CSSPropertyID cssPropertyID(StringView);
</ins><span class="cx"> CSSValueID cssValueKeywordID(StringView);
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (range.peek().type() != IdentToken)
</span><span class="cx"> return nullptr;
</span><del>- return CSSPrimitiveValue::createIdentifier(range.consumeIncludingWhitespace().id());
</del><ins>+ return CSSValuePool::singleton().createIdentifierValue(range.consumeIncludingWhitespace().id());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange& range, CSSValueID lower, CSSValueID upper)
</span><span class="lines">@@ -333,11 +333,14 @@
</span><span class="cx"> return consumeIdent(range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRange& range)
</del><ins>+// FIXME-NEWPARSER: Eventually we'd like this to use CSSCustomIdentValue, but we need
+// to do other plumbing work first (like changing Pair to CSSValuePair and make it not
+// use only primitive values).
+RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange& range)
</ins><span class="cx"> {
</span><span class="cx"> if (range.peek().type() != IdentToken || isCSSWideKeyword(range.peek().id()))
</span><span class="cx"> return nullptr;
</span><del>- return CSSCustomIdentValue::create(range.consumeIncludingWhitespace().value().toString());
</del><ins>+ return CSSValuePool::singleton().createValue(range.consumeIncludingWhitespace().value().toString(), CSSPrimitiveValue::UnitTypes::CSS_STRING);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<CSSPrimitiveValue> consumeString(CSSParserTokenRange& range)
</span><span class="lines">@@ -344,7 +347,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (range.peek().type() != StringToken)
</span><span class="cx"> return nullptr;
</span><del>- return CSSPrimitiveValue::create(range.consumeIncludingWhitespace().value().toString(), CSSPrimitiveValue::UnitTypes::CSS_STRING);
</del><ins>+ return CSSValuePool::singleton().createValue(range.consumeIncludingWhitespace().value().toString(), CSSPrimitiveValue::UnitTypes::CSS_STRING);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> StringView consumeUrlAsStringView(CSSParserTokenRange& range)
</span><span class="lines">@@ -1034,7 +1037,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> RefPtr<CSSValue> image = CSSImageValue::create(completeURL(context, urlValue));
</span><del>- imageSet->append(*image);
</del><ins>+ imageSet->append(image.releaseNonNull());
</ins><span class="cx">
</span><span class="cx"> const CSSParserToken& token = args.consumeIncludingWhitespace();
</span><span class="cx"> if (token.type() != DimensionToken)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h (207478 => 207479)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h        2016-10-18 19:22:11 UTC (rev 207478)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h        2016-10-18 20:03:18 UTC (rev 207479)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> template<CSSValueID, CSSValueID...> inline bool identMatches(CSSValueID id);
</span><span class="cx"> template<CSSValueID... allowedIdents> RefPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&);
</span><span class="cx">
</span><del>-RefPtr<CSSCustomIdentValue> consumeCustomIdent(CSSParserTokenRange&);
</del><ins>+RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange&);
</ins><span class="cx"> RefPtr<CSSPrimitiveValue> consumeString(CSSParserTokenRange&);
</span><span class="cx"> StringView consumeUrlAsStringView(CSSParserTokenRange&);
</span><span class="cx"> RefPtr<CSSPrimitiveValue> consumeUrl(CSSParserTokenRange&);
</span></span></pre>
</div>
</div>
</body>
</html>