Move Node::isKeyboardFocusable() to Element.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 May 2013 12:02:35 +0000 (12:02 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 May 2013 12:02:35 +0000 (12:02 +0000)
commite566e60635ee494533bad1613818f8b98bb137d7
tree1af9527fc8a0459ee2a0aa83d475ff47010bdf16
parent0ff6bf9bfb06cd95c82018796970005903360bc7
Move Node::isKeyboardFocusable() to Element.
<http://webkit.org/b/116761>

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/html/HTMLAnchorElement.h
Source/WebCore/html/HTMLAreaElement.h
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFrameOwnerElement.h
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLPlugInElement.h
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLTextAreaElement.h
Source/WebCore/page/FocusController.cpp
Source/WebCore/svg/SVGAElement.h
Source/WebCore/svg/SVGStyledElement.h