<!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>[192023] trunk</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/192023">192023</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2015-11-04 09:49:46 -0800 (Wed, 04 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Accept 8 and 4 value hex colors (#RRGGBBAA)
https://bugs.webkit.org/show_bug.cgi?id=150853
&lt;rdar://problem/23380930&gt;

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Delete these tests. The have been updated in the original repository,
so we'll get the new versions soon. Meanwhile, they are covered by
other tests.

* canvas/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed.
* canvas/2d.fillStyle.parse.invalid.hex4.html: Removed.
* canvas/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed.
* canvas/2d.fillStyle.parse.invalid.hex8.html: Removed.
* css/css-color-3/t421-rgb-hex-parsing-f.xht:

Source/WebCore:

CSS Color Level 4 allows #RGBA and #RRGGBBAA values
for colors.

Test: fast/css/hex-colors.html

* platform/graphics/Color.cpp:
(WebCore::parseHexColorInternal): Update the color parsing for
the new syntax.

LayoutTests:

Add a new test for hex colors that covers 4 and 8 value forms.
Also update existing tests now that the syntax has changed.

For the deleted philip tests, they are now in the W3C web-latform-tests import.

* canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html: Removed.
* fast/css/hex-colors-expected.txt: Added.
* fast/css/hex-colors.html: Added.
* fast/css/invalid-hex-color-expected.txt:
* fast/css/invalid-hex-color.html:
* fast/css/invalid-predefined-color-expected.txt:
* fast/css/invalid-predefined-color.html:
* fast/css/script-tests/invalid-predefined-color.js:
* fast/dom/attribute-legacy-colors-expected.txt:
* fast/dom/script-tests/attribute-legacy-colors.js:
* svg/dom/rgb-color-parser-expected.txt:
* svg/dom/rgb-color-parser.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssinvalidhexcolorexpectedtxt">trunk/LayoutTests/fast/css/invalid-hex-color-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssinvalidhexcolorhtml">trunk/LayoutTests/fast/css/invalid-hex-color.html</a></li>
<li><a href="#trunkLayoutTestsfastcssinvalidpredefinedcolorexpectedtxt">trunk/LayoutTests/fast/css/invalid-predefined-color-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssinvalidpredefinedcolorhtml">trunk/LayoutTests/fast/css/invalid-predefined-color.html</a></li>
<li><a href="#trunkLayoutTestsfastcssscripttestsinvalidpredefinedcolorjs">trunk/LayoutTests/fast/css/script-tests/invalid-predefined-color.js</a></li>
<li><a href="#trunkLayoutTestsfastdomattributelegacycolorsexpectedtxt">trunk/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomscripttestsattributelegacycolorsjs">trunk/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3ccsscsscolor3t421rgbhexparsingfxht">trunk/LayoutTests/imported/w3c/css/css-color-3/t421-rgb-hex-parsing-f.xht</a></li>
<li><a href="#trunkLayoutTestssvgdomrgbcolorparserexpectedtxt">trunk/LayoutTests/svg/dom/rgb-color-parser-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomrgbcolorparserhtml">trunk/LayoutTests/svg/dom/rgb-color-parser.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorcpp">trunk/Source/WebCore/platform/graphics/Color.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsshexcolorsexpectedtxt">trunk/LayoutTests/fast/css/hex-colors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsshexcolorshtml">trunk/LayoutTests/fast/css/hex-colors.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex4expectedtxt">trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt</a></li>
<li><a href="#trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex4html">trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html</a></li>
<li><a href="#trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex8expectedtxt">trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt</a></li>
<li><a href="#trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex8html">trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex4expectedtxt">trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex4html">trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex8expectedtxt">trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex8html">trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/ChangeLog        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-11-03  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Accept 8 and 4 value hex colors (#RRGGBBAA)
+        https://bugs.webkit.org/show_bug.cgi?id=150853
+        &lt;rdar://problem/23380930&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add a new test for hex colors that covers 4 and 8 value forms.
+        Also update existing tests now that the syntax has changed.
+
+        For the deleted philip tests, they are now in the W3C web-latform-tests import.
+
+        * canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed.
+        * canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html: Removed.
+        * canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed.
+        * canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html: Removed.
+        * fast/css/hex-colors-expected.txt: Added.
+        * fast/css/hex-colors.html: Added.
+        * fast/css/invalid-hex-color-expected.txt:
+        * fast/css/invalid-hex-color.html:
+        * fast/css/invalid-predefined-color-expected.txt:
+        * fast/css/invalid-predefined-color.html:
+        * fast/css/script-tests/invalid-predefined-color.js:
+        * fast/dom/attribute-legacy-colors-expected.txt:
+        * fast/dom/script-tests/attribute-legacy-colors.js:
+        * svg/dom/rgb-color-parser-expected.txt:
+        * svg/dom/rgb-color-parser.html:
+
</ins><span class="cx"> 2015-11-04  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [AX] WebProcess from WebKitGtk+ 2.10.0 compiled in Debug mode hits ASSERT on textUnderElement
</span></span></pre></div>
<a id="trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex4expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-Passed
</del></span></pre></div>
<a id="trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex4html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;title&gt;Canvas test: 2d.fillStyle.parse.invalid.hex4&lt;/title&gt;
-&lt;script src=&quot;../tests.js&quot;&gt;&lt;/script&gt;
-&lt;link rel=&quot;stylesheet&quot; href=&quot;../tests.css&quot;&gt;
-&lt;body&gt;
-&lt;p id=&quot;passtext&quot;&gt;Pass&lt;/p&gt;
-&lt;p id=&quot;failtext&quot;&gt;Fail&lt;/p&gt;
-&lt;p class=&quot;output&quot;&gt;These images should be identical:&lt;/p&gt;
-&lt;canvas id=&quot;c&quot; class=&quot;output&quot; width=&quot;100&quot; height=&quot;50&quot;&gt;&lt;p class=&quot;fallback&quot;&gt;FAIL (fallback content)&lt;/p&gt;&lt;/canvas&gt;
-&lt;p class=&quot;output expectedtext&quot;&gt;Expected output:&lt;p&gt;&lt;img src=&quot;green-100x50.png&quot; class=&quot;output expected&quot; id=&quot;expected&quot; alt=&quot;&quot;&gt;
-&lt;ul id=&quot;d&quot;&gt;&lt;/ul&gt;
-&lt;script&gt;
-_addTest(function(canvas, ctx) {
-
-
-ctx.fillStyle = '#0f0';
-try { ctx.fillStyle = '#ff00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
-ctx.fillRect(0, 0, 100, 50);
-_assertPixel(canvas, 50,25, 0,255,0,255, &quot;50,25&quot;, &quot;0,255,0,255&quot;);
-
-
-});
-&lt;/script&gt;
-
</del></span></pre></div>
<a id="trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex8expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-Passed
</del></span></pre></div>
<a id="trunkLayoutTestscanvasphiliptests2dfillStyleparseinvalidhex8html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;title&gt;Canvas test: 2d.fillStyle.parse.invalid.hex8&lt;/title&gt;
-&lt;script src=&quot;../tests.js&quot;&gt;&lt;/script&gt;
-&lt;link rel=&quot;stylesheet&quot; href=&quot;../tests.css&quot;&gt;
-&lt;body&gt;
-&lt;p id=&quot;passtext&quot;&gt;Pass&lt;/p&gt;
-&lt;p id=&quot;failtext&quot;&gt;Fail&lt;/p&gt;
-&lt;p class=&quot;output&quot;&gt;These images should be identical:&lt;/p&gt;
-&lt;canvas id=&quot;c&quot; class=&quot;output&quot; width=&quot;100&quot; height=&quot;50&quot;&gt;&lt;p class=&quot;fallback&quot;&gt;FAIL (fallback content)&lt;/p&gt;&lt;/canvas&gt;
-&lt;p class=&quot;output expectedtext&quot;&gt;Expected output:&lt;p&gt;&lt;img src=&quot;green-100x50.png&quot; class=&quot;output expected&quot; id=&quot;expected&quot; alt=&quot;&quot;&gt;
-&lt;ul id=&quot;d&quot;&gt;&lt;/ul&gt;
-&lt;script&gt;
-_addTest(function(canvas, ctx) {
-
-
-ctx.fillStyle = '#0f0';
-try { ctx.fillStyle = '#ff0000ff'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
-ctx.fillRect(0, 0, 100, 50);
-_assertPixel(canvas, 50,25, 0,255,0,255, &quot;50,25&quot;, &quot;0,255,0,255&quot;);
-
-
-});
-&lt;/script&gt;
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastcsshexcolorsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/hex-colors-expected.txt (0 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/hex-colors-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/hex-colors-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+PASS #000 was red:0 green: 0 blue: 0
+PASS #001 was red:0 green: 0 blue: 17
+PASS #012 was red:0 green: 17 blue: 34
+PASS #123 was red:17 green: 34 blue: 51
+PASS #0001 was red:0 green: 0 blue: 0 alpha: 17
+PASS #0012 was red:0 green: 0 blue: 17 alpha: 34
+PASS #0123 was red:0 green: 17 blue: 34 alpha: 51
+PASS #1234 was red:17 green: 34 blue: 51 alpha: 68
+PASS #000000 was red:0 green: 0 blue: 0
+PASS #000012 was red:0 green: 0 blue: 18
+PASS #001234 was red:0 green: 18 blue: 52
+PASS #123456 was red:18 green: 52 blue: 86
+PASS #00000000 was red:0 green: 0 blue: 0 alpha: 0
+PASS #00000012 was red:0 green: 0 blue: 0 alpha: 18
+PASS #00001234 was red:0 green: 0 blue: 18 alpha: 52
+PASS #00123456 was red:0 green: 18 blue: 52 alpha: 86
+PASS #12345678 was red:18 green: 52 blue: 86 alpha: 120
+PASS #12x3 was red:255 green: 0 blue: 0
+PASS #123x was red:255 green: 0 blue: 0
+PASS #123x4567 was red:255 green: 0 blue: 0
+PASS #1234567r was red:255 green: 0 blue: 0
+PASS #123456x6 was red:255 green: 0 blue: 0
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css/hex-colors-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcsshexcolorshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/hex-colors.html (0 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/hex-colors.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/hex-colors.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+var TESTS = [
+    [&quot;#000&quot;, 0, 0, 0],
+    [&quot;#001&quot;, 0, 0, 17],
+    [&quot;#012&quot;, 0, 17, 34],
+    [&quot;#123&quot;, 17, 34, 51],
+    [&quot;#0001&quot;, 0, 0, 0, 17],
+    [&quot;#0012&quot;, 0, 0, 17,34],
+    [&quot;#0123&quot;, 0, 17, 34, 51],
+    [&quot;#1234&quot;, 17, 34, 51, 68],
+    [&quot;#000000&quot;, 0, 0, 0],
+    [&quot;#000012&quot;, 0, 0, 18],
+    [&quot;#001234&quot;, 0, 18, 52],
+    [&quot;#123456&quot;, 18, 52, 86],
+    [&quot;#00000000&quot;, 0, 0, 0, 0],
+    [&quot;#00000012&quot;, 0, 0, 0, 18],
+    [&quot;#00001234&quot;, 0, 0, 18, 52],
+    [&quot;#00123456&quot;, 0, 18, 52, 86],
+    [&quot;#12345678&quot;, 18, 52, 86, 120],
+    // Bad content from here on shows the red failure color.
+    [&quot;#12x3&quot;, 255, 0, 0],
+    [&quot;#123x&quot;, 255, 0, 0],
+    [&quot;#123x4567&quot;, 255, 0, 0],
+    [&quot;#1234567r&quot;, 255, 0, 0],
+    [&quot;#123456x6&quot;, 255, 0, 0],
+];
+
+function extractComponents(rgbValue) {
+    var re = /rgba?\((\d+),\s(\d+),\s(\d+)(,\s([\d\.]+))?\)/;
+    var match = re.exec(rgbValue);
+    var results = [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])];
+    if (match[5])
+        results.push(Math.round(parseFloat(match[5]) * 255));
+    return results;
+}
+
+function componentsMatch(components, expectedR, expectedG, expectedB, expectedA) {
+    if (components[0] == expectedR &amp;&amp; components[1] == expectedG &amp;&amp; components[2] == expectedB) {
+        if (components.length != 4)
+            return true;
+        return components[3] == expectedA;
+    }
+}
+
+function componentsAsRGBA(r, g, b, a) {
+    if (a !== undefined)
+        return &quot;red:&quot; + r + &quot; green: &quot; + g + &quot; blue: &quot; + b + &quot; alpha: &quot; + a;
+    return &quot;red:&quot; + r + &quot; green: &quot; + g + &quot; blue: &quot; + b;
+}
+
+function runTest() {
+    var element = document.querySelector(&quot;p&quot;);
+    var results = &quot;&quot;;
+
+    for (var test of TESTS) {
+        element.style.color = test[0];
+        var components = extractComponents(window.getComputedStyle(element).color);
+        if (componentsMatch(components, test[1], test[2], test[3], test[4]))
+            results += &quot;PASS &quot; + test[0] + &quot; was &quot; + componentsAsRGBA(test[1], test[2], test[3], test[4]) + &quot;&lt;br&gt;&quot;;
+        else
+            results += &quot;FAIL &quot; + test[0] + &quot; should be &quot; + componentsAsRGBA(test[1], test[2], test[3], test[4]) + &quot; but was &quot; + componentsAsRGBA(components[0], components[1], components[2], components[3]) + &quot;&lt;br&gt;&quot;;
+
+        // Force a color reset and style recalc.
+        element.style.color = &quot;red&quot;;
+        computedStyle = window.getComputedStyle(element).color;
+    }
+
+    document.querySelector(&quot;div&quot;).innerHTML = results;
+}
+
+window.addEventListener(&quot;load&quot;, runTest, false);
+&lt;/script&gt;
+&lt;div id=&quot;results&quot;&gt;&lt;/div&gt;
+&lt;p&gt;&lt;/p&gt;
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css/hex-colors.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcssinvalidhexcolorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/invalid-hex-color-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/invalid-hex-color-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/fast/css/invalid-hex-color-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -2,15 +2,17 @@
</span><span class="cx"> Test 1 (Invalid: 1 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</span><span class="cx"> Test 2 (Invalid: 2 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</span><span class="cx"> Test 3 (Valid: 3 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</span><del>-Test 4 (Invalid: 4 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</del><ins>+Test 4 (Valid: 4 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</ins><span class="cx"> Test 5 (Invalid: 5 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</span><span class="cx"> Test 6 (Valid: 6 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</span><span class="cx"> Test 7 (Invalid: 7 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
</span><del>-Test 8 (Invalid: 0 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
-Test 9 (Invalid: 1 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
-Test 10 (Invalid: 2 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
-Test 11 (Invalid: 3 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
-Test 12 (Invalid: 4 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
-Test 13 (Invalid: 5 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
-Test 14 (Invalid: 6 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
-Test 15 (Invalid: 7 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
</del><ins>+Test 8 (Valid: 8 hexadecimal digits) [EXPECTED] [ACTUAL] PASS
+Test 9 (Invalid: 0 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 10 (Invalid: 1 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 11 (Invalid: 2 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 12 (Invalid: 3 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 13 (Invalid: 4 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 14 (Invalid: 5 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 15 (Invalid: 6 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 16 (Invalid: 7 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
+Test 17 (Invalid: 8 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssinvalidhexcolorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/invalid-hex-color.html (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/invalid-hex-color.html        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/fast/css/invalid-hex-color.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -19,10 +19,11 @@
</span><span class="cx">         [&quot;Invalid: 1 hexadecimal digits&quot;, &quot;&quot;, &quot;border-bottom: solid #1&quot;],
</span><span class="cx">         [&quot;Invalid: 2 hexadecimal digits&quot;, &quot;&quot;, &quot;border-bottom: solid #11&quot;],
</span><span class="cx">         [&quot;Valid: 3 hexadecimal digits&quot;, &quot;border-bottom: solid rgb(17,17,17)&quot;, &quot;border-bottom: solid #111&quot;],
</span><del>-        [&quot;Invalid: 4 hexadecimal digits&quot;, &quot;&quot;, &quot;border-bottom: solid #1111&quot;],
</del><ins>+        [&quot;Valid: 4 hexadecimal digits&quot;, &quot;border-bottom: solid rgba(17,17,17,255)&quot;, &quot;border-bottom: solid #111f&quot;],
</ins><span class="cx">         [&quot;Invalid: 5 hexadecimal digits&quot;, &quot;&quot;, &quot;border-bottom: solid #11111&quot;],
</span><span class="cx">         [&quot;Valid: 6 hexadecimal digits&quot;, &quot;border-bottom: solid rgb(17,17,17)&quot;, &quot;border-bottom: solid #111111&quot;],
</span><span class="cx">         [&quot;Invalid: 7 hexadecimal digits&quot;, &quot;&quot;, &quot;border-bottom: solid #1111111&quot;],
</span><ins>+        [&quot;Valid: 8 hexadecimal digits&quot;, &quot;border-bottom: solid rgba(17,17,17,255)&quot;, &quot;border-bottom: solid #111111ff&quot;],
</ins><span class="cx">         [&quot;Invalid: 0 hexadecimal digits concatenated with 'px'&quot;, &quot;&quot;, &quot;border-bottom: solid #px&quot;],
</span><span class="cx">         [&quot;Invalid: 1 hexadecimal digits concatenated with 'px'&quot;, &quot;&quot;, &quot;border-bottom: solid #1px&quot;],
</span><span class="cx">         [&quot;Invalid: 2 hexadecimal digits concatenated with 'px'&quot;, &quot;&quot;, &quot;border-bottom: solid #11px&quot;],
</span><span class="lines">@@ -31,6 +32,7 @@
</span><span class="cx">         [&quot;Invalid: 5 hexadecimal digits concatenated with 'px'&quot;, &quot;&quot;, &quot;border-bottom: solid #11111px&quot;],
</span><span class="cx">         [&quot;Invalid: 6 hexadecimal digits concatenated with 'px'&quot;, &quot;&quot;, &quot;border-bottom: solid #111111px&quot;],
</span><span class="cx">         [&quot;Invalid: 7 hexadecimal digits concatenated with 'px'&quot;, &quot;&quot;, &quot;border-bottom: solid #1111111px&quot;],
</span><ins>+        [&quot;Invalid: 8 hexadecimal digits concatenated with 'px'&quot;, &quot;&quot;, &quot;border-bottom: solid #11111111px&quot;],
</ins><span class="cx">     ];
</span><span class="cx"> 
</span><span class="cx">     var testHtml = &quot;&quot;;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssinvalidpredefinedcolorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/invalid-predefined-color-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/invalid-predefined-color-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/fast/css/invalid-predefined-color-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -12,7 +12,6 @@
</span><span class="cx"> PASS getComputedStyle(div, null).color is black
</span><span class="cx"> PASS getComputedStyle(div, null).color is black
</span><span class="cx"> PASS getComputedStyle(div, null).color is black
</span><del>-PASS getComputedStyle(div, null).color is black
</del><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><span class="lines">@@ -25,4 +24,3 @@
</span><span class="cx"> This style is &quot;color: #yellow&quot;
</span><span class="cx"> This style is &quot;color: #green&quot;
</span><span class="cx"> This style is &quot;color: #FFAALL&quot;
</span><del>-This style is &quot;color: #FF000000&quot;
</del></span></pre></div>
<a id="trunkLayoutTestsfastcssinvalidpredefinedcolorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/invalid-predefined-color.html (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/invalid-predefined-color.html        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/fast/css/invalid-predefined-color.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -14,7 +14,6 @@
</span><span class="cx"> &lt;div id=&quot;invalid2&quot; style=&quot;color: #yellow&quot;&gt;This style is &quot;color: #yellow&quot;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;invalid3&quot; style=&quot;color: #green&quot;&gt;This style is &quot;color: #green&quot;&lt;/div&gt;
</span><span class="cx"> &lt;div id=&quot;invalid4&quot; style=&quot;color: #FFAALL&quot;&gt;This style is &quot;color: #FFAALL&quot;&lt;/div&gt;
</span><del>-&lt;div id=&quot;invalid5&quot; style=&quot;color: #FF000000&quot;&gt;This style is &quot;color: #FF000000&quot;&lt;/div&gt;
</del><span class="cx"> 
</span><span class="cx"> &lt;script src=&quot;script-tests/invalid-predefined-color.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssscripttestsinvalidpredefinedcolorjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/script-tests/invalid-predefined-color.js (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/script-tests/invalid-predefined-color.js        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/fast/css/script-tests/invalid-predefined-color.js        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx">     shouldBe(&quot;getComputedStyle(div, null).color&quot;, &quot;red&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-for (var i=1;i&lt;=5;i++)
</del><ins>+for (var i=1;i&lt;=4;i++)
</ins><span class="cx"> {
</span><span class="cx">     var div = document.getElementById(&quot;invalid&quot;+i);
</span><span class="cx">     shouldBe(&quot;getComputedStyle(div, null).color&quot;, &quot;black&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomattributelegacycolorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -16,7 +16,6 @@
</span><span class="cx"> PASS document.body.bgColor='#ffzzzz';getComputedStyle(document.body).backgroundColor; is 'rgb(255, 0, 0)'
</span><span class="cx"> PASS document.body.bgColor='f00';getComputedStyle(document.body).backgroundColor; is 'rgb(15, 0, 0)'
</span><span class="cx"> PASS document.body.bgColor='ff0000';getComputedStyle(document.body).backgroundColor; is 'rgb(255, 0, 0)'
</span><del>-PASS document.body.bgColor='#00000000';getComputedStyle(document.body).backgroundColor; is 'rgb(0, 0, 0)'
</del><span class="cx"> PASS document.body.bgColor='foo';getComputedStyle(document.body).backgroundColor; is 'rgb(15, 0, 0)'
</span><span class="cx"> PASS document.body.bgColor='cheese';getComputedStyle(document.body).backgroundColor; is 'rgb(192, 238, 14)'
</span><span class="cx"> PASS document.body.bgColor='ff򀿿ff';getComputedStyle(document.body).backgroundColor; is 'rgb(255, 0, 255)'
</span><span class="lines">@@ -35,11 +34,9 @@
</span><span class="cx"> PASS document.body.bgColor='#5';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 0, 0)'
</span><span class="cx"> PASS document.body.bgColor='#55';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 5, 0)'
</span><span class="cx"> PASS document.body.bgColor='#555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 85)'
</span><del>-PASS document.body.bgColor='#5555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 0)'
</del><span class="cx"> PASS document.body.bgColor='#55555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 80)'
</span><span class="cx"> PASS document.body.bgColor='#555555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 85)'
</span><span class="cx"> PASS document.body.bgColor='#5555555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 80)'
</span><del>-PASS document.body.bgColor='#55555555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 85)'
</del><span class="cx"> PASS document.body.bgColor='5';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 0, 0)'
</span><span class="cx"> PASS document.body.bgColor='55';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 5, 0)'
</span><span class="cx"> PASS document.body.bgColor='555';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 5, 5)'
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomscripttestsattributelegacycolorsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -15,7 +15,6 @@
</span><span class="cx">         {'test':'#ffzzzz', 'expected':[255, 0, 0]},
</span><span class="cx">         {'test':'f00', 'expected':[15, 0, 0]},
</span><span class="cx">         {'test':'ff0000', 'expected':[255, 0, 0]},
</span><del>-        {'test':'#00000000', 'expected':[0, 0, 0]},
</del><span class="cx">         {'test':'foo', 'expected':[15, 0, 0]},
</span><span class="cx">         {'test':'cheese', 'expected':[192, 238, 14]},
</span><span class="cx">         {'test':'ff򀿿ff', 'expected':[255, 0, 255]},
</span><span class="lines">@@ -34,11 +33,9 @@
</span><span class="cx">         {'test':'#5', 'expected':[5, 0, 0]},
</span><span class="cx">         {'test':'#55', 'expected':[5, 5, 0]},
</span><span class="cx">         {'test':'#555', 'expected':[85, 85, 85]},
</span><del>-        {'test':'#5555', 'expected':[85, 85, 0]},
</del><span class="cx">         {'test':'#55555', 'expected':[85, 85, 80]},
</span><span class="cx">         {'test':'#555555', 'expected':[85, 85, 85]},
</span><span class="cx">         {'test':'#5555555', 'expected':[85, 85, 80]},
</span><del>-        {'test':'#55555555', 'expected':[85, 85, 85]},
</del><span class="cx">         {'test':'5', 'expected':[5, 0, 0]},
</span><span class="cx">         {'test':'55', 'expected':[5, 5, 0]},
</span><span class="cx">         {'test':'555', 'expected':[5, 5, 5]},
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-11-03  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Accept 8 and 4 value hex colors (#RRGGBBAA)
+        https://bugs.webkit.org/show_bug.cgi?id=150853
+        &lt;rdar://problem/23380930&gt;
+
+        Reviewed by Simon Fraser.
+
+        Delete these tests. The have been updated in the original repository,
+        so we'll get the new versions soon. Meanwhile, they are covered by
+        other tests.
+
+        * canvas/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed.
+        * canvas/2d.fillStyle.parse.invalid.hex4.html: Removed.
+        * canvas/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed.
+        * canvas/2d.fillStyle.parse.invalid.hex8.html: Removed.
+        * css/css-color-3/t421-rgb-hex-parsing-f.xht:
+
</ins><span class="cx"> 2015-11-02  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement support for the autocomplete attribute
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex4expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-2d.fillStyle.parse.invalid.hex4
-Spec references: 2d.colours.parse
-Actual output:
-Expected output:
-
-Passed
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex4html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4.html (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4.html        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex4.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;title&gt;Canvas test: 2d.fillStyle.parse.invalid.hex4&lt;/title&gt;
-&lt;meta name=&quot;author&quot; content=&quot;Philip Taylor&quot;&gt;
-&lt;script src=&quot;../common/canvas-tests.js&quot;&gt;&lt;/script&gt;
-&lt;link rel=&quot;stylesheet&quot; href=&quot;../common/canvas-tests.css&quot;&gt;
-&lt;body class=&quot;show_output&quot;&gt;
-
-&lt;h1&gt;&lt;a href=&quot;index.2d.html&quot;&gt;2d&lt;/a&gt;.&lt;a href=&quot;index.2d.fillStyle.html&quot;&gt;fillStyle&lt;/a&gt;.&lt;a href=&quot;index.2d.fillStyle.parse.html&quot;&gt;parse&lt;/a&gt;.&lt;a href=&quot;index.2d.fillStyle.parse.invalid.html&quot;&gt;invalid&lt;/a&gt;.hex4&lt;/h1&gt;
-&lt;p class=&quot;desc&quot;&gt;&lt;/p&gt;
-
-&lt;div class=&quot;refs&quot;&gt;Spec references:
-&lt;ul&gt;
-&lt;li&gt;&lt;a href=&quot;../annotated-spec/canvas.html#testrefs.2d.colours.parse&quot;&gt;2d.colours.parse&lt;/a&gt;
-&lt;/ul&gt;
-&lt;/div&gt;
-
-&lt;p class=&quot;output&quot;&gt;Actual output:&lt;/p&gt;
-&lt;canvas id=&quot;c&quot; class=&quot;output&quot; width=&quot;100&quot; height=&quot;50&quot;&gt;&lt;p class=&quot;fallback&quot;&gt;FAIL (fallback content)&lt;/p&gt;&lt;/canvas&gt;
-&lt;p class=&quot;output expectedtext&quot;&gt;Expected output:&lt;p&gt;&lt;img src=&quot;../resources/green-100x50.png&quot; class=&quot;output expected&quot; id=&quot;expected&quot; alt=&quot;&quot;&gt;
-&lt;ul id=&quot;d&quot;&gt;&lt;/ul&gt;
-&lt;script&gt;
-_addTest(function(canvas, ctx) {
-
-
-ctx.fillStyle = '#0f0';
-try { ctx.fillStyle = '#ff00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
-ctx.fillRect(0, 0, 100, 50);
-_assertPixel(canvas, 50,25, 0,255,0,255, &quot;50,25&quot;, &quot;0,255,0,255&quot;);
-
-
-});
-&lt;/script&gt;
-
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex8expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-2d.fillStyle.parse.invalid.hex8
-Spec references: 2d.colours.parse
-Actual output:
-Expected output:
-
-Passed
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3ccanvas2dfillStyleparseinvalidhex8html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8.html (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8.html        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/imported/w3c/canvas/2d.fillStyle.parse.invalid.hex8.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;title&gt;Canvas test: 2d.fillStyle.parse.invalid.hex8&lt;/title&gt;
-&lt;meta name=&quot;author&quot; content=&quot;Philip Taylor&quot;&gt;
-&lt;script src=&quot;../common/canvas-tests.js&quot;&gt;&lt;/script&gt;
-&lt;link rel=&quot;stylesheet&quot; href=&quot;../common/canvas-tests.css&quot;&gt;
-&lt;body class=&quot;show_output&quot;&gt;
-
-&lt;h1&gt;&lt;a href=&quot;index.2d.html&quot;&gt;2d&lt;/a&gt;.&lt;a href=&quot;index.2d.fillStyle.html&quot;&gt;fillStyle&lt;/a&gt;.&lt;a href=&quot;index.2d.fillStyle.parse.html&quot;&gt;parse&lt;/a&gt;.&lt;a href=&quot;index.2d.fillStyle.parse.invalid.html&quot;&gt;invalid&lt;/a&gt;.hex8&lt;/h1&gt;
-&lt;p class=&quot;desc&quot;&gt;&lt;/p&gt;
-
-&lt;div class=&quot;refs&quot;&gt;Spec references:
-&lt;ul&gt;
-&lt;li&gt;&lt;a href=&quot;../annotated-spec/canvas.html#testrefs.2d.colours.parse&quot;&gt;2d.colours.parse&lt;/a&gt;
-&lt;/ul&gt;
-&lt;/div&gt;
-
-&lt;p class=&quot;output&quot;&gt;Actual output:&lt;/p&gt;
-&lt;canvas id=&quot;c&quot; class=&quot;output&quot; width=&quot;100&quot; height=&quot;50&quot;&gt;&lt;p class=&quot;fallback&quot;&gt;FAIL (fallback content)&lt;/p&gt;&lt;/canvas&gt;
-&lt;p class=&quot;output expectedtext&quot;&gt;Expected output:&lt;p&gt;&lt;img src=&quot;../resources/green-100x50.png&quot; class=&quot;output expected&quot; id=&quot;expected&quot; alt=&quot;&quot;&gt;
-&lt;ul id=&quot;d&quot;&gt;&lt;/ul&gt;
-&lt;script&gt;
-_addTest(function(canvas, ctx) {
-
-
-ctx.fillStyle = '#0f0';
-try { ctx.fillStyle = '#ff0000ff'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
-ctx.fillRect(0, 0, 100, 50);
-_assertPixel(canvas, 50,25, 0,255,0,255, &quot;50,25&quot;, &quot;0,255,0,255&quot;);
-
-
-});
-&lt;/script&gt;
-
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3ccsscsscolor3t421rgbhexparsingfxht"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/css/css-color-3/t421-rgb-hex-parsing-f.xht (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/css/css-color-3/t421-rgb-hex-parsing-f.xht        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/imported/w3c/css/css-color-3/t421-rgb-hex-parsing-f.xht        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -12,10 +12,8 @@
</span><span class="cx">                         p { color: green; }
</span><span class="cx">                         p { color: #f; }
</span><span class="cx">                         p { color: #ff; }
</span><del>-                        p { color: #ff00; }
</del><span class="cx">                         p { color: #ff000; }
</span><span class="cx">                         p { color: #ff00000; }
</span><del>-                        p { color: #ff000000; }
</del><span class="cx">                         p { color: #ff0000000; }
</span><span class="cx">                         p { color: #ff00000000; }
</span><span class="cx">                 ]]&gt;&lt;/style&gt;
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomrgbcolorparserexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/rgb-color-parser-expected.txt (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/rgb-color-parser-expected.txt        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/svg/dom/rgb-color-parser-expected.txt        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -163,7 +163,6 @@
</span><span class="cx"> Failed to parse: #
</span><span class="cx"> Failed to parse: #f
</span><span class="cx"> Failed to parse: #ff
</span><del>-Failed to parse: #ffff
</del><span class="cx"> Failed to parse: #fffff
</span><span class="cx"> Failed to parse: #fffffff
</span><span class="cx"> Failed to parse: green,
</span><span class="lines">@@ -177,7 +176,9 @@
</span><span class="cx"> Failed to parse: 'visual'
</span><span class="cx"> Parsed as rgb(0,10,20): rgb(0, 10, 20)
</span><span class="cx"> Parsed as rgb(255,255,255): #fff
</span><ins>+Parsed as rgb(255,255,255): #ffff
</ins><span class="cx"> Parsed as rgb(255,255,255): #ffffff
</span><ins>+Parsed as rgb(255,255,255): #ffffffff
</ins><span class="cx"> Parsed as rgb(255,255,255): #FFF
</span><span class="cx"> Parsed as rgb(255,255,255): #FFFFFF
</span><span class="cx"> Parsed as rgb(0,128,0):  green
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomrgbcolorparserhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/rgb-color-parser.html (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/rgb-color-parser.html        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/LayoutTests/svg/dom/rgb-color-parser.html        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -226,7 +226,6 @@
</span><span class="cx">         parseRGBColor(&quot;#&quot;);
</span><span class="cx">         parseRGBColor(&quot;#f&quot;);
</span><span class="cx">         parseRGBColor(&quot;#ff&quot;);
</span><del>-        parseRGBColor(&quot;#ffff&quot;);
</del><span class="cx">         parseRGBColor(&quot;#fffff&quot;);
</span><span class="cx">         parseRGBColor(&quot;#fffffff&quot;);
</span><span class="cx">         parseRGBColor(&quot;green,&quot;);
</span><span class="lines">@@ -242,7 +241,9 @@
</span><span class="cx">         // Some more valid ones.
</span><span class="cx">         parseRGBColor(&quot;rgb(0, 10, 20)&quot;);
</span><span class="cx">         parseRGBColor(&quot;#fff&quot;);
</span><ins>+        parseRGBColor(&quot;#ffff&quot;);
</ins><span class="cx">         parseRGBColor(&quot;#ffffff&quot;);
</span><ins>+        parseRGBColor(&quot;#ffffffff&quot;);
</ins><span class="cx">         parseRGBColor(&quot;#FFF&quot;);
</span><span class="cx">         parseRGBColor(&quot;#FFFFFF&quot;);
</span><span class="cx">         parseRGBColor(&quot; green&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/Source/WebCore/ChangeLog        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-11-03  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Accept 8 and 4 value hex colors (#RRGGBBAA)
+        https://bugs.webkit.org/show_bug.cgi?id=150853
+        &lt;rdar://problem/23380930&gt;
+
+        Reviewed by Simon Fraser.
+
+        CSS Color Level 4 allows #RGBA and #RRGGBBAA values
+        for colors.
+
+        Test: fast/css/hex-colors.html
+
+        * platform/graphics/Color.cpp:
+        (WebCore::parseHexColorInternal): Update the color parsing for
+        the new syntax.
+
</ins><span class="cx"> 2015-11-04  Mario Sanchez Prada  &lt;mario@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [AX] WebProcess from WebKitGtk+ 2.10.0 compiled in Debug mode hits ASSERT on textUnderElement
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Color.cpp (192022 => 192023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Color.cpp        2015-11-04 14:46:19 UTC (rev 192022)
+++ trunk/Source/WebCore/platform/graphics/Color.cpp        2015-11-04 17:49:46 UTC (rev 192023)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> template &lt;typename CharacterType&gt;
</span><span class="cx"> static inline bool parseHexColorInternal(const CharacterType* name, unsigned length, RGBA32&amp; rgb)
</span><span class="cx"> {
</span><del>-    if (length != 3 &amp;&amp; length != 6)
</del><ins>+    if (length != 3 &amp;&amp; length != 4 &amp;&amp; length != 6 &amp;&amp; length != 8)
</ins><span class="cx">         return false;
</span><span class="cx">     unsigned value = 0;
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="lines">@@ -141,6 +141,20 @@
</span><span class="cx">         rgb = 0xFF000000 | value;
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><ins>+    if (length == 8) {
+        // We parsed the values into RGBA order, but the RGBA32 type
+        // expects them to be in ARGB order, so we right rotate eight bits.
+        rgb = value &lt;&lt; 24 | value &gt;&gt; 8;
+        return true;
+    }
+    if (length == 4) {
+        // #abcd converts to ddaabbcc in RGBA32.
+        rgb = (value &amp; 0xF) &lt;&lt; 28 | (value &amp; 0xF) &lt;&lt; 24
+            | (value &amp; 0xF000) &lt;&lt; 8 | (value &amp; 0xF000) &lt;&lt; 4
+            | (value &amp; 0xF00) &lt;&lt; 4 | (value &amp; 0xF00)
+            | (value &amp; 0xF0) | (value &amp; 0xF0) &gt;&gt; 4;
+        return true;
+    }
</ins><span class="cx">     // #abc converts to #aabbcc
</span><span class="cx">     rgb = 0xFF000000
</span><span class="cx">         | (value &amp; 0xF00) &lt;&lt; 12 | (value &amp; 0xF00) &lt;&lt; 8
</span></span></pre>
</div>
</div>

</body>
</html>