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

Unified Diff: third_party/WebKit/Source/core/input/GestureManager.cpp

Issue 2809333002: WIP Logging for Contextual Search: Node->Element. (Closed)
Patch Set: Created 3 years, 8 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
Index: third_party/WebKit/Source/core/input/GestureManager.cpp
diff --git a/third_party/WebKit/Source/core/input/GestureManager.cpp b/third_party/WebKit/Source/core/input/GestureManager.cpp
index cf16ec673be0a424729e5399b0516fef9380a62f..b88b30557db6d50b541239228c4dd4922db299f6 100644
--- a/third_party/WebKit/Source/core/input/GestureManager.cpp
+++ b/third_party/WebKit/Source/core/input/GestureManager.cpp
@@ -185,17 +185,17 @@ WebInputEventResult GestureManager::HandleGestureTap(
}
// Capture data for showUnhandledTapUIIfNeeded.
- Node* tapped_node = current_hit_test.InnerNode();
+ VLOG(0) << "ctxs Capture data for ShowUnhandledTapUIIfNeeded";
IntPoint tapped_position =
FlooredIntPoint(gesture_event.PositionInRootFrame());
- Node* tapped_non_text_node = tapped_node;
UserGestureIndicator gesture_indicator(DocumentUserGestureToken::Create(
- tapped_node ? &tapped_node->GetDocument() : nullptr));
+ current_hit_test.InnerNode()
+ ? &current_hit_test.InnerNode()->GetDocument()
+ : nullptr));
- if (tapped_non_text_node && tapped_non_text_node->IsTextNode())
- tapped_non_text_node = FlatTreeTraversal::Parent(*tapped_non_text_node);
-
- mouse_event_manager_->SetClickNode(tapped_non_text_node);
+ Element* tapped_element =
+ EventHandlingUtil::ParentElementIfNeeded(current_hit_test.InnerNode());
+ mouse_event_manager_->SetClickElement(tapped_element);
WebMouseEvent fake_mouse_down(
WebInputEvent::kMouseDown, gesture_event,
@@ -262,7 +262,7 @@ WebInputEventResult GestureManager::HandleGestureTap(
EventTypeNames::mouseup, fake_mouse_up);
WebInputEventResult click_event_result = WebInputEventResult::kNotHandled;
- if (tapped_non_text_node) {
+ if (tapped_element) {
if (current_hit_test.InnerNode()) {
// Updates distribution because a mouseup (or mousedown) event listener
// can make the tree dirty at dispatchMouseEvent() invocation above.
@@ -270,15 +270,15 @@ WebInputEventResult GestureManager::HandleGestureTap(
// tappedNonTextNode and currentHitTest.innerNode()) don't need to be
// updated because commonAncestor() will exit early if their documents are
// different.
- tapped_non_text_node->UpdateDistribution();
+ tapped_element->UpdateDistribution();
Node* click_target_node = current_hit_test.InnerNode()->CommonAncestor(
- *tapped_non_text_node, EventHandlingUtil::ParentForClickEvent);
+ *tapped_element, EventHandlingUtil::ParentForClickEvent);
click_event_result =
mouse_event_manager_->SetMousePositionAndDispatchMouseEvent(
click_target_node, String(), EventTypeNames::click,
fake_mouse_up);
}
- mouse_event_manager_->SetClickNode(nullptr);
+ mouse_event_manager_->SetClickElement(nullptr);
}
if (mouse_up_event_result == WebInputEventResult::kNotHandled)
@@ -290,7 +290,7 @@ WebInputEventResult GestureManager::HandleGestureTap(
EventHandlingUtil::MergeEventResult(mouse_down_event_result,
mouse_up_event_result),
click_event_result);
- if (event_result == WebInputEventResult::kNotHandled && tapped_node &&
+ if (event_result == WebInputEventResult::kNotHandled && tapped_element &&
frame_->GetPage()) {
bool dom_tree_changed = pre_dispatch_dom_tree_version !=
frame_->GetDocument()->DomTreeVersion();
@@ -300,8 +300,11 @@ WebInputEventResult GestureManager::HandleGestureTap(
IntPoint tapped_position_in_viewport =
frame_->GetPage()->GetVisualViewport().RootFrameToViewport(
tapped_position);
+ VLOG(0) << "ctxs ShowUnhandledTapUIIfNeeded";
+ // Check here if it's a text node/element?
+ // VLOG(0) << "ctxs ShowUnhandledTapUIIfNeeded textNode? " << tapped_element->isT;
frame_->GetChromeClient().ShowUnhandledTapUIIfNeeded(
- tapped_position_in_viewport, tapped_node,
+ tapped_position_in_viewport, tapped_element,
hayato 2017/04/12 07:04:24 I finally understand what ShowUnhandledTapUIIfNeed
dom_tree_changed || style_changed);
}
return event_result;

Powered by Google App Engine
This is Rietveld 408576698