Move "hover" state logic from Node to Element.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 May 2013 09:16:30 +0000 (09:16 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 May 2013 09:16:30 +0000 (09:16 +0000)
commit64c3988150f7f7f0f6f19eb26f39fd81c7078c7d
tree2f90d2d2196b05087f9f4b78dc6c1e48c7fe32a6
parentbe596b2e60c28822bad28b485f90743508d5f031
Move "hover" state logic from Node to Element.
<http://webkit.org/b/116757>

Reviewed by Antti Koivisto.

Resolve a 7 year old FIXME by merging the "hover" state logic from Node and ContainerNode
and moving it all to Element instead.

* dom/Node.cpp:
(WebCore::Node::detach):
* dom/Element.cpp:
(WebCore::Element::detach):

    Move Document::hoveredNodeDetached() call from Node::detach() to Element::detach().

(WebCore::Element::isUserActionElementHovered):
(WebCore::Element::setHovered):
* dom/Element.h:
(WebCore::Element::hovered):

    Moved here from Node/ContainerNode.

* dom/UserActionElementSet.h:
(WebCore::UserActionElementSet::setHovered):
(WebCore::UserActionElementSet::setFlags):

    Make setHovered() take an Element* instead of a Node*. I'd like to do this will all
    of these methods eventually, so added a setFlags() helper with the tighter type.

* html/HTMLLabelElement.h:
* html/shadow/SpinButtonElement.h:

    Sprinkle OVERRIDE on setHovered() overrides.

* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isHovered):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isHovered):

    Check if the inspected Node is an element before asking if it's hovered.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNode.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/UserActionElementSet.cpp
Source/WebCore/dom/UserActionElementSet.h
Source/WebCore/html/HTMLLabelElement.h
Source/WebCore/html/shadow/SpinButtonElement.h
Source/WebCore/rendering/RenderTheme.cpp