<!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>[205290] trunk/Source/WebCore</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/205290">205290</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2016-09-01 07:22:33 -0700 (Thu, 01 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>FocusController should pass KeyboardEvent around by reference.
&lt;https://webkit.org/b/161461&gt;

Reviewed by Sam Weinig.

Clean up FocusController to pass KeyboardEvent&amp; around internally.

Also make FocusController::setInitialFocus() synthesize a dummy KeyboardEvent
if one isn't provided, just like nextFocusableElement()/previousFocusableElement() does.
This way we can feel confident about dereferencing the formerly KeyboardEvent* everywhere.

* page/EventHandler.cpp:
(WebCore::EventHandler::defaultArrowEventHandler):
(WebCore::EventHandler::defaultTabEventHandler):
* page/FocusController.cpp:
(WebCore::isFocusableElementOrScopeOwner):
(WebCore::isNonFocusableScopeOwner):
(WebCore::isFocusableScopeOwner):
(WebCore::shadowAdjustedTabIndex):
(WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
(WebCore::FocusController::setInitialFocus):
(WebCore::FocusController::advanceFocus):
(WebCore::FocusController::advanceFocusInDocumentOrder):
(WebCore::FocusController::findFocusableElementAcrossFocusScope):
(WebCore::FocusController::findFocusableElementWithinScope):
(WebCore::FocusController::nextFocusableElementWithinScope):
(WebCore::FocusController::previousFocusableElementWithinScope):
(WebCore::FocusController::findFocusableElementOrScopeOwner):
(WebCore::FocusController::findElementWithExactTabIndex):
(WebCore::nextElementWithGreaterTabIndex):
(WebCore::previousElementWithLowerTabIndex):
(WebCore::FocusController::nextFocusableElement):
(WebCore::FocusController::previousFocusableElement):
(WebCore::FocusController::nextFocusableElementOrScopeOwner):
(WebCore::FocusController::previousFocusableElementOrScopeOwner):
(WebCore::FocusController::findFocusCandidateInContainer):
(WebCore::FocusController::advanceFocusDirectionallyInContainer):
(WebCore::FocusController::advanceFocusDirectionally):
* page/FocusController.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorepageFocusControllerh">trunk/Source/WebCore/page/FocusController.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205289 => 205290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-01 14:14:05 UTC (rev 205289)
+++ trunk/Source/WebCore/ChangeLog        2016-09-01 14:22:33 UTC (rev 205290)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-09-01  Andreas Kling  &lt;akling@apple.com&gt;
+
+        FocusController should pass KeyboardEvent around by reference.
+        &lt;https://webkit.org/b/161461&gt;
+
+        Reviewed by Sam Weinig.
+
+        Clean up FocusController to pass KeyboardEvent&amp; around internally.
+
+        Also make FocusController::setInitialFocus() synthesize a dummy KeyboardEvent
+        if one isn't provided, just like nextFocusableElement()/previousFocusableElement() does.
+        This way we can feel confident about dereferencing the formerly KeyboardEvent* everywhere.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::defaultArrowEventHandler):
+        (WebCore::EventHandler::defaultTabEventHandler):
+        * page/FocusController.cpp:
+        (WebCore::isFocusableElementOrScopeOwner):
+        (WebCore::isNonFocusableScopeOwner):
+        (WebCore::isFocusableScopeOwner):
+        (WebCore::shadowAdjustedTabIndex):
+        (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
+        (WebCore::FocusController::setInitialFocus):
+        (WebCore::FocusController::advanceFocus):
+        (WebCore::FocusController::advanceFocusInDocumentOrder):
+        (WebCore::FocusController::findFocusableElementAcrossFocusScope):
+        (WebCore::FocusController::findFocusableElementWithinScope):
+        (WebCore::FocusController::nextFocusableElementWithinScope):
+        (WebCore::FocusController::previousFocusableElementWithinScope):
+        (WebCore::FocusController::findFocusableElementOrScopeOwner):
+        (WebCore::FocusController::findElementWithExactTabIndex):
+        (WebCore::nextElementWithGreaterTabIndex):
+        (WebCore::previousElementWithLowerTabIndex):
+        (WebCore::FocusController::nextFocusableElement):
+        (WebCore::FocusController::previousFocusableElement):
+        (WebCore::FocusController::nextFocusableElementOrScopeOwner):
+        (WebCore::FocusController::previousFocusableElementOrScopeOwner):
+        (WebCore::FocusController::findFocusCandidateInContainer):
+        (WebCore::FocusController::advanceFocusDirectionallyInContainer):
+        (WebCore::FocusController::advanceFocusDirectionally):
+        * page/FocusController.h:
+
</ins><span class="cx"> 2016-09-01  Romain Bellessort  &lt;romain.bellessort@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Align internal structure of ReadableStream with spec
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (205289 => 205290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2016-09-01 14:14:05 UTC (rev 205289)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2016-09-01 14:22:33 UTC (rev 205290)
</span><span class="lines">@@ -3666,7 +3666,7 @@
</span><span class="cx">     if (m_frame.document()-&gt;inDesignMode())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (page-&gt;focusController().advanceFocus(focusDirection, &amp;event))
</del><ins>+    if (page-&gt;focusController().advanceFocus(focusDirection, event))
</ins><span class="cx">         event.setDefaultHandled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3690,7 +3690,7 @@
</span><span class="cx">     if (m_frame.document()-&gt;inDesignMode())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (page-&gt;focusController().advanceFocus(focusDirection, &amp;event))
</del><ins>+    if (page-&gt;focusController().advanceFocus(focusDirection, event))
</ins><span class="cx">         event.setDefaultHandled();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (205289 => 205290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2016-09-01 14:14:05 UTC (rev 205289)
+++ trunk/Source/WebCore/page/FocusController.cpp        2016-09-01 14:22:33 UTC (rev 205290)
</span><span class="lines">@@ -289,22 +289,22 @@
</span><span class="cx">         document-&gt;focusedElement()-&gt;dispatchFocusEvent(nullptr, FocusDirectionNone);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isFocusableElementOrScopeOwner(Element&amp; element, KeyboardEvent* event)
</del><ins>+static inline bool isFocusableElementOrScopeOwner(Element&amp; element, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><del>-    return element.isKeyboardFocusable(*event) || isFocusScopeOwner(element);
</del><ins>+    return element.isKeyboardFocusable(event) || isFocusScopeOwner(element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isNonFocusableScopeOwner(Element&amp; element, KeyboardEvent* event)
</del><ins>+static inline bool isNonFocusableScopeOwner(Element&amp; element, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><del>-    return !element.isKeyboardFocusable(*event) &amp;&amp; isFocusScopeOwner(element);
</del><ins>+    return !element.isKeyboardFocusable(event) &amp;&amp; isFocusScopeOwner(element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isFocusableScopeOwner(Element&amp; element, KeyboardEvent* event)
</del><ins>+static inline bool isFocusableScopeOwner(Element&amp; element, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><del>-    return element.isKeyboardFocusable(*event) &amp;&amp; isFocusScopeOwner(element);
</del><ins>+    return element.isKeyboardFocusable(event) &amp;&amp; isFocusScopeOwner(element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline int shadowAdjustedTabIndex(Element&amp; element, KeyboardEvent* event)
</del><ins>+static inline int shadowAdjustedTabIndex(Element&amp; element, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     if (isNonFocusableScopeOwner(element, event)) {
</span><span class="cx">         if (!element.tabIndexSetExplicitly())
</span><span class="lines">@@ -376,7 +376,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::findFocusableElementDescendingDownIntoFrameDocument(FocusDirection direction, Element* element, KeyboardEvent* event)
</del><ins>+Element* FocusController::findFocusableElementDescendingDownIntoFrameDocument(FocusDirection direction, Element* element, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     // The node we found might be a HTMLFrameOwnerElement, so descend down the tree until we find either:
</span><span class="cx">     // 1) a focusable node, or
</span><span class="lines">@@ -394,9 +394,13 @@
</span><span class="cx">     return element;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FocusController::setInitialFocus(FocusDirection direction, KeyboardEvent* event)
</del><ins>+bool FocusController::setInitialFocus(FocusDirection direction, KeyboardEvent* providedEvent)
</ins><span class="cx"> {
</span><del>-    bool didAdvanceFocus = advanceFocus(direction, event, true);
</del><ins>+    RefPtr&lt;KeyboardEvent&gt; event = providedEvent;
+    if (!event)
+        event = KeyboardEvent::createForDummy();
+
+    bool didAdvanceFocus = advanceFocus(direction, *event, true);
</ins><span class="cx">     
</span><span class="cx">     // If focus is being set initially, accessibility needs to be informed that system focus has moved 
</span><span class="cx">     // into the web area again, even if focus did not change within WebCore. PostNotification is called instead
</span><span class="lines">@@ -407,7 +411,7 @@
</span><span class="cx">     return didAdvanceFocus;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FocusController::advanceFocus(FocusDirection direction, KeyboardEvent* event, bool initialFocus)
</del><ins>+bool FocusController::advanceFocus(FocusDirection direction, KeyboardEvent&amp; event, bool initialFocus)
</ins><span class="cx"> {
</span><span class="cx">     switch (direction) {
</span><span class="cx">     case FocusDirectionForward:
</span><span class="lines">@@ -425,7 +429,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FocusController::advanceFocusInDocumentOrder(FocusDirection direction, KeyboardEvent* event, bool initialFocus)
</del><ins>+bool FocusController::advanceFocusInDocumentOrder(FocusDirection direction, KeyboardEvent&amp; event, bool initialFocus)
</ins><span class="cx"> {
</span><span class="cx">     Frame&amp; frame = focusedOrMainFrame();
</span><span class="cx">     Document* document = frame.document();
</span><span class="lines">@@ -464,7 +468,7 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (is&lt;HTMLFrameOwnerElement&gt;(*element) &amp;&amp; (!is&lt;HTMLPlugInElement&gt;(*element) || !element-&gt;isKeyboardFocusable(*event))) {
</del><ins>+    if (is&lt;HTMLFrameOwnerElement&gt;(*element) &amp;&amp; (!is&lt;HTMLPlugInElement&gt;(*element) || !element-&gt;isKeyboardFocusable(event))) {
</ins><span class="cx">         // We focus frames rather than frame owners.
</span><span class="cx">         // FIXME: We should not focus frames that have no scrollbars, as focusing them isn't useful to the user.
</span><span class="cx">         HTMLFrameOwnerElement&amp; owner = downcast&lt;HTMLFrameOwnerElement&gt;(*element);
</span><span class="lines">@@ -502,7 +506,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::findFocusableElementAcrossFocusScope(FocusDirection direction, const FocusNavigationScope&amp; scope, Node* currentNode, KeyboardEvent* event)
</del><ins>+Element* FocusController::findFocusableElementAcrossFocusScope(FocusDirection direction, const FocusNavigationScope&amp; scope, Node* currentNode, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!is&lt;Element&gt;(currentNode) || !isNonFocusableScopeOwner(downcast&lt;Element&gt;(*currentNode), event));
</span><span class="cx"> 
</span><span class="lines">@@ -528,7 +532,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::findFocusableElementWithinScope(FocusDirection direction, const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent* event)
</del><ins>+Element* FocusController::findFocusableElementWithinScope(FocusDirection direction, const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     // Starting node is exclusive.
</span><span class="cx">     Element* candidate = direction == FocusDirectionForward
</span><span class="lines">@@ -537,7 +541,7 @@
</span><span class="cx">     return findFocusableElementDescendingDownIntoFrameDocument(direction, candidate, event);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::nextFocusableElementWithinScope(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent* event)
</del><ins>+Element* FocusController::nextFocusableElementWithinScope(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     Element* found = nextFocusableElementOrScopeOwner(scope, start, event);
</span><span class="cx">     if (!found)
</span><span class="lines">@@ -550,7 +554,7 @@
</span><span class="cx">     return found;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::previousFocusableElementWithinScope(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent* event)
</del><ins>+Element* FocusController::previousFocusableElementWithinScope(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     Element* found = previousFocusableElementOrScopeOwner(scope, start, event);
</span><span class="cx">     if (!found)
</span><span class="lines">@@ -569,7 +573,7 @@
</span><span class="cx">     return found;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::findFocusableElementOrScopeOwner(FocusDirection direction, const FocusNavigationScope&amp; scope, Node* node, KeyboardEvent* event)
</del><ins>+Element* FocusController::findFocusableElementOrScopeOwner(FocusDirection direction, const FocusNavigationScope&amp; scope, Node* node, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     return (direction == FocusDirectionForward)
</span><span class="cx">         ? nextFocusableElementOrScopeOwner(scope, node, event)
</span><span class="lines">@@ -576,7 +580,7 @@
</span><span class="cx">         : previousFocusableElementOrScopeOwner(scope, node, event);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::findElementWithExactTabIndex(const FocusNavigationScope&amp; scope, Node* start, int tabIndex, KeyboardEvent* event, FocusDirection direction)
</del><ins>+Element* FocusController::findElementWithExactTabIndex(const FocusNavigationScope&amp; scope, Node* start, int tabIndex, KeyboardEvent&amp; event, FocusDirection direction)
</ins><span class="cx"> {
</span><span class="cx">     // Search is inclusive of start
</span><span class="cx">     for (Node* node = start; node; node = direction == FocusDirectionForward ? scope.nextInScope(node) : scope.previousInScope(node)) {
</span><span class="lines">@@ -589,7 +593,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Element* nextElementWithGreaterTabIndex(const FocusNavigationScope&amp; scope, int tabIndex, KeyboardEvent* event)
</del><ins>+static Element* nextElementWithGreaterTabIndex(const FocusNavigationScope&amp; scope, int tabIndex, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     // Search is inclusive of start
</span><span class="cx">     int winningTabIndex = std::numeric_limits&lt;int&gt;::max();
</span><span class="lines">@@ -608,7 +612,7 @@
</span><span class="cx">     return winner;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Element* previousElementWithLowerTabIndex(const FocusNavigationScope&amp; scope, Node* start, int tabIndex, KeyboardEvent* event)
</del><ins>+static Element* previousElementWithLowerTabIndex(const FocusNavigationScope&amp; scope, Node* start, int tabIndex, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     // Search is inclusive of start
</span><span class="cx">     int winningTabIndex = 0;
</span><span class="lines">@@ -630,7 +634,7 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: This can return a non-focusable shadow host.
</span><span class="cx">     Ref&lt;KeyboardEvent&gt; keyEvent = KeyboardEvent::createForDummy();
</span><del>-    return nextFocusableElementOrScopeOwner(FocusNavigationScope::scopeOf(start), &amp;start, keyEvent.ptr());
</del><ins>+    return nextFocusableElementOrScopeOwner(FocusNavigationScope::scopeOf(start), &amp;start, keyEvent.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Element* FocusController::previousFocusableElement(Node&amp; start)
</span><span class="lines">@@ -637,10 +641,10 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: This can return a non-focusable shadow host.
</span><span class="cx">     Ref&lt;KeyboardEvent&gt; keyEvent = KeyboardEvent::createForDummy();
</span><del>-    return previousFocusableElementOrScopeOwner(FocusNavigationScope::scopeOf(start), &amp;start, keyEvent.ptr());
</del><ins>+    return previousFocusableElementOrScopeOwner(FocusNavigationScope::scopeOf(start), &amp;start, keyEvent.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::nextFocusableElementOrScopeOwner(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent* event)
</del><ins>+Element* FocusController::nextFocusableElementOrScopeOwner(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     int startTabIndex = 0;
</span><span class="cx">     if (start &amp;&amp; is&lt;Element&gt;(*start))
</span><span class="lines">@@ -677,7 +681,7 @@
</span><span class="cx">     return findElementWithExactTabIndex(scope, scope.firstNodeInScope(), 0, event, FocusDirectionForward);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Element* FocusController::previousFocusableElementOrScopeOwner(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent* event)
</del><ins>+Element* FocusController::previousFocusableElementOrScopeOwner(const FocusNavigationScope&amp; scope, Node* start, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     Node* last = nullptr;
</span><span class="cx">     for (Node* node = scope.lastNodeInScope(); node; node = scope.lastChildInScope(*node))
</span><span class="lines">@@ -937,7 +941,7 @@
</span><span class="cx">         closest = candidate;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FocusController::findFocusCandidateInContainer(Node&amp; container, const LayoutRect&amp; startingRect, FocusDirection direction, KeyboardEvent* event, FocusCandidate&amp; closest)
</del><ins>+void FocusController::findFocusCandidateInContainer(Node&amp; container, const LayoutRect&amp; startingRect, FocusDirection direction, KeyboardEvent&amp; event, FocusCandidate&amp; closest)
</ins><span class="cx"> {
</span><span class="cx">     Node* focusedNode = (focusedFrame() &amp;&amp; focusedFrame()-&gt;document()) ? focusedFrame()-&gt;document()-&gt;focusedElement() : 0;
</span><span class="cx"> 
</span><span class="lines">@@ -954,7 +958,7 @@
</span><span class="cx">         if (element == focusedNode)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (!element-&gt;isKeyboardFocusable(*event) &amp;&amp; !element-&gt;isFrameOwnerElement() &amp;&amp; !canScrollInDirection(element, direction))
</del><ins>+        if (!element-&gt;isKeyboardFocusable(event) &amp;&amp; !element-&gt;isFrameOwnerElement() &amp;&amp; !canScrollInDirection(element, direction))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         FocusCandidate candidate = FocusCandidate(element, direction);
</span><span class="lines">@@ -977,7 +981,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FocusController::advanceFocusDirectionallyInContainer(Node* container, const LayoutRect&amp; startingRect, FocusDirection direction, KeyboardEvent* event)
</del><ins>+bool FocusController::advanceFocusDirectionallyInContainer(Node* container, const LayoutRect&amp; startingRect, FocusDirection direction, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     if (!container)
</span><span class="cx">         return false;
</span><span class="lines">@@ -1047,7 +1051,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FocusController::advanceFocusDirectionally(FocusDirection direction, KeyboardEvent* event)
</del><ins>+bool FocusController::advanceFocusDirectionally(FocusDirection direction, KeyboardEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     Document* focusedDocument = focusedOrMainFrame().document();
</span><span class="cx">     if (!focusedDocument)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.h (205289 => 205290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.h        2016-09-01 14:14:05 UTC (rev 205289)
+++ trunk/Source/WebCore/page/FocusController.h        2016-09-01 14:22:33 UTC (rev 205290)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     WEBCORE_EXPORT Frame&amp; focusedOrMainFrame() const;
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool setInitialFocus(FocusDirection, KeyboardEvent*);
</span><del>-    bool advanceFocus(FocusDirection, KeyboardEvent*, bool initialFocus = false);
</del><ins>+    bool advanceFocus(FocusDirection, KeyboardEvent&amp;, bool initialFocus = false);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool setFocusedElement(Element*, PassRefPtr&lt;Frame&gt;, FocusDirection = FocusDirectionNone);
</span><span class="cx"> 
</span><span class="lines">@@ -85,16 +85,16 @@
</span><span class="cx">     void setFocusedInternal(bool);
</span><span class="cx">     void setIsVisibleAndActiveInternal(bool);
</span><span class="cx"> 
</span><del>-    bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*);
-    bool advanceFocusInDocumentOrder(FocusDirection, KeyboardEvent*, bool initialFocus);
</del><ins>+    bool advanceFocusDirectionally(FocusDirection, KeyboardEvent&amp;);
+    bool advanceFocusInDocumentOrder(FocusDirection, KeyboardEvent&amp;, bool initialFocus);
</ins><span class="cx"> 
</span><del>-    Element* findFocusableElementAcrossFocusScope(FocusDirection, const FocusNavigationScope&amp; startScope, Node* start, KeyboardEvent*);
</del><ins>+    Element* findFocusableElementAcrossFocusScope(FocusDirection, const FocusNavigationScope&amp; startScope, Node* start, KeyboardEvent&amp;);
</ins><span class="cx"> 
</span><del>-    Element* findFocusableElementWithinScope(FocusDirection, const FocusNavigationScope&amp;, Node* start, KeyboardEvent*);
-    Element* nextFocusableElementWithinScope(const FocusNavigationScope&amp;, Node* start, KeyboardEvent*);
-    Element* previousFocusableElementWithinScope(const FocusNavigationScope&amp;, Node* start, KeyboardEvent*);
</del><ins>+    Element* findFocusableElementWithinScope(FocusDirection, const FocusNavigationScope&amp;, Node* start, KeyboardEvent&amp;);
+    Element* nextFocusableElementWithinScope(const FocusNavigationScope&amp;, Node* start, KeyboardEvent&amp;);
+    Element* previousFocusableElementWithinScope(const FocusNavigationScope&amp;, Node* start, KeyboardEvent&amp;);
</ins><span class="cx"> 
</span><del>-    Element* findFocusableElementDescendingDownIntoFrameDocument(FocusDirection, Element*, KeyboardEvent*);
</del><ins>+    Element* findFocusableElementDescendingDownIntoFrameDocument(FocusDirection, Element*, KeyboardEvent&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // Searches through the given tree scope, starting from start node, for the next/previous selectable element that comes after/before start node.
</span><span class="cx">     // The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab indexes
</span><span class="lines">@@ -105,15 +105,15 @@
</span><span class="cx">     // @return The focus node that comes after/before start node.
</span><span class="cx">     //
</span><span class="cx">     // See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1
</span><del>-    Element* findFocusableElementOrScopeOwner(FocusDirection, const FocusNavigationScope&amp;, Node* start, KeyboardEvent*);
</del><ins>+    Element* findFocusableElementOrScopeOwner(FocusDirection, const FocusNavigationScope&amp;, Node* start, KeyboardEvent&amp;);
</ins><span class="cx"> 
</span><del>-    Element* findElementWithExactTabIndex(const FocusNavigationScope&amp;, Node* start, int tabIndex, KeyboardEvent*, FocusDirection);
</del><ins>+    Element* findElementWithExactTabIndex(const FocusNavigationScope&amp;, Node* start, int tabIndex, KeyboardEvent&amp;, FocusDirection);
</ins><span class="cx">     
</span><del>-    Element* nextFocusableElementOrScopeOwner(const FocusNavigationScope&amp;, Node* start, KeyboardEvent*);
-    Element* previousFocusableElementOrScopeOwner(const FocusNavigationScope&amp;, Node* start, KeyboardEvent*);
</del><ins>+    Element* nextFocusableElementOrScopeOwner(const FocusNavigationScope&amp;, Node* start, KeyboardEvent&amp;);
+    Element* previousFocusableElementOrScopeOwner(const FocusNavigationScope&amp;, Node* start, KeyboardEvent&amp;);
</ins><span class="cx"> 
</span><del>-    bool advanceFocusDirectionallyInContainer(Node* container, const LayoutRect&amp; startingRect, FocusDirection, KeyboardEvent*);
-    void findFocusCandidateInContainer(Node&amp; container, const LayoutRect&amp; startingRect, FocusDirection, KeyboardEvent*, FocusCandidate&amp; closest);
</del><ins>+    bool advanceFocusDirectionallyInContainer(Node* container, const LayoutRect&amp; startingRect, FocusDirection, KeyboardEvent&amp;);
+    void findFocusCandidateInContainer(Node&amp; container, const LayoutRect&amp; startingRect, FocusDirection, KeyboardEvent&amp;, FocusCandidate&amp; closest);
</ins><span class="cx"> 
</span><span class="cx">     void focusRepaintTimerFired();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>