Move Node::supportsFocus() to Element.
<http://webkit.org/b/116778>

Reviewed by Antti Koivisto.

Node never supports focus, so move supportsFocus() to Element instead.

* dom/Element.h:
* dom/Node.cpp:
* dom/Node.h:

    Removed Node::supportsFocus(), it always returned false anyway.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):

    Check that the underlying Node is an Element before asking if it supports focus.

* html/HTMLAnchorElement.h:
* html/HTMLAreaElement.h:
* html/HTMLBodyElement.h:
* html/HTMLElement.h:
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlElement.h:
* html/HTMLFrameElementBase.h:
* html/HTMLMediaElement.h:
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.h:
* html/HTMLOutputElement.h:
* svg/SVGAElement.h:
* svg/SVGCircleElement.h:
* svg/SVGEllipseElement.h:
* svg/SVGGElement.h:
* svg/SVGImageElement.h:
* svg/SVGLineElement.h:
* svg/SVGPathElement.h:
* svg/SVGPolyElement.h:
* svg/SVGRectElement.h:
* svg/SVGSVGElement.h:
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.h:
* svg/SVGTextElement.h:
* svg/SVGUseElement.h:

    OVERRIDE ALL THE THINGS!

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move some form control things from Element to HTMLFormControlElement.
<http://webkit.org/b/116779>

Reviewed by Antti Koivisto.

The following methods sit better on HTMLFormControlElement than on Element:

    - formControlType()
    - wasChangedSinceLastFormControlChangeEvent()
    - setChangedSinceLastFormControlChangeEvent()
    - dispatchFormControlChangeEvent()

Moved them, and devirtualized as much as possible.

* dom/Document.cpp:
(WebCore::Document::setFocusedNode):

    Check if the old focus target is an Element before (possibly) dispatching a change event.

* dom/Element.cpp:
* dom/Element.h:

    Removed some stub methods that were only used by HTMLFormControlElement subclasses.

* html/HTMLFormControlElement.cpp:
* html/HTMLFormControlElement.h:
(WebCore::isHTMLFormControlElement):
(WebCore::toHTMLFormControlElement):

    Add toHTMLFormControlElement() helper with ASSERT_WITH_SECURITY_IMPLICATION.

* html/HTMLTextFormControlElement.h:

    Sprinkle OVERRIDE.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FocusController::setFocusedNode() should be setFocusedElement().
<http://webkit.org/b/116780>

Reviewed by Antti Koivisto.

Source/WebCore:

Only Elements can have focus, so make the public API of FocusController take Element*.

* WebCore.exp.in:
* page/FocusController.h:
* page/FocusController.cpp:
(WebCore::FocusController::setFocusedElement):

    Out with the setFocusedNode(), in with the setFocusedElement().

* dom/Element.cpp:
(WebCore::Element::focus):
(WebCore::Element::blur):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):
* plugins/PluginView.cpp:
(WebCore::PluginView::focusPluginElement):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setFocusedNodeIfNeeded):

    Tweak for FocusController taking Element* instead of Node*.

(WebCore::FrameSelection::setFocusedElementIfNeeded):

    Renamed from setFocusedNodeIfNeeded().

* editing/htmlediting.h:
* editing/htmlediting.cpp:
(WebCore::enclosingAnchorElement):

    Cleaned up the loop for readability and made it return an Element.

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::clearFocusNode):
(BlackBerry::WebKit::WebPage::setNodeFocus):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::selectObject):

Source/WebKit/win:

* WebView.cpp:
(WebView::clearFocusNode):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::focusPluginElement):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TreeScope::rootNode() should return a ContainerNode.
<http://webkit.org/b/116782>

Reviewed by Antti Koivisto.

The rootNode() of a TreeScope is always a ContainerNode, so update pointer types to reflect that.
This lets us take advantage of Antti's optimized traversal functions.

* dom/ContainerNode.h:
(WebCore::Node::isTreeScope):
* dom/Document.cpp:
(WebCore::Document::buildAccessKeyMap):
* dom/Node.cpp:
(WebCore::Node::containingShadowRoot):
* dom/Node.h:
* dom/TreeScope.h:
(WebCore::TreeScope::rootNode):
(TreeScope):
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::rootNode):
(WebCore::FocusNavigationScope::owner):
* page/FocusController.h:
(FocusNavigationScope):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150713 268f45cc-cd09-0410-ab3c-d52691b4dbfc