Commit 699fcf38 authored by mkwst@chromium.org's avatar mkwst@chromium.org

Remove redundant code in Document::updateHoverActiveState.

https://bugs.webkit.org/show_bug.cgi?id=111303

Reviewed by Darin Adler.

Document::updateHoverActiveState currently looks for touchrelease events
and explictly clears out the hover state for all nodes between the
currently hovered node and the top of the hover chain. This is actually
redundant with the logic in the rest of the function; we can simplify by
setting the Element* we're working with to 0, which causes the later
loops to do the necessary work.

There should be no web-visible effect from this change; it should simply
make this function less complex.

Extracted from Allan Sandfeld Jensen's original patch to wkbug.com/98168

* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
    Set innerElementInDocument to 0 rather than walking the hover chain
    and clearing it when we see a touchrelease event. The rest of the
    code in this function will have the same effect.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6bdc5f6e
2013-03-05 Mike West <mkwst@chromium.org>
Remove redundant code in Document::updateHoverActiveState.
https://bugs.webkit.org/show_bug.cgi?id=111303
Reviewed by Darin Adler.
Document::updateHoverActiveState currently looks for touchrelease events
and explictly clears out the hover state for all nodes between the
currently hovered node and the top of the hover chain. This is actually
redundant with the logic in the rest of the function; we can simplify by
setting the Element* we're working with to 0, which causes the later
loops to do the necessary work.
There should be no web-visible effect from this change; it should simply
make this function less complex.
Extracted from Allan Sandfeld Jensen's original patch to wkbug.com/98168
* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
Set innerElementInDocument to 0 rather than walking the hover chain
and clearing it when we see a touchrelease event. The rest of the
code in this function will have the same effect.
2013-03-05 Koji Hara <kojih@chromium.org>
[V8] Remove unused custom indexedPropertyGetter
......@@ -5869,18 +5869,11 @@ void Document::updateHoverActiveState(const HitTestRequest& request, HitTestResu
bool mustBeInActiveChain = request.active() && request.move();
RefPtr<Node> oldHoverNode = hoverNode();
// Clear the :hover chain when the touch gesture is over.
if (request.touchRelease()) {
if (oldHoverNode) {
for (RenderObject* curr = oldHoverNode->renderer(); curr; curr = curr->hoverAncestor()) {
if (curr->node() && !curr->isText())
curr->node()->setHovered(false);
}
setHoverNode(0);
}
// A touch release can not set new hover or active target.
return;
}
// A touch release does not set a new hover target; setting the element we're working with to 0
// will clear the chain of hovered elements all the way to the top of the tree.
if (request.touchRelease())
innerElementInDocument = 0;
// Check to see if the hovered node has changed.
// If it hasn't, we do not need to do anything.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment