<!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>[150687] 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/150687">150687</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2013-05-25 05:02:35 -0700 (Sat, 25 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move Node::isKeyboardFocusable() to Element.
&lt;http://webkit.org/b/116761&gt;

Reviewed by Antti Koivisto.

Only Elements can be keyboard-focusable. Move the base isKeyboardFocusable() implementation to Element
and sprinkle OVERRIDE on subclass overrides.
FocusController gets some temporary type checks that will go away as that code moves to dealing in
Elements instead of Node.

* dom/Node.h:
* dom/Node.cpp:
* dom/Element.h:
* dom/Element.cpp:
(WebCore::Element::isKeyboardFocusable):

    Move isKeyboardFocusable() from Node to Element.

* page/FocusController.cpp:
(WebCore::isNonFocusableShadowHost):
(WebCore::isFocusableShadowHost):
(WebCore::shouldVisit):
(WebCore::FocusController::advanceFocusInDocumentOrder):

    Check that the inspected Node is an Element before querying isKeyboardFocusable().

* html/HTMLAnchorElement.h:
* html/HTMLAreaElement.h:
* html/HTMLFormControlElement.h:
* html/HTMLFrameOwnerElement.h:
* html/HTMLInputElement.h:
* html/HTMLPlugInElement.h:
* html/HTMLSelectElement.h:
* html/HTMLTextAreaElement.h:
* svg/SVGAElement.h:
* svg/SVGStyledElement.h:

    Sprinkle OVERRIDE.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementh">trunk/Source/WebCore/html/HTMLAnchorElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementh">trunk/Source/WebCore/html/HTMLAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementh">trunk/Source/WebCore/html/HTMLFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFrameOwnerElementh">trunk/Source/WebCore/html/HTMLFrameOwnerElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementh">trunk/Source/WebCore/html/HTMLPlugInElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSelectElementh">trunk/Source/WebCore/html/HTMLSelectElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementh">trunk/Source/WebCore/html/HTMLTextAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorepageFocusControllercpp">trunk/Source/WebCore/page/FocusController.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAElementh">trunk/Source/WebCore/svg/SVGAElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGStyledElementh">trunk/Source/WebCore/svg/SVGStyledElement.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/ChangeLog        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2013-05-25  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move Node::isKeyboardFocusable() to Element.
+        &lt;http://webkit.org/b/116761&gt;
+
+        Reviewed by Antti Koivisto.
+
+        Only Elements can be keyboard-focusable. Move the base isKeyboardFocusable() implementation to Element
+        and sprinkle OVERRIDE on subclass overrides.
+        FocusController gets some temporary type checks that will go away as that code moves to dealing in
+        Elements instead of Node.
+
+        * dom/Node.h:
+        * dom/Node.cpp:
+        * dom/Element.h:
+        * dom/Element.cpp:
+        (WebCore::Element::isKeyboardFocusable):
+
+            Move isKeyboardFocusable() from Node to Element.
+
+        * page/FocusController.cpp:
+        (WebCore::isNonFocusableShadowHost):
+        (WebCore::isFocusableShadowHost):
+        (WebCore::shouldVisit):
+        (WebCore::FocusController::advanceFocusInDocumentOrder):
+
+            Check that the inspected Node is an Element before querying isKeyboardFocusable().
+
+        * html/HTMLAnchorElement.h:
+        * html/HTMLAreaElement.h:
+        * html/HTMLFormControlElement.h:
+        * html/HTMLFrameOwnerElement.h:
+        * html/HTMLInputElement.h:
+        * html/HTMLPlugInElement.h:
+        * html/HTMLSelectElement.h:
+        * html/HTMLTextAreaElement.h:
+        * svg/SVGAElement.h:
+        * svg/SVGStyledElement.h:
+
+            Sprinkle OVERRIDE.
+
+2013-05-25  Andreas Kling  &lt;akling@apple.com&gt;
+
</ins><span class="cx">         Begin moving &quot;focus&quot; state logic from Node to Element.
</span><span class="cx">         &lt;http://webkit.org/b/116760&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/dom/Element.cpp        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -249,6 +249,11 @@
</span><span class="cx">     return hasRareData() ? elementRareData()-&gt;tabIndex() : 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Element::isKeyboardFocusable(KeyboardEvent*) const
+{
+    return isFocusable() &amp;&amp; tabIndex() &gt;= 0;
+}
+
</ins><span class="cx"> DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, blur);
</span><span class="cx"> DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, error);
</span><span class="cx"> DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, focus);
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/dom/Element.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -432,6 +432,8 @@
</span><span class="cx">     virtual void setHovered(bool flag = true);
</span><span class="cx">     virtual void setFocus(bool flag);
</span><span class="cx"> 
</span><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
+
</ins><span class="cx">     RenderStyle* computedStyle(PseudoId = NOPSEUDO);
</span><span class="cx"> 
</span><span class="cx">     // Methods for indicating the style is affected by dynamic updates (e.g., children changing, our position changing in our sibling list, etc.)
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/dom/Node.cpp        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -885,11 +885,6 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Node::isKeyboardFocusable(KeyboardEvent*) const
-{
-    return isFocusable() &amp;&amp; tabIndex() &gt;= 0;
-}
-
</del><span class="cx"> bool Node::isMouseFocusable() const
</span><span class="cx"> {
</span><span class="cx">     return isFocusable();
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/dom/Node.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -406,7 +406,6 @@
</span><span class="cx">     virtual bool supportsFocus() const;
</span><span class="cx">     // Whether the node can actually be focused.
</span><span class="cx">     virtual bool isFocusable() const;
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><span class="cx">     virtual bool isMouseFocusable() const;
</span><span class="cx">     virtual Node* focusDelegate();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx"> private:
</span><span class="cx">     virtual bool supportsFocus() const;
</span><span class="cx">     virtual bool isMouseFocusable() const;
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual void defaultEventHandler(Event*);
</span><span class="cx">     virtual void setActive(bool active = true, bool pause = false);
</span><span class="cx">     virtual void accessKeyAction(bool sendMouseEvents);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLAreaElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) OVERRIDE;
</span><span class="cx">     virtual bool supportsFocus() const;
</span><span class="cx">     virtual String target() const;
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isMouseFocusable() const;
</span><span class="cx">     virtual bool isFocusable() const;
</span><span class="cx">     virtual void updateFocusAppearance(bool /*restorePreviousSelection*/);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx">     virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     virtual bool supportsFocus() const;
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isMouseFocusable() const;
</span><span class="cx"> 
</span><span class="cx">     virtual void didRecalcStyle(StyleChange) OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFrameOwnerElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFrameOwnerElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFrameOwnerElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLFrameOwnerElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     void setSandboxFlags(SandboxFlags);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isFrameOwnerElement() const OVERRIDE { return true; }
</span><span class="cx"> 
</span><span class="cx">     Frame* m_contentFrame;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx">     virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     virtual bool hasCustomFocusLogic() const OVERRIDE;
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isMouseFocusable() const;
</span><span class="cx">     virtual bool isEnumeratable() const;
</span><span class="cx">     virtual bool supportLabels() const OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool supportsFocus() const OVERRIDE;
</span><span class="cx"> 
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isPluginElement() const;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;JSC::Bindings::Instance&gt; m_instance;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSelectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSelectElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSelectElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLSelectElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> private:
</span><span class="cx">     virtual const AtomicString&amp; formControlType() const;
</span><span class="cx">     
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isMouseFocusable() const;
</span><span class="cx"> 
</span><span class="cx">     virtual void dispatchFocusEvent(PassRefPtr&lt;Node&gt; oldFocusedNode, FocusDirection) OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">     virtual void reset();
</span><span class="cx">     virtual bool hasCustomFocusLogic() const OVERRIDE;
</span><span class="cx">     virtual bool isMouseFocusable() const;
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual void updateFocusAppearance(bool restorePreviousSelection);
</span><span class="cx"> 
</span><span class="cx">     virtual void accessKeyAction(bool sendMouseEvents);
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.cpp (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.cpp        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/page/FocusController.cpp        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -137,13 +137,13 @@
</span><span class="cx"> static inline bool isNonFocusableShadowHost(Node* node, KeyboardEvent* event)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(node);
</span><del>-    return !node-&gt;isKeyboardFocusable(event) &amp;&amp; isShadowHost(node) &amp;&amp; !hasCustomFocusLogic(node);
</del><ins>+    return node-&gt;isElementNode() &amp;&amp; !toElement(node)-&gt;isKeyboardFocusable(event) &amp;&amp; isShadowHost(node) &amp;&amp; !hasCustomFocusLogic(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool isFocusableShadowHost(Node* node, KeyboardEvent* event)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(node);
</span><del>-    return node-&gt;isKeyboardFocusable(event) &amp;&amp; isShadowHost(node) &amp;&amp; !hasCustomFocusLogic(node);
</del><ins>+    return node-&gt;isElementNode() &amp;&amp; toElement(node)-&gt;isKeyboardFocusable(event) &amp;&amp; isShadowHost(node) &amp;&amp; !hasCustomFocusLogic(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline int adjustedTabIndex(Node* node, KeyboardEvent* event)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> static inline bool shouldVisit(Node* node, KeyboardEvent* event)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(node);
</span><del>-    return node-&gt;isKeyboardFocusable(event) || isNonFocusableShadowHost(node, event);
</del><ins>+    return (node-&gt;isElementNode() &amp;&amp; toElement(node)-&gt;isKeyboardFocusable(event)) || isNonFocusableShadowHost(node, event);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FocusController::FocusController(Page* page)
</span><span class="lines">@@ -320,10 +320,12 @@
</span><span class="cx">         // FIXME: May need a way to focus a document here.
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (node-&gt;isFrameOwnerElement() &amp;&amp; (!node-&gt;isPluginElement() || !node-&gt;isKeyboardFocusable(event))) {
</del><ins>+    Element* element = toElement(node.get());
+
+    if (element-&gt;isFrameOwnerElement() &amp;&amp; (!element-&gt;isPluginElement() || !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><del>-        HTMLFrameOwnerElement* owner = static_cast&lt;HTMLFrameOwnerElement*&gt;(node.get());
</del><ins>+        HTMLFrameOwnerElement* owner = toFrameOwnerElement(element);
</ins><span class="cx">         if (!owner-&gt;contentFrame())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/svg/SVGAElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     
</span><span class="cx">     virtual bool supportsFocus() const;
</span><span class="cx">     virtual bool isMouseFocusable() const;
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isFocusable() const;
</span><span class="cx">     virtual bool isURLAttribute(const Attribute&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGStyledElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGStyledElement.h (150686 => 150687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGStyledElement.h        2013-05-25 10:27:37 UTC (rev 150686)
+++ trunk/Source/WebCore/svg/SVGStyledElement.h        2013-05-25 12:02:35 UTC (rev 150687)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> private:
</span><span class="cx">     virtual bool isSVGStyledElement() const OVERRIDE FINAL { return true; }
</span><span class="cx"> 
</span><del>-    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
</del><ins>+    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
</ins><span class="cx">     virtual bool isMouseFocusable() const;
</span><span class="cx"> 
</span><span class="cx">     void buildPendingResourcesIfNeeded();
</span></span></pre>
</div>
</div>

</body>
</html>