Title: [144741] trunk/Source/WebCore
- Revision
- 144741
- Author
- [email protected]
- Date
- 2013-03-05 01:15:59 -0800 (Tue, 05 Mar 2013)
Log Message
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.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (144740 => 144741)
--- trunk/Source/WebCore/ChangeLog 2013-03-05 09:02:11 UTC (rev 144740)
+++ trunk/Source/WebCore/ChangeLog 2013-03-05 09:15:59 UTC (rev 144741)
@@ -1,3 +1,28 @@
+2013-03-05 Mike West <[email protected]>
+
+ 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 <[email protected]>
[V8] Remove unused custom indexedPropertyGetter
Modified: trunk/Source/WebCore/dom/Document.cpp (144740 => 144741)
--- trunk/Source/WebCore/dom/Document.cpp 2013-03-05 09:02:11 UTC (rev 144740)
+++ trunk/Source/WebCore/dom/Document.cpp 2013-03-05 09:15:59 UTC (rev 144741)
@@ -5869,19 +5869,12 @@
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.
Node* newHoverNode = innerElementInDocument;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes