<!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>[175213] 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/175213">175213</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-26 21:28:48 -0700 (Sun, 26 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Images with usemap should not have a link state
https://bugs.webkit.org/show_bug.cgi?id=138071

Reviewed by Andreas Kling.

Source/WebCore:

Image tags were incorrectly getting a link state if a usemap is defined.
The &lt;area&gt; of the usemap is supposed to get the link state, but never the image.

Unfortunately, the Accessibility code was relying on the wrong behavior
to set the ImageMapRole, most of the patch is updating that code to get
the correct role without the link state.

Test: fast/selectors/images-with-usemap-should-not-match-link.html

The accessibility code is covered by a few tests in accessibility/.
The test accessibility/aria-used-on-image-maps.html ensure the &lt;area&gt;
elements also get the correct role.

* dom/Node.h:
(WebCore::Node::setIsLink):
(WebCore::Node::clearIsLink): Deleted.
Unused code.

(WebCore::Node::isLink):
Move with its setter for clarity.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
This is the bug.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
Here the branches for the role ImageMap where behind isLink() which would
never be valid after the fix.

My fix here was to use the same definition previously set by HTMLImageElement::parseAttribute(),
any usemap attribute qualifies the node for ImageMapRole.

(WebCore::AccessibilityRenderObject::anchorElement):
(WebCore::AccessibilityRenderObject::linkedUIElements):
(WebCore::AccessibilityRenderObject::url):

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isAnchor): Deleted.
Something funny I discovered is the Accessibility code worked around the bug
by defining isAnchor() that exclude images from isLink().

Since isLink() will no longer be true for images, the hack can be removed.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::anchorElement):
(WebCore::AccessibilityNodeObject::isAnchor): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):

LayoutTests:

* fast/selectors/images-with-usemap-should-not-match-link-expected.txt: Added.
* fast/selectors/images-with-usemap-should-not-match-link.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjecth">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLImageElementcpp">trunk/Source/WebCore/html/HTMLImageElement.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastselectorsimageswithusemapshouldnotmatchlinkexpectedtxt">trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsimageswithusemapshouldnotmatchlinkhtml">trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/LayoutTests/ChangeLog        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-10-26  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Images with usemap should not have a link state
+        https://bugs.webkit.org/show_bug.cgi?id=138071
+
+        Reviewed by Andreas Kling.
+
+        * fast/selectors/images-with-usemap-should-not-match-link-expected.txt: Added.
+        * fast/selectors/images-with-usemap-should-not-match-link.html: Added.
+
</ins><span class="cx"> 2014-10-25  Gwang Yoon Hwang  &lt;yoon@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Unreviewed GTK gardening after r174685.
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsimageswithusemapshouldnotmatchlinkexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link-expected.txt (0 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link-expected.txt        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+WebKit had a bug where &lt;img&gt; tag would get a link status whenever usemap was defined.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.querySelectorAll(&quot;testcases img&quot;)[0].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[0].matches(&quot;:-webkit-any-link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[1].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[1].matches(&quot;:-webkit-any-link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[2].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[2].matches(&quot;:-webkit-any-link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[3].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[3].matches(&quot;:-webkit-any-link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[4].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[4].matches(&quot;:-webkit-any-link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[5].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[5].matches(&quot;:-webkit-any-link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[6].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[6].matches(&quot;:-webkit-any-link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[7].matches(&quot;:link&quot;) is false
+PASS document.querySelectorAll(&quot;testcases img&quot;)[7].matches(&quot;:-webkit-any-link&quot;) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsimageswithusemapshouldnotmatchlinkhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link.html (0 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/images-with-usemap-should-not-match-link.html        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;testcases style=&quot;display:none&quot;&gt;
+        &lt;map name=&quot;testmap&quot;&gt;
+            &lt;area shape=&quot;circle&quot; coords=&quot;200,250,25&quot; href=&quot;another.htm&quot; /&gt;
+            &lt;area shape=&quot;default&quot; /&gt;
+        &lt;/map&gt;
+
+        &lt;img&gt;
+        &lt;img src=&quot;webkit.png&quot;&gt;
+        &lt;img src=&quot;webkit.png&quot; usemap&gt;
+        &lt;img src=&quot;webkit.png&quot; usemap=&quot;&quot;&gt;
+        &lt;img src=&quot;webkit.png&quot; usemap=&quot;notthere&quot;&gt;
+        &lt;img src=&quot;webkit.png&quot; usemap=&quot;#notthere&quot;&gt;
+        &lt;img src=&quot;webkit.png&quot; usemap=&quot;testmap&quot;&gt;
+        &lt;img src=&quot;webkit.png&quot; usemap=&quot;#testmap&quot;&gt;
+    &lt;testcases&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('WebKit had a bug where &amp;lt;img&amp;gt; tag would get a link status whenever usemap was defined.');
+
+var testCaseCount = document.querySelectorAll('testcases img').length;
+for (var i = 0; i &lt; testCaseCount; ++i) {
+    shouldBeFalse('document.querySelectorAll(&quot;testcases img&quot;)[' + i + '].matches(&quot;:link&quot;)');
+    shouldBeFalse('document.querySelectorAll(&quot;testcases img&quot;)[' + i + '].matches(&quot;:-webkit-any-link&quot;)');
+}
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/ChangeLog        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -1,5 +1,63 @@
</span><span class="cx"> 2014-10-26  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        Images with usemap should not have a link state
+        https://bugs.webkit.org/show_bug.cgi?id=138071
+
+        Reviewed by Andreas Kling.
+
+        Image tags were incorrectly getting a link state if a usemap is defined.
+        The &lt;area&gt; of the usemap is supposed to get the link state, but never the image.
+
+        Unfortunately, the Accessibility code was relying on the wrong behavior
+        to set the ImageMapRole, most of the patch is updating that code to get
+        the correct role without the link state.
+
+        Test: fast/selectors/images-with-usemap-should-not-match-link.html
+
+        The accessibility code is covered by a few tests in accessibility/.
+        The test accessibility/aria-used-on-image-maps.html ensure the &lt;area&gt;
+        elements also get the correct role.
+
+        * dom/Node.h:
+        (WebCore::Node::setIsLink):
+        (WebCore::Node::clearIsLink): Deleted.
+        Unused code.
+
+        (WebCore::Node::isLink):
+        Move with its setter for clarity.
+
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::parseAttribute):
+        This is the bug.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        Here the branches for the role ImageMap where behind isLink() which would
+        never be valid after the fix.
+
+        My fix here was to use the same definition previously set by HTMLImageElement::parseAttribute(),
+        any usemap attribute qualifies the node for ImageMapRole.
+
+        (WebCore::AccessibilityRenderObject::anchorElement):
+        (WebCore::AccessibilityRenderObject::linkedUIElements):
+        (WebCore::AccessibilityRenderObject::url):
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::isAnchor): Deleted.
+        Something funny I discovered is the Accessibility code worked around the bug
+        by defining isAnchor() that exclude images from isLink().
+
+        Since isLink() will no longer be true for images, the hack can be removed.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::anchorElement):
+        (WebCore::AccessibilityNodeObject::isAnchor): Deleted.
+        * accessibility/AccessibilityNodeObject.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+
+2014-10-26  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
</ins><span class="cx">         Replace Element::didAffectSelector() by setNeedsStyleRecalc()
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=138080
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -454,11 +454,6 @@
</span><span class="cx">     return isNativeImage() &amp;&amp; isButton();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool AccessibilityNodeObject::isAnchor() const
-{
-    return !isNativeImage() &amp;&amp; isLink();
-}
-
</del><span class="cx"> bool AccessibilityNodeObject::isNativeTextControl() const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><span class="lines">@@ -957,7 +952,7 @@
</span><span class="cx">     // search up the DOM tree for an anchor element
</span><span class="cx">     // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElement
</span><span class="cx">     for ( ; node; node = node-&gt;parentNode()) {
</span><del>-        if (is&lt;HTMLAnchorElement&gt;(*node) || (node-&gt;renderer() &amp;&amp; cache-&gt;getOrCreate(node-&gt;renderer())-&gt;isAnchor()))
</del><ins>+        if (is&lt;HTMLAnchorElement&gt;(*node) || (node-&gt;renderer() &amp;&amp; cache-&gt;getOrCreate(node-&gt;renderer())-&gt;isLink()))
</ins><span class="cx">             return downcast&lt;Element&gt;(node);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -73,7 +73,6 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool canvasHasFallbackContent() const override;
</span><span class="cx"> 
</span><del>-    virtual bool isAnchor() const override;
</del><span class="cx">     virtual bool isControl() const override;
</span><span class="cx">     virtual bool isFieldset() const override;
</span><span class="cx">     virtual bool isGroup() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -444,8 +444,7 @@
</span><span class="cx">     virtual bool isAccessibilitySVGRoot() const { return false; }
</span><span class="cx"> 
</span><span class="cx">     bool accessibilityObjectContainsText(String *) const;
</span><del>-    
-    virtual bool isAnchor() const { return false; }
</del><ins>+
</ins><span class="cx">     virtual bool isAttachment() const { return false; }
</span><span class="cx">     virtual bool isHeading() const { return false; }
</span><span class="cx">     virtual bool isLink() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -571,7 +571,7 @@
</span><span class="cx">     // search up the DOM tree for an anchor element
</span><span class="cx">     // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElement
</span><span class="cx">     for (Node* node = currentRenderer-&gt;node(); node; node = node-&gt;parentNode()) {
</span><del>-        if (is&lt;HTMLAnchorElement&gt;(*node) || (node-&gt;renderer() &amp;&amp; cache-&gt;getOrCreate(node-&gt;renderer())-&gt;isAnchor()))
</del><ins>+        if (is&lt;HTMLAnchorElement&gt;(*node) || (node-&gt;renderer() &amp;&amp; cache-&gt;getOrCreate(node-&gt;renderer())-&gt;isLink()))
</ins><span class="cx">             return downcast&lt;Element&gt;(node);
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -976,7 +976,7 @@
</span><span class="cx"> {
</span><span class="cx">     ariaFlowToElements(linkedUIElements);
</span><span class="cx"> 
</span><del>-    if (isAnchor()) {
</del><ins>+    if (isLink()) {
</ins><span class="cx">         AccessibilityObject* linkedAXElement = internalLinkElement();
</span><span class="cx">         if (linkedAXElement)
</span><span class="cx">             linkedUIElements.append(linkedAXElement);
</span><span class="lines">@@ -1496,7 +1496,7 @@
</span><span class="cx"> 
</span><span class="cx"> URL AccessibilityRenderObject::url() const
</span><span class="cx"> {
</span><del>-    if (isAnchor() &amp;&amp; is&lt;HTMLAnchorElement&gt;(*m_renderer-&gt;node())) {
</del><ins>+    if (isLink() &amp;&amp; is&lt;HTMLAnchorElement&gt;(*m_renderer-&gt;node())) {
</ins><span class="cx">         if (HTMLAnchorElement* anchor = downcast&lt;HTMLAnchorElement&gt;(anchorElement()))
</span><span class="cx">             return anchor-&gt;href();
</span><span class="cx">     }
</span><span class="lines">@@ -2452,11 +2452,10 @@
</span><span class="cx">     Node* node = m_renderer-&gt;node();
</span><span class="cx">     RenderBoxModelObject* cssBox = renderBoxModelObject();
</span><span class="cx"> 
</span><del>-    if (node &amp;&amp; node-&gt;isLink()) {
-        if (cssBox &amp;&amp; cssBox-&gt;isImage())
-            return ImageMapRole;
</del><ins>+    if (node &amp;&amp; node-&gt;isLink())
</ins><span class="cx">         return WebCoreLinkRole;
</span><del>-    }
</del><ins>+    if (node &amp;&amp; is&lt;HTMLImageElement&gt;(*node) &amp;&amp; !downcast&lt;HTMLImageElement&gt;(*node).fastGetAttribute(usemapAttr).isNull())
+        return ImageMapRole;
</ins><span class="cx">     if ((cssBox &amp;&amp; cssBox-&gt;isListItem()) || (node &amp;&amp; node-&gt;hasTagName(liTag)))
</span><span class="cx">         return ListItemRole;
</span><span class="cx">     if (m_renderer-&gt;isListMarker())
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -1587,7 +1587,7 @@
</span><span class="cx">     else if (m_object-&gt;isTextControl())
</span><span class="cx">         objectAttributes = textAttrs;
</span><span class="cx">     
</span><del>-    else if (m_object-&gt;isAnchor() || m_object-&gt;isImage() || m_object-&gt;isLink())
</del><ins>+    else if (m_object-&gt;isLink() || m_object-&gt;isImage())
</ins><span class="cx">         objectAttributes = anchorAttrs;
</span><span class="cx">     
</span><span class="cx">     else if (is&lt;AccessibilityTable&gt;(*m_object) &amp;&amp; downcast&lt;AccessibilityTable&gt;(*m_object).isExposableThroughAccessibility())
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/dom/Node.h        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -327,7 +327,6 @@
</span><span class="cx">     StyleChangeType styleChangeType() const { return static_cast&lt;StyleChangeType&gt;(m_nodeFlags &amp; StyleChangeMask); }
</span><span class="cx">     bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFlag); }
</span><span class="cx">     bool styleIsAffectedByPreviousSibling() const { return getFlag(StyleIsAffectedByPreviousSibling); }
</span><del>-    bool isLink() const { return getFlag(IsLinkFlag); }
</del><span class="cx">     bool isEditingText() const { return getFlag(IsEditingTextFlag); }
</span><span class="cx"> 
</span><span class="cx">     void setChildNeedsStyleRecalc() { setFlag(ChildNeedsStyleRecalcFlag); }
</span><span class="lines">@@ -336,9 +335,8 @@
</span><span class="cx">     WEBCORE_EXPORT void setNeedsStyleRecalc(StyleChangeType = FullStyleChange);
</span><span class="cx">     void clearNeedsStyleRecalc() { m_nodeFlags &amp;= ~StyleChangeMask; }
</span><span class="cx"> 
</span><del>-    void setIsLink(bool f) { setFlag(f, IsLinkFlag); }
-    void setIsLink() { setFlag(IsLinkFlag); }
-    void clearIsLink() { clearFlag(IsLinkFlag); }
</del><ins>+    bool isLink() const { return getFlag(IsLinkFlag); }
+    void setIsLink(bool flag) { setFlag(flag, IsLinkFlag); }
</ins><span class="cx"> 
</span><span class="cx">     void setIsNamedFlowContentNode() { setFlag(IsNamedFlowContentNodeFlag); }
</span><span class="cx">     void clearIsNamedFlowContentNode() { clearFlag(IsNamedFlowContentNodeFlag); }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (175212 => 175213)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLImageElement.cpp        2014-10-27 04:20:25 UTC (rev 175212)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp        2014-10-27 04:28:48 UTC (rev 175213)
</span><span class="lines">@@ -151,8 +151,6 @@
</span><span class="cx">         setBestFitURLAndDPRFromImageCandidate(candidate);
</span><span class="cx">         m_imageLoader.updateFromElementIgnoringPreviousError();
</span><span class="cx">     } else if (name == usemapAttr) {
</span><del>-        setIsLink(!value.isNull() &amp;&amp; !shouldProhibitLinks(this));
-
</del><span class="cx">         if (inDocument() &amp;&amp; !m_lowercasedUsemap.isNull())
</span><span class="cx">             document().removeImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>