<!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:
"For keyboard users, activating a fragment URL should transfer
focus and caret to the destination"
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 <commit-queue@webkit.org>
+
+ 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:
+
+ "For keyboard users, activating a fragment URL should transfer
+ focus and caret to the destination"
+ https://bugs.webkit.org/show_bug.cgi?id=116046
+ http://trac.webkit.org/changeset/200479
+
</ins><span class="cx"> 2016-05-05 Chris Dumez <cdumez@apple.com>
</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("document.activeElement", "document.getElementById('fragment1')");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-debug("Activate a link that does not have a focusable fragment and verify that the currently focused element is unfocused.");
</del><ins>+debug("Activate a link that does not have a focusable fragment and verify focus does not move.");
</ins><span class="cx"> var link2 = document.getElementById("link2");
</span><span class="cx"> link2.focus();
</span><span class="cx"> shouldBe("document.activeElement", "link2");
</span><span class="cx"> link2.click();
</span><del>-shouldBe("document.activeElement", "document.body");
</del><ins>+shouldBe("document.activeElement", "link2");
</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 = '<input id=prev><div style="height:200px;"><span>text</span></div><input id=next>'; focusSpan(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '<input id=prev><div style="height:200px;"><span>text</span></div><input id=next>'; focusSpan(); moveFocus('backward'); document.activeElement.id is 'prev'
-PASS container.innerHTML = '<span style="font-size:60px;"><input id=prev>Text Text<input id=next></span>'; focusSpan(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '<span style="font-size:60px;"><input id=prev>Text Text<input id=next></span>'; focusSpan(); moveFocus('backward'); document.activeElement.id is 'prev'
-
-Fragment navigation should update sequential focus navigation starting point.
-PASS container.innerHTML = '<a href="#fragment"></a><input id=prev><a name="fragment"></a><input id=next>'; clickLink(); moveFocus('forward'); document.activeElement.id is 'next'
-
-Focusing an element should update sequential focus navigation starting point.
-PASS container.innerHTML = '<input id=prev><input id=start><input id=next>'; 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 = '<input id=prev><input id=start><input id=next>'; focusStart(); removeStart(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '<input id=prev><input id=start><input id=next>'; focusStart(); removeStart(); moveFocus('backward'); document.activeElement.id is 'prev'
-PASS container.innerHTML = '<input id=prev><div><input id=start></div><input id=next>'; focusStart(); removeDiv(); moveFocus('forward'); document.activeElement.id is 'next'
-PASS container.innerHTML = '<div><input id=start><input id=prev></div><input id=next>'; 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>-<!DOCTYPE html>
-<body onload="runTest();">
-<script src="../../resources/js-test-pre.js"></script>
-<script src="../forms/resources/common.js"></script>
-<div id="log"></div>
-<div id="container"></div>
-<script>
-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("Mouse press should update sequential focus navigation starting point.");
- var container = document.querySelector('#container');
-
- shouldBe("container.innerHTML = '<input id=prev><div style=\"height:200px;\"><span>text</span></div><input id=next>'; focusSpan(); moveFocus('forward'); document.activeElement.id", "'next'");
- eventSender.mouseUp();
- shouldBe("container.innerHTML = '<input id=prev><div style=\"height:200px;\"><span>text</span></div><input id=next>'; focusSpan(); moveFocus('backward'); document.activeElement.id", "'prev'");
- eventSender.mouseUp();
- shouldBe("container.innerHTML = '<span style=\"font-size:60px;\"><input id=prev>Text Text<input id=next></span>'; focusSpan(); moveFocus('forward'); document.activeElement.id", "'next'");
- eventSender.mouseUp();
- shouldBe("container.innerHTML = '<span style=\"font-size:60px;\"><input id=prev>Text Text<input id=next></span>'; focusSpan(); moveFocus('backward'); document.activeElement.id", "'prev'");
- eventSender.mouseUp();
-
- debug("\nFragment navigation should update sequential focus navigation starting point.");
- shouldBe("container.innerHTML = '<a href=\"#fragment\"></a><input id=prev><a name=\"fragment\"></a><input id=next>'; clickLink(); moveFocus('forward'); document.activeElement.id", "'next'");
-
- debug("\nFocusing an element should update sequential focus navigation starting point.");
- shouldBe("container.innerHTML = '<input id=prev><input id=start><input id=next>'; focusStart(); moveFocus('forward'); document.activeElement.id", "'next'");
-
- debug("\nAfter removing a focused element from the document tree, sequential focus navigation should start at a place where the focused element was.");
- shouldBe("container.innerHTML = '<input id=prev><input id=start><input id=next>'; focusStart(); removeStart(); moveFocus('forward'); document.activeElement.id", "'next'");
- shouldBe("container.innerHTML = '<input id=prev><input id=start><input id=next>'; focusStart(); removeStart(); moveFocus('backward'); document.activeElement.id", "'prev'");
- shouldBe("container.innerHTML = '<input id=prev><div><input id=start></div><input id=next>'; focusStart(); removeDiv(); moveFocus('forward'); document.activeElement.id", "'next'");
- shouldBe("container.innerHTML = '<div><input id=start><input id=prev></div><input id=next>'; focusStart(); removeStart(); moveFocus('forward'); document.activeElement.id", "'prev'");
-}
-
-</script>
-</body>
</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 <commit-queue@webkit.org>
+
+ 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:
+
+ "For keyboard users, activating a fragment URL should transfer
+ focus and caret to the destination"
+ https://bugs.webkit.org/show_bug.cgi?id=116046
+ http://trac.webkit.org/changeset/200479
+
</ins><span class="cx"> 2016-05-05 Chris Dumez <cdumez@apple.com>
</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->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->setActive(false);
</span><span class="cx">
</span><span class="cx"> oldFocusedElement->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<HTMLFormControlElement>(*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->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& node)
-{
- return is<HTMLIFrameElement>(node) || is<HTMLHtmlElement>(node) || is<HTMLDocument>(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->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<Element>(*nextNode))
- return downcast<Element>(nextNode);
- return ElementTraversal::next(*nextNode);
- }
-
- if (is<Element>(*node))
- return downcast<Element>(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->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->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& n)
</span><span class="lines">@@ -4078,37 +4017,8 @@
</span><span class="cx">
</span><span class="cx"> if (is<Text>(n))
</span><span class="cx"> m_markers->removeMarkers(&n);
</span><del>-
- updateFocusNavigationStartingNodeWithNodeRemoval(n, false);
</del><span class="cx"> }
</span><span class="cx">
</span><del>-static Node* fallbackFocusNavigationStartingNodeAfterRemoval(Node& node)
-{
- return node.previousSibling() ? node.previousSibling() : node.parentNode();
-}
-
-void Document::updateFocusNavigationStartingNodeWithNodeRemoval(Node& node, bool removeChildren)
-{
- if (!m_focusNavigationStartingNode)
- return;
-
- if (m_focusNavigationStartingNode.get() == &node) {
- if (removeChildren)
- return;
- m_focusNavigationStartingNode = fallbackFocusNavigationStartingNodeAfterRemoval(node);
- m_focusNavigationStartingNodeIsRemoved = true;
- return;
- }
-
- for (Node* parentNode = m_focusNavigationStartingNode->parentNode(); parentNode; parentNode = parentNode->parentNode()) {
- if (parentNode == &node) {
- m_focusNavigationStartingNode = removeChildren ? &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& userActionElements() { return m_userActionElements; }
</span><span class="cx"> const UserActionElementSet& 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&);
</span><span class="cx"> // nodeWillBeRemoved is only safe when removing one node at a time.
</span><span class="cx"> void nodeWillBeRemoved(Node&);
</span><del>- void updateFocusNavigationStartingNodeWithNodeRemoval(Node&, bool);
</del><span class="cx"> enum class AcceptChildOperation { Replace, InsertOrAdd };
</span><span class="cx"> bool canAcceptChild(const Node& 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<Node> m_focusNavigationStartingNode;
</del><span class="cx"> RefPtr<Element> m_focusedElement;
</span><span class="cx"> RefPtr<Element> m_hoveredElement;
</span><span class="cx"> RefPtr<Element> 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()->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()->setFocusNavigationStartingNode(mouseEvent.targetNode());
</del><span class="cx">
</span><span class="cx"> RefPtr<Frame> subframe = subframeForHitTestResult(mouseEvent);
</span><span class="cx"> if (subframe && 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& frame = focusedOrMainFrame();
</span><span class="cx"> Document* document = frame.document();
</span><span class="cx">
</span><del>- Node* currentNode = document->focusNavigationStartingNode(direction);
</del><ins>+ Node* currentNode = document->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->isFocusable())
- document.setFocusedElement(anchorElement);
- else {
- document.setFocusedElement(nullptr);
- document.setFocusNavigationStartingNode(anchorElement);
- }
- }
</del><ins>+ if (anchorElement && anchorElement->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>