<!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>[209810] 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/209810">209810</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-12-14 09:37:24 -0800 (Wed, 14 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove Unicode case-insensitive matching for usemap=&quot;&quot;
https://bugs.webkit.org/show_bug.cgi?id=163894

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/semantics/embedded-content/the-img-element/usemap-casing-expected.txt:

Source/WebCore:

Remove Unicode case-insensitive matching for usemap=&quot;&quot; as this no longer
matches the specification [1] or Firefox. Also align our parsing logic for
the usemap attribute to match the specification [2].

This simplifies the code a bit, is more efficient and the compatibility
risk should be low based on Firefox's behavior and Chome's usage data.

[1] https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
[2] https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference

Test: fast/images/image-usemap-parsing.html

* dom/Document.cpp:
(WebCore::Document::addImageElementByUsemap):
(WebCore::Document::removeImageElementByUsemap):
(WebCore::Document::imageElementByUsemap):
* dom/Document.h:
* dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::getElementByUsemap):
* dom/DocumentOrderedMap.h:
* dom/TreeScope.cpp:
(WebCore::TreeScope::getImageMap):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedInto):
(WebCore::HTMLImageElement::removedFrom):
(WebCore::HTMLImageElement::matchesUsemap):
* html/HTMLImageElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
(WebCore::HTMLMapElement::parseAttribute):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLHashNameReference):
* html/parser/HTMLParserIdioms.h:

LayoutTests:

* fast/images/image-map-multiple.html:
Fix case of the usemap.

* fast/images/image-usemap-parsing-expected.txt: Added.
* fast/images/image-usemap-parsing.html: Added.
Add layout test coverage.

* fast/images/imagemap-case.html: Removed.
* platform/efl/fast/images/imagemap-case-expected.png: Removed.
* platform/efl/fast/images/imagemap-case-expected.txt: Removed.
* platform/gtk/fast/images/imagemap-case-expected.png: Removed.
* platform/gtk/fast/images/imagemap-case-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/images/imagemap-case-expected.txt: Removed.
* platform/ios-simulator/fast/images/imagemap-case-expected.txt: Removed.
* platform/mac/fast/images/imagemap-case-expected.png: Removed.
* platform/mac/fast/images/imagemap-case-expected.txt: Removed.
* platform/win/fast/images/imagemap-case-expected.txt: Removed.
Drop outdated pixel test case. Case sensitivity is now covered by
the new fast/images/image-usemap-parsing.html test.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastimagesimagemapmultiplehtml">trunk/LayoutTests/fast/images/image-map-multiple.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsembeddedcontenttheimgelementusemapcasingexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/usemap-casing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk2TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentOrderedMapcpp">trunk/Source/WebCore/dom/DocumentOrderedMap.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentOrderedMaph">trunk/Source/WebCore/dom/DocumentOrderedMap.h</a></li>
<li><a href="#trunkSourceWebCoredomTreeScopecpp">trunk/Source/WebCore/dom/TreeScope.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLImageElementcpp">trunk/Source/WebCore/html/HTMLImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLImageElementh">trunk/Source/WebCore/html/HTMLImageElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMapElementcpp">trunk/Source/WebCore/html/HTMLMapElement.cpp</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>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastimagesimageusemapparsingexpectedtxt">trunk/LayoutTests/fast/images/image-usemap-parsing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastimagesimageusemapparsinghtml">trunk/LayoutTests/fast/images/image-usemap-parsing.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastimagesimagemapcasehtml">trunk/LayoutTests/fast/images/imagemap-case.html</a></li>
<li><a href="#trunkLayoutTestsplatformeflfastimagesimagemapcaseexpectedpng">trunk/LayoutTests/platform/efl/fast/images/imagemap-case-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformeflfastimagesimagemapcaseexpectedtxt">trunk/LayoutTests/platform/efl/fast/images/imagemap-case-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfastimagesimagemapcaseexpectedpng">trunk/LayoutTests/platform/gtk/fast/images/imagemap-case-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfastimagesimagemapcaseexpectedtxt">trunk/LayoutTests/platform/gtk/fast/images/imagemap-case-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastimagesimagemapcaseexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/images/imagemap-case-expected.txt</a></li>
<li>trunk/LayoutTests/platform/ios-simulator-wk2/fast/images/</li>
<li><a href="#trunkLayoutTestsplatformmacfastimagesimagemapcaseexpectedpng">trunk/LayoutTests/platform/mac/fast/images/imagemap-case-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastimagesimagemapcaseexpectedtxt">trunk/LayoutTests/platform/mac/fast/images/imagemap-case-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwinfastimagesimagemapcaseexpectedtxt">trunk/LayoutTests/platform/win/fast/images/imagemap-case-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/ChangeLog        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-12-14  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Remove Unicode case-insensitive matching for usemap=&quot;&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=163894
+
+        Reviewed by Antti Koivisto.
+
+        * fast/images/image-map-multiple.html:
+        Fix case of the usemap.
+
+        * fast/images/image-usemap-parsing-expected.txt: Added.
+        * fast/images/image-usemap-parsing.html: Added.
+        Add layout test coverage.
+
+        * fast/images/imagemap-case.html: Removed.
+        * platform/efl/fast/images/imagemap-case-expected.png: Removed.
+        * platform/efl/fast/images/imagemap-case-expected.txt: Removed.
+        * platform/gtk/fast/images/imagemap-case-expected.png: Removed.
+        * platform/gtk/fast/images/imagemap-case-expected.txt: Removed.
+        * platform/ios-simulator-wk2/fast/images/imagemap-case-expected.txt: Removed.
+        * platform/ios-simulator/fast/images/imagemap-case-expected.txt: Removed.
+        * platform/mac/fast/images/imagemap-case-expected.png: Removed.
+        * platform/mac/fast/images/imagemap-case-expected.txt: Removed.
+        * platform/win/fast/images/imagemap-case-expected.txt: Removed.
+        Drop outdated pixel test case. Case sensitivity is now covered by
+        the new fast/images/image-usemap-parsing.html test.
+
</ins><span class="cx"> 2016-12-14  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Remove WebkitCSSTransformValue
</span></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapmultiplehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/images/image-map-multiple.html (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-map-multiple.html        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/fast/images/image-map-multiple.html        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;body onload=&quot;runTest()&quot;&gt;
</span><del>-&lt;map name=&quot;mapName&quot;&gt;&lt;area shape=rect coords=&quot;0,0,100,100&quot; onclick=&quot;setResult('1')&quot;&gt;&lt;/map&gt;
</del><ins>+&lt;map name=&quot;mapname&quot;&gt;&lt;area shape=rect coords=&quot;0,0,100,100&quot; onclick=&quot;setResult('1')&quot;&gt;&lt;/map&gt;
</ins><span class="cx"> &lt;map name=&quot;mapname&quot;&gt;&lt;area shape=rect coords=&quot;0,0,100,100&quot; onclick=&quot;setResult('2')&quot;&gt;&lt;/map&gt;
</span><span class="cx"> &lt;map name=&quot;mapname&quot;&gt;&lt;area shape=rect coords=&quot;0,0,100,100&quot; onclick=&quot;setResult('3')&quot;&gt;&lt;/map&gt;
</span><span class="cx"> &lt;img src=&quot;resources/green.jpg&quot; border=20 width=100 height=100 usemap=&quot;#mapname&quot; ismap onclick=&quot;setResult('img')&quot;&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastimagesimageusemapparsingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-usemap-parsing-expected.txt (0 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-usemap-parsing-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/images/image-usemap-parsing-expected.txt        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+ 
+Tests that usemap attribute parsing logic.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+usemap=#navmap
+PASS areaWasClicked is true
+
+usemap=navmap
+PASS areaWasClicked is false
+
+usemap=#navMap
+PASS areaWasClicked is false
+
+usemap=foo#navmap
+PASS areaWasClicked is true
+
+usemap=foo#navmap2
+PASS areaWasClicked is false
+
+usemap=navmap#
+PASS areaWasClicked is false
+
+usemap=navmap#bar
+PASS areaWasClicked is false
+
+usemap=#
+PASS areaWasClicked is false
+
+usemap=
+PASS areaWasClicked is false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesimageusemapparsinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/image-usemap-parsing.html (0 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/image-usemap-parsing.html                                (rev 0)
+++ trunk/LayoutTests/fast/images/image-usemap-parsing.html        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;map name=&quot;navmap&quot;&gt;
+&lt;area id=&quot;testArea&quot; shape=rect coords=&quot;0,0,100,100&quot; href=&quot;#&quot;&gt; 
+&lt;/map&gt;
+&lt;img id=&quot;testImage&quot; border=2 width=100 height=100 ismap&gt;
+&lt;div id=&quot;description&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+description(&quot;Tests that usemap attribute parsing logic.&quot;);
+
+var areaWasClicked = false;
+document.getElementById(&quot;testArea&quot;).onclick = function() {
+    areaWasClicked = true;
+};
+
+function testUsemapAttribute(usemap, shouldMatch)
+{
+    debug(&quot;usemap=&quot; + usemap);
+    document.getElementById(&quot;testImage&quot;).setAttribute(&quot;usemap&quot;, usemap);
+
+    areaWasClicked = false;
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(50, 50);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+    shouldBe(&quot;areaWasClicked&quot;, &quot;&quot; + shouldMatch);
+    debug(&quot;&quot;);
+}
+
+testUsemapAttribute(&quot;#navmap&quot;, true);
+testUsemapAttribute(&quot;navmap&quot;, false);
+testUsemapAttribute(&quot;#navMap&quot;, false);
+testUsemapAttribute(&quot;foo#navmap&quot;, true);
+testUsemapAttribute(&quot;foo#navmap2&quot;, false);
+testUsemapAttribute(&quot;navmap#&quot;, false);
+testUsemapAttribute(&quot;navmap#bar&quot;, false);
+testUsemapAttribute(&quot;#&quot;, false);
+testUsemapAttribute(&quot;&quot;, false);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesimagemapcasehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/images/imagemap-case.html (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/imagemap-case.html        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/fast/images/imagemap-case.html        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML&gt;
-&lt;html&gt;
-&lt;body&gt;
-&lt;map name=&quot;navMap&quot;&gt;
-&lt;area shape=rect coords=&quot;0,0,100,100&quot; href onclick=&quot;document.getElementById('res1').innerHTML = 'success';return false;&quot;&gt; 
-&lt;/map&gt;
-&lt;img border=2 width=100 height=100 usemap=#navmap ismap&gt;
-
-&lt;br&gt;
-
-&lt;map name=&quot;navmap2&quot;&gt;
-&lt;area shape=rect coords=&quot;0,0,100,100&quot; href onclick=&quot;document.getElementById('res2').innerHTML = 'success';return false;&quot;&gt; 
-&lt;/map&gt;
-&lt;img border=2 width=100 height=100 usemap=#navMap2 ismap&gt;
-
-&lt;div id=res1&gt;&lt;/div&gt;
-&lt;div id=res2&gt;&lt;/div&gt;
-
-&lt;script&gt;
-    if (window.eventSender) {
-        eventSender.mouseMoveTo(50, 50);
-        eventSender.mouseDown();
-        eventSender.mouseUp();
-        eventSender.mouseMoveTo(50, 150);
-        eventSender.mouseDown();
-        eventSender.mouseUp();
-    }    
-&lt;/script&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-12-14  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Remove Unicode case-insensitive matching for usemap=&quot;&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=163894
+
+        Reviewed by Antti Koivisto.
+
+        Rebaseline W3C test now that more checks are passing.
+
+        * web-platform-tests/html/semantics/embedded-content/the-img-element/usemap-casing-expected.txt:
+
</ins><span class="cx"> 2016-12-14  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Test infrastructure should allow to filter out text output before doing a comparison with the baseline
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsembeddedcontenttheimgelementusemapcasingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/usemap-casing-expected.txt (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/usemap-casing-expected.txt        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/usemap-casing-expected.txt        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Image with usemap of #sanityCheck should match the area with map named sanityCheck 
</span><del>-FAIL Image with usemap of #sImPlE should not match any of the areas assert_equals: The element retrieved must be the image, not an area; used &lt;map&gt; with name &quot;simple&quot; expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#sImPlE&quot; width... but got Element node &lt;area shape=&quot;rect&quot; coords=&quot;0,0,300,300&quot;&gt;&lt;/area&gt;
-FAIL Image with usemap of #paSSfield-killroyß should not match any of the areas assert_equals: The element retrieved must be the image, not an area; used &lt;map&gt; with name &quot;passfield-killroyß&quot; expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#paSSfield-kil... but got Element node &lt;area shape=&quot;rect&quot; coords=&quot;0,0,300,300&quot;&gt;&lt;/area&gt;
-FAIL Image with usemap of #глупый should not match any of the areas assert_equals: The element retrieved must be the image, not an area; used &lt;map&gt; with name &quot;ГЛУПЫЙ&quot; expected Element node &lt;img src=&quot;/images/threecolors.png&quot; usemap=&quot;#глупый&quot; width... but got Element node &lt;area shape=&quot;rect&quot; coords=&quot;0,0,300,300&quot;&gt;&lt;/area&gt;
</del><ins>+PASS Image with usemap of #sImPlE should not match any of the areas 
+PASS Image with usemap of #paSSfield-killroyß should not match any of the areas 
+PASS Image with usemap of #глупый should not match any of the areas 
</ins><span class="cx"> FAIL Image with usemap of #åωk should not match any of the areas null is not an object (evaluating 'element.parentElement')
</span><span class="cx"> FAIL Image with usemap of #blah1 should not match any of the areas null is not an object (evaluating 'element.parentElement')
</span><span class="cx"> FAIL Image with usemap of #tÉdz5アパートFi should not match any of the areas null is not an object (evaluating 'element.parentElement')
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflfastimagesimagemapcaseexpectedpng"></a>
<div class="binary"><h4>Deleted: trunk/LayoutTests/platform/efl/fast/images/imagemap-case-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflfastimagesimagemapcaseexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/efl/fast/images/imagemap-case-expected.txt (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/fast/images/imagemap-case-expected.txt        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/platform/efl/fast/images/imagemap-case-expected.txt        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x268
-  RenderBlock {HTML} at (0,0) size 800x268
-    RenderBody {BODY} at (8,8) size 784x252
-      RenderBlock (anonymous) at (0,0) size 784x216
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,0) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (104,90) size 4x17
-          text run at (104,90) width 4: &quot; &quot;
-        RenderBR {BR} at (0,0) size 0x0
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,108) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,216) size 784x18
-        RenderText {#text} at (0,0) size 47x17
-          text run at (0,0) width 47: &quot;success&quot;
-      RenderBlock {DIV} at (0,234) size 784x18
-        RenderText {#text} at (0,0) size 47x17
-          text run at (0,0) width 47: &quot;success&quot;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfastimagesimagemapcaseexpectedpng"></a>
<div class="binary"><h4>Deleted: trunk/LayoutTests/platform/gtk/fast/images/imagemap-case-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfastimagesimagemapcaseexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/gtk/fast/images/imagemap-case-expected.txt (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/images/imagemap-case-expected.txt        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/platform/gtk/fast/images/imagemap-case-expected.txt        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x264
-  RenderBlock {HTML} at (0,0) size 800x264
-    RenderBody {BODY} at (8,8) size 784x248
-      RenderBlock (anonymous) at (0,0) size 784x214
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,0) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (104,90) size 4x17
-          text run at (104,90) width 4: &quot; &quot;
-        RenderBR {BR} at (0,0) size 0x0
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,107) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,214) size 784x17
-        RenderText {#text} at (0,0) size 47x17
-          text run at (0,0) width 47: &quot;success&quot;
-      RenderBlock {DIV} at (0,231) size 784x17
-        RenderText {#text} at (0,0) size 47x17
-          text run at (0,0) width 47: &quot;success&quot;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastimagesimagemapcaseexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-simulator/fast/images/imagemap-case-expected.txt (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/images/imagemap-case-expected.txt        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/platform/ios-simulator/fast/images/imagemap-case-expected.txt        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x274
-  RenderBlock {HTML} at (0,0) size 800x274
-    RenderBody {BODY} at (8,8) size 784x258
-      RenderBlock (anonymous) at (0,0) size 784x218
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,0) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (104,89) size 4x19
-          text run at (104,89) width 4: &quot; &quot;
-        RenderBR {BR} at (0,0) size 0x0
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,109) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,218) size 784x20
-        RenderText {#text} at (0,0) size 48x19
-          text run at (0,0) width 48: &quot;success&quot;
-      RenderBlock {DIV} at (0,238) size 784x20
-        RenderText {#text} at (0,0) size 48x19
-          text run at (0,0) width 48: &quot;success&quot;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1777,6 +1777,7 @@
</span><span class="cx"> fast/loader/location-hash-user-gesture.html [ Skip ]
</span><span class="cx"> imported/blink/editing/selection/selectstart-event-crash.html [ Skip ]
</span><span class="cx"> fast/dom/Window/post-message-user-action.html [ Skip ]
</span><ins>+fast/images/image-usemap-parsing.html [ Skip ]
</ins><span class="cx"> fast/shadow-dom/click-on-slotted-anchor-with-hover.html [ Skip ]
</span><span class="cx"> fast/shadow-dom/click-text-inside-linked-slot.html [ Skip ]
</span><span class="cx"> fast/shadow-dom/fullscreen-in-shadow-fullscreenElement.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastimagesimagemapcaseexpectedpng"></a>
<div class="binary"><h4>Deleted: trunk/LayoutTests/platform/mac/fast/images/imagemap-case-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastimagesimagemapcaseexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac/fast/images/imagemap-case-expected.txt (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/images/imagemap-case-expected.txt        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/platform/mac/fast/images/imagemap-case-expected.txt        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x268
-  RenderBlock {HTML} at (0,0) size 800x268
-    RenderBody {BODY} at (8,8) size 784x252
-      RenderBlock (anonymous) at (0,0) size 784x216
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,0) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (104,90) size 4x18
-          text run at (104,90) width 4: &quot; &quot;
-        RenderBR {BR} at (0,0) size 0x0
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,108) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,216) size 784x18
-        RenderText {#text} at (0,0) size 48x18
-          text run at (0,0) width 48: &quot;success&quot;
-      RenderBlock {DIV} at (0,234) size 784x18
-        RenderText {#text} at (0,0) size 48x18
-          text run at (0,0) width 48: &quot;success&quot;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformwinfastimagesimagemapcaseexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/win/fast/images/imagemap-case-expected.txt (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/fast/images/imagemap-case-expected.txt        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/LayoutTests/platform/win/fast/images/imagemap-case-expected.txt        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x268
-  RenderBlock {HTML} at (0,0) size 800x268
-    RenderBody {BODY} at (8,8) size 784x252
-      RenderBlock (anonymous) at (0,0) size 784x216
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,0) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (104,90) size 4x18
-          text run at (104,90) width 4: &quot; &quot;
-        RenderBR {BR} at (0,0) size 0x0
-        RenderInline {MAP} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-        RenderImage {IMG} at (0,108) size 104x104 [border: (2px solid #000000)]
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {DIV} at (0,216) size 784x18
-        RenderText {#text} at (0,0) size 47x18
-          text run at (0,0) width 47: &quot;success&quot;
-      RenderBlock {DIV} at (0,234) size 784x18
-        RenderText {#text} at (0,0) size 47x18
-          text run at (0,0) width 47: &quot;success&quot;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/ChangeLog        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-12-14  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Remove Unicode case-insensitive matching for usemap=&quot;&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=163894
+
+        Reviewed by Antti Koivisto.
+
+        Remove Unicode case-insensitive matching for usemap=&quot;&quot; as this no longer
+        matches the specification [1] or Firefox. Also align our parsing logic for
+        the usemap attribute to match the specification [2].
+
+        This simplifies the code a bit, is more efficient and the compatibility
+        risk should be low based on Firefox's behavior and Chome's usage data.
+
+        [1] https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
+        [2] https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference
+
+        Test: fast/images/image-usemap-parsing.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::addImageElementByUsemap):
+        (WebCore::Document::removeImageElementByUsemap):
+        (WebCore::Document::imageElementByUsemap):
+        * dom/Document.h:
+        * dom/DocumentOrderedMap.cpp:
+        (WebCore::DocumentOrderedMap::getElementByUsemap):
+        * dom/DocumentOrderedMap.h:
+        * dom/TreeScope.cpp:
+        (WebCore::TreeScope::getImageMap):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::parseAttribute):
+        (WebCore::HTMLImageElement::insertedInto):
+        (WebCore::HTMLImageElement::removedFrom):
+        (WebCore::HTMLImageElement::matchesUsemap):
+        * html/HTMLImageElement.h:
+        * html/HTMLMapElement.cpp:
+        (WebCore::HTMLMapElement::imageElement):
+        (WebCore::HTMLMapElement::parseAttribute):
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::parseHTMLHashNameReference):
+        * html/parser/HTMLParserIdioms.h:
+
</ins><span class="cx"> 2016-12-14  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Attempt to fix the Windows build after r209805.
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -749,19 +749,19 @@
</span><span class="cx">     m_elementsByAccessKey.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::addImageElementByCaseFoldedUsemap(const AtomicStringImpl&amp; name, HTMLImageElement&amp; element)
</del><ins>+void Document::addImageElementByUsemap(const AtomicStringImpl&amp; name, HTMLImageElement&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     return m_imagesByUsemap.add(name, element, *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::removeImageElementByCaseFoldedUsemap(const AtomicStringImpl&amp; name, HTMLImageElement&amp; element)
</del><ins>+void Document::removeImageElementByUsemap(const AtomicStringImpl&amp; name, HTMLImageElement&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     return m_imagesByUsemap.remove(name, element);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLImageElement* Document::imageElementByCaseFoldedUsemap(const AtomicStringImpl&amp; name) const
</del><ins>+HTMLImageElement* Document::imageElementByUsemap(const AtomicStringImpl&amp; name) const
</ins><span class="cx"> {
</span><del>-    return m_imagesByUsemap.getElementByCaseFoldedUsemap(name, *this);
</del><ins>+    return m_imagesByUsemap.getElementByUsemap(name, *this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;SelectorQuery&amp;&gt; Document::selectorQueryForString(const String&amp; selectorString)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/dom/Document.h        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -343,9 +343,9 @@
</span><span class="cx">     Element* getElementByAccessKey(const String&amp; key);
</span><span class="cx">     void invalidateAccessKeyMap();
</span><span class="cx"> 
</span><del>-    void addImageElementByCaseFoldedUsemap(const AtomicStringImpl&amp;, HTMLImageElement&amp;);
-    void removeImageElementByCaseFoldedUsemap(const AtomicStringImpl&amp;, HTMLImageElement&amp;);
-    HTMLImageElement* imageElementByCaseFoldedUsemap(const AtomicStringImpl&amp;) const;
</del><ins>+    void addImageElementByUsemap(const AtomicStringImpl&amp;, HTMLImageElement&amp;);
+    void removeImageElementByUsemap(const AtomicStringImpl&amp;, HTMLImageElement&amp;);
+    HTMLImageElement* imageElementByUsemap(const AtomicStringImpl&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     ExceptionOr&lt;SelectorQuery&amp;&gt; selectorQueryForString(const String&amp;);
</span><span class="cx">     void clearSelectorQueryCache();
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentOrderedMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentOrderedMap.cpp (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentOrderedMap.cpp        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/dom/DocumentOrderedMap.cpp        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -149,18 +149,11 @@
</span><span class="cx">     }));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLMapElement* DocumentOrderedMap::getElementByCaseFoldedMapName(const AtomicStringImpl&amp; key, const TreeScope&amp; scope) const
</del><ins>+HTMLImageElement* DocumentOrderedMap::getElementByUsemap(const AtomicStringImpl&amp; key, const TreeScope&amp; scope) const
</ins><span class="cx"> {
</span><del>-    return downcast&lt;HTMLMapElement&gt;(get(key, scope, [] (const AtomicStringImpl&amp; key, const Element&amp; element) {
-        return is&lt;HTMLMapElement&gt;(element) &amp;&amp; equal(downcast&lt;HTMLMapElement&gt;(element).getName().string().foldCase().impl(), &amp;key);
-    }));
-}
-
-HTMLImageElement* DocumentOrderedMap::getElementByCaseFoldedUsemap(const AtomicStringImpl&amp; key, const TreeScope&amp; scope) const
-{
</del><span class="cx">     return downcast&lt;HTMLImageElement&gt;(get(key, scope, [] (const AtomicStringImpl&amp; key, const Element&amp; element) {
</span><span class="cx">         // FIXME: HTML5 specification says we should match both image and object elements.
</span><del>-        return is&lt;HTMLImageElement&gt;(element) &amp;&amp; downcast&lt;HTMLImageElement&gt;(element).matchesCaseFoldedUsemap(key);
</del><ins>+        return is&lt;HTMLImageElement&gt;(element) &amp;&amp; downcast&lt;HTMLImageElement&gt;(element).matchesUsemap(key);
</ins><span class="cx">     }));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentOrderedMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentOrderedMap.h (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentOrderedMap.h        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/dom/DocumentOrderedMap.h        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -58,8 +58,7 @@
</span><span class="cx">     Element* getElementById(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</span><span class="cx">     Element* getElementByName(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</span><span class="cx">     HTMLMapElement* getElementByMapName(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</span><del>-    HTMLMapElement* getElementByCaseFoldedMapName(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
-    HTMLImageElement* getElementByCaseFoldedUsemap(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</del><ins>+    HTMLImageElement* getElementByUsemap(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</ins><span class="cx">     HTMLLabelElement* getElementByLabelForAttribute(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</span><span class="cx">     Element* getElementByWindowNamedItem(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</span><span class="cx">     Element* getElementByDocumentNamedItem(const AtomicStringImpl&amp;, const TreeScope&amp;) const;
</span></span></pre></div>
<a id="trunkSourceWebCoredomTreeScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TreeScope.cpp (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TreeScope.cpp        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/dom/TreeScope.cpp        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -248,8 +248,6 @@
</span><span class="cx">     String name = url.substring(hashPosition + 1);
</span><span class="cx">     if (name.isEmpty())
</span><span class="cx">         return nullptr;
</span><del>-    if (m_rootNode.document().isHTMLDocument())
-        return m_imageMapsByName-&gt;getElementByCaseFoldedMapName(*AtomicString(name.foldCase()).impl(), *this);
</del><span class="cx">     return m_imageMapsByName-&gt;getElementByMapName(*AtomicString(name).impl(), *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLImageElement.cpp        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -206,20 +206,13 @@
</span><span class="cx">     } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr)
</span><span class="cx">         selectImageSource();
</span><span class="cx">     else if (name == usemapAttr) {
</span><del>-        if (inDocument() &amp;&amp; !m_caseFoldedUsemap.isNull())
-            document().removeImageElementByCaseFoldedUsemap(*m_caseFoldedUsemap.impl(), *this);
</del><ins>+        if (inDocument() &amp;&amp; !m_parsedUsemap.isNull())
+            document().removeImageElementByUsemap(*m_parsedUsemap.impl(), *this);
</ins><span class="cx"> 
</span><del>-        // The HTMLImageElement's useMap() value includes the '#' symbol at the beginning, which has to be stripped off.
-        // FIXME: We should check that the first character is '#'.
-        // FIXME: HTML specification says we should strip any leading string before '#'.
-        // FIXME: HTML specification says we should ignore usemap attributes without '#'.
-        if (value.length() &gt; 1)
-            m_caseFoldedUsemap = value.string().substring(1).foldCase();
-        else
-            m_caseFoldedUsemap = nullAtom;
</del><ins>+        m_parsedUsemap = parseHTMLHashNameReference(value);
</ins><span class="cx"> 
</span><del>-        if (inDocument() &amp;&amp; !m_caseFoldedUsemap.isNull())
-            document().addImageElementByCaseFoldedUsemap(*m_caseFoldedUsemap.impl(), *this);
</del><ins>+        if (inDocument() &amp;&amp; !m_parsedUsemap.isNull())
+            document().addImageElementByUsemap(*m_parsedUsemap.impl(), *this);
</ins><span class="cx">     } else if (name == compositeAttr) {
</span><span class="cx">         // FIXME: images don't support blend modes in their compositing attribute.
</span><span class="cx">         BlendMode blendOp = BlendModeNormal;
</span><span class="lines">@@ -322,8 +315,8 @@
</span><span class="cx">     // in callbacks back to this node.
</span><span class="cx">     Node::InsertionNotificationRequest insertNotificationRequest = HTMLElement::insertedInto(insertionPoint);
</span><span class="cx"> 
</span><del>-    if (insertionPoint.inDocument() &amp;&amp; !m_caseFoldedUsemap.isNull())
-        document().addImageElementByCaseFoldedUsemap(*m_caseFoldedUsemap.impl(), *this);
</del><ins>+    if (insertionPoint.inDocument() &amp;&amp; !m_parsedUsemap.isNull())
+        document().addImageElementByUsemap(*m_parsedUsemap.impl(), *this);
</ins><span class="cx"> 
</span><span class="cx">     if (is&lt;HTMLPictureElement&gt;(parentNode())) {
</span><span class="cx">         setPictureElement(&amp;downcast&lt;HTMLPictureElement&gt;(*parentNode()));
</span><span class="lines">@@ -343,8 +336,8 @@
</span><span class="cx">     if (m_form)
</span><span class="cx">         m_form-&gt;removeImgElement(this);
</span><span class="cx"> 
</span><del>-    if (insertionPoint.inDocument() &amp;&amp; !m_caseFoldedUsemap.isNull())
-        document().removeImageElementByCaseFoldedUsemap(*m_caseFoldedUsemap.impl(), *this);
</del><ins>+    if (insertionPoint.inDocument() &amp;&amp; !m_parsedUsemap.isNull())
+        document().removeImageElementByUsemap(*m_parsedUsemap.impl(), *this);
</ins><span class="cx">     
</span><span class="cx">     if (is&lt;HTMLPictureElement&gt;(parentNode()))
</span><span class="cx">         setPictureElement(nullptr);
</span><span class="lines">@@ -482,10 +475,9 @@
</span><span class="cx">     return HTMLElement::completeURLsInAttributeValue(base, attribute);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool HTMLImageElement::matchesCaseFoldedUsemap(const AtomicStringImpl&amp; name) const
</del><ins>+bool HTMLImageElement::matchesUsemap(const AtomicStringImpl&amp; name) const
</ins><span class="cx"> {
</span><del>-    ASSERT(String(&amp;const_cast&lt;AtomicStringImpl&amp;&gt;(name)).foldCase().impl() == &amp;name);
-    return m_caseFoldedUsemap.impl() == &amp;name;
</del><ins>+    return m_parsedUsemap.impl() == &amp;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AtomicString&amp; HTMLImageElement::alt() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLImageElement.h (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLImageElement.h        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/html/HTMLImageElement.h        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setLoadManually(bool loadManually) { m_imageLoader.setLoadManually(loadManually); }
</span><span class="cx"> 
</span><del>-    bool matchesCaseFoldedUsemap(const AtomicStringImpl&amp;) const;
</del><ins>+    bool matchesUsemap(const AtomicStringImpl&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT const AtomicString&amp; alt() const;
</span><span class="cx"> 
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">     CompositeOperator m_compositeOperator;
</span><span class="cx">     AtomicString m_bestFitImageURL;
</span><span class="cx">     AtomicString m_currentSrc;
</span><del>-    AtomicString m_caseFoldedUsemap;
</del><ins>+    AtomicString m_parsedUsemap;
</ins><span class="cx">     float m_imageDevicePixelRatio;
</span><span class="cx">     bool m_experimentalImageMenuEnabled;
</span><span class="cx">     bool m_hadNameBeforeAttributeChanged { false }; // FIXME: We only need this because parseAttribute() can't see the old value.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMapElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMapElement.cpp (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMapElement.cpp        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/html/HTMLMapElement.cpp        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_name.isEmpty())
</span><span class="cx">         return nullptr;
</span><del>-    return document().imageElementByCaseFoldedUsemap(*AtomicString(m_name.string().foldCase()).impl());
</del><ins>+    return document().imageElementByUsemap(*m_name.impl());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMapElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">         String mapName = value;
</span><span class="cx">         if (mapName[0] == '#')
</span><span class="cx">             mapName = mapName.substring(1);
</span><del>-        m_name = document().isHTMLDocument() ? mapName.foldCase() : mapName;
</del><ins>+        m_name = mapName;
</ins><span class="cx">         if (inDocument())
</span><span class="cx">             treeScope().addImageMap(*this);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -455,4 +455,13 @@
</span><span class="cx">     return parseHTTPRefreshInternal(start, start + input.length(), delay, url);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference
+AtomicString parseHTMLHashNameReference(StringView usemap)
+{
+    size_t numberSignIndex = usemap.find('#');
+    if (numberSignIndex == notFound)
+        return nullAtom;
+    return usemap.substring(numberSignIndex + 1).toAtomicString();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.h (209809 => 209810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-12-14 17:28:16 UTC (rev 209809)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-12-14 17:37:24 UTC (rev 209810)
</span><span class="lines">@@ -84,6 +84,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool threadSafeMatch(const QualifiedName&amp;, const QualifiedName&amp;);
</span><span class="cx"> 
</span><ins>+AtomicString parseHTMLHashNameReference(StringView);
+
</ins><span class="cx"> // Inline implementations of some of the functions declared above.
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename CharacterType&gt; inline bool isHTMLSpace(CharacterType character)
</span></span></pre>
</div>
</div>

</body>
</html>