<!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>[207361] 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/207361">207361</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2016-10-14 16:37:21 -0700 (Fri, 14 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>CSS parsing should use Color not RGBA32
https://bugs.webkit.org/show_bug.cgi?id=163423
&lt;rdar://problem/28766903&gt;

Reviewed by Simon Fraser.

Re-landing this after it was rolled out in https://trac.webkit.org/<a href="http://trac.webkit.org/projects/webkit/changeset/207342">r207342</a>.

In order to allow CSS to use the ExtendedColor variant of
Color, we need to stop using RGBA32. This is a fairly big
change that goes through all the places in the parser
related to colors, and moves them from RGBA32 to Color.

No change in functionality, so covered by existing tests.

* WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.

* css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
rather than an unsigned int for colors.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::getRGBColorValue):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
* css/CSSPrimitiveValue.h: Move to Color* and also use some
nullptrs.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
constructor.

* css/CSSValuePool.cpp: Move to Color.
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createColorValue):
* css/CSSValuePool.h: Change the ColorValueCache to a new type.

* css/StyleResolver.cpp: Move to Color.
(WebCore::StyleResolver::colorFromPrimitiveValue):
* css/parser/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseColorFromString):
(WebCore::CSSParser::parseSystemColor):
(WebCore::fastParseColorInternal):
(WebCore::CSSParser::fastParseColor):
(WebCore::CSSParser::parseColorFromValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
(WebCore::CSSParserFastPaths::parseColor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeColor):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
(WebCore::CSSParser::parseSVGPaint):
(WebCore::CSSParser::parseSVGColor):
* editing/EditingStyle.cpp:
(WebCore::cssValueToColor):
(WebCore::textColorFromStyle):
(WebCore::backgroundColorFromStyle):
(WebCore::rgbaBackgroundColorInEffect):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::isTransparentColorValue):
(WebCore::cssValueToRGBA): Deleted.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/canvas/CanvasGradient.cpp:
(WebCore::CanvasGradient::addColorStop):
* html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
remind myself to come back when colorWithOverrideAlpha has been updated.
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasStyle.cpp:
(WebCore::isCurrentColorString):
(WebCore::parseColor):
(WebCore::currentColor):
(WebCore::parseColorOrCurrentColor):
(WebCore::CanvasStyle::createFromString):
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/canvas/CanvasStyle.h:
* svg/SVGColor.cpp:
(WebCore::SVGColor::colorFromRGBColorString):

* platform/graphics/Color.h: Add new constructors for the special
empty and deleted Color values used in HashTables.
(WebCore::Color::Color):
(WebCore::Color::isHashTableDeletedValue):
(WebCore::Color::asUint64): New accessor to get the raw uint64_t value.

* platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
(WTF::ColorHash::hash):
(WTF::ColorHash::equal):
(WTF::HashTraits&lt;WebCore::Color&gt;::emptyValue):
(WTF::HashTraits&lt;WebCore::Color&gt;::constructDeletedValue):
(WTF::HashTraits&lt;WebCore::Color&gt;::isDeletedValue):</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCorecssCSSPrimitiveValuecpp">trunk/Source/WebCore/css/CSSPrimitiveValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueh">trunk/Source/WebCore/css/CSSPrimitiveValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuePoolcpp">trunk/Source/WebCore/css/CSSValuePool.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuePoolh">trunk/Source/WebCore/css/CSSValuePool.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParsercpp">trunk/Source/WebCore/css/parser/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserh">trunk/Source/WebCore/css/parser/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserFastPathscpp">trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserHelperscpp">trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserSVGCSSParsercpp">trunk/Source/WebCore/css/parser/SVGCSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaHTMLConvertermm">trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLBodyElementcpp">trunk/Source/WebCore/html/HTMLBodyElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasGradientcpp">trunk/Source/WebCore/html/canvas/CanvasGradient.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasStylecpp">trunk/Source/WebCore/html/canvas/CanvasStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasStyleh">trunk/Source/WebCore/html/canvas/CanvasStyle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorh">trunk/Source/WebCore/platform/graphics/Color.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGColorcpp">trunk/Source/WebCore/svg/SVGColor.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorHashh">trunk/Source/WebCore/platform/graphics/ColorHash.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/ChangeLog        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -1,3 +1,105 @@
</span><ins>+2016-10-14  Dean Jackson  &lt;dino@apple.com&gt;
+
+        CSS parsing should use Color not RGBA32
+        https://bugs.webkit.org/show_bug.cgi?id=163423
+        &lt;rdar://problem/28766903&gt;
+
+        Reviewed by Simon Fraser.
+
+        Re-landing this after it was rolled out in https://trac.webkit.org/r207342.
+
+        In order to allow CSS to use the ExtendedColor variant of
+        Color, we need to stop using RGBA32. This is a fairly big
+        change that goes through all the places in the parser
+        related to colors, and moves them from RGBA32 to Color.
+
+        No change in functionality, so covered by existing tests.
+
+        * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
+
+        * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
+        rather than an unsigned int for colors.
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::getRGBColorValue):
+        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
+        (WebCore::CSSPrimitiveValue::cloneForCSSOM):
+        (WebCore::CSSPrimitiveValue::equals):
+        * css/CSSPrimitiveValue.h: Move to Color* and also use some
+        nullptrs.
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
+        constructor.
+
+        * css/CSSValuePool.cpp: Move to Color.
+        (WebCore::CSSValuePool::CSSValuePool):
+        (WebCore::CSSValuePool::createColorValue):
+        * css/CSSValuePool.h: Change the ColorValueCache to a new type.
+
+        * css/StyleResolver.cpp: Move to Color.
+        (WebCore::StyleResolver::colorFromPrimitiveValue):
+        * css/parser/CSSParser.cpp:
+        (WebCore::parseColorValue):
+        (WebCore::CSSParser::parseColor):
+        (WebCore::CSSParser::parseColorFromString):
+        (WebCore::CSSParser::parseSystemColor):
+        (WebCore::fastParseColorInternal):
+        (WebCore::CSSParser::fastParseColor):
+        (WebCore::CSSParser::parseColorFromValue):
+        * css/parser/CSSParser.h:
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::fastParseColorInternal):
+        (WebCore::CSSParserFastPaths::parseColor):
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::consumeColor):
+        * css/parser/SVGCSSParser.cpp:
+        (WebCore::CSSParser::parseSVGValue):
+        (WebCore::CSSParser::parseSVGPaint):
+        (WebCore::CSSParser::parseSVGColor):
+        * editing/EditingStyle.cpp:
+        (WebCore::cssValueToColor):
+        (WebCore::textColorFromStyle):
+        (WebCore::backgroundColorFromStyle):
+        (WebCore::rgbaBackgroundColorInEffect):
+        (WebCore::EditingStyle::prepareToApplyAt):
+        (WebCore::isTransparentColorValue):
+        (WebCore::cssValueToRGBA): Deleted.
+        * editing/cocoa/HTMLConverter.mm:
+        (HTMLConverterCaches::colorPropertyValueForNode):
+        * html/HTMLBodyElement.cpp:
+        (WebCore::HTMLBodyElement::parseAttribute):
+        * html/canvas/CanvasGradient.cpp:
+        (WebCore::CanvasGradient::addColorStop):
+        * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
+        remind myself to come back when colorWithOverrideAlpha has been updated.
+        (WebCore::CanvasRenderingContext2D::setStrokeStyle):
+        (WebCore::CanvasRenderingContext2D::setFillStyle):
+        (WebCore::CanvasRenderingContext2D::setShadowColor):
+        (WebCore::CanvasRenderingContext2D::setShadow):
+        * html/canvas/CanvasStyle.cpp:
+        (WebCore::isCurrentColorString):
+        (WebCore::parseColor):
+        (WebCore::currentColor):
+        (WebCore::parseColorOrCurrentColor):
+        (WebCore::CanvasStyle::createFromString):
+        (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
+        * html/canvas/CanvasStyle.h:
+        * svg/SVGColor.cpp:
+        (WebCore::SVGColor::colorFromRGBColorString):
+
+        * platform/graphics/Color.h: Add new constructors for the special
+        empty and deleted Color values used in HashTables.
+        (WebCore::Color::Color):
+        (WebCore::Color::isHashTableDeletedValue):
+        (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
+
+        * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
+        (WTF::ColorHash::hash):
+        (WTF::ColorHash::equal):
+        (WTF::HashTraits&lt;WebCore::Color&gt;::emptyValue):
+        (WTF::HashTraits&lt;WebCore::Color&gt;::constructDeletedValue):
+        (WTF::HashTraits&lt;WebCore::Color&gt;::isDeletedValue):
+
</ins><span class="cx"> 2016-10-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win][Direct2D] Implement basic SVG support
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -1297,6 +1297,7 @@
</span><span class="cx">                 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */; };
</span><span class="cx">                 2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFE9121C9F4200C27627 /* FileStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFF8121CB0CE00C27627 /* FileStreamClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                3103B7DF1DB01567008BB890 /* ColorHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 3103B7DE1DB01556008BB890 /* ColorHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 3106036F14327D2E00ABF4BA /* WebKitCSSFilterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3106036C14327D2E00ABF4BA /* WebKitCSSFilterValue.cpp */; };
</span><span class="cx">                 3106037014327D2E00ABF4BA /* WebKitCSSFilterValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 3106036D14327D2E00ABF4BA /* WebKitCSSFilterValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 310603741432819C00ABF4BA /* JSWebKitCSSFilterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 310603721432819C00ABF4BA /* JSWebKitCSSFilterValue.cpp */; };
</span><span class="lines">@@ -8259,6 +8260,7 @@
</span><span class="cx">                 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStream.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EF1BFE9121C9F4200C27627 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStream.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EF1BFF8121CB0CE00C27627 /* FileStreamClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStreamClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                3103B7DE1DB01556008BB890 /* ColorHash.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorHash.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 3106036C14327D2E00ABF4BA /* WebKitCSSFilterValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSFilterValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3106036D14327D2E00ABF4BA /* WebKitCSSFilterValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSFilterValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3106036E14327D2E00ABF4BA /* WebKitCSSFilterValue.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitCSSFilterValue.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20728,6 +20730,7 @@
</span><span class="cx">                                 CDDE02E918B3DFC700CF7FF1 /* CDMSession.h */,
</span><span class="cx">                                 B27535380B053814002CE64F /* Color.cpp */,
</span><span class="cx">                                 B27535390B053814002CE64F /* Color.h */,
</span><ins>+                                3103B7DE1DB01556008BB890 /* ColorHash.h */,
</ins><span class="cx">                                 31DCDF411DA1C45400EA5B93 /* ExtendedColor.cpp */,
</span><span class="cx">                                 31DCDF421DA1C45400EA5B93 /* ExtendedColor.h */,
</span><span class="cx">                                 9382DF5710A8D5C900925652 /* ColorSpace.h */,
</span><span class="lines">@@ -25379,6 +25382,7 @@
</span><span class="cx">                                 BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
</span><span class="cx">                                 FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
</span><span class="cx">                                 CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
</span><ins>+                                3103B7DF1DB01567008BB890 /* ColorHash.h in Headers */,
</ins><span class="cx">                                 9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */,
</span><span class="cx">                                 CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
</span><span class="cx">                                 CD9DE17D17AAC75B00EA386D /* JSSourceBufferList.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -350,11 +350,11 @@
</span><span class="cx">         m_value.string-&gt;ref();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CSSPrimitiveValue::CSSPrimitiveValue(RGBA32 color)
</del><ins>+CSSPrimitiveValue::CSSPrimitiveValue(const Color&amp; color)
</ins><span class="cx">     : CSSValue(PrimitiveClass)
</span><span class="cx"> {
</span><span class="cx">     m_primitiveUnitType = CSS_RGBCOLOR;
</span><del>-    m_value.rgbcolor = color;
</del><ins>+    m_value.color = new Color(color);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CSSPrimitiveValue::CSSPrimitiveValue(const Length&amp; length)
</span><span class="lines">@@ -574,6 +574,11 @@
</span><span class="cx">         delete m_value.fontFamily;
</span><span class="cx">         m_value.fontFamily = nullptr;
</span><span class="cx">         break;
</span><ins>+    case CSS_RGBCOLOR:
+        ASSERT(m_value.color);
+        delete m_value.color;
+        m_value.color = nullptr;
+        break;
</ins><span class="cx">     case CSS_NUMBER:
</span><span class="cx">     case CSS_PARSER_INTEGER:
</span><span class="cx">     case CSS_PERCENTAGE:
</span><span class="lines">@@ -605,7 +610,6 @@
</span><span class="cx">     case CSS_DPCM:
</span><span class="cx">     case CSS_FR:
</span><span class="cx">     case CSS_IDENT:
</span><del>-    case CSS_RGBCOLOR:
</del><span class="cx">     case CSS_UNKNOWN:
</span><span class="cx">     case CSS_UNICODE_RANGE:
</span><span class="cx">     case CSS_PARSER_OPERATOR:
</span><span class="lines">@@ -1028,7 +1032,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIMXE: This should not return a new object for each invocation.
</span><del>-    return RGBColor::create(m_value.rgbcolor);
</del><ins>+    return RGBColor::create(m_value.color-&gt;rgb());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Pair* CSSPrimitiveValue::getPairValue(ExceptionCode&amp; ec) const
</span><span class="lines">@@ -1175,13 +1179,13 @@
</span><span class="cx">     case CSS_LENGTH_REPEAT:
</span><span class="cx">         return getLengthRepeatValue()-&gt;cssText();
</span><span class="cx"> #endif
</span><del>-    case CSS_RGBCOLOR:
</del><span class="cx">     case CSS_PARSER_HEXCOLOR: {
</span><del>-        RGBA32 rgbColor = m_value.rgbcolor;
-        if (m_primitiveUnitType == CSS_PARSER_HEXCOLOR)
-            Color::parseHexColor((String)m_value.string, rgbColor);
-        return Color(rgbColor).cssText();
</del><ins>+        RGBA32 rgb;
+        Color::parseHexColor((String)m_value.string, rgb);
+        return Color(rgb).cssText();
</ins><span class="cx">     }
</span><ins>+    case CSS_RGBCOLOR:
+        return color().cssText();
</ins><span class="cx">     case CSS_PAIR:
</span><span class="cx">         return getPairValue()-&gt;cssText();
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="lines">@@ -1351,7 +1355,7 @@
</span><span class="cx">         result = CSSPrimitiveValue::createIdentifier(m_value.valueID);
</span><span class="cx">         break;
</span><span class="cx">     case CSS_RGBCOLOR:
</span><del>-        result = CSSPrimitiveValue::createColor(m_value.rgbcolor);
</del><ins>+        result = CSSPrimitiveValue::create(*m_value.color);
</ins><span class="cx">         break;
</span><span class="cx">     case CSS_DIMENSION:
</span><span class="cx">     case CSS_UNKNOWN:
</span><span class="lines">@@ -1430,7 +1434,7 @@
</span><span class="cx">         return m_value.lengthRepeat &amp;&amp; other.m_value.lengthRepeat &amp;&amp; m_value.lengthRepeat-&gt;equals(*other.m_value.lengthRepeat);
</span><span class="cx"> #endif
</span><span class="cx">     case CSS_RGBCOLOR:
</span><del>-        return m_value.rgbcolor == other.m_value.rgbcolor;
</del><ins>+        return color() == other.color();
</ins><span class="cx">     case CSS_PAIR:
</span><span class="cx">         return m_value.pair &amp;&amp; other.m_value.pair &amp;&amp; m_value.pair-&gt;equals(*other.m_value.pair);
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.h        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -253,7 +253,6 @@
</span><span class="cx">     static Ref&lt;CSSPrimitiveValue&gt; createIdentifier(CSSPropertyID propertyID) { return adoptRef(*new CSSPrimitiveValue(propertyID)); }
</span><span class="cx">     static Ref&lt;CSSPrimitiveValue&gt; createParserOperator(int parserOperator) { return adoptRef(*new CSSPrimitiveValue(parserOperator)); }
</span><span class="cx"> 
</span><del>-    static Ref&lt;CSSPrimitiveValue&gt; createColor(unsigned rgbValue) { return adoptRef(*new CSSPrimitiveValue(rgbValue)); }
</del><span class="cx">     static Ref&lt;CSSPrimitiveValue&gt; create(double value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
</span><span class="cx">     static Ref&lt;CSSPrimitiveValue&gt; create(const String&amp; value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
</span><span class="cx">     static Ref&lt;CSSPrimitiveValue&gt; create(const Length&amp; value, const RenderStyle&amp; style) { return adoptRef(*new CSSPrimitiveValue(value, style)); }
</span><span class="lines">@@ -342,21 +341,21 @@
</span><span class="cx">     WEBCORE_EXPORT String getStringValue() const;
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT Counter* getCounterValue(ExceptionCode&amp;) const;
</span><del>-    Counter* getCounterValue() const { return m_primitiveUnitType != CSS_COUNTER ? 0 : m_value.counter; }
</del><ins>+    Counter* getCounterValue() const { return m_primitiveUnitType != CSS_COUNTER ? nullptr : m_value.counter; }
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT Rect* getRectValue(ExceptionCode&amp;) const;
</span><del>-    Rect* getRectValue() const { return m_primitiveUnitType != CSS_RECT ? 0 : m_value.rect; }
</del><ins>+    Rect* getRectValue() const { return m_primitiveUnitType != CSS_RECT ? nullptr : m_value.rect; }
</ins><span class="cx"> 
</span><span class="cx">     Quad* getQuadValue(ExceptionCode&amp;) const;
</span><del>-    Quad* getQuadValue() const { return m_primitiveUnitType != CSS_QUAD ? 0 : m_value.quad; }
</del><ins>+    Quad* getQuadValue() const { return m_primitiveUnitType != CSS_QUAD ? nullptr : m_value.quad; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">     LengthRepeat* getLengthRepeatValue(ExceptionCode&amp;) const;
</span><del>-    LengthRepeat* getLengthRepeatValue() const { return m_primitiveUnitType != CSS_LENGTH_REPEAT ? 0 : m_value.lengthRepeat; }
</del><ins>+    LengthRepeat* getLengthRepeatValue() const { return m_primitiveUnitType != CSS_LENGTH_REPEAT ? nullptr : m_value.lengthRepeat; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT RefPtr&lt;RGBColor&gt; getRGBColorValue(ExceptionCode&amp;) const;
</span><del>-    RGBA32 getRGBA32Value() const { return m_primitiveUnitType != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; }
</del><ins>+    const Color&amp; color() const { ASSERT(m_primitiveUnitType == CSS_RGBCOLOR); return *m_value.color; }
</ins><span class="cx"> 
</span><span class="cx">     Pair* getPairValue(ExceptionCode&amp;) const;
</span><span class="cx">     Pair* getPairValue() const { return m_primitiveUnitType != CSS_PAIR ? nullptr : m_value.pair; }
</span><span class="lines">@@ -404,7 +403,7 @@
</span><span class="cx">     CSSPrimitiveValue(CSSPropertyID);
</span><span class="cx">     // FIXME: int vs. unsigned overloading is too subtle to distinguish the color and operator cases.
</span><span class="cx">     CSSPrimitiveValue(int parserOperator);
</span><del>-    CSSPrimitiveValue(unsigned color); // RGB value
</del><ins>+    CSSPrimitiveValue(const Color&amp;);
</ins><span class="cx">     CSSPrimitiveValue(const Length&amp;);
</span><span class="cx">     CSSPrimitiveValue(const Length&amp;, const RenderStyle&amp;);
</span><span class="cx">     CSSPrimitiveValue(const LengthSize&amp;, const RenderStyle&amp;);
</span><span class="lines">@@ -464,7 +463,7 @@
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">         LengthRepeat* lengthRepeat;
</span><span class="cx"> #endif
</span><del>-        unsigned rgbcolor;
</del><ins>+        const Color* color;
</ins><span class="cx">         Pair* pair;
</span><span class="cx">         DashboardRegion* region;
</span><span class="cx">         CSSBasicShape* shape;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -4939,6 +4939,13 @@
</span><span class="cx">     return WM_LRTB;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;&gt; inline CSSPrimitiveValue::CSSPrimitiveValue(const Color&amp; color)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_RGBCOLOR;
+    m_value.color = new Color(color);
+}
+
</ins><span class="cx"> template&lt;&gt; inline CSSPrimitiveValue::CSSPrimitiveValue(CSSFontFamily fontFamily)
</span><span class="cx">     : CSSValue(PrimitiveClass)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuePoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValuePool.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValuePool.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/CSSValuePool.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -48,9 +48,9 @@
</span><span class="cx">     m_unsetValue.construct();
</span><span class="cx">     m_revertValue.construct();
</span><span class="cx"> 
</span><del>-    m_transparentColor.construct(Color::transparent);
-    m_whiteColor.construct(Color::white);
-    m_blackColor.construct(Color::black);
</del><ins>+    m_transparentColor.construct(Color(Color::transparent));
+    m_whiteColor.construct(Color(Color::white));
+    m_blackColor.construct(Color(Color::black));
</ins><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; numCSSValueKeywords; ++i)
</span><span class="cx">         m_identifierValues[i].construct(static_cast&lt;CSSValueID&gt;(i));
</span><span class="lines">@@ -73,15 +73,15 @@
</span><span class="cx">     return CSSPrimitiveValue::createIdentifier(ident);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;CSSPrimitiveValue&gt; CSSValuePool::createColorValue(unsigned rgbValue)
</del><ins>+Ref&lt;CSSPrimitiveValue&gt; CSSValuePool::createColorValue(const Color&amp; color)
</ins><span class="cx"> {
</span><span class="cx">     // These are the empty and deleted values of the hash table.
</span><del>-    if (rgbValue == Color::transparent)
</del><ins>+    if (color == Color::transparent)
</ins><span class="cx">         return m_transparentColor.get();
</span><del>-    if (rgbValue == Color::white)
</del><ins>+    if (color == Color::white)
</ins><span class="cx">         return m_whiteColor.get();
</span><span class="cx">     // Just because it is common.
</span><del>-    if (rgbValue == Color::black)
</del><ins>+    if (color == Color::black)
</ins><span class="cx">         return m_blackColor.get();
</span><span class="cx"> 
</span><span class="cx">     // Remove one entry at random if the cache grows too large.
</span><span class="lines">@@ -89,9 +89,9 @@
</span><span class="cx">     if (m_colorValueCache.size() &gt;= maximumColorCacheSize)
</span><span class="cx">         m_colorValueCache.remove(m_colorValueCache.begin());
</span><span class="cx"> 
</span><del>-    ColorValueCache::AddResult entry = m_colorValueCache.add(rgbValue, nullptr);
</del><ins>+    ColorValueCache::AddResult entry = m_colorValueCache.add(color, nullptr);
</ins><span class="cx">     if (entry.isNewEntry)
</span><del>-        entry.iterator-&gt;value = CSSPrimitiveValue::createColor(rgbValue);
</del><ins>+        entry.iterator-&gt;value = CSSPrimitiveValue::create(color);
</ins><span class="cx">     return *entry.iterator-&gt;value;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuePoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValuePool.h (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValuePool.h        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/CSSValuePool.h        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;CSSRevertValue.h&quot;
</span><span class="cx"> #include &quot;CSSUnsetValue.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><ins>+#include &quot;ColorHash.h&quot;
</ins><span class="cx"> #include &lt;utility&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="lines">@@ -60,7 +61,7 @@
</span><span class="cx">     Ref&lt;CSSRevertValue&gt; createRevertValue() { return m_revertValue.get(); }
</span><span class="cx">     Ref&lt;CSSPrimitiveValue&gt; createIdentifierValue(CSSValueID identifier);
</span><span class="cx">     Ref&lt;CSSPrimitiveValue&gt; createIdentifierValue(CSSPropertyID identifier);
</span><del>-    Ref&lt;CSSPrimitiveValue&gt; createColorValue(unsigned rgbValue);
</del><ins>+    Ref&lt;CSSPrimitiveValue&gt; createColorValue(const Color&amp;);
</ins><span class="cx">     Ref&lt;CSSPrimitiveValue&gt; createValue(double value, CSSPrimitiveValue::UnitTypes);
</span><span class="cx">     Ref&lt;CSSPrimitiveValue&gt; createValue(const String&amp; value, CSSPrimitiveValue::UnitTypes type) { return CSSPrimitiveValue::create(value, type); }
</span><span class="cx">     Ref&lt;CSSPrimitiveValue&gt; createValue(const Length&amp; value, const RenderStyle&amp; style) { return CSSPrimitiveValue::create(value, style); }
</span><span class="lines">@@ -72,7 +73,7 @@
</span><span class="cx"> private:
</span><span class="cx">     CSSValuePool();
</span><span class="cx"> 
</span><del>-    typedef HashMap&lt;unsigned, RefPtr&lt;CSSPrimitiveValue&gt;&gt; ColorValueCache;
</del><ins>+    typedef HashMap&lt;Color, RefPtr&lt;CSSPrimitiveValue&gt;&gt; ColorValueCache;
</ins><span class="cx">     ColorValueCache m_colorValueCache;
</span><span class="cx"> 
</span><span class="cx">     typedef HashMap&lt;AtomicString, RefPtr&lt;CSSValueList&gt;&gt; FontFaceValueCache;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -1831,7 +1831,7 @@
</span><span class="cx"> Color StyleResolver::colorFromPrimitiveValue(const CSSPrimitiveValue&amp; value, bool forVisitedLink) const
</span><span class="cx"> {
</span><span class="cx">     if (value.isRGBColor())
</span><del>-        return Color(value.getRGBA32Value());
</del><ins>+        return value.color();
</ins><span class="cx"> 
</span><span class="cx">     const State&amp; state = m_state;
</span><span class="cx">     CSSValueID ident = value.getValueID();
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -494,8 +494,8 @@
</span><span class="cx">         auto value = CSSValuePool::singleton().createIdentifierValue(valueID);
</span><span class="cx">         return declaration.addParsedProperty(CSSProperty(propertyId, WTFMove(value), important)) ? CSSParser::ParseResult::Changed : CSSParser::ParseResult::Unchanged;
</span><span class="cx">     }
</span><del>-    RGBA32 color;
-    if (!CSSParser::fastParseColor(color, string, strict &amp;&amp; string[0] != '#'))
</del><ins>+    Color color = CSSParser::fastParseColor(string, strict &amp;&amp; string[0] != '#');
+    if (!color.isValid())
</ins><span class="cx">         return CSSParser::ParseResult::Error;
</span><span class="cx"> 
</span><span class="cx">     auto value = CSSValuePool::singleton().createColorValue(color);
</span><span class="lines">@@ -1370,36 +1370,34 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// The color will only be changed when string contains a valid CSS color, so callers
-// can set it to a default color and ignore the boolean result.
-bool CSSParser::parseColor(RGBA32&amp; color, const String&amp; string, bool strict)
</del><ins>+Color CSSParser::parseColor(const String&amp; string, bool strict)
</ins><span class="cx"> {
</span><span class="cx">     if (string.isEmpty())
</span><del>-        return false;
</del><ins>+        return Color();
</ins><span class="cx"> 
</span><span class="cx">     // First try creating a color specified by name, rgba(), rgb() or &quot;#&quot; syntax.
</span><del>-    if (fastParseColor(color, string, strict))
-        return true;
</del><ins>+    Color color = fastParseColor(string, strict);
+    if (color.isValid())
+        return color;
</ins><span class="cx"> 
</span><span class="cx">     CSSParser parser(HTMLStandardMode);
</span><span class="cx"> 
</span><span class="cx">     // In case the fast-path parser didn't understand the color, try the full parser.
</span><del>-    if (!parser.parseColor(string))
-        return false;
</del><ins>+    if (!parser.parseColorFromString(string))
+        return Color();
</ins><span class="cx"> 
</span><span class="cx">     CSSValue&amp; value = *parser.m_parsedProperties.first().value();
</span><span class="cx">     if (!is&lt;CSSPrimitiveValue&gt;(value))
</span><del>-        return false;
</del><ins>+        return Color();
</ins><span class="cx"> 
</span><span class="cx">     CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
</span><span class="cx">     if (!primitiveValue.isRGBColor())
</span><del>-        return false;
</del><ins>+        return Color();
</ins><span class="cx"> 
</span><del>-    color = primitiveValue.getRGBA32Value();
-    return true;
</del><ins>+    return primitiveValue.color();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CSSParser::parseColor(const String&amp; string)
</del><ins>+bool CSSParser::parseColorFromString(const String&amp; string)
</ins><span class="cx"> {
</span><span class="cx">     setupParser(&quot;@-webkit-decls{color:&quot;, string, &quot;} &quot;);
</span><span class="cx">     cssyyparse(this);
</span><span class="lines">@@ -1408,23 +1406,18 @@
</span><span class="cx">     return !m_parsedProperties.isEmpty() &amp;&amp; m_parsedProperties.first().id() == CSSPropertyColor;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CSSParser::parseSystemColor(RGBA32&amp; color, const String&amp; string, Document* document)
</del><ins>+Color CSSParser::parseSystemColor(const String&amp; string, Document* document)
</ins><span class="cx"> {
</span><span class="cx">     if (!document || !document-&gt;page())
</span><del>-        return false;
</del><ins>+        return Color();
</ins><span class="cx"> 
</span><span class="cx">     CSSParserString cssColor;
</span><span class="cx">     cssColor.init(string);
</span><span class="cx">     CSSValueID id = cssValueKeywordID(cssColor);
</span><span class="cx">     if (!validPrimitiveValueColor(id))
</span><del>-        return false;
</del><ins>+        return Color();
</ins><span class="cx"> 
</span><del>-    Color parsedColor = document-&gt;page()-&gt;theme().systemColor(id);
-    if (!parsedColor.isValid())
-        return false;
-
-    color = parsedColor.rgb();
-    return true;
</del><ins>+    return document-&gt;page()-&gt;theme().systemColor(id);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSParser::parseSelector(const String&amp; string, CSSSelectorList&amp; selectorList)
</span><span class="lines">@@ -7481,17 +7474,18 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename CharacterType&gt;
</span><del>-static inline bool fastParseColorInternal(RGBA32&amp; rgb, const CharacterType* characters, unsigned length , bool strict)
</del><ins>+static inline Color fastParseColorInternal(const CharacterType* characters, unsigned length , bool strict)
</ins><span class="cx"> {
</span><span class="cx">     CSSPrimitiveValue::UnitTypes expect = CSSPrimitiveValue::CSS_UNKNOWN;
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (!strict &amp;&amp; length &gt;= 3) {
</span><ins>+        RGBA32 rgb;
</ins><span class="cx">         if (characters[0] == '#') {
</span><span class="cx">             if (Color::parseHexColor(characters + 1, length - 1, rgb))
</span><del>-                return true;
</del><ins>+                return Color(rgb);
</ins><span class="cx">         } else {
</span><span class="cx">             if (Color::parseHexColor(characters, length, rgb))
</span><del>-                return true;
</del><ins>+                return Color(rgb);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -7505,17 +7499,16 @@
</span><span class="cx">         int alpha;
</span><span class="cx">         
</span><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, red))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, green))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, blue))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseAlphaValue(current, end, ')', alpha))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (current != end)
</span><del>-            return false;
-        rgb = makeRGBA(red, green, blue, alpha);
-        return true;
</del><ins>+            return Color();
+        return Color(makeRGBA(red, green, blue, alpha));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Try rgb() syntax.
</span><span class="lines">@@ -7526,45 +7519,39 @@
</span><span class="cx">         int green;
</span><span class="cx">         int blue;
</span><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, red))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, green))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ')', expect, blue))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (current != end)
</span><del>-            return false;
-        rgb = makeRGB(red, green, blue);
-        return true;
</del><ins>+            return Color();
+        return Color(makeRGB(red, green, blue));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return false;
</del><ins>+    return Color();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename StringType&gt;
</span><del>-bool CSSParser::fastParseColor(RGBA32&amp; rgb, const StringType&amp; name, bool strict)
</del><ins>+Color CSSParser::fastParseColor(const StringType&amp; name, bool strict)
</ins><span class="cx"> {
</span><span class="cx">     unsigned length = name.length();
</span><del>-    bool parseResult;
</del><span class="cx"> 
</span><span class="cx">     if (!length)
</span><del>-        return false;
</del><ins>+        return Color();
</ins><span class="cx"> 
</span><ins>+    Color color;
</ins><span class="cx">     if (name.is8Bit())
</span><del>-        parseResult = fastParseColorInternal(rgb, name.characters8(), length, strict);
</del><ins>+        color = fastParseColorInternal(name.characters8(), length, strict);
</ins><span class="cx">     else
</span><del>-        parseResult = fastParseColorInternal(rgb, name.characters16(), length, strict);
</del><ins>+        color = fastParseColorInternal(name.characters16(), length, strict);
</ins><span class="cx"> 
</span><del>-    if (parseResult)
-        return true;
</del><ins>+    if (color.isValid())
+        return color;
</ins><span class="cx"> 
</span><span class="cx">     // Try named colors.
</span><del>-    Color tc;
-    tc.setNamedColor(name);
-    if (tc.isValid()) {
-        rgb = tc.rgb();
-        return true;
-    }
-    return false;
</del><ins>+    color.setNamedColor(name);
+    return color;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> inline double CSSParser::parsedDouble(ValueWithCalculation&amp; valueWithCalculation)
</span><span class="lines">@@ -7680,25 +7667,23 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSPrimitiveValue&gt; CSSParser::parseColor(CSSParserValue* value)
</span><span class="cx"> {
</span><del>-    RGBA32 c = Color::transparent;
-    if (!parseColorFromValue(value ? *value : *m_valueList-&gt;current(), c))
</del><ins>+    Color color = parseColorFromValue(value ? *value : *m_valueList-&gt;current());
+    if (!color.isValid())
</ins><span class="cx">         return nullptr;
</span><del>-    return CSSValuePool::singleton().createColorValue(c);
</del><ins>+    return CSSValuePool::singleton().createColorValue(color);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CSSParser::parseColorFromValue(CSSParserValue&amp; value, RGBA32&amp; c)
</del><ins>+Color CSSParser::parseColorFromValue(CSSParserValue&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     if (inQuirksMode() &amp;&amp; value.unit == CSSPrimitiveValue::CSS_NUMBER
</span><span class="cx">         &amp;&amp; value.fValue &gt;= 0. &amp;&amp; value.fValue &lt; 1000000.) {
</span><span class="cx">         String str = String::format(&quot;%06d&quot;, static_cast&lt;int&gt;((value.fValue+.5)));
</span><span class="cx">         // FIXME: This should be strict parsing for SVG as well.
</span><del>-        if (!fastParseColor(c, str, inStrictMode()))
-            return false;
</del><ins>+        return fastParseColor(str, inStrictMode());
</ins><span class="cx">     } else if (value.unit == CSSPrimitiveValue::CSS_PARSER_HEXCOLOR
</span><span class="cx">         || value.unit == CSSPrimitiveValue::CSS_IDENT
</span><span class="cx">         || (inQuirksMode() &amp;&amp; value.unit == CSSPrimitiveValue::CSS_DIMENSION)) {
</span><del>-        if (!fastParseColor(c, value.string, inStrictMode() &amp;&amp; value.unit == CSSPrimitiveValue::CSS_IDENT))
-            return false;
</del><ins>+        return fastParseColor(value.string, inStrictMode() &amp;&amp; value.unit == CSSPrimitiveValue::CSS_IDENT);
</ins><span class="cx">     } else if (value.unit == CSSParserValue::Function
</span><span class="cx">         &amp;&amp; value.function-&gt;args
</span><span class="cx">         &amp;&amp; value.function-&gt;args-&gt;size() == 5 /* rgb + two commas */
</span><span class="lines">@@ -7705,8 +7690,8 @@
</span><span class="cx">         &amp;&amp; equalLettersIgnoringASCIICase(value.function-&gt;name, &quot;rgb(&quot;)) {
</span><span class="cx">         int colorValues[3];
</span><span class="cx">         if (!parseRGBParameters(value, colorValues, false))
</span><del>-            return false;
-        c = makeRGB(colorValues[0], colorValues[1], colorValues[2]);
</del><ins>+            return Color();
+        return Color(makeRGB(colorValues[0], colorValues[1], colorValues[2]));
</ins><span class="cx">     } else if (value.unit == CSSParserValue::Function
</span><span class="cx">         &amp;&amp; value.function-&gt;args
</span><span class="cx">         &amp;&amp; value.function-&gt;args-&gt;size() == 7 /* rgba + three commas */
</span><span class="lines">@@ -7713,8 +7698,8 @@
</span><span class="cx">         &amp;&amp; equalLettersIgnoringASCIICase(value.function-&gt;name, &quot;rgba(&quot;)) {
</span><span class="cx">         int colorValues[4];
</span><span class="cx">         if (!parseRGBParameters(value, colorValues, true))
</span><del>-            return false;
-        c = makeRGBA(colorValues[0], colorValues[1], colorValues[2], colorValues[3]);
</del><ins>+            return Color();
+        return Color(makeRGBA(colorValues[0], colorValues[1], colorValues[2], colorValues[3]));
</ins><span class="cx">     } else if (value.unit == CSSParserValue::Function
</span><span class="cx">         &amp;&amp; value.function-&gt;args
</span><span class="cx">         &amp;&amp; value.function-&gt;args-&gt;size() == 5 /* hsl + two commas */
</span><span class="lines">@@ -7721,8 +7706,8 @@
</span><span class="cx">         &amp;&amp; equalLettersIgnoringASCIICase(value.function-&gt;name, &quot;hsl(&quot;)) {
</span><span class="cx">         double colorValues[3];
</span><span class="cx">         if (!parseHSLParameters(value, colorValues, false))
</span><del>-            return false;
-        c = makeRGBAFromHSLA(colorValues[0], colorValues[1], colorValues[2], 1.0);
</del><ins>+            return Color();
+        return Color(makeRGBAFromHSLA(colorValues[0], colorValues[1], colorValues[2], 1.0));
</ins><span class="cx">     } else if (value.unit == CSSParserValue::Function
</span><span class="cx">         &amp;&amp; value.function-&gt;args
</span><span class="cx">         &amp;&amp; value.function-&gt;args-&gt;size() == 7 /* hsla + three commas */
</span><span class="lines">@@ -7729,12 +7714,11 @@
</span><span class="cx">         &amp;&amp; equalLettersIgnoringASCIICase(value.function-&gt;name, &quot;hsla(&quot;)) {
</span><span class="cx">         double colorValues[4];
</span><span class="cx">         if (!parseHSLParameters(value, colorValues, true))
</span><del>-            return false;
-        c = makeRGBAFromHSLA(colorValues[0], colorValues[1], colorValues[2], colorValues[3]);
-    } else
-        return false;
</del><ins>+            return Color();
+        return Color(makeRGBAFromHSLA(colorValues[0], colorValues[1], colorValues[2], colorValues[3]));
+    }
</ins><span class="cx"> 
</span><del>-    return true;
</del><ins>+    return Color();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This class tracks parsing state for shadow values.  If it goes out of scope (e.g., due to an early return)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.h (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.h        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/parser/CSSParser.h        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -134,9 +134,9 @@
</span><span class="cx">     static ParseResult parseValue(MutableStyleProperties&amp;, CSSPropertyID, const String&amp;, bool important, const CSSParserContext&amp;, StyleSheetContents*);
</span><span class="cx">     static ParseResult parseCustomPropertyValue(MutableStyleProperties&amp;, const AtomicString&amp; propertyName, const String&amp;, bool important, const CSSParserContext&amp;, StyleSheetContents* contextStyleSheet);
</span><span class="cx"> 
</span><del>-    static bool parseColor(RGBA32&amp; color, const String&amp;, bool strict = false);
</del><ins>+    static Color parseColor(const String&amp;, bool strict = false);
</ins><span class="cx">     static bool isValidSystemColorValue(CSSValueID);
</span><del>-    static bool parseSystemColor(RGBA32&amp; color, const String&amp;, Document*);
</del><ins>+    static Color parseSystemColor(const String&amp;, Document*);
</ins><span class="cx">     static RefPtr&lt;CSSValueList&gt; parseFontFaceValue(const AtomicString&amp;);
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; parseValidPrimitive(CSSValueID ident, ValueWithCalculation&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -278,11 +278,11 @@
</span><span class="cx">     bool parseRGBParameters(CSSParserValue&amp;, int* colorValues, bool parseAlpha);
</span><span class="cx">     bool parseHSLParameters(CSSParserValue&amp;, double* colorValues, bool parseAlpha);
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; parseColor(CSSParserValue* = nullptr);
</span><del>-    bool parseColorFromValue(CSSParserValue&amp;, RGBA32&amp;);
</del><ins>+    Color parseColorFromValue(CSSParserValue&amp;);
</ins><span class="cx">     void parseSelector(const String&amp;, CSSSelectorList&amp;);
</span><span class="cx"> 
</span><span class="cx">     template&lt;typename StringType&gt;
</span><del>-    static bool fastParseColor(RGBA32&amp;, const StringType&amp;, bool strict);
</del><ins>+    static Color fastParseColor(const StringType&amp;, bool strict);
</ins><span class="cx"> 
</span><span class="cx">     bool parseLineHeight(bool important);
</span><span class="cx">     bool parseFontSize(bool important);
</span><span class="lines">@@ -618,7 +618,7 @@
</span><span class="cx">     bool parseFontFaceSrcURI(CSSValueList&amp;);
</span><span class="cx">     bool parseFontFaceSrcLocal(CSSValueList&amp;);
</span><span class="cx"> 
</span><del>-    bool parseColor(const String&amp;);
</del><ins>+    bool parseColorFromString(const String&amp;);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">     bool parseIntegerOrCustomIdentFromGridPosition(RefPtr&lt;CSSPrimitiveValue&gt;&amp; numericValue, RefPtr&lt;CSSPrimitiveValue&gt;&amp; gridLineName);
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserFastPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -411,16 +411,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename CharacterType&gt;
</span><del>-static bool fastParseColorInternal(RGBA32&amp; rgb, const CharacterType* characters, unsigned length, bool quirksMode)
</del><ins>+static Color fastParseColorInternal(const CharacterType* characters, unsigned length, bool quirksMode)
</ins><span class="cx"> {
</span><span class="cx">     CSSPrimitiveValue::UnitTypes expect = CSSPrimitiveValue::UnitTypes::CSS_UNKNOWN;
</span><span class="cx"> 
</span><del>-    if (length &gt;= 4 &amp;&amp; characters[0] == '#')
-        return Color::parseHexColor(characters + 1, length - 1, rgb);
</del><ins>+    if (length &gt;= 4 &amp;&amp; characters[0] == '#') {
+        // FIXME: Why doesn't this check if the parse worked? Is the fallback black?
+        RGBA32 rgb;
+        Color::parseHexColor(characters + 1, length - 1, rgb);
+        return Color(rgb);
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (quirksMode &amp;&amp; (length == 3 || length == 6)) {
</span><ins>+        RGBA32 rgb;
</ins><span class="cx">         if (Color::parseHexColor(characters, length, rgb))
</span><del>-            return true;
</del><ins>+            return Color(rgb);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Try rgba() syntax.
</span><span class="lines">@@ -433,17 +438,16 @@
</span><span class="cx">         int alpha;
</span><span class="cx"> 
</span><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, red))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, green))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, blue))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseAlphaValue(current, end, ')', alpha))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (current != end)
</span><del>-            return false;
-        rgb = makeRGBA(red, green, blue, alpha);
-        return true;
</del><ins>+            return Color();
+        return Color(makeRGBA(red, green, blue, alpha));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Try rgb() syntax.
</span><span class="lines">@@ -454,18 +458,17 @@
</span><span class="cx">         int green;
</span><span class="cx">         int blue;
</span><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, red))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ',', expect, green))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (!parseColorIntOrPercentage(current, end, ')', expect, blue))
</span><del>-            return false;
</del><ins>+            return Color();
</ins><span class="cx">         if (current != end)
</span><del>-            return false;
-        rgb = makeRGB(red, green, blue);
-        return true;
</del><ins>+            return Color();
+        return Color(makeRGB(red, green, blue));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return false;
</del><ins>+    return Color();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParserFastPaths::parseColor(const String&amp; string, CSSParserMode parserMode)
</span><span class="lines">@@ -478,16 +481,15 @@
</span><span class="cx">         return CSSPrimitiveValue::createIdentifier(valueID);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RGBA32 color;
</del><span class="cx">     bool quirksMode = isQuirksModeBehavior(parserMode);
</span><span class="cx"> 
</span><span class="cx">     // Fast path for hex colors and rgb()/rgba() colors
</span><del>-    bool parseResult;
</del><ins>+    Color color;
</ins><span class="cx">     if (string.is8Bit())
</span><del>-        parseResult = fastParseColorInternal(color, string.characters8(), string.length(), quirksMode);
</del><ins>+        color = fastParseColorInternal(string.characters8(), string.length(), quirksMode);
</ins><span class="cx">     else
</span><del>-        parseResult = fastParseColorInternal(color, string.characters16(), string.length(), quirksMode);
-    if (!parseResult)
</del><ins>+        color = fastParseColorInternal(string.characters16(), string.length(), quirksMode);
+    if (!color.isValid())
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return CSSValuePool::singleton().createColorValue(color);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -509,7 +509,7 @@
</span><span class="cx">     RGBA32 color = Color::transparent;
</span><span class="cx">     if (!parseHexColor(range, color, acceptQuirkyColors) &amp;&amp; !parseColorFunction(range, color))
</span><span class="cx">         return nullptr;
</span><del>-    return CSSPrimitiveValue::createColor(color);
</del><ins>+    return CSSPrimitiveValue::create(Color(color));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;CSSPrimitiveValue&gt; consumePositionComponent(CSSParserTokenRange&amp; range, CSSParserMode cssParserMode, UnitlessQuirk unitless)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserSVGCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/SVGCSSParser.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/SVGCSSParser.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/css/parser/SVGCSSParser.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -131,10 +131,10 @@
</span><span class="cx">             else if (isValidSystemControlColorValue(id) || id == CSSValueMenu)
</span><span class="cx">                 parsedValue = SVGPaint::createColor(RenderTheme::defaultTheme()-&gt;systemColor(id));
</span><span class="cx">             else if (valueWithCalculation.value().unit == CSSPrimitiveValue::CSS_URI) {
</span><del>-                RGBA32 c = Color::transparent;
</del><span class="cx">                 if (m_valueList-&gt;next()) {
</span><del>-                    if (parseColorFromValue(*m_valueList-&gt;current(), c))
-                        parsedValue = SVGPaint::createURIAndColor(valueWithCalculation.value().string, c);
</del><ins>+                    Color color = parseColorFromValue(*m_valueList-&gt;current());
+                    if (color.isValid())
+                        parsedValue = SVGPaint::createURIAndColor(valueWithCalculation.value().string, color);
</ins><span class="cx">                     else if (m_valueList-&gt;current()-&gt;id == CSSValueNone)
</span><span class="cx">                         parsedValue = SVGPaint::createURIAndNone(valueWithCalculation.value().string);
</span><span class="cx">                 }
</span><span class="lines">@@ -286,18 +286,18 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;SVGPaint&gt; CSSParser::parseSVGPaint()
</span><span class="cx"> {
</span><del>-    RGBA32 c = Color::transparent;
-    if (!parseColorFromValue(*m_valueList-&gt;current(), c))
</del><ins>+    Color color = parseColorFromValue(*m_valueList-&gt;current());
+    if (!color.isValid())
</ins><span class="cx">         return nullptr;
</span><del>-    return SVGPaint::createColor(Color(c));
</del><ins>+    return SVGPaint::createColor(color);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;SVGColor&gt; CSSParser::parseSVGColor()
</span><span class="cx"> {
</span><del>-    RGBA32 c = Color::transparent;
-    if (!parseColorFromValue(*m_valueList-&gt;current(), c))
</del><ins>+    Color color = parseColorFromValue(*m_valueList-&gt;current());
+    if (!color.isValid())
</ins><span class="cx">         return nullptr;
</span><del>-    return SVGColor::createFromColor(Color(c));
</del><ins>+    return SVGColor::createFromColor(color);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValueList&gt; CSSParser::parsePaintOrder()
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -382,7 +382,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RGBA32 cssValueToRGBA(CSSValue* colorValue)
</del><ins>+static Color cssValueToColor(CSSValue* colorValue)
</ins><span class="cx"> {
</span><span class="cx">     if (!is&lt;CSSPrimitiveValue&gt;(colorValue))
</span><span class="cx">         return Color::transparent;
</span><span class="lines">@@ -389,28 +389,26 @@
</span><span class="cx">     
</span><span class="cx">     CSSPrimitiveValue&amp; primitiveColor = downcast&lt;CSSPrimitiveValue&gt;(*colorValue);
</span><span class="cx">     if (primitiveColor.isRGBColor())
</span><del>-        return primitiveColor.getRGBA32Value();
</del><ins>+        return primitiveColor.color();
</ins><span class="cx">     
</span><del>-    RGBA32 rgba = 0;
-    CSSParser::parseColor(rgba, colorValue-&gt;cssText());
-    return rgba;
</del><ins>+    return CSSParser::parseColor(colorValue-&gt;cssText());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-static inline RGBA32 textColorFromStyle(T&amp; style)
</del><ins>+static inline Color textColorFromStyle(T&amp; style)
</ins><span class="cx"> {
</span><del>-    return cssValueToRGBA(extractPropertyValue(style, CSSPropertyColor).get());
</del><ins>+    return cssValueToColor(extractPropertyValue(style, CSSPropertyColor).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-static inline RGBA32 backgroundColorFromStyle(T&amp; style)
</del><ins>+static inline Color backgroundColorFromStyle(T&amp; style)
</ins><span class="cx"> {
</span><del>-    return cssValueToRGBA(extractPropertyValue(style, CSSPropertyBackgroundColor).get());
</del><ins>+    return cssValueToColor(extractPropertyValue(style, CSSPropertyBackgroundColor).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline RGBA32 rgbaBackgroundColorInEffect(Node* node)
</del><ins>+static inline Color rgbaBackgroundColorInEffect(Node* node)
</ins><span class="cx"> {
</span><del>-    return cssValueToRGBA(backgroundColorInEffect(node).get());
</del><ins>+    return cssValueToColor(backgroundColorInEffect(node).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static int textAlignResolvingStartAndEnd(int textAlign, int direction)
</span><span class="lines">@@ -1096,7 +1094,7 @@
</span><span class="cx">         m_mutableStyle-&gt;removeProperty(CSSPropertyColor);
</span><span class="cx"> 
</span><span class="cx">     if (hasTransparentBackgroundColor(m_mutableStyle.get())
</span><del>-        || cssValueToRGBA(m_mutableStyle-&gt;getPropertyCSSValue(CSSPropertyBackgroundColor).get()) == rgbaBackgroundColorInEffect(position.containerNode()))
</del><ins>+        || cssValueToColor(m_mutableStyle-&gt;getPropertyCSSValue(CSSPropertyBackgroundColor).get()) == rgbaBackgroundColorInEffect(position.containerNode()))
</ins><span class="cx">         m_mutableStyle-&gt;removeProperty(CSSPropertyBackgroundColor);
</span><span class="cx"> 
</span><span class="cx">     if (is&lt;CSSPrimitiveValue&gt;(unicodeBidi.get())) {
</span><span class="lines">@@ -1840,7 +1838,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     CSSPrimitiveValue&amp; value = downcast&lt;CSSPrimitiveValue&gt;(*cssValue);
</span><span class="cx">     if (value.isRGBColor())
</span><del>-        return !alphaChannel(value.getRGBA32Value());
</del><ins>+        return value.color().alpha() == 0;
</ins><span class="cx">     return value.getValueID() == CSSValueTransparent;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -989,13 +989,13 @@
</span><span class="cx">     Element&amp; element = downcast&lt;Element&gt;(node);
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</span><span class="cx">         if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).isRGBColor())
</span><del>-            return normalizedColor(Color(downcast&lt;CSSPrimitiveValue&gt;(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</del><ins>+            return normalizedColor(Color(downcast&lt;CSSPrimitiveValue&gt;(*value).color().rgb()), propertyId == CSSPropertyColor);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool inherit = false;
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyId)) {
</span><span class="cx">         if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).isRGBColor())
</span><del>-            return normalizedColor(Color(downcast&lt;CSSPrimitiveValue&gt;(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</del><ins>+            return normalizedColor(Color(downcast&lt;CSSPrimitiveValue&gt;(*value).color().rgb()), propertyId == CSSPropertyColor);
</ins><span class="cx">         if (value-&gt;isInheritedValue())
</span><span class="cx">             inherit = true;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLBodyElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLBodyElement.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLBodyElement.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/html/HTMLBodyElement.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -158,8 +158,8 @@
</span><span class="cx">             else
</span><span class="cx">                 document().resetActiveLinkColor();
</span><span class="cx">         } else {
</span><del>-            RGBA32 color;
-            if (CSSParser::parseColor(color, value, !document().inQuirksMode())) {
</del><ins>+            Color color = CSSParser::parseColor(value, !document().inQuirksMode());
+            if (color.isValid()) {
</ins><span class="cx">                 if (name == linkAttr)
</span><span class="cx">                     document().setLinkColor(color);
</span><span class="cx">                 else if (name == vlinkAttr)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasGradientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasGradient.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasGradient.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/html/canvas/CanvasGradient.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasGradient::addColorStop(float value, const String&amp; color, ExceptionCode&amp; ec)
</del><ins>+void CanvasGradient::addColorStop(float value, const String&amp; colorString, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     if (!(value &gt;= 0 &amp;&amp; value &lt;= 1.0f)) {
</span><span class="cx">         ec = INDEX_SIZE_ERR;
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RGBA32 rgba = 0;
-    if (!parseColorOrCurrentColor(rgba, color, 0 /*canvas*/)) {
</del><ins>+    Color color = parseColorOrCurrentColor(colorString, 0 /*canvas*/);
+    if (!color.isValid()) {
</ins><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="cx">         if (!m_dashboardCompatibilityMode)
</span><span class="cx">             ec = SYNTAX_ERR;
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_gradient-&gt;addColorStop(value, Color(rgba));
</del><ins>+    m_gradient-&gt;addColorStop(value, color);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -404,9 +404,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (style.isCurrentColor()) {
</span><del>-        if (style.hasOverrideAlpha())
-            style = CanvasStyle(colorWithOverrideAlpha(currentColor(canvas()), style.overrideAlpha()));
-        else
</del><ins>+        if (style.hasOverrideAlpha()) {
+            // FIXME: Should not use RGBA32 here.
+            style = CanvasStyle(colorWithOverrideAlpha(currentColor(canvas()).rgb(), style.overrideAlpha()));
+        } else
</ins><span class="cx">             style = CanvasStyle(currentColor(canvas()));
</span><span class="cx">     } else
</span><span class="cx">         checkOrigin(style.canvasPattern());
</span><span class="lines">@@ -430,9 +431,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (style.isCurrentColor()) {
</span><del>-        if (style.hasOverrideAlpha())
-            style = CanvasStyle(colorWithOverrideAlpha(currentColor(canvas()), style.overrideAlpha()));
-        else
</del><ins>+        if (style.hasOverrideAlpha()) {
+            // FIXME: Should not use RGBA32 here.
+            style = CanvasStyle(colorWithOverrideAlpha(currentColor(canvas()).rgb(), style.overrideAlpha()));
+        } else
</ins><span class="cx">             style = CanvasStyle(currentColor(canvas()));
</span><span class="cx">     } else
</span><span class="cx">         checkOrigin(style.canvasPattern());
</span><span class="lines">@@ -578,15 +580,15 @@
</span><span class="cx">     return Color(state().shadowColor).serialized();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::setShadowColor(const String&amp; color)
</del><ins>+void CanvasRenderingContext2D::setShadowColor(const String&amp; colorString)
</ins><span class="cx"> {
</span><del>-    RGBA32 rgba;
-    if (!parseColorOrCurrentColor(rgba, color, canvas()))
</del><ins>+    Color color = parseColorOrCurrentColor(colorString, canvas());
+    if (!color.isValid())
</ins><span class="cx">         return;
</span><del>-    if (state().shadowColor == rgba)
</del><ins>+    if (state().shadowColor == color)
</ins><span class="cx">         return;
</span><span class="cx">     realizeSaves();
</span><del>-    modifiableState().shadowColor = rgba;
</del><ins>+    modifiableState().shadowColor = color;
</ins><span class="cx">     applyShadow();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1248,12 +1250,15 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::setShadow(float width, float height, float blur, const String&amp; color, Optional&lt;float&gt; alpha)
</del><ins>+void CanvasRenderingContext2D::setShadow(float width, float height, float blur, const String&amp; colorString, Optional&lt;float&gt; alpha)
</ins><span class="cx"> {
</span><del>-    RGBA32 rgba = Color::transparent;
-    if (!color.isNull() &amp;&amp; !parseColorOrCurrentColor(rgba, color, canvas()))
</del><ins>+    Color color = parseColorOrCurrentColor(colorString, canvas());
+    if (!colorString.isNull() &amp;&amp; !color.isValid())
</ins><span class="cx">         return;
</span><del>-    setShadow(FloatSize(width, height), blur, colorWithOverrideAlpha(rgba, alpha));
</del><ins>+    if (!color.isValid())
+        color = Color::transparent;
+    // FIXME: Should not use RGBA32 here.
+    setShadow(FloatSize(width, height), blur, colorWithOverrideAlpha(color.rgb(), alpha));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::setShadow(float width, float height, float blur, float grayLevel, float alpha)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasStyle.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasStyle.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/html/canvas/CanvasStyle.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -43,44 +43,36 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-enum ColorParseResult { ParsedRGBA, ParsedCurrentColor, ParsedSystemColor, ParseFailed };
</del><ins>+static bool isCurrentColorString(const String&amp; colorString)
+{
+    return equalLettersIgnoringASCIICase(colorString, &quot;currentcolor&quot;);
+}
</ins><span class="cx"> 
</span><del>-static ColorParseResult parseColor(RGBA32&amp; parsedColor, const String&amp; colorString, Document* document = nullptr)
</del><ins>+static Color parseColor(const String&amp; colorString, Document* document = nullptr)
</ins><span class="cx"> {
</span><del>-    if (equalLettersIgnoringASCIICase(colorString, &quot;currentcolor&quot;))
-        return ParsedCurrentColor;
-    if (CSSParser::parseColor(parsedColor, colorString))
-        return ParsedRGBA;
-    if (CSSParser::parseSystemColor(parsedColor, colorString, document))
-        return ParsedSystemColor;
-    return ParseFailed;
</del><ins>+    Color color = CSSParser::parseColor(colorString);
+    if (color.isValid())
+        return color;
+
+    return CSSParser::parseSystemColor(colorString, document);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RGBA32 currentColor(HTMLCanvasElement* canvas)
</del><ins>+Color currentColor(HTMLCanvasElement* canvas)
</ins><span class="cx"> {
</span><span class="cx">     if (!canvas || !canvas-&gt;inDocument() || !canvas-&gt;inlineStyle())
</span><span class="cx">         return Color::black;
</span><del>-    RGBA32 rgba = Color::black;
-    CSSParser::parseColor(rgba, canvas-&gt;inlineStyle()-&gt;getPropertyValue(CSSPropertyColor));
-    return rgba;
</del><ins>+    Color color = CSSParser::parseColor(canvas-&gt;inlineStyle()-&gt;getPropertyValue(CSSPropertyColor));
+    if (!color.isValid())
+        return Color::black;
+    return color;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool parseColorOrCurrentColor(RGBA32&amp; parsedColor, const String&amp; colorString, HTMLCanvasElement* canvas)
</del><ins>+Color parseColorOrCurrentColor(const String&amp; colorString, HTMLCanvasElement* canvas)
</ins><span class="cx"> {
</span><del>-    ColorParseResult parseResult = parseColor(parsedColor, colorString, canvas ? &amp;canvas-&gt;document() : 0);
-    switch (parseResult) {
-    case ParsedRGBA:
-    case ParsedSystemColor:
-        return true;
-    case ParsedCurrentColor:
-        parsedColor = currentColor(canvas);
-        return true;
-    case ParseFailed:
-        return false;
-    default:
-        ASSERT_NOT_REACHED();
-        return false;
-    }
</del><ins>+    if (isCurrentColorString(colorString))
+        return currentColor(canvas);
+
+    return parseColor(colorString, canvas ? &amp;canvas-&gt;document() : nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasStyle::CanvasStyle(Color color)
</span><span class="lines">@@ -133,39 +125,28 @@
</span><span class="cx">         delete m_cmyka;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasStyle CanvasStyle::createFromString(const String&amp; color, Document* document)
</del><ins>+CanvasStyle CanvasStyle::createFromString(const String&amp; colorString, Document* document)
</ins><span class="cx"> {
</span><del>-    RGBA32 rgba;
-    ColorParseResult parseResult = parseColor(rgba, color, document);
-    switch (parseResult) {
-    case ParsedRGBA:
-    case ParsedSystemColor:
-        return CanvasStyle(rgba);
-    case ParsedCurrentColor:
</del><ins>+    if (isCurrentColorString(colorString))
</ins><span class="cx">         return CanvasStyle(ConstructCurrentColor);
</span><del>-    case ParseFailed:
-        return CanvasStyle();
-    default:
-        ASSERT_NOT_REACHED();
-        return CanvasStyle();
-    }
</del><ins>+
+    Color color = parseColor(colorString, document);
+    if (color.isValid())
+        return CanvasStyle(color);
+
+    return CanvasStyle();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasStyle CanvasStyle::createFromStringWithOverrideAlpha(const String&amp; color, float alpha)
</del><ins>+CanvasStyle CanvasStyle::createFromStringWithOverrideAlpha(const String&amp; colorString, float alpha)
</ins><span class="cx"> {
</span><del>-    RGBA32 rgba;
-    ColorParseResult parseResult = parseColor(rgba, color);
-    switch (parseResult) {
-    case ParsedRGBA:
-        return CanvasStyle(colorWithOverrideAlpha(rgba, alpha));
-    case ParsedCurrentColor:
</del><ins>+    if (isCurrentColorString(colorString))
</ins><span class="cx">         return CanvasStyle(CurrentColorWithOverrideAlpha, alpha);
</span><del>-    case ParseFailed:
-        return CanvasStyle();
-    default:
-        ASSERT_NOT_REACHED();
-        return CanvasStyle();
-    }
</del><ins>+
+    Color color = parseColor(colorString);
+    if (color.isValid())
+        return CanvasStyle(colorWithOverrideAlpha(color.rgb(), alpha));
+
+    return CanvasStyle();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CanvasStyle::isEquivalentColor(const CanvasStyle&amp; other) const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasStyle.h (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasStyle.h        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/html/canvas/CanvasStyle.h        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -113,8 +113,8 @@
</span><span class="cx">         Type m_type;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    RGBA32 currentColor(HTMLCanvasElement*);
-    bool parseColorOrCurrentColor(RGBA32&amp; parsedColor, const String&amp; colorString, HTMLCanvasElement*);
</del><ins>+    Color currentColor(HTMLCanvasElement*);
+    Color parseColorOrCurrentColor(const String&amp; colorString, HTMLCanvasElement*);
</ins><span class="cx"> 
</span><span class="cx">     inline CanvasStyle::CanvasStyle()
</span><span class="cx">         : m_type(Invalid)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Color.h (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Color.h        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/platform/graphics/Color.h        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -141,6 +141,23 @@
</span><span class="cx">     WEBCORE_EXPORT explicit Color(const String&amp;);
</span><span class="cx">     explicit Color(const char*);
</span><span class="cx"> 
</span><ins>+    explicit Color(WTF::HashTableDeletedValueType)
+    {
+        m_colorData.rgbaAndFlags = 0xfffffffffffffffd;
+        ASSERT(!isExtended());
+    }
+
+    bool isHashTableDeletedValue() const
+    {
+        return m_colorData.rgbaAndFlags == 0xfffffffffffffffd;
+    }
+
+    explicit Color(WTF::HashTableEmptyValueType)
+    {
+        m_colorData.rgbaAndFlags = 0xffffffffffffffb;
+        ASSERT(!isExtended());
+    }
+
</ins><span class="cx">     // FIXME: Add constructor for ExtendedColor type.
</span><span class="cx"> 
</span><span class="cx">     Color(RGBA, ColorSpace);
</span><span class="lines">@@ -184,6 +201,7 @@
</span><span class="cx">     RGBA32 rgb() const { ASSERT(!isExtended()); return static_cast&lt;RGBA32&gt;(m_colorData.rgbaAndFlags &gt;&gt; 32); }
</span><span class="cx">     void setRGB(int r, int g, int b) { setRGB(makeRGB(r, g, b)); }
</span><span class="cx">     void setRGB(RGBA32);
</span><ins>+    uint64_t asUint64() const { return m_colorData.rgbaAndFlags; }
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void getRGBA(float&amp; r, float&amp; g, float&amp; b, float&amp; a) const;
</span><span class="cx">     WEBCORE_EXPORT void getRGBA(double&amp; r, double&amp; g, double&amp; b, double&amp; a) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorHashh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ColorHash.h (0 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorHash.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ColorHash.h        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;Color.h&quot;
+#include &lt;wtf/HashTraits.h&gt;
+
+namespace WTF {
+
+struct ColorHash {
+    static unsigned hash(const WebCore::Color&amp; key) { return intHash(key.asUint64()); }
+    static bool equal(const WebCore::Color&amp; a, const WebCore::Color&amp; b) { return a == b; }
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+template&lt;&gt; struct DefaultHash&lt;WebCore::Color&gt; {
+    typedef ColorHash Hash;
+};
+
+template&lt;&gt; struct HashTraits&lt;WebCore::Color&gt; : GenericHashTraits&lt;WebCore::Color&gt; {
+    static const bool emptyValueIsZero = false;
+    static WebCore::Color emptyValue() { return WebCore::Color(HashTableEmptyValue); }
+
+    static void constructDeletedValue(WebCore::Color&amp; slot) { new (NotNull, &amp;slot) WebCore::Color(HashTableDeletedValue); }
+    static bool isDeletedValue(const WebCore::Color&amp; value) { return value.isHashTableDeletedValue(); }
+};
+
+} // namespace WTF
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/graphics/ColorHash.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Author Id Revision HeadURL
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkSourceWebCoresvgSVGColorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGColor.cpp (207360 => 207361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGColor.cpp        2016-10-14 23:22:07 UTC (rev 207360)
+++ trunk/Source/WebCore/svg/SVGColor.cpp        2016-10-14 23:37:21 UTC (rev 207361)
</span><span class="lines">@@ -51,10 +51,7 @@
</span><span class="cx">     // FIXME: Rework CSS parser so it exactly matches what the SVG specification requires?
</span><span class="cx">     // FIXME: Move this out of the SVGColor class?
</span><span class="cx">     // FIXME: Is it really OK to do stripWhitespace here instead of stripLeadingAndTrailingHTMLSpaces?
</span><del>-    RGBA32 color;
-    if (CSSParser::parseColor(color, colorString.stripWhiteSpace()))
-        return color;
-    return Color();
</del><ins>+    return CSSParser::parseColor(colorString.stripWhiteSpace());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SVGColor::setRGBColor(const String&amp;, ExceptionCode&amp; ec)
</span></span></pre>
</div>
</div>

</body>
</html>