Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Unified Diff: Source/core/page/EventHandler.cpp

Issue 267313008: First-cut at fixing unhandled Tap event returns in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added separate isInteractiveNode() static function to EventHandler.cpp. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 46e48ac448b53e0de8c14b10db360fc897fd2c5e..572ba648a6c9666bea623136e1f8455515c40698 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -475,6 +475,17 @@ static int textDistance(const Position& start, const Position& end)
return TextIterator::rangeLength(range.get(), true);
}
+static bool isInteractiveNode(Node* node)
+{
+ if (!node)
+ return false;
+ // Editable nodes are always interactive.
+ if (node->rendererIsEditable())
+ return true;
+ // TODO(donnd): check for other indications of interactivity, including control elements and ARIA roles.
+ return false;
+}
+
bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestResults& event)
{
TRACE_EVENT0("webkit", "EventHandler::handleMousePressEventSingleClick");
@@ -538,8 +549,10 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR
newSelection = expandSelectionToRespectUserSelectAll(innerNode, VisibleSelection(visiblePos));
}
- bool handled = updateSelectionForMouseDownDispatchingSelectStart(innerNode, newSelection, granularity);
- return handled;
+ updateSelectionForMouseDownDispatchingSelectStart(innerNode, newSelection, granularity);
Rick Byers 2014/05/28 17:36:57 I think this is fine for addressing the original p
donnd 2014/05/31 03:22:55 Done.
+
+ // If the target node is editable, then it handles the click, either directly or through a handler.
Rick Byers 2014/05/28 17:36:57 Hmm, it seems wrong / error-prone to have this log
donnd 2014/05/31 03:22:55 For now, we just always return false. That should
+ return isInteractiveNode(event.targetNode());
}
static inline bool canMouseDownStartSelect(Node* node)
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698