<!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>[205030] 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/205030">205030</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-08-26 11:09:01 -0700 (Fri, 26 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
https://bugs.webkit.org/show_bug.cgi?id=161216

Reviewed by Andreas Kling.

LayoutTests/imported/w3c:

Rebaseline W3C test now that all checks are passing. Chrome is also passing all the checks.

* web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords-expected.txt:

Source/WebCore:

HTMLAreaElement's coords attributes parsing does not comply with the HTML specification:
- https://html.spec.whatwg.org/#attr-area-coords

This patch aligns our parsing of this attribute with the specification and Chrome.

No new tests, rebaselined existing test.

* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::HTMLAreaElement):
(WebCore::HTMLAreaElement::parseAttribute):
(WebCore::HTMLAreaElement::getRegion):
* html/HTMLAreaElement.h:
* html/parser/HTMLParserIdioms.cpp:
(WebCore::isHTMLSpaceOrDelimiter):
(WebCore::isNumberStart):
(WebCore::parseHTMLListOfOfFloatingPointNumberValuesInternal):
(WebCore::parseHTMLListOfOfFloatingPointNumberValues):
(WebCore::parseHTMLNonNegativeInteger): Deleted.
* html/parser/HTMLParserIdioms.h:

LayoutTests:

Unskip web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords.html
as it is now passing and not longer crashing in debug builds.

* TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsembeddedcontenttheareaelementareacoordsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementcpp">trunk/Source/WebCore/html/HTMLAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementh">trunk/Source/WebCore/html/HTMLAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomscpp">trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomsh">trunk/Source/WebCore/html/parser/HTMLParserIdioms.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/LayoutTests/ChangeLog        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2016-08-26  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
+        https://bugs.webkit.org/show_bug.cgi?id=161216
+
+        Reviewed by Andreas Kling.
+
+        Unskip web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords.html
+        as it is now passing and not longer crashing in debug builds.
+
+        * TestExpectations:
+
+2016-08-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Trying to access cross-origin Location properties should throw a SecurityError
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=161248
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/LayoutTests/TestExpectations        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -475,8 +475,6 @@
</span><span class="cx"> # WPT tests that fail after doing full test repository reimport and need further investigation
</span><span class="cx"> imported/w3c/web-platform-tests/XMLHttpRequest/send-entity-body-document.htm [ Pass Failure Timeout ]
</span><span class="cx"> imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace.html [ Pass Failure ]
</span><del>-webkit.org/b/155516 [ Debug ] imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords.html [ Skip ]
-webkit.org/b/155516 [ Release ] imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords.html [ Failure ]
</del><span class="cx"> 
</span><span class="cx"> # W3C XMLHttpRequest tests
</span><span class="cx"> imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-timeout-aborted.html [ Slow ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-08-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
+        https://bugs.webkit.org/show_bug.cgi?id=161216
+
+        Reviewed by Andreas Kling.
+
+        Rebaseline W3C test now that all checks are passing. Chrome is also passing all the checks.
+
+        * web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords-expected.txt:
+
</ins><span class="cx"> 2016-08-25  Johan K. Jensen  &lt;johan_jensen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update the Resource Timing implementation
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsembeddedcontenttheareaelementareacoordsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords-expected.txt (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords-expected.txt        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-coords-expected.txt        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -7,9 +7,29 @@
</span><span class="cx"> PASS FORM FEED: &quot;2\f2\f10\f10&quot; (rect) 
</span><span class="cx"> PASS LINE FEED: &quot;2\n2\n10\n10&quot; (rect) 
</span><span class="cx"> PASS CARRIGAGE RETURN: &quot;2\r2\r10\r10&quot; (rect) 
</span><del>-FAIL LINE TABULATION: &quot;2\v2\v10\v10&quot; (rect) assert_equals: elementFromPoint(3, 3) expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#x&quot; id=&quot;img&quot; w... but got Element node &lt;area id=&quot;area&quot; shape=&quot;rect&quot; coords=&quot;2 2 10 10&quot;&gt;&lt;/area&gt;
-FAIL LINE NEXT: &quot;2…2…10…10&quot; (rect) assert_equals: elementFromPoint(3, 3) expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#x&quot; id=&quot;img&quot; w... but got Element node &lt;area id=&quot;area&quot; shape=&quot;rect&quot; coords=&quot;2…2…10…10&quot;&gt;&lt;/area&gt;
-FAIL EN QUAD: &quot;2 2 10 10&quot; (rect) assert_equals: elementFromPoint(3, 3) expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#x&quot; id=&quot;img&quot; w... but got Element node &lt;area id=&quot;area&quot; shape=&quot;rect&quot; coords=&quot;2 2 10 10&quot;&gt;&lt;/area&gt;
-FAIL abc between numbers: &quot;2a2b20c20,2,10,10&quot; (rect) assert_equals: elementFromPoint(11, 9) expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#x&quot; id=&quot;img&quot; w... but got Element node &lt;area id=&quot;area&quot; shape=&quot;rect&quot; coords=&quot;2a2b20c20,2,10,10&quot;&gt;&lt;...
-FAIL COLON between numbers: &quot;2:2:20:20,2,10,10&quot; (rect) assert_equals: elementFromPoint(11, 9) expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#x&quot; id=&quot;img&quot; w... but got Element node &lt;area id=&quot;area&quot; shape=&quot;rect&quot; coords=&quot;2:2:20:20,2,10,10&quot;&gt;&lt;...
-FAIL U+0000 between numbers: &quot;2\02\020\020,2,10,10&quot; (rect) assert_equals: elementFromPoint(11, 9) expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#x&quot; id=&quot;img&quot; w... but got Element node &lt;area id=&quot;area&quot; shape=&quot;rect&quot; coords=&quot;2
</del><span class="cx">\ No newline at end of file
</span><ins>+PASS LINE TABULATION: &quot;2\v2\v10\v10&quot; (rect) 
+PASS LINE NEXT: &quot;2…2…10…10&quot; (rect) 
+PASS EN QUAD: &quot;2 2 10 10&quot; (rect) 
+PASS abc between numbers: &quot;2a2b20c20,2,10,10&quot; (rect) 
+PASS COLON between numbers: &quot;2:2:20:20,2,10,10&quot; (rect) 
+PASS U+0000 between numbers: &quot;2\02\020\020,2,10,10&quot; (rect) 
+PASS leading COMMA: &quot;,2,2,10,10&quot; (rect) 
+PASS leading SPACE: &quot; 2,2,10,10&quot; (rect) 
+PASS leading SEMICOLON: &quot;;2,2,10,10&quot; (rect) 
+PASS trailing COMMA: &quot;2,2,10,&quot; (rect) 
+PASS trailing SPACE: &quot;2,2,10 &quot; (rect) 
+PASS trailing SEMICOLON: &quot;2,2,10;&quot; (rect) 
+PASS PERCENT: &quot;2%,2%,10%,10%&quot; (rect) 
+PASS CSS units: &quot;2in,2in,10cm,10cm&quot; (rect) 
+PASS float: &quot;1.4,1.4,10,10&quot; (rect) 
+PASS number starting with PERIOD: &quot;.4,.4,10,10&quot; (rect) 
+PASS sci-not: &quot;2,2,1e1,1e1&quot; (rect) 
+PASS leading/trailing garbage: &quot;='2,2,10,10' &quot; (rect) 
+PASS non-ascii garbage: &quot;“2,2,10,10\&quot;&quot; (rect) 
+PASS URL garbage with number: &quot;2,2,10ls/spain/holidays/regions/10/Canary+Islands/Canary+Islands.html&quot; (rect) 
+PASS consecutive COMMAs: &quot;2,,10,10&quot; (rect) 
+PASS consecutive SPACEs: &quot;2  10,10&quot; (rect) 
+PASS consecutive SEMICOLONs: &quot;2;;10,10&quot; (rect) 
+PASS several consecutive separators: &quot;,,2;,;2,;,10 \t\r\n10;;&quot; (rect) 
+PASS one too many numbers, trailing COMMA: &quot;100,100,120,100,100,120,300,&quot; (poly) 
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/Source/WebCore/ChangeLog        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-08-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
+        https://bugs.webkit.org/show_bug.cgi?id=161216
+
+        Reviewed by Andreas Kling.
+
+        HTMLAreaElement's coords attributes parsing does not comply with the HTML specification:
+        - https://html.spec.whatwg.org/#attr-area-coords
+
+        This patch aligns our parsing of this attribute with the specification and Chrome.
+
+        No new tests, rebaselined existing test.
+
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::HTMLAreaElement):
+        (WebCore::HTMLAreaElement::parseAttribute):
+        (WebCore::HTMLAreaElement::getRegion):
+        * html/HTMLAreaElement.h:
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::isHTMLSpaceOrDelimiter):
+        (WebCore::isNumberStart):
+        (WebCore::parseHTMLListOfOfFloatingPointNumberValuesInternal):
+        (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
+        (WebCore::parseHTMLNonNegativeInteger): Deleted.
+        * html/parser/HTMLParserIdioms.h:
+
</ins><span class="cx"> 2016-08-26  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix the !ENABLE(WEB_SOCKETS) build
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.cpp (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.cpp        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/Source/WebCore/html/HTMLAreaElement.cpp        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;HTMLImageElement.h&quot;
</span><span class="cx"> #include &quot;HTMLMapElement.h&quot;
</span><ins>+#include &quot;HTMLParserIdioms.h&quot;
</ins><span class="cx"> #include &quot;HitTestResult.h&quot;
</span><span class="cx"> #include &quot;Path.h&quot;
</span><span class="cx"> #include &quot;RenderImage.h&quot;
</span><span class="lines">@@ -37,7 +38,6 @@
</span><span class="cx"> 
</span><span class="cx"> inline HTMLAreaElement::HTMLAreaElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="cx">     : HTMLAnchorElement(tagName, document)
</span><del>-    , m_coordsLen(0)
</del><span class="cx">     , m_lastSize(-1, -1)
</span><span class="cx">     , m_shape(Unknown)
</span><span class="cx"> {
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">             m_shape = Rect;
</span><span class="cx">         invalidateCachedRegion();
</span><span class="cx">     } else if (name == coordsAttr) {
</span><del>-        m_coords = newCoordsArray(value.string(), m_coordsLen);
</del><ins>+        m_coords = parseHTMLListOfOfFloatingPointNumberValues(value.string());
</ins><span class="cx">         invalidateCachedRegion();
</span><span class="cx">     } else if (name == altAttr || name == accesskeyAttr) {
</span><span class="cx">         // Do nothing.
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> 
</span><span class="cx"> Path HTMLAreaElement::getRegion(const LayoutSize&amp; size) const
</span><span class="cx"> {
</span><del>-    if (!m_coords &amp;&amp; m_shape != Default)
</del><ins>+    if (m_coords.isEmpty() &amp;&amp; m_shape != Default)
</ins><span class="cx">         return Path();
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit width = size.width();
</span><span class="lines">@@ -138,11 +138,11 @@
</span><span class="cx">     // If element omits the shape attribute, select shape based on number of coordinates.
</span><span class="cx">     Shape shape = m_shape;
</span><span class="cx">     if (shape == Unknown) {
</span><del>-        if (m_coordsLen == 3)
</del><ins>+        if (m_coords.size() == 3)
</ins><span class="cx">             shape = Circle;
</span><del>-        else if (m_coordsLen == 4)
</del><ins>+        else if (m_coords.size() == 4)
</ins><span class="cx">             shape = Rect;
</span><del>-        else if (m_coordsLen &gt;= 6)
</del><ins>+        else if (m_coords.size() &gt;= 6)
</ins><span class="cx">             shape = Poly;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -149,27 +149,26 @@
</span><span class="cx">     Path path;
</span><span class="cx">     switch (shape) {
</span><span class="cx">         case Poly:
</span><del>-            if (m_coordsLen &gt;= 6) {
-                int numPoints = m_coordsLen / 2;
-                path.moveTo(FloatPoint(minimumValueForLength(m_coords[0], width), minimumValueForLength(m_coords[1], height)));
</del><ins>+            if (m_coords.size() &gt;= 6) {
+                int numPoints = m_coords.size() / 2;
+                path.moveTo(FloatPoint(m_coords[0], m_coords[1]));
</ins><span class="cx">                 for (int i = 1; i &lt; numPoints; ++i)
</span><del>-                    path.addLineTo(FloatPoint(minimumValueForLength(m_coords[i * 2], width), minimumValueForLength(m_coords[i * 2 + 1], height)));
</del><ins>+                    path.addLineTo(FloatPoint(m_coords[i * 2], m_coords[i * 2 + 1]));
</ins><span class="cx">                 path.closeSubpath();
</span><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         case Circle:
</span><del>-            if (m_coordsLen &gt;= 3) {
-                Length radius = m_coords[2];
-                int r = std::min(minimumValueForLength(radius, width), minimumValueForLength(radius, height));
-                path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], width) - r, minimumValueForLength(m_coords[1], height) - r, 2 * r, 2 * r));
</del><ins>+            if (m_coords.size() &gt;= 3) {
+                double r = m_coords[2];
+                path.addEllipse(FloatRect(m_coords[0] - r, m_coords[1] - r, 2 * r, 2 * r));
</ins><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         case Rect:
</span><del>-            if (m_coordsLen &gt;= 4) {
-                int x0 = minimumValueForLength(m_coords[0], width);
-                int y0 = minimumValueForLength(m_coords[1], height);
-                int x1 = minimumValueForLength(m_coords[2], width);
-                int y1 = minimumValueForLength(m_coords[3], height);
</del><ins>+            if (m_coords.size() &gt;= 4) {
+                double x0 = m_coords[0];
+                double y0 = m_coords[1];
+                double x1 = m_coords[2];
+                double y1 = m_coords[3];
</ins><span class="cx">                 path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0));
</span><span class="cx">             }
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.h (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.h        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/Source/WebCore/html/HTMLAreaElement.h        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -65,8 +65,7 @@
</span><span class="cx">     void invalidateCachedRegion();
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;Path&gt; m_region;
</span><del>-    std::unique_ptr&lt;Length[]&gt; m_coords;
-    int m_coordsLen;
</del><ins>+    Vector&lt;double&gt; m_coords;
</ins><span class="cx">     LayoutSize m_lastSize;
</span><span class="cx">     Shape m_shape;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &lt;limits&gt;
</span><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><ins>+#include &lt;wtf/dtoa.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -215,6 +216,64 @@
</span><span class="cx">     return signedValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template &lt;typename CharacterType&gt;
+static inline bool isHTMLSpaceOrDelimiter(CharacterType character)
+{
+    return isHTMLSpace(character) || character == ',' || character == ';';
+}
+
+template &lt;typename CharacterType&gt;
+static inline bool isNumberStart(CharacterType character)
+{
+    return isASCIIDigit(character) || character == '.' || character == '-';
+}
+
+// https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-floating-point-number-values
+template &lt;typename CharacterType&gt;
+static Vector&lt;double&gt; parseHTMLListOfOfFloatingPointNumberValuesInternal(const CharacterType* position, const CharacterType* end)
+{
+    Vector&lt;double&gt; numbers;
+
+    // This skips past any leading delimiters.
+    while (position &lt; end &amp;&amp; isHTMLSpaceOrDelimiter(*position))
+        ++position;
+
+    while (position &lt; end) {
+        // This skips past leading garbage.
+        while (position &lt; end &amp;&amp; !(isHTMLSpaceOrDelimiter(*position) || isNumberStart(*position)))
+            ++position;
+
+        const CharacterType* numberStart = position;
+        while (position &lt; end &amp;&amp; !isHTMLSpaceOrDelimiter(*position))
+            ++position;
+
+        size_t parsedLength = 0;
+        double number = parseDouble(numberStart, position - numberStart, parsedLength);
+        numbers.append(parsedLength &gt; 0 &amp;&amp; std::isfinite(number) ? number : 0);
+
+        // This skips past the delimiter.
+        while (position &lt; end &amp;&amp; isHTMLSpaceOrDelimiter(*position))
+            ++position;
+    }
+
+    return numbers;
+}
+
+Vector&lt;double&gt; parseHTMLListOfOfFloatingPointNumberValues(const String&amp; input)
+{
+    unsigned length = input.length();
+    if (!length)
+        return { };
+
+    if (LIKELY(input.is8Bit())) {
+        auto* start = input.characters8();
+        return parseHTMLListOfOfFloatingPointNumberValuesInternal(start, start + length);
+    }
+
+    auto* start = input.characters16();
+    return parseHTMLListOfOfFloatingPointNumberValuesInternal(start, start + length);
+}
+
</ins><span class="cx"> static bool threadSafeEqual(const StringImpl&amp; a, const StringImpl&amp; b)
</span><span class="cx"> {
</span><span class="cx">     if (&amp;a == &amp;b)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.h (205029 => 205030)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-08-26 18:00:28 UTC (rev 205029)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-08-26 18:09:01 UTC (rev 205030)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include &lt;unicode/uchar.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><ins>+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -66,6 +67,9 @@
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-negative-integers
</span><span class="cx"> WEBCORE_EXPORT Optional&lt;int&gt; parseHTMLNonNegativeInteger(const String&amp;);
</span><span class="cx"> 
</span><ins>+// https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-floating-point-number-values
+Vector&lt;double&gt; parseHTMLListOfOfFloatingPointNumberValues(const String&amp;);
+
</ins><span class="cx"> // https://html.spec.whatwg.org/multipage/infrastructure.html#cors-settings-attribute
</span><span class="cx"> String parseCORSSettingsAttribute(const AtomicString&amp;);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>