Commit 6c9478ff authored by Navid Zolghadr's avatar Navid Zolghadr Committed by Commit Bot

Revert of 'Send click event to the nearest common ancestor'

This is a partial revert of the click target calculation
CL:
https://chromium-review.googlesource.com/c/chromium/src/+/1161164

which puts https://crbug.com/869919 back on the table.

It still keeps the wpt test though to make sure the test is
there for the final desired behavior.

Bug: 890711, 869919
Change-Id: I3ea000a8f62b08b7222f91d27a6957d5a94e8388
Reviewed-on: https://chromium-review.googlesource.com/1256377
Commit-Queue: Navid Zolghadr <nzolghadr@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595932}
parent dc479516
...@@ -2314,6 +2314,8 @@ crbug.com/813697 vr/getFrameData_oneframeupdate.html [ Pass Failure ] ...@@ -2314,6 +2314,8 @@ crbug.com/813697 vr/getFrameData_oneframeupdate.html [ Pass Failure ]
crbug.com/806357 [ Win Debug ] virtual/threaded/fast/events/pointerevents/pinch/pointerevent_touch-action-pinch_zoom_touch.html [ Pass Failure ] crbug.com/806357 [ Win Debug ] virtual/threaded/fast/events/pointerevents/pinch/pointerevent_touch-action-pinch_zoom_touch.html [ Pass Failure ]
crbug.com/839038 [ Mac ] external/wpt/pointerevents/pointerevent_lostpointercapture_for_disconnected_node-manual.html [ Skip ] crbug.com/839038 [ Mac ] external/wpt/pointerevents/pointerevent_lostpointercapture_for_disconnected_node-manual.html [ Skip ]
crbug.com/869919 external/wpt/uievents/click/click_event_target-manual.html [ Failure ]
crbug.com/346473 fast/events/drag-on-mouse-move-cancelled.html [ Failure ] crbug.com/346473 fast/events/drag-on-mouse-move-cancelled.html [ Failure ]
crbug.com/346473 virtual/mouseevent_fractional/fast/events/drag-on-mouse-move-cancelled.html [ Failure ] crbug.com/346473 virtual/mouseevent_fractional/fast/events/drag-on-mouse-move-cancelled.html [ Failure ]
crbug.com/346473 virtual/user-activation-v2/fast/events/drag-on-mouse-move-cancelled.html [ Failure ] crbug.com/346473 virtual/user-activation-v2/fast/events/drag-on-mouse-move-cancelled.html [ Failure ]
......
...@@ -2,7 +2,7 @@ CONSOLE WARNING: line 18: Element.createShadowRoot is deprecated and will be rem ...@@ -2,7 +2,7 @@ CONSOLE WARNING: line 18: Element.createShadowRoot is deprecated and will be rem
When selecting from non-anchor Node to anchor node in ShadowDOM, client should not cause page jump. When selecting from non-anchor Node to anchor node in ShadowDOM, client should not cause page jump.
Selecting from a node to another node in ShadowDOM. This should not start page navigation. Selecting from a node to another node in ShadowDOM. This should not start page navigation.
PASS lastClickTarget is host PASS lastClickTarget is null
Clicking a node in ShadowDOM. Clicking a node in ShadowDOM.
PASS lastClickTarget is host PASS lastClickTarget is host
......
...@@ -31,7 +31,7 @@ mouseMoveTo(shadowRoot.firstChild); ...@@ -31,7 +31,7 @@ mouseMoveTo(shadowRoot.firstChild);
eventSender.mouseDown(); eventSender.mouseDown();
mouseMoveTo(shadowRoot.firstChild.nextSibling); mouseMoveTo(shadowRoot.firstChild.nextSibling);
eventSender.mouseUp(); eventSender.mouseUp();
shouldBe('lastClickTarget', 'host'); shouldBeNull('lastClickTarget');
debug(''); debug('');
lastClickTarget = null; lastClickTarget = null;
......
...@@ -23,7 +23,7 @@ PASS lastClickTarget is button1 ...@@ -23,7 +23,7 @@ PASS lastClickTarget is button1
Click on disappearing INPUT value: Click on disappearing INPUT value:
PASS lastClickTarget is input1 PASS lastClickTarget is input1
Mousedown on a form control, and mouseup on an element outside: Mousedown on a form control, and mouseup on an element outside:
PASS lastClickTarget is document.body PASS lastClickTarget is null
PASS successfullyParsed is true PASS successfullyParsed is true
TEST COMPLETE TEST COMPLETE
......
...@@ -131,7 +131,7 @@ eventSender.mouseMoveTo(inputRect.left + 8, (inputRect.top + inputRect.bottom) / ...@@ -131,7 +131,7 @@ eventSender.mouseMoveTo(inputRect.left + 8, (inputRect.top + inputRect.bottom) /
eventSender.mouseDown(); eventSender.mouseDown();
eventSender.mouseMoveTo((spanRect.left + spanRect.right) / 2, spanRect.top + 1); eventSender.mouseMoveTo((spanRect.left + spanRect.right) / 2, spanRect.top + 1);
eventSender.mouseUp(); eventSender.mouseUp();
shouldBe('lastClickTarget', 'document.body'); shouldBeNull('lastClickTarget');
lastClickTarget = null; lastClickTarget = null;
container.remove(); container.remove();
......
...@@ -100,6 +100,11 @@ ScrollableArea* AssociatedScrollableArea(const PaintLayer* layer) { ...@@ -100,6 +100,11 @@ ScrollableArea* AssociatedScrollableArea(const PaintLayer* layer) {
} }
ContainerNode* ParentForClickEvent(const Node& node) { ContainerNode* ParentForClickEvent(const Node& node) {
// IE doesn't dispatch click events for mousedown/mouseup events across form
// controls.
if (node.IsHTMLElement() && ToHTMLElement(node).IsInteractiveContent())
return nullptr;
return FlatTreeTraversal::Parent(node); return FlatTreeTraversal::Parent(node);
} }
......
...@@ -915,14 +915,15 @@ bool MouseEventManager::HandleDrag(const MouseEventWithHitTestResults& event, ...@@ -915,14 +915,15 @@ bool MouseEventManager::HandleDrag(const MouseEventWithHitTestResults& event,
return true; return true;
} }
// Once we're past the drag threshold, we don't want to treat this gesture as
// a click.
InvalidateClick();
if (!TryStartDrag(event)) { if (!TryStartDrag(event)) {
// Something failed to start the drag, clean up. // Something failed to start the drag, clean up.
ClearDragDataTransfer(); ClearDragDataTransfer();
ResetDragState(); ResetDragState();
} else { } else {
// Once the drag operation is initiated, we don't want to treat this
// gesture as a click.
InvalidateClick();
// Since drag operation started we need to send a pointercancel for the // Since drag operation started we need to send a pointercancel for the
// corresponding pointer. // corresponding pointer.
if (initiator == DragInitiator::kMouse) { if (initiator == DragInitiator::kMouse) {
......
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