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

Issue 1308173007: Correct touch rect hit-test against iframe with scrolled content (Closed)

Created:
5 years, 3 months ago by Yufeng Shen (Slow to review)
Modified:
5 years, 3 months ago
Reviewers:
dtapuska, Rick Byers
CC:
blink-reviews, pdr+renderingwatchlist_chromium.org, zoltan1, szager+layoutwatch_chromium.org, eae+blinkwatch, leviw+renderwatch, blink-reviews-rendering, jchaffraix+rendering
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

When touch rect is hit-tested against an iframe with scrolled content, the touch rect is translated into the iframe document's space using the document's scroll offset. It has a subtle problem that if originally the touch rect is only partially overlapping with the iframe, after it is translated into the iframe document's space, the touch rect might be considered to be fully contained in the document. Reinforce the detection by asserting that only when the touch hit-test rect is totally within the iframe's bound in the main document's space then do we stop the rect-base hit-test search. BUG=461972 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201935

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 2

Patch Set 4 : optimization that only calling nodeAtPointOverWidget() once #

Total comments: 2

Patch Set 5 : address comments #

Patch Set 6 : fix comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -6 lines) Patch
A LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content.html View 1 1 chunk +68 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt View 1 1 chunk +7 lines, -4 lines 0 comments Download
A LayoutTests/fast/dom/nodesFromRect/resources/child-frame-scrolled.html View 1 chunk +21 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutPart.cpp View 1 2 3 4 5 1 chunk +15 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Yufeng Shen (Slow to review)
5 years, 3 months ago (2015-09-02 02:37:28 UTC) #2
Rick Byers
Sorry for the delay - missed this after getting back from vacation. https://codereview.chromium.org/1308173007/diff/40001/Source/core/layout/LayoutPart.cpp File Source/core/layout/LayoutPart.cpp ...
5 years, 3 months ago (2015-09-08 15:12:34 UTC) #3
Yufeng Shen (Slow to review)
https://codereview.chromium.org/1308173007/diff/40001/Source/core/layout/LayoutPart.cpp File Source/core/layout/LayoutPart.cpp (right): https://codereview.chromium.org/1308173007/diff/40001/Source/core/layout/LayoutPart.cpp#newcode194 Source/core/layout/LayoutPart.cpp:194: && nodeAtPointOverWidget(pointOverWidgetResult, locationInContainer, accumulatedOffset, action)) On 2015/09/08 15:12:33, Rick ...
5 years, 3 months ago (2015-09-08 18:44:53 UTC) #4
Rick Byers
LGTM
5 years, 3 months ago (2015-09-08 19:50:21 UTC) #5
dtapuska
https://codereview.chromium.org/1308173007/diff/60001/Source/core/layout/LayoutPart.cpp File Source/core/layout/LayoutPart.cpp (right): https://codereview.chromium.org/1308173007/diff/60001/Source/core/layout/LayoutPart.cpp#newcode192 Source/core/layout/LayoutPart.cpp:192: if (isInsideChildFrame) { I presume this code path isn't ...
5 years, 3 months ago (2015-09-08 20:07:48 UTC) #6
Yufeng Shen (Slow to review)
https://codereview.chromium.org/1308173007/diff/60001/Source/core/layout/LayoutPart.cpp File Source/core/layout/LayoutPart.cpp (right): https://codereview.chromium.org/1308173007/diff/60001/Source/core/layout/LayoutPart.cpp#newcode192 Source/core/layout/LayoutPart.cpp:192: if (isInsideChildFrame) { On 2015/09/08 20:07:48, dtapuska wrote: > ...
5 years, 3 months ago (2015-09-08 22:08:42 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308173007/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308173007/100001
5 years, 3 months ago (2015-09-08 23:15:23 UTC) #10
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://src.chromium.org/viewvc/blink?view=rev&revision=201935
5 years, 3 months ago (2015-09-08 23:23:03 UTC) #11
Rick Byers
5 years, 3 months ago (2015-09-09 14:26:34 UTC) #12
Message was sent while issue was closed.
On 2015/09/08 22:08:42, Yufeng Shen wrote:
>
https://codereview.chromium.org/1308173007/diff/60001/Source/core/layout/Layo...
> File Source/core/layout/LayoutPart.cpp (right):
> 
>
https://codereview.chromium.org/1308173007/diff/60001/Source/core/layout/Layo...
> Source/core/layout/LayoutPart.cpp:192: if (isInsideChildFrame) {
> On 2015/09/08 20:07:48, dtapuska wrote:
> > I presume this code path isn't necessary for the non rect based hit test..
> > should it be avoided in that case?
> > 
> 
> done.
> 
> > 
> > Also is this also an issue for any element that is backed by a
ScrollableArea?
> > ie; does it happen with a div with overflow scroll?
> 
> Yes, the same underlying issue applies also for overflow scroll div,
> but the symptom gets mitigated by the fact that we do a re-hit-test
> for gesture event, see here
> 
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> 
> The re-hit-test uses hitTestResultInFrame. So if the tap finds the wrong
frame,
> then the click is routed
> to the wrong frame. But if the tap finds at least the correct frame but wrong
> node, the click is
> still routed to the right node. It is really complicated and subtle :(

Yeah, this sucks.  We're going to have to decide whether to really invest in
rect-based hit testing, or consider it feature for legacy content only.  If the
latter, then perhaps we should just change the re-hit-test work-around to hit
test across all frames to ensure the damage due to touch adjustment bugs is
contained even in iframe cases?

Powered by Google App Engine
This is Rietveld 408576698