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

Issue 2809333002: WIP Logging for Contextual Search: Node->Element. (Closed)

Created:
3 years, 8 months ago by Donn Denman
Modified:
3 years, 7 months ago
Reviewers:
hayato
CC:
agrieve+watch_chromium.org, blink-reviews, chromium-reviews, darin-cc_chromium.org, donnd+watch_chromium.org, dtapuska+blinkwatch_chromium.org, jam, kinuko+watch, mlamouri+watch-content_chromium.org, nona+watch_chromium.org, Navid Zolghadr, shuchen+watch_chromium.org, James Su, twellington+watch_chromium.org, yusukes+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

WIP Logging for Contextual Search: Node->Element. Base patch description below. ============================================ Fix the wrong TextNode handling in EventHanlder and MouseEventManager EventHandler and MouseEventManager are storing a clicked node (or a touched node) as Node*, instead of Element*, That would be a bad practice. Actually, that would be the cause of several wrong behaviors in Blink, such as: (A) Blink does NOT fire a click event when a clicked text node has been removed in mouseup. This is wrong because a click event should be fired on an element node. See [1] for details. (B) Blink DOES fire a touch event on a non-element node. This is wrong because TouchEvent specification says all kinds of touch events' event target types are only Document and Element. For reference, (A) would happen in the following scenario: 1. User presses a mouse button 2. UA did a hittest. The result's innerNode() is a text node. 3. MouseEventManager#click_node_ is set to the parent element of the clicked text node 4. Dispatch mouse press events (or anything) 5. User releases a mouse button 6. UA did another hittest because UA would dispatch a click event at the commo n ancestor of: - A location of mouse pressed; MouseEventManager#click_node_ is used in this case. - and A location of mouse released; The 2nd hit test's result is used in this case. 7. Users removed a text node, which is the result of 2nd hit test. 8. Since there is no common ancestor of MouseEventManager#click_node_ and the 2nd hit test's result, a click event is not dispatched. To prevent these wrong behaviors, this CL does: - Replaces the usage of |Node*| to |Element*| as much as possible so that it rejects the wrong code at type level. - To prevent a false-negative event firing, like in the mentioned case, preserve the parent *element*, if necessary, of a clicked node before dispatching MouseRelease event so that a following click event should be fired correctly even when a text node has been removed in mouseup. - [1]: topmost event target; https://www.w3.org/TR/uievents/#topmost-event-target - [2]: Trusted proximal event target types are: Document and Element; https://w3c.github.io/touch-events/#list-of-touchevent-types This CL mainly aims to fix bug 708394. I think there are other places, such as other events, which should be fixed, which can be done in another CL. BUG=708394, 710425 patch from issue 2807123002 at patchset 80001 (http://crrev.com/2807123002#ps80001)

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -64 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 chunk +10 lines, -0 lines 2 comments Download
A third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html View 1 chunk +27 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup-expected.txt View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 3 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandlingUtil.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandlingUtil.cpp View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/GestureManager.cpp View 5 chunks +16 lines, -13 lines 1 comment Download
M third_party/WebKit/Source/core/input/MouseEventManager.h View 3 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.cpp View 7 chunks +39 lines, -37 lines 0 comments Download
M third_party/WebKit/Source/web/ChromeClientImpl.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 2 chunks +4 lines, -5 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Donn Denman
Hayato, I did some debugging of what's going wrong with your cl by patching it ...
3 years, 8 months ago (2017-04-12 02:12:47 UTC) #2
hayato
https://codereview.chromium.org/2809333002/diff/1/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/2809333002/diff/1/content/renderer/render_widget.cc#newcode2150 content/renderer/render_widget.cc:2150: VLOG(0) << "ctxs RenderWidget::ShowUnhandledTapUIIfNeeded IsTextNode: " << tapped_node.IsTextNode(); On ...
3 years, 8 months ago (2017-04-12 03:27:49 UTC) #4
hayato
On 2017/04/12 at 03:27:49, hayato wrote: > https://codereview.chromium.org/2809333002/diff/1/content/renderer/render_widget.cc > File content/renderer/render_widget.cc (right): > > https://codereview.chromium.org/2809333002/diff/1/content/renderer/render_widget.cc#newcode2150 ...
3 years, 8 months ago (2017-04-12 04:04:07 UTC) #5
hayato
https://codereview.chromium.org/2809333002/diff/1/third_party/WebKit/Source/core/input/GestureManager.cpp File third_party/WebKit/Source/core/input/GestureManager.cpp (right): https://codereview.chromium.org/2809333002/diff/1/third_party/WebKit/Source/core/input/GestureManager.cpp#newcode307 third_party/WebKit/Source/core/input/GestureManager.cpp:307: tapped_position_in_viewport, tapped_element, I finally understand what ShowUnhandledTapUIIfNeeded is meant ...
3 years, 8 months ago (2017-04-12 07:04:24 UTC) #6
hayato
3 years, 8 months ago (2017-04-12 07:14:51 UTC) #7
I have updated the CL, https://codereview.chromium.org/2807123002, and it looks
all green.
Thank you for your advice!

Powered by Google App Engine
This is Rietveld 408576698