<!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>[168313] 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/168313">168313</a></dd>
<dt>Author</dt> <dd>krit@webkit.org</dd>
<dt>Date</dt> <dd>2014-05-05 13:31:29 -0700 (Mon, 05 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: tabindex support in SVG2
https://bugs.webkit.org/show_bug.cgi?id=130212

Reviewed by Chris Fleizach.

Source/WebCore:
The patch is mainly based on a patch for Blink by Erik Dahlström.
https://src.chromium.org/viewvc/blink?revision=172964&amp;view=revision

It adds support for tabindex to SVG by reusing the HTML code.

Spec: https://svgwg.org/svg2-draft/interact.html#sequential-focus-navigation-and-the-tabindex-attribute
IDL attribute: https://svgwg.org/svg2-draft/types.html#__svg__SVGElement__tabIndex

Test: svg/custom/tabindex-order.html

* dom/Element.cpp:
(WebCore::Element::setTabIndex): Moved from HTMLElement and shared with all elements.
* dom/Element.h:
* html/HTMLAnchorElement.cpp: Remove outdated comment.
(WebCore::HTMLAnchorElement::canStartSelection):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setTabIndex): Deleted.
* html/HTMLElement.h:
* svg/SVGAElement.cpp: Uses the same logic as HTMLAnchorElement now.
(WebCore::SVGAElement::tabIndex):
(WebCore::SVGAElement::supportsFocus):
(WebCore::SVGAElement::isMouseFocusable):
(WebCore::SVGAElement::isKeyboardFocusable):
(WebCore::SVGAElement::canStartSelection):
* svg/SVGAElement.h:
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.h:
* svg/SVGDefsElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::tabIndex): Return -1 if element can not be focused.
(WebCore::SVGElement::parseAttribute):
(WebCore::SVGElement::isMouseFocusable):
(WebCore::SVGElement::isKeyboardFocusable): Deleted. Use function on Element.
* svg/SVGElement.h:
* svg/SVGElement.idl:
* svg/SVGEllipseElement.h:
* svg/SVGGElement.h:
* svg/SVGGraphicsElement.h: Remove supportsFocus() from inheriting functions.
    Don't just return true. SVG elements should not be focusable by default.
    Instead check if tabindex was set explicitly.
* svg/SVGImageElement.h:
* svg/SVGLineElement.h:
* svg/SVGPathElement.h:
* svg/SVGPolyElement.h:
* svg/SVGRectElement.h:
* svg/SVGSVGElement.h:
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.h:
* svg/SVGTextElement.h:

LayoutTests:
Add test for tabindex on various SVG elements. Negative tests included.

Test is based upon a test from Erik Dahlström. Modified to test all SVGGraphicsElements.

* svg/custom/tabindex-order-expected.txt: Added.
* svg/custom/tabindex-order.html: Added.
* accessibility/svg-group-element-with-title.html: Give group element a role.
* platform/gtk/svg/custom/linking-uri-01-b-expected.txt:
* platform/ios-sim/svg/custom/linking-uri-01-b-expected.txt:
* platform/mac/svg/custom/linking-uri-01-b-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilitysvggroupelementwithtitlehtml">trunk/LayoutTests/accessibility/svg-group-element-with-title.html</a></li>
<li><a href="#trunkLayoutTestsplatformgtksvgcustomlinkinguri01bexpectedtxt">trunk/LayoutTests/platform/gtk/svg/custom/linking-uri-01-b-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimsvgcustomlinkinguri01bexpectedtxt">trunk/LayoutTests/platform/ios-sim/svg/custom/linking-uri-01-b-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgcustomlinkinguri01bexpectedtxt">trunk/LayoutTests/platform/mac/svg/custom/linking-uri-01-b-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementcpp">trunk/Source/WebCore/html/HTMLAnchorElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementh">trunk/Source/WebCore/html/HTMLElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAElementcpp">trunk/Source/WebCore/svg/SVGAElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAElementh">trunk/Source/WebCore/svg/SVGAElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGCircleElementh">trunk/Source/WebCore/svg/SVGCircleElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGClipPathElementh">trunk/Source/WebCore/svg/SVGClipPathElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGDefsElementh">trunk/Source/WebCore/svg/SVGDefsElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementcpp">trunk/Source/WebCore/svg/SVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementh">trunk/Source/WebCore/svg/SVGElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementidl">trunk/Source/WebCore/svg/SVGElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvgSVGEllipseElementh">trunk/Source/WebCore/svg/SVGEllipseElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGGElementh">trunk/Source/WebCore/svg/SVGGElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGGraphicsElementh">trunk/Source/WebCore/svg/SVGGraphicsElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGImageElementh">trunk/Source/WebCore/svg/SVGImageElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLineElementh">trunk/Source/WebCore/svg/SVGLineElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPathElementh">trunk/Source/WebCore/svg/SVGPathElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPolyElementh">trunk/Source/WebCore/svg/SVGPolyElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGRectElementh">trunk/Source/WebCore/svg/SVGRectElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSVGElementh">trunk/Source/WebCore/svg/SVGSVGElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSwitchElementh">trunk/Source/WebCore/svg/SVGSwitchElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSymbolElementh">trunk/Source/WebCore/svg/SVGSymbolElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGTextElementh">trunk/Source/WebCore/svg/SVGTextElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGUseElementh">trunk/Source/WebCore/svg/SVGUseElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgcustomtabindexorderexpectedtxt">trunk/LayoutTests/svg/custom/tabindex-order-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustomtabindexorderhtml">trunk/LayoutTests/svg/custom/tabindex-order.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/LayoutTests/ChangeLog        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-05-05  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        AX: tabindex support in SVG2
+        https://bugs.webkit.org/show_bug.cgi?id=130212
+
+        Reviewed by Chris Fleizach.
+
+        Add test for tabindex on various SVG elements. Negative tests included.
+
+        Test is based upon a test from Erik Dahlström. Modified to test all SVGGraphicsElements.
+
+        * svg/custom/tabindex-order-expected.txt: Added.
+        * svg/custom/tabindex-order.html: Added.
+        * accessibility/svg-group-element-with-title.html: Give group element a role.
+        * platform/gtk/svg/custom/linking-uri-01-b-expected.txt:
+        * platform/ios-sim/svg/custom/linking-uri-01-b-expected.txt:
+        * platform/mac/svg/custom/linking-uri-01-b-expected.txt:
+
</ins><span class="cx"> 2014-05-05  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r168244): compositing/visibility/visibility-image-layers-dynamic.html 
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitysvggroupelementwithtitlehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/svg-group-element-with-title.html (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/svg-group-element-with-title.html        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/LayoutTests/accessibility/svg-group-element-with-title.html        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> &lt;body id=&quot;body&quot;&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;svg width=&quot;500&quot; height=&quot;300&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
</span><del>-  &lt;g id=&quot;group1&quot;&gt;
</del><ins>+  &lt;g id=&quot;group1&quot; role=&quot;group&quot;&gt;
</ins><span class="cx">     &lt;title&gt;SVG TITLE 1&lt;/title&gt;
</span><span class="cx">     &lt;rect x=&quot;10&quot; y=&quot;10&quot; width=&quot;200&quot; height=&quot;100&quot;
</span><span class="cx">       style=&quot;fill:none; stroke:blue; stroke-width:1px&quot;/&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtksvgcustomlinkinguri01bexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/svg/custom/linking-uri-01-b-expected.txt (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/svg/custom/linking-uri-01-b-expected.txt        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/LayoutTests/platform/gtk/svg/custom/linking-uri-01-b-expected.txt        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -75,4 +75,3 @@
</span><span class="cx">         RenderSVGInlineText {#text} at (0,0) size 249x36
</span><span class="cx">           chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 17 width 248.06: &quot;$Revision: 1.12 $&quot;
</span><span class="cx">     RenderSVGRect {rect} at (0,0) size 800x600 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
</span><del>-caret: position 0 of child 0 {#text} of child 1 {text} of child 5 {a} of child 1 {g} of child 3 {g} of child 25 {g} of child 0 {svg} of document
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimsvgcustomlinkinguri01bexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-sim/svg/custom/linking-uri-01-b-expected.txt (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-sim/svg/custom/linking-uri-01-b-expected.txt        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/LayoutTests/platform/ios-sim/svg/custom/linking-uri-01-b-expected.txt        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -75,4 +75,3 @@
</span><span class="cx">         RenderSVGInlineText {#text} at (0,0) size 248x37
</span><span class="cx">           chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 17 width 247.02: &quot;$Revision: 1.12 $&quot;
</span><span class="cx">     RenderSVGRect {rect} at (0,0) size 800x600 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
</span><del>-caret: position 0 of child 0 {#text} of child 1 {text} of child 5 {a} of child 1 {g} of child 3 {g} of child 25 {g} of child 0 {svg} of document
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgcustomlinkinguri01bexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/custom/linking-uri-01-b-expected.txt (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/custom/linking-uri-01-b-expected.txt        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/LayoutTests/platform/mac/svg/custom/linking-uri-01-b-expected.txt        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -75,4 +75,3 @@
</span><span class="cx">         RenderSVGInlineText {#text} at (0,0) size 249x37
</span><span class="cx">           chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 17 width 248.06: &quot;$Revision: 1.12 $&quot;
</span><span class="cx">     RenderSVGRect {rect} at (0,0) size 800x600 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
</span><del>-caret: position 0 of child 0 {#text} of child 1 {text} of child 5 {a} of child 1 {g} of child 3 {g} of child 25 {g} of child 0 {svg} of document
</del></span></pre></div>
<a id="trunkLayoutTestssvgcustomtabindexorderexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/tabindex-order-expected.txt (0 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/tabindex-order-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/custom/tabindex-order-expected.txt        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+This page tests that the SVG tabbing order is respected properly.
+
+To test, put focus in &quot;a&quot;. Pressing Tab should focus &quot;a&quot; through &quot;k&quot; in order, and pressing Shift-Tab should reverse the order.
+
+ Tabbing forward....
+
+id: a tabindex: 1 [object SVGCircleElement] is focused.
+id: b tabindex: 1 [object SVGGElement] is focused.
+id: c tabindex: 1 [object SVGEllipseElement] is focused.
+id: d tabindex: 1 [object SVGPathElement] is focused.
+id: e tabindex: 3 [object SVGAElement] is focused.
+id: f tabindex: 4 [object SVGPolylineElement] is focused.
+id: g tabindex: 6 [object SVGRectElement] is focused.
+id: h tabindex: 6 [object SVGTextElement] is focused.
+id: i tabindex: 0 [object SVGSVGElement] is focused.
+id: j tabindex: 0 [object SVGLineElement] is focused.
+id: k tabindex: 0 [object SVGPolygonElement] is focused.
+
+Tabbing backward....
+
+id: k tabindex: 0 [object SVGPolygonElement] is focused.
+id: j tabindex: 0 [object SVGLineElement] is focused.
+id: i tabindex: 0 [object SVGSVGElement] is focused.
+id: h tabindex: 6 [object SVGTextElement] is focused.
+id: g tabindex: 6 [object SVGRectElement] is focused.
+id: f tabindex: 4 [object SVGPolylineElement] is focused.
+id: e tabindex: 3 [object SVGAElement] is focused.
+id: d tabindex: 1 [object SVGPathElement] is focused.
+id: c tabindex: 1 [object SVGEllipseElement] is focused.
+id: b tabindex: 1 [object SVGGElement] is focused.
+id: a tabindex: 1 [object SVGCircleElement] is focused.
+
+Test finished
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcustomtabindexorderhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/custom/tabindex-order.html (0 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/tabindex-order.html                                (rev 0)
+++ trunk/LayoutTests/svg/custom/tabindex-order.html        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+    &lt;script&gt;
+        function log(msg)
+        {
+            document.getElementById('log').appendChild(document.createTextNode(msg + '\n'));
+        }
+
+        function dispatchTabPress(element, shiftKey)
+        {
+            var event = document.createEvent('KeyboardEvents');
+            var tabKeyIdentifier = 'U+0009';
+            event.initKeyboardEvent('keydown', true, true, document.defaultView, tabKeyIdentifier, 0, false, false, shiftKey, false, false);
+            element.dispatchEvent(event);
+        }
+
+        var lastFocusedElement = null;
+        function focusListener(event)
+        {
+            log('id: ' + event.target.id + ' tabindex: ' + event.target.tabIndex + ' ' + event.target + ' is focused.');
+            lastFocusedElement = event.target;
+        }
+
+        function addEventListenersToRects(rects)
+        {
+            for (var i = 0; i &lt; rects.length; ++i) {
+                rects[i].addEventListener('focus', focusListener, false);
+            }
+        }
+
+        function test()
+        {
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+            }
+
+            var rects = document.getElementsByClassName('tab');
+
+            // Put focus in the page
+            rects[0].focus();
+            rects[0].blur();
+
+            addEventListenersToRects(rects);
+
+            log('Tabbing forward....\n');
+            for (var i = 0; i &lt; rects.length; ++i) {
+                if (rects[i].tabIndex &gt;= 0)
+                    dispatchTabPress(document, false);
+            }
+
+            lastFocusedElement.blur();
+
+            log('\nTabbing backward....\n');
+            for (var i = 0; i &lt; rects.length; ++i) {
+                if (rects[i].tabIndex &gt;= 0)
+                    dispatchTabPress(document, true);
+            }
+
+            log('\nTest finished\n');
+        }
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;test()&quot;&gt;
+    &lt;p&gt;This page tests that the SVG tabbing order is respected properly.&lt;/p&gt;
+    &lt;p&gt;To test, put focus in &amp;quot;a&amp;quot;. Pressing Tab should focus &amp;quot;a&amp;quot; through &amp;quot;k&amp;quot; in order, and pressing Shift-Tab should reverse the order.&lt;/p&gt;
+    &lt;svg&gt;
+        &lt;rect class=&quot;tab&quot; tabindex=&quot;6&quot; id=&quot;g&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
+        &lt;circle class=&quot;tab&quot; tabindex=&quot;1&quot; id=&quot;a&quot; r=&quot;1&quot; cx=&quot;0&quot; cy=&quot;0&quot;/&gt;
+        &lt;rect class=&quot;tab&quot; tabindex=&quot;-5&quot; id=&quot;not in tab order (negative tabindex)&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
+        &lt;g class=&quot;tab&quot; tabindex=&quot;1&quot; id=&quot;b&quot;/&gt;
+        &lt;svg class=&quot;tab&quot; tabindex=&quot;0&quot; id=&quot;i&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
+        &lt;text class=&quot;tab&quot; tabindex=&quot;6&quot; id=&quot;h&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
+        &lt;ellipse class=&quot;tab&quot; tabindex=&quot;1&quot; id=&quot;c&quot; rx=&quot;1&quot; ry=&quot;1&quot; cx=&quot;0&quot; cy=&quot;0&quot;/&gt;
+        &lt;symbol class=&quot;tab&quot; tabindex=&quot;1&quot; id=&quot;symbol is not focusable&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
+        &lt;defs class=&quot;tab&quot; tabindex=&quot;1&quot; id=&quot;defs is not focusable&quot;/&gt;
+        &lt;path class=&quot;tab&quot; tabindex=&quot;1&quot; id=&quot;d&quot; d=&quot;M0,0&quot;/&gt;
+        &lt;line class=&quot;tab&quot; tabindex=&quot;0&quot; id=&quot;j&quot; x1=&quot;1&quot; x2=&quot;1&quot; y1=&quot;0&quot; y2=&quot;0&quot;/&gt;
+        &lt;rect class=&quot;tab&quot; tabindex=&quot;-1&quot; id=&quot;not in tab order (negative tabindex)&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
+        &lt;polygon class=&quot;tab&quot; tabindex=&quot;0&quot; id=&quot;k&quot; points=&quot;1,1 2,2&quot;/&gt;
+        &lt;polyline class=&quot;tab&quot; tabindex=&quot;4&quot; id=&quot;f&quot; points=&quot;1,1 2,2&quot;/&gt;
+        &lt;a class=&quot;tab&quot; tabindex=&quot;3&quot; id=&quot;e&quot;&gt;&lt;rect width=&quot;1&quot; height=&quot;1&quot;/&gt;&lt;/a&gt;
+    &lt;/svg&gt;
+
+    &lt;pre id=&quot;log&quot;&gt;&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/ChangeLog        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2014-05-05  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        AX: tabindex support in SVG2
+        https://bugs.webkit.org/show_bug.cgi?id=130212
+
+        Reviewed by Chris Fleizach.
+
+        The patch is mainly based on a patch for Blink by Erik Dahlström.
+        https://src.chromium.org/viewvc/blink?revision=172964&amp;view=revision
+
+        It adds support for tabindex to SVG by reusing the HTML code.
+
+        Spec: https://svgwg.org/svg2-draft/interact.html#sequential-focus-navigation-and-the-tabindex-attribute
+        IDL attribute: https://svgwg.org/svg2-draft/types.html#__svg__SVGElement__tabIndex
+
+        Test: svg/custom/tabindex-order.html
+
+        * dom/Element.cpp:
+        (WebCore::Element::setTabIndex): Moved from HTMLElement and shared with all elements.
+        * dom/Element.h:
+        * html/HTMLAnchorElement.cpp: Remove outdated comment.
+        (WebCore::HTMLAnchorElement::canStartSelection):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::setTabIndex): Deleted.
+        * html/HTMLElement.h:
+        * svg/SVGAElement.cpp: Uses the same logic as HTMLAnchorElement now.
+        (WebCore::SVGAElement::tabIndex):
+        (WebCore::SVGAElement::supportsFocus):
+        (WebCore::SVGAElement::isMouseFocusable):
+        (WebCore::SVGAElement::isKeyboardFocusable):
+        (WebCore::SVGAElement::canStartSelection):
+        * svg/SVGAElement.h:
+        * svg/SVGCircleElement.h:
+        * svg/SVGClipPathElement.h:
+        * svg/SVGDefsElement.h:
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::tabIndex): Return -1 if element can not be focused.
+        (WebCore::SVGElement::parseAttribute):
+        (WebCore::SVGElement::isMouseFocusable):
+        (WebCore::SVGElement::isKeyboardFocusable): Deleted. Use function on Element.
+        * svg/SVGElement.h:
+        * svg/SVGElement.idl:
+        * svg/SVGEllipseElement.h:
+        * svg/SVGGElement.h:
+        * svg/SVGGraphicsElement.h: Remove supportsFocus() from inheriting functions.
+            Don't just return true. SVG elements should not be focusable by default.
+            Instead check if tabindex was set explicitly.
+        * svg/SVGImageElement.h:
+        * svg/SVGLineElement.h:
+        * svg/SVGPathElement.h:
+        * svg/SVGPolyElement.h:
+        * svg/SVGRectElement.h:
+        * svg/SVGSVGElement.h:
+        * svg/SVGSwitchElement.h:
+        * svg/SVGSymbolElement.h:
+        * svg/SVGTextElement.h:
+
</ins><span class="cx"> 2014-05-05  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement beginScrubbing and endScrubbing for video fullscreen.
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -203,6 +203,11 @@
</span><span class="cx">     return hasRareData() ? elementRareData()-&gt;tabIndex() : 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Element::setTabIndex(int value)
+{
+    setIntegralAttribute(tabindexAttr, value);
+}
+
</ins><span class="cx"> bool Element::isKeyboardFocusable(KeyboardEvent*) const
</span><span class="cx"> {
</span><span class="cx">     return isFocusable() &amp;&amp; tabIndex() &gt;= 0;
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/dom/Element.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -349,6 +349,7 @@
</span><span class="cx">     virtual bool shouldUseInputMethod();
</span><span class="cx"> 
</span><span class="cx">     virtual short tabIndex() const;
</span><ins>+    void setTabIndex(int);
</ins><span class="cx">     virtual Element* focusDelegate();
</span><span class="cx"> 
</span><span class="cx">     virtual RenderStyle* computedStyle(PseudoId = NOPSEUDO) override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -276,7 +276,6 @@
</span><span class="cx"> 
</span><span class="cx"> bool HTMLAnchorElement::canStartSelection() const
</span><span class="cx"> {
</span><del>-    // FIXME: We probably want this same behavior in SVGAElement too
</del><span class="cx">     if (!isLink())
</span><span class="cx">         return HTMLElement::canStartSelection();
</span><span class="cx">     return hasEditableStyle();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -754,11 +754,6 @@
</span><span class="cx">     return -1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLElement::setTabIndex(int value)
-{
-    setIntegralAttribute(tabindexAttr, value);
-}
-
</del><span class="cx"> TranslateAttributeMode HTMLElement::translateAttributeMode() const
</span><span class="cx"> {
</span><span class="cx">     const AtomicString&amp; value = fastGetAttribute(translateAttr);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/html/HTMLElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx">     virtual String title() const override final;
</span><span class="cx"> 
</span><span class="cx">     virtual short tabIndex() const override;
</span><del>-    void setTabIndex(int);
</del><span class="cx"> 
</span><span class="cx">     String innerHTML() const;
</span><span class="cx">     String outerHTML() const;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAElement.cpp (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAElement.cpp        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGAElement.cpp        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -185,11 +185,18 @@
</span><span class="cx">     SVGGraphicsElement::defaultEventHandler(event);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+short SVGAElement::tabIndex() const
+{
+    // Skip the supportsFocus check in SVGElement.
+    return Element::tabIndex();
+}
+
</ins><span class="cx"> bool SVGAElement::supportsFocus() const
</span><span class="cx"> {
</span><span class="cx">     if (hasEditableStyle())
</span><span class="cx">         return SVGGraphicsElement::supportsFocus();
</span><del>-    return true;
</del><ins>+    // If not a link we should still be able to focus the element if it has a tabIndex.
+    return isLink() || Element::supportsFocus();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SVGAElement::isFocusable() const
</span><span class="lines">@@ -207,20 +214,33 @@
</span><span class="cx"> 
</span><span class="cx"> bool SVGAElement::isMouseFocusable() const
</span><span class="cx"> {
</span><del>-    return false;
</del><ins>+    // Links are focusable by default, but only allow links with tabindex or contenteditable to be mouse focusable.
+    // https://bugs.webkit.org/show_bug.cgi?id=26856
+    if (isLink())
+        return Element::supportsFocus();
+    
+    return SVGElement::isMouseFocusable();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SVGAElement::isKeyboardFocusable(KeyboardEvent* event) const
</span><span class="cx"> {
</span><del>-    if (!isFocusable())
-        return false;
-    
-    if (!document().frame())
-        return false;
-    
-    return document().frame()-&gt;eventHandler().tabsToLinks(event);
</del><ins>+    if (isFocusable() &amp;&amp; Element::supportsFocus())
+        return SVGElement::isKeyboardFocusable(event);
+
+    if (isLink())
+        return document().frame()-&gt;eventHandler().tabsToLinks(event);
+
+    return SVGElement::isKeyboardFocusable(event);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool SVGAElement::canStartSelection() const
+{
+    if (!isLink())
+        return SVGElement::canStartSelection();
+
+    return hasEditableStyle();
+}
+
</ins><span class="cx"> bool SVGAElement::childShouldCreateRenderer(const Node&amp; child) const
</span><span class="cx"> {
</span><span class="cx">     // http://www.w3.org/2003/01/REC-SVG11-20030114-errata#linking-text-environment
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGAElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx">     virtual bool isKeyboardFocusable(KeyboardEvent*) const override;
</span><span class="cx">     virtual bool isFocusable() const override;
</span><span class="cx">     virtual bool isURLAttribute(const Attribute&amp;) const override;
</span><ins>+    virtual bool canStartSelection() const override;
+    virtual short tabIndex() const override;
</ins><span class="cx"> 
</span><span class="cx">     virtual bool willRespondToMouseClickEvents() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGCircleElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGCircleElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGCircleElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGCircleElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx">     SVGCircleElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGClipPathElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGClipPathElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGClipPathElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGClipPathElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx">     SVGClipPathElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><ins>+    virtual bool supportsFocus() const override { return false; }
</ins><span class="cx">     virtual bool needsPendingResourceHandling() const override { return false; }
</span><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGDefsElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGDefsElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGDefsElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGDefsElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     SVGDefsElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual bool isValid() const override;
</span><ins>+    virtual bool supportsFocus() const override { return false; }
</ins><span class="cx"> 
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.cpp (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.cpp        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGElement.cpp        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><ins>+#include &quot;HTMLParserIdioms.h&quot;
</ins><span class="cx"> #include &quot;RenderObject.h&quot;
</span><span class="cx"> #include &quot;RenderSVGResource.h&quot;
</span><span class="cx"> #include &quot;RenderSVGResourceClipper.h&quot;
</span><span class="lines">@@ -250,6 +251,13 @@
</span><span class="cx">     document().accessSVGExtensions()-&gt;removeAllElementReferencesForTarget(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+short SVGElement::tabIndex() const
+{
+    if (supportsFocus())
+        return Element::tabIndex();
+    return -1;
+}
+
</ins><span class="cx"> bool SVGElement::willRecalcStyle(Style::Change change)
</span><span class="cx"> {
</span><span class="cx">     if (!m_svgRareData || styleChangeType() == SyntheticStyleChange)
</span><span class="lines">@@ -312,7 +320,6 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> bool SVGElement::isSupported(StringImpl* feature, StringImpl* version) const
</span><span class="cx"> {
</span><span class="cx">     return DOMImplementation::hasFeature(feature, version);
</span><span class="lines">@@ -509,7 +516,15 @@
</span><span class="cx">     else if (name == ongestureendAttr)
</span><span class="cx">         setAttributeEventListener(eventNames().gestureendEvent, name, value);
</span><span class="cx"> #endif
</span><del>-    else if (SVGLangSpace::parseAttribute(name, value)) {
</del><ins>+    else if (name == tabindexAttr) {
+        int tabindex = 0;
+        if (value.isEmpty())
+            clearTabIndexExplicitlyIfNeeded();
+        else if (parseHTMLInteger(value, tabindex)) {
+            // Clamp tabindex to the range of 'short' to match Firefox's behavior.
+            setTabIndexExplicitly(std::max(static_cast&lt;int&gt;(std::numeric_limits&lt;short&gt;::min()), std::min(tabindex, static_cast&lt;int&gt;(std::numeric_limits&lt;short&gt;::max()))));
+        }
+    } else if (SVGLangSpace::parseAttribute(name, value)) {
</ins><span class="cx">     } else
</span><span class="cx">         StyledElement::parseAttribute(name, value);
</span><span class="cx"> }
</span><span class="lines">@@ -1137,18 +1152,25 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool SVGElement::hasFocusEventListeners() const
+{
+    Element* eventTarget = const_cast&lt;SVGElement*&gt;(this);
+    return eventTarget-&gt;hasEventListeners(eventNames().focusinEvent)
+        || eventTarget-&gt;hasEventListeners(eventNames().focusoutEvent)
+        || eventTarget-&gt;hasEventListeners(eventNames().focusEvent)
+        || eventTarget-&gt;hasEventListeners(eventNames().blurEvent);
+}
+
</ins><span class="cx"> bool SVGElement::isMouseFocusable() const
</span><span class="cx"> {
</span><span class="cx">     if (!isFocusable())
</span><span class="cx">         return false;
</span><span class="cx">     Element* eventTarget = const_cast&lt;SVGElement*&gt;(this);
</span><del>-    return eventTarget-&gt;hasEventListeners(eventNames().focusinEvent) || eventTarget-&gt;hasEventListeners(eventNames().focusoutEvent);
</del><ins>+    return hasFocusEventListeners()
+        || eventTarget-&gt;hasEventListeners(eventNames().keydownEvent)
+        || eventTarget-&gt;hasEventListeners(eventNames().keyupEvent)
+        || eventTarget-&gt;hasEventListeners(eventNames().keypressEvent);
</ins><span class="cx"> }
</span><del>-
-bool SVGElement::isKeyboardFocusable(KeyboardEvent*) const
-{
-    return isMouseFocusable();
-}
</del><span class="cx">     
</span><span class="cx"> void SVGElement::accessKeyAction(bool sendMouseEvents)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -135,17 +135,22 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool addEventListener(const AtomicString&amp; eventType, PassRefPtr&lt;EventListener&gt;, bool useCapture) override;
</span><span class="cx">     virtual bool removeEventListener(const AtomicString&amp; eventType, EventListener*, bool useCapture) override;
</span><ins>+    bool hasFocusEventListeners() const;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx">     virtual bool shouldMoveToFlowThread(const RenderStyle&amp;) const override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool hasTagName(const SVGQualifiedName&amp; name) const { return hasLocalName(name.localName()); }
</span><ins>+    virtual short tabIndex() const override;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     SVGElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     virtual ~SVGElement();
</span><span class="cx"> 
</span><ins>+    virtual bool isMouseFocusable() const override;
+    virtual bool supportsFocus() const override { return false; }
+
</ins><span class="cx">     virtual bool rendererIsNeeded(const RenderStyle&amp;) override;
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><span class="cx"> 
</span><span class="lines">@@ -179,8 +184,6 @@
</span><span class="cx">     void removeInstanceMapping(SVGElementInstance*);
</span><span class="cx"> 
</span><span class="cx">     void buildPendingResourcesIfNeeded();
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const override;
-    virtual bool isMouseFocusable() const override;
</del><span class="cx">     virtual void accessKeyAction(bool sendMouseEvents) override;
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.idl (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.idl        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGElement.idl        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx">     readonly attribute SVGAnimatedString className;
</span><span class="cx">     readonly attribute CSSStyleDeclaration style;
</span><span class="cx"> 
</span><ins>+    attribute long tabIndex;
+
</ins><span class="cx">     CSSValue getPresentationAttribute([Default=Undefined] optional DOMString name);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGEllipseElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGEllipseElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGEllipseElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGEllipseElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx">     SVGEllipseElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGGElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGGElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGGElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx"> 
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGGraphicsElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGGraphicsElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGGraphicsElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGGraphicsElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -57,6 +57,9 @@
</span><span class="cx">     SVGGraphicsElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><ins>+
+    virtual bool supportsFocus() const override { return Element::supportsFocus() || hasFocusEventListeners(); }
+
</ins><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><span class="cx">     virtual void svgAttributeChanged(const QualifiedName&amp;) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGImageElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGImageElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGImageElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx">     SVGImageElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLineElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLineElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLineElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGLineElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx">     SVGLineElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPathElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPathElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPathElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGPathElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -101,7 +101,6 @@
</span><span class="cx">     SVGPathElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPolyElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPolyElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPolyElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGPolyElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -43,7 +43,6 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override; 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGRectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGRectElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGRectElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGRectElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx">     SVGRectElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSVGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSVGElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSVGElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGSVGElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -50,7 +50,6 @@
</span><span class="cx">     using SVGGraphicsElement::deref;
</span><span class="cx"> 
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     // 'SVGSVGElement' functions
</span><span class="cx">     const AtomicString&amp; contentScriptType() const;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSwitchElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSwitchElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSwitchElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGSwitchElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx">     SVGSwitchElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     virtual bool childShouldCreateRenderer(const Node&amp;) const override;
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSymbolElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSymbolElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSymbolElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGSymbolElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -39,8 +39,6 @@
</span><span class="cx"> private:
</span><span class="cx">     SVGSymbolElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><del>-    virtual bool supportsFocus() const override { return true; }
-
</del><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><span class="cx">     virtual void svgAttributeChanged(const QualifiedName&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGTextElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGTextElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGTextElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGTextElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -34,8 +34,6 @@
</span><span class="cx"> private:
</span><span class="cx">     SVGTextElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><del>-    virtual bool supportsFocus() const override { return true; }
-
</del><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx">     virtual bool childShouldCreateRenderer(const Node&amp;) const override;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGUseElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGUseElement.h (168312 => 168313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGUseElement.h        2014-05-05 20:14:11 UTC (rev 168312)
+++ trunk/Source/WebCore/svg/SVGUseElement.h        2014-05-05 20:31:29 UTC (rev 168313)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx">     SVGUseElement(const QualifiedName&amp;, Document&amp;, bool wasInsertedByParser);
</span><span class="cx"> 
</span><span class="cx">     virtual bool isValid() const override { return SVGTests::isValid(); }
</span><del>-    virtual bool supportsFocus() const override { return true; }
</del><span class="cx"> 
</span><span class="cx">     virtual InsertionNotificationRequest insertedInto(ContainerNode&amp;) override;
</span><span class="cx">     virtual void removedFrom(ContainerNode&amp;) override;
</span></span></pre>
</div>
</div>

</body>
</html>