<!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>[200494] 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/200494">200494</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-05 16:30:21 -0700 (Thu, 05 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/200479">r200479</a>.
https://bugs.webkit.org/show_bug.cgi?id=157397

A LayoutTest added with this change is crashing on Mac WK1
test runs. (Requested by ryanhaddad on #webkit).

Reverted changeset:

&quot;For keyboard users, activating a fragment URL should transfer
focus and caret to the destination&quot;
https://bugs.webkit.org/show_bug.cgi?id=116046
http://trac.webkit.org/changeset/200479</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomfragmentactivationfocusestargetexpectedtxt">trunk/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomfragmentactivationfocusestargethtml">trunk/LayoutTests/fast/dom/fragment-activation-focuses-target.html</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/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="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFocusControllercpp">trunk/Source/WebCore/page/FocusController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventssequentialfocusnavigationstartingpointexpectedtxt">trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventssequentialfocusnavigationstartingpointhtml">trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/LayoutTests/ChangeLog        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-05-05  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r200479.
+        https://bugs.webkit.org/show_bug.cgi?id=157397
+
+        A LayoutTest added with this change is crashing on Mac WK1
+        test runs. (Requested by ryanhaddad on #webkit).
+
+        Reverted changeset:
+
+        &quot;For keyboard users, activating a fragment URL should transfer
+        focus and caret to the destination&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=116046
+        http://trac.webkit.org/changeset/200479
+
</ins><span class="cx"> 2016-05-05  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CORS check is sometimes incorrectly failing for media loads
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomfragmentactivationfocusestargetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -14,9 +14,9 @@
</span><span class="cx"> Verify Tab behaves correctly after following the link.
</span><span class="cx"> PASS document.activeElement is document.getElementById('fragment3')
</span><span class="cx"> PASS document.activeElement is document.getElementById('fragment1')
</span><del>-Activate a link that does not have a focusable fragment and verify that the currently focused element is unfocused.
</del><ins>+Activate a link that does not have a focusable fragment and verify focus does not move.
</ins><span class="cx"> PASS document.activeElement is link2
</span><del>-PASS document.activeElement is document.body
</del><ins>+PASS document.activeElement is link2
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomfragmentactivationfocusestargethtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/fragment-activation-focuses-target.html (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/fragment-activation-focuses-target.html        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/LayoutTests/fast/dom/fragment-activation-focuses-target.html        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -43,12 +43,12 @@
</span><span class="cx">   shouldBe(&quot;document.activeElement&quot;, &quot;document.getElementById('fragment1')&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-debug(&quot;Activate a link that does not have a focusable fragment and verify that the currently focused element is unfocused.&quot;);
</del><ins>+debug(&quot;Activate a link that does not have a focusable fragment and verify focus does not move.&quot;);
</ins><span class="cx"> var link2 = document.getElementById(&quot;link2&quot;);
</span><span class="cx"> link2.focus();
</span><span class="cx"> shouldBe(&quot;document.activeElement&quot;, &quot;link2&quot;);
</span><span class="cx"> link2.click();
</span><del>-shouldBe(&quot;document.activeElement&quot;, &quot;document.body&quot;);
</del><ins>+shouldBe(&quot;document.activeElement&quot;, &quot;link2&quot;);
</ins><span class="cx"> 
</span><span class="cx"> var successfullyParsed = true;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventssequentialfocusnavigationstartingpointexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point-expected.txt (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point-expected.txt        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point-expected.txt        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Mouse press should update sequential focus navigation starting point.
-PASS container.innerHTML = '&lt;input id=prev&gt;&lt;div style=&quot;height:200px;&quot;&gt;&lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusSpan(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '&lt;input id=prev&gt;&lt;div style=&quot;height:200px;&quot;&gt;&lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusSpan(); moveFocus('backward'); document.activeElement.id is 'prev'
-PASS container.innerHTML = '&lt;span style=&quot;font-size:60px;&quot;&gt;&lt;input id=prev&gt;Text Text&lt;input id=next&gt;&lt;/span&gt;'; focusSpan(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '&lt;span style=&quot;font-size:60px;&quot;&gt;&lt;input id=prev&gt;Text Text&lt;input id=next&gt;&lt;/span&gt;'; focusSpan(); moveFocus('backward'); document.activeElement.id is 'prev'
-
-Fragment navigation should update sequential focus navigation starting point.
-PASS container.innerHTML = '&lt;a href=&quot;#fragment&quot;&gt;&lt;/a&gt;&lt;input id=prev&gt;&lt;a name=&quot;fragment&quot;&gt;&lt;/a&gt;&lt;input id=next&gt;'; clickLink(); moveFocus('forward'); document.activeElement.id is 'next'
-
-Focusing an element should update sequential focus navigation starting point.
-PASS container.innerHTML = '&lt;input id=prev&gt;&lt;input id=start&gt;&lt;input id=next&gt;'; focusStart(); moveFocus('forward'); document.activeElement.id is 'next'
-
-After removing a focused element from the document tree, sequential focus navigation should start at a place where the focused element was.
-PASS container.innerHTML = '&lt;input id=prev&gt;&lt;input id=start&gt;&lt;input id=next&gt;'; focusStart(); removeStart(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '&lt;input id=prev&gt;&lt;input id=start&gt;&lt;input id=next&gt;'; focusStart(); removeStart(); moveFocus('backward'); document.activeElement.id is 'prev'
-PASS container.innerHTML = '&lt;input id=prev&gt;&lt;div&gt;&lt;input id=start&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusStart(); removeDiv(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '&lt;div&gt;&lt;input id=start&gt;&lt;input id=prev&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusStart(); removeStart(); moveFocus('forward'); document.activeElement.id is 'prev'
-
-
</del></span></pre></div>
<a id="trunkLayoutTestsfasteventssequentialfocusnavigationstartingpointhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point.html (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point.html        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/LayoutTests/fast/events/sequential-focus-navigation-starting-point.html        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;body onload=&quot;runTest();&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../forms/resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
-&lt;div id=&quot;container&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-if (!window.eventSender)
-    document.body.textContent = 'This test requires window.eventSender.';
-
-function focusSpan() { 
-    hoverOverElement(container.querySelector('span')); 
-    eventSender.mouseDown();
-}
-
-function focusDiv() { 
-    hoverOverElement(container.querySelector('div')); 
-    eventSender.mouseDown();
-}
-
-function moveFocus(direction) { 
-    eventSender.keyDown('\t', direction == 'forward' ? [] : ['shiftKey']); 
-}
-
-function clickLink() {
-    container.querySelector('a').click();
-}
-
-function focusStart() {
-    container.querySelector('#start').focus();
-}
-
-function removeStart() {
-    container.querySelector('#start').remove();
-}
-
-function removeDiv() {
-    container.querySelector('div').remove();
-}
-
-function runTest() {
-    
-    debug(&quot;Mouse press should update sequential focus navigation starting point.&quot;);
-    var container = document.querySelector('#container');
-    
-    shouldBe(&quot;container.innerHTML = '&lt;input id=prev&gt;&lt;div style=\&quot;height:200px;\&quot;&gt;&lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusSpan(); moveFocus('forward'); document.activeElement.id&quot;, &quot;'next'&quot;);
-    eventSender.mouseUp();
-    shouldBe(&quot;container.innerHTML = '&lt;input id=prev&gt;&lt;div style=\&quot;height:200px;\&quot;&gt;&lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusSpan(); moveFocus('backward'); document.activeElement.id&quot;, &quot;'prev'&quot;);
-    eventSender.mouseUp();
-    shouldBe(&quot;container.innerHTML = '&lt;span style=\&quot;font-size:60px;\&quot;&gt;&lt;input id=prev&gt;Text Text&lt;input id=next&gt;&lt;/span&gt;'; focusSpan(); moveFocus('forward'); document.activeElement.id&quot;, &quot;'next'&quot;);
-    eventSender.mouseUp();
-    shouldBe(&quot;container.innerHTML = '&lt;span style=\&quot;font-size:60px;\&quot;&gt;&lt;input id=prev&gt;Text Text&lt;input id=next&gt;&lt;/span&gt;'; focusSpan(); moveFocus('backward'); document.activeElement.id&quot;, &quot;'prev'&quot;);
-    eventSender.mouseUp();
-    
-    debug(&quot;\nFragment navigation should update sequential focus navigation starting point.&quot;);
-    shouldBe(&quot;container.innerHTML = '&lt;a href=\&quot;#fragment\&quot;&gt;&lt;/a&gt;&lt;input id=prev&gt;&lt;a name=\&quot;fragment\&quot;&gt;&lt;/a&gt;&lt;input id=next&gt;'; clickLink(); moveFocus('forward'); document.activeElement.id&quot;, &quot;'next'&quot;);
-    
-    debug(&quot;\nFocusing an element should update sequential focus navigation starting point.&quot;);
-    shouldBe(&quot;container.innerHTML = '&lt;input id=prev&gt;&lt;input id=start&gt;&lt;input id=next&gt;'; focusStart(); moveFocus('forward'); document.activeElement.id&quot;, &quot;'next'&quot;);
-    
-    debug(&quot;\nAfter removing a focused element from the document tree, sequential focus navigation should start at a place where the focused element was.&quot;);
-    shouldBe(&quot;container.innerHTML = '&lt;input id=prev&gt;&lt;input id=start&gt;&lt;input id=next&gt;'; focusStart(); removeStart(); moveFocus('forward'); document.activeElement.id&quot;, &quot;'next'&quot;);
-    shouldBe(&quot;container.innerHTML = '&lt;input id=prev&gt;&lt;input id=start&gt;&lt;input id=next&gt;'; focusStart(); removeStart(); moveFocus('backward'); document.activeElement.id&quot;, &quot;'prev'&quot;);
-    shouldBe(&quot;container.innerHTML = '&lt;input id=prev&gt;&lt;div&gt;&lt;input id=start&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusStart(); removeDiv(); moveFocus('forward'); document.activeElement.id&quot;, &quot;'next'&quot;);
-    shouldBe(&quot;container.innerHTML = '&lt;div&gt;&lt;input id=start&gt;&lt;input id=prev&gt;&lt;/div&gt;&lt;input id=next&gt;'; focusStart(); removeStart(); moveFocus('forward'); document.activeElement.id&quot;, &quot;'prev'&quot;);
-}
-
-&lt;/script&gt;
-&lt;/body&gt;
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -256,7 +256,6 @@
</span><span class="cx"> 
</span><span class="cx"> # No tab navigation support on iOS
</span><span class="cx"> fast/shadow-dom/negative-tabindex-on-shadow-host.html [ Failure ]
</span><del>-webkit.org/b/116046 fast/events/sequential-focus-navigation-starting-point.html [ Skip ]
</del><span class="cx"> 
</span><span class="cx"> webkit.org/b/150225 fast/custom-elements [ Pass ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/Source/WebCore/ChangeLog        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-05-05  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r200479.
+        https://bugs.webkit.org/show_bug.cgi?id=157397
+
+        A LayoutTest added with this change is crashing on Mac WK1
+        test runs. (Requested by ryanhaddad on #webkit).
+
+        Reverted changeset:
+
+        &quot;For keyboard users, activating a fragment URL should transfer
+        focus and caret to the destination&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=116046
+        http://trac.webkit.org/changeset/200479
+
</ins><span class="cx"> 2016-05-05  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CORS check is sometimes incorrectly failing for media loads
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -691,7 +691,6 @@
</span><span class="cx">         m_activeElement = nullptr;
</span><span class="cx">         m_titleElement = nullptr;
</span><span class="cx">         m_documentElement = nullptr;
</span><del>-        m_focusNavigationStartingNode = nullptr;
</del><span class="cx">         m_userActionElements.documentDidRemoveLastRef();
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">         m_fullScreenElement = nullptr;
</span><span class="lines">@@ -2312,7 +2311,6 @@
</span><span class="cx">     m_hoveredElement = nullptr;
</span><span class="cx">     m_focusedElement = nullptr;
</span><span class="cx">     m_activeElement = nullptr;
</span><del>-    m_focusNavigationStartingNode = nullptr;
</del><span class="cx"> 
</span><span class="cx">     if (m_documentElement)
</span><span class="cx">         RenderTreeUpdater::tearDownRenderers(*m_documentElement);
</span><span class="lines">@@ -3713,10 +3711,8 @@
</span><span class="cx">     else
</span><span class="cx">         nodeInSubtree = (focusedElement == node) || focusedElement-&gt;isDescendantOf(node);
</span><span class="cx">     
</span><del>-    if (nodeInSubtree) {
</del><ins>+    if (nodeInSubtree)
</ins><span class="cx">         setFocusedElement(nullptr);
</span><del>-        setFocusNavigationStartingNode(focusedElement);
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::hoveredElementDidDetach(Element* element)
</span><span class="lines">@@ -3776,7 +3772,6 @@
</span><span class="cx">             oldFocusedElement-&gt;setActive(false);
</span><span class="cx"> 
</span><span class="cx">         oldFocusedElement-&gt;setFocus(false);
</span><del>-        setFocusNavigationStartingNode(nullptr);
</del><span class="cx"> 
</span><span class="cx">         // Dispatch a change event for form control elements that have been edited.
</span><span class="cx">         if (is&lt;HTMLFormControlElement&gt;(*oldFocusedElement)) {
</span><span class="lines">@@ -3824,7 +3819,6 @@
</span><span class="cx">         }
</span><span class="cx">         // Set focus on the new node
</span><span class="cx">         m_focusedElement = newFocusedElement;
</span><del>-        setFocusNavigationStartingNode(m_focusedElement.get());
</del><span class="cx"> 
</span><span class="cx">         // Dispatch the focus event and let the node do any other focus related activities (important for text fields)
</span><span class="cx">         m_focusedElement-&gt;dispatchFocusEvent(oldFocusedElement.copyRef(), direction);
</span><span class="lines">@@ -3891,59 +3885,6 @@
</span><span class="cx">     return !focusChangeBlocked;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool isNodeFrameOrDocument(Node&amp; node)
-{
-    return is&lt;HTMLIFrameElement&gt;(node) || is&lt;HTMLHtmlElement&gt;(node) || is&lt;HTMLDocument&gt;(node);
-}
-
-void Document::setFocusNavigationStartingNode(Node* node)
-{
-    if (!m_frame)
-        return;
-
-    m_focusNavigationStartingNodeIsRemoved = false;
-    if (!node || isNodeFrameOrDocument(*node)) {
-        m_focusNavigationStartingNode = nullptr;
-        return;
-    }
-
-    m_focusNavigationStartingNode = node;
-}
-
-Element* Document::focusNavigationStartingNode(FocusDirection direction) const
-{
-    if (m_focusedElement) {
-        if (!m_focusNavigationStartingNode || !m_focusNavigationStartingNode-&gt;isDescendantOf(m_focusedElement.get()))
-            return m_focusedElement.get();
-    }
-
-    if (!m_focusNavigationStartingNode)
-        return nullptr;
-
-    Node* node = m_focusNavigationStartingNode.get();
-    
-    // When the node was removed from the document tree. This case is not specified in the spec:
-    // https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point
-    // Current behaivor is to move the sequential navigation node to / after (based on the focus direction)
-    // the previous sibling of the removed node.
-    if (m_focusNavigationStartingNodeIsRemoved) {
-        Node* nextNode = NodeTraversal::next(*node);
-        if (direction == FocusDirectionForward)
-            return ElementTraversal::previous(*nextNode);
-        if (is&lt;Element&gt;(*nextNode))
-            return downcast&lt;Element&gt;(nextNode);
-        return ElementTraversal::next(*nextNode);
-    }
-
-    if (is&lt;Element&gt;(*node))
-        return downcast&lt;Element&gt;(node);
-    // When going forward, the sibling needs to be an element prior to the next focusable element.
-    // Similar logic goes to the backwards case.
-    if (Element* sibling = direction == FocusDirectionForward ? ElementTraversal::previous(*node) : ElementTraversal::next(*node))
-        return sibling;
-    return node-&gt;parentOrShadowHostElement();
-}
-
</del><span class="cx"> void Document::setCSSTarget(Element* n)
</span><span class="cx"> {
</span><span class="cx">     if (m_cssTarget)
</span><span class="lines">@@ -4058,8 +3999,6 @@
</span><span class="cx">         for (Text* textNode = TextNodeTraversal::firstChild(container); textNode; textNode = TextNodeTraversal::nextSibling(*textNode))
</span><span class="cx">             m_markers-&gt;removeMarkers(textNode);
</span><span class="cx">     }
</span><del>-
-    updateFocusNavigationStartingNodeWithNodeRemoval(container, true);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::nodeWillBeRemoved(Node&amp; n)
</span><span class="lines">@@ -4078,37 +4017,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (is&lt;Text&gt;(n))
</span><span class="cx">         m_markers-&gt;removeMarkers(&amp;n);
</span><del>-
-    updateFocusNavigationStartingNodeWithNodeRemoval(n, false);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Node* fallbackFocusNavigationStartingNodeAfterRemoval(Node&amp; node)
-{
-    return node.previousSibling() ? node.previousSibling() : node.parentNode();
-}
-
-void Document::updateFocusNavigationStartingNodeWithNodeRemoval(Node&amp; node, bool removeChildren)
-{
-    if (!m_focusNavigationStartingNode)
-        return;
-
-    if (m_focusNavigationStartingNode.get() == &amp;node) {
-        if (removeChildren)
-            return;
-        m_focusNavigationStartingNode = fallbackFocusNavigationStartingNodeAfterRemoval(node);
-        m_focusNavigationStartingNodeIsRemoved = true;
-        return;
-    }
-
-    for (Node* parentNode = m_focusNavigationStartingNode-&gt;parentNode(); parentNode; parentNode = parentNode-&gt;parentNode()) {
-        if (parentNode == &amp;node) {
-            m_focusNavigationStartingNode = removeChildren ? &amp;node : fallbackFocusNavigationStartingNodeAfterRemoval(node);
-            m_focusNavigationStartingNodeIsRemoved = true;
-            return;
-        }
-    }
-}
-
</del><span class="cx"> void Document::textInserted(Node* text, unsigned offset, unsigned length)
</span><span class="cx"> {
</span><span class="cx">     if (!m_ranges.isEmpty()) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/Source/WebCore/dom/Document.h        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -729,9 +729,6 @@
</span><span class="cx">     UserActionElementSet&amp; userActionElements()  { return m_userActionElements; }
</span><span class="cx">     const UserActionElementSet&amp; userActionElements() const { return m_userActionElements; }
</span><span class="cx"> 
</span><del>-    void setFocusNavigationStartingNode(Node*);
-    Element* focusNavigationStartingNode(FocusDirection) const;
-
</del><span class="cx">     void removeFocusedNodeOfSubtree(Node*, bool amongChildrenOnly = false);
</span><span class="cx">     void hoveredElementDidDetach(Element*);
</span><span class="cx">     void elementInActiveChainDidDetach(Element*);
</span><span class="lines">@@ -771,7 +768,6 @@
</span><span class="cx">     void nodeChildrenWillBeRemoved(ContainerNode&amp;);
</span><span class="cx">     // nodeWillBeRemoved is only safe when removing one node at a time.
</span><span class="cx">     void nodeWillBeRemoved(Node&amp;);
</span><del>-    void updateFocusNavigationStartingNodeWithNodeRemoval(Node&amp;, bool);
</del><span class="cx">     enum class AcceptChildOperation { Replace, InsertOrAdd };
</span><span class="cx">     bool canAcceptChild(const Node&amp; newChild, const Node* refChild, AcceptChildOperation) const;
</span><span class="cx"> 
</span><span class="lines">@@ -1468,8 +1464,6 @@
</span><span class="cx"> 
</span><span class="cx">     Color m_textColor;
</span><span class="cx"> 
</span><del>-    bool m_focusNavigationStartingNodeIsRemoved;
-    RefPtr&lt;Node&gt; m_focusNavigationStartingNode;
</del><span class="cx">     RefPtr&lt;Element&gt; m_focusedElement;
</span><span class="cx">     RefPtr&lt;Element&gt; m_hoveredElement;
</span><span class="cx">     RefPtr&lt;Element&gt; m_activeElement;
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -793,7 +793,6 @@
</span><span class="cx">         focusDocumentView();
</span><span class="cx"> 
</span><span class="cx">     m_mousePressNode = event.targetNode();
</span><del>-    m_frame.document()-&gt;setFocusNavigationStartingNode(event.targetNode());
</del><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     m_dragStartPos = event.event().position();
</span><span class="cx"> #endif
</span><span class="lines">@@ -1649,7 +1648,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_mousePressNode = mouseEvent.targetNode();
</span><del>-    m_frame.document()-&gt;setFocusNavigationStartingNode(mouseEvent.targetNode());
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Frame&gt; subframe = subframeForHitTestResult(mouseEvent);
</span><span class="cx">     if (subframe &amp;&amp; passMousePressEventToSubframe(mouseEvent, subframe.get())) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/Source/WebCore/page/FocusController.cpp        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx">     Frame&amp; frame = focusedOrMainFrame();
</span><span class="cx">     Document* document = frame.document();
</span><span class="cx"> 
</span><del>-    Node* currentNode = document-&gt;focusNavigationStartingNode(direction);
</del><ins>+    Node* currentNode = document-&gt;focusedElement();
</ins><span class="cx">     // FIXME: Not quite correct when it comes to focus transitions leaving/entering the WebView itself
</span><span class="cx">     bool caretBrowsing = frame.settings().caretBrowsingEnabled();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (200493 => 200494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-05-05 23:27:08 UTC (rev 200493)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-05-05 23:30:21 UTC (rev 200494)
</span><span class="lines">@@ -2090,14 +2090,8 @@
</span><span class="cx">     maintainScrollPositionAtAnchor(scrollPositionAnchor);
</span><span class="cx">     
</span><span class="cx">     // If the anchor accepts keyboard focus, move focus there to aid users relying on keyboard navigation.
</span><del>-    if (anchorElement) {
-        if (anchorElement-&gt;isFocusable())
-            document.setFocusedElement(anchorElement);
-        else {
-            document.setFocusedElement(nullptr);
-            document.setFocusNavigationStartingNode(anchorElement);
-        }
-    }
</del><ins>+    if (anchorElement &amp;&amp; anchorElement-&gt;isFocusable())
+        document.setFocusedElement(anchorElement);
</ins><span class="cx">     
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>