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

Issue 1860273002: Fix scrollIntoViewIfNeeded when scroll box has no height or width. (Closed)

Created:
4 years, 8 months ago by bokan
Modified:
4 years, 8 months ago
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, eae+blinkwatch, jchaffraix+rendering, kinuko+watch, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix scrollIntoViewIfNeeded when scroll box has no height or width. When calling scrollIntoView with a centering behavior (e.g. scrollIntoViewIfNeeded and focus-initiated scrollIntoView) on a scroll box with no height or width the current behavior is to not scroll the box and call scrollIntoView with the same rect to the next ancestor box. This is clearly wrong since we won't scroll the rect into view of the child box so the ancestor box will try to scrollIntoView a rect that might be outside its visible rect, even though the child box is within it. This is the surprising behavior seen in the bug; focus() is called on an element inside a scroller with zero height and large scrollTop which causes the main frame to scroll up instead of the scroller. The fix in this CL is to give a box with a zero width or height a minimum size. This means we'll scroll the content "into view" as if the box were just very small in that dimension. This matches the behavior in Firefox. It also prevents surprising scrolls in ancestor boxes. BUG=585368 Committed: https://crrev.com/2e27d335ad7b6aa54d71f3f1259649909b4c4387 Cr-Commit-Position: refs/heads/master@{#385579}

Patch Set 1 #

Patch Set 2 : Fixed broken composition test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -22 lines) Patch
A third_party/WebKit/LayoutTests/fast/scrolling/scroll-into-view-collapsed-div.html View 1 chunk +114 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/scrolling/scroll-into-view-collapsed-div-expected.txt View 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ScrollAlignment.cpp View 5 chunks +30 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/platform/LayoutUnit.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (10 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1860273002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1860273002/1
4 years, 8 months ago (2016-04-05 23:08:07 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/141156)
4 years, 8 months ago (2016-04-06 00:07:51 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1860273002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1860273002/20001
4 years, 8 months ago (2016-04-06 11:20:47 UTC) #6
bokan
Hi Ali, I see you've touched ScrollAlignment a bunch. PTAL.
4 years, 8 months ago (2016-04-06 11:33:20 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-06 12:33:25 UTC) #11
ajuma
lgtm
4 years, 8 months ago (2016-04-06 13:25:20 UTC) #12
bokan
+leviw@ for TODO removal in LayoutUnit
4 years, 8 months ago (2016-04-06 13:26:04 UTC) #13
bokan
+leviw@ for LayoutUnit (for real this time)
4 years, 8 months ago (2016-04-06 13:26:33 UTC) #15
leviw_travelin_and_unemployed
Hehe, thanks for the catch! LGTM for removing my TODO :)
4 years, 8 months ago (2016-04-06 23:19:55 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1860273002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1860273002/20001
4 years, 8 months ago (2016-04-06 23:20:55 UTC) #18
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 8 months ago (2016-04-06 23:45:34 UTC) #20
commit-bot: I haz the power
4 years, 8 months ago (2016-04-06 23:47:40 UTC) #22
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/2e27d335ad7b6aa54d71f3f1259649909b4c4387
Cr-Commit-Position: refs/heads/master@{#385579}

Powered by Google App Engine
This is Rietveld 408576698