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

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed)

Created:
5 years, 3 months ago by ymalik
Modified:
5 years, 2 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. Previously, we would scrollRectIntoView despite of the overflow:hidden property. This makes sense for programmatic scrolls but not user scrolls. For example, a scroll initiated from Element::scrollIntoView should in fact scroll even if the element has overflow:hidden. The problem is that user scrolls (autoscroll) and programmatic scrolls have the same codepath. This patch takes the type of scroll as a param (defaulted to programmatic scroll), and only scrolls if it's a programmatic scroll, or a user scroll on a LayoutBox which does not have overflow:hidden set. The default value of the param ensures that only the "autoscroll" and "FindText" codepath is affected. May need to set this flag to false for other cases in the future. This patch also updates the tests that fail because of adding input::-webkit-scrollbar { display:none; } to the default style sheet used to render HTML. BUG=531525 Committed: https://crrev.com/24936947c5a7019a20e269e523dd338e39588c95 Cr-Commit-Position: refs/heads/master@{#352355}

Patch Set 1 #

Patch Set 2 : Handle case when overflow-x:hidden and y:scroll #

Total comments: 3

Patch Set 3 : Added test #

Patch Set 4 : fix minor typo #

Patch Set 5 : Added ScrollType parameter to ScrollableArea::scrollIntoView #

Patch Set 6 : Remove the now unnecessary code from Patchset 1 #

Total comments: 12

Patch Set 7 : Added more tests #

Total comments: 8

Patch Set 8 : Fixed typos #

Total comments: 10

Patch Set 9 : Worked on review comments #

Total comments: 3

Patch Set 10 : Removed scrollbar hiding logic from css #

Total comments: 4

Patch Set 11 : Worked on nits #

Patch Set 12 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+237 lines, -34 lines) Patch
A third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-no-scroll-iframe.html View 1 2 3 4 5 6 7 1 chunk +40 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-no-scroll-iframe-expected.txt View 1 2 3 4 5 6 7 1 chunk +2 lines, -6 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +62 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +48 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/resources/page-with-scrollable-div.html View 1 2 3 4 5 6 1 chunk +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/RootFrameViewport.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/RootFrameViewport.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +8 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollableArea.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/TextFinder.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 39 (8 generated)
ymalik
Before scrolling a rect into view, we check if it has overflow set to hidden, ...
5 years, 3 months ago (2015-09-24 14:52:16 UTC) #2
ymalik
Added test.
5 years, 2 months ago (2015-09-25 22:23:26 UTC) #3
bokan
Hey, this looks like it'll work but I think we're just papering over some earlier ...
5 years, 2 months ago (2015-09-25 22:26:26 UTC) #4
ymalik
On 2015/09/25 22:26:26, bokan wrote: > Hey, this looks like it'll work but I think ...
5 years, 2 months ago (2015-09-29 17:35:17 UTC) #5
ymalik (do not use)
@bokan PTAL. I propagated the ScrollType to scroll into view and added a check for ...
5 years, 2 months ago (2015-09-29 17:52:31 UTC) #7
ymalik (do not use)
@skobes Because we set the scrollbar display to none in html.css, some tests under fast/css/invalidations ...
5 years, 2 months ago (2015-09-29 18:03:44 UTC) #9
bokan
On 2015/09/29 18:03:44, ymalik wrote: > @skobes > > Because we set the scrollbar display ...
5 years, 2 months ago (2015-09-29 19:29:36 UTC) #10
bokan
Digging through the history here, it seems autoscroll is filled with special cases and hacks. ...
5 years, 2 months ago (2015-09-29 19:42:50 UTC) #11
skobes
On 2015/09/29 19:29:36, bokan wrote: > On 2015/09/29 18:03:44, ymalik wrote: > > @skobes > ...
5 years, 2 months ago (2015-09-29 20:30:31 UTC) #12
skobes
https://codereview.chromium.org/1365853003/diff/100001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html File third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html (right): https://codereview.chromium.org/1365853003/diff/100001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html#newcode46 third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html:46: <iframe id="partialScrolliFrame" src="resources/page-with-scrollable-div-overflow-y-hidden-body.html"></iframe> On 2015/09/29 19:42:49, bokan wrote: > ...
5 years, 2 months ago (2015-09-29 20:33:23 UTC) #13
ymalik
On 2015/09/29 19:42:50, bokan wrote: > Digging through the history here, it seems autoscroll is ...
5 years, 2 months ago (2015-09-30 00:39:11 UTC) #14
ymalik
On 2015/09/29 20:30:31, skobes wrote: > On 2015/09/29 19:29:36, bokan wrote: > > On 2015/09/29 ...
5 years, 2 months ago (2015-09-30 00:40:11 UTC) #15
ymalik
@bokan @skobes I worked on your comments. PTAL :) https://codereview.chromium.org/1365853003/diff/100001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body-expected.txt File third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body-expected.txt (right): https://codereview.chromium.org/1365853003/diff/100001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body-expected.txt#newcode1 third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body-expected.txt:1: ...
5 years, 2 months ago (2015-09-30 00:41:09 UTC) #16
bokan
lgtm w/nits. https://codereview.chromium.org/1365853003/diff/100001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/1365853003/diff/100001/third_party/WebKit/Source/core/layout/LayoutBox.cpp#newcode525 third_party/WebKit/Source/core/layout/LayoutBox.cpp:525: } else if (!parentBox && canBeProgramaticallyScrolled()) { ...
5 years, 2 months ago (2015-09-30 12:52:40 UTC) #17
bokan
One more thing - forgot to reply to this one: On 2015/09/30 00:39:11, ymalik1 wrote: ...
5 years, 2 months ago (2015-09-30 12:57:42 UTC) #18
ymalik
Sorry about the insures/ensures typo. Carelessness at its best :) Worked on nits. https://codereview.chromium.org/1365853003/diff/100001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File ...
5 years, 2 months ago (2015-09-30 14:16:58 UTC) #19
ymalik
On 2015/09/30 12:57:42, bokan wrote: > One more thing - forgot to reply to this ...
5 years, 2 months ago (2015-09-30 14:17:16 UTC) #20
ymalik
+Rick for Source/platform/ OWNER
5 years, 2 months ago (2015-09-30 14:29:07 UTC) #22
Rick Byers
On 2015/09/30 14:29:07, ymalik1 wrote: > +Rick for Source/platform/ OWNER Source/platform LGTM
5 years, 2 months ago (2015-09-30 15:11:34 UTC) #23
ymalik
@skobes Gentle ping :)
5 years, 2 months ago (2015-09-30 22:21:02 UTC) #24
skobes
https://chromiumcodereview.appspot.com/1365853003/diff/140001/third_party/WebKit/Source/core/css/html.css File third_party/WebKit/Source/core/css/html.css (right): https://chromiumcodereview.appspot.com/1365853003/diff/140001/third_party/WebKit/Source/core/css/html.css#newcode529 third_party/WebKit/Source/core/css/html.css:529: input::-webkit-scrollbar { Can we constrain this to [type="text"]? https://chromiumcodereview.appspot.com/1365853003/diff/140001/third_party/WebKit/Source/core/frame/RootFrameViewport.h ...
5 years, 2 months ago (2015-09-30 22:31:14 UTC) #25
ymalik
@skobes PTAL :) https://codereview.chromium.org/1365853003/diff/140001/third_party/WebKit/Source/core/css/html.css File third_party/WebKit/Source/core/css/html.css (right): https://codereview.chromium.org/1365853003/diff/140001/third_party/WebKit/Source/core/css/html.css#newcode529 third_party/WebKit/Source/core/css/html.css:529: input::-webkit-scrollbar { On 2015/09/30 22:31:14, skobes ...
5 years, 2 months ago (2015-10-01 22:25:31 UTC) #26
skobes
https://codereview.chromium.org/1365853003/diff/160001/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp File third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp (right): https://codereview.chromium.org/1365853003/diff/160001/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp#newcode354 third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp:354: void LayoutTextControlSingleLine::addScrollbarPeudoStyle() On 2015/10/01 22:25:31, ymalik1 wrote: > Added ...
5 years, 2 months ago (2015-10-01 22:40:19 UTC) #27
ymalik
@skobes PTAL :) https://codereview.chromium.org/1365853003/diff/160001/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp File third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp (right): https://codereview.chromium.org/1365853003/diff/160001/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp#newcode354 third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp:354: void LayoutTextControlSingleLine::addScrollbarPeudoStyle() On 2015/10/01 22:40:19, skobes ...
5 years, 2 months ago (2015-10-03 20:49:21 UTC) #28
skobes
lgtm % nits https://codereview.chromium.org/1365853003/diff/180001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html File third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html (right): https://codereview.chromium.org/1365853003/diff/180001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html#newcode25 third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html:25: "scrollable div, it does not propagate ...
5 years, 2 months ago (2015-10-05 01:37:24 UTC) #29
ymalik
Worked on nits. https://codereview.chromium.org/1365853003/diff/180001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html File third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html (right): https://codereview.chromium.org/1365853003/diff/180001/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html#newcode25 third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html:25: "scrollable div, it does not propagate ...
5 years, 2 months ago (2015-10-05 14:25:03 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1365853003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1365853003/220001
5 years, 2 months ago (2015-10-05 14:37:05 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_clobber_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_clobber_rel_ng/builds/78101)
5 years, 2 months ago (2015-10-05 14:44:53 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1365853003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1365853003/220001
5 years, 2 months ago (2015-10-05 16:36:39 UTC) #37
commit-bot: I haz the power
Committed patchset #12 (id:220001)
5 years, 2 months ago (2015-10-05 18:20:42 UTC) #38
commit-bot: I haz the power
5 years, 2 months ago (2015-10-05 18:21:45 UTC) #39
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/24936947c5a7019a20e269e523dd338e39588c95
Cr-Commit-Position: refs/heads/master@{#352355}

Powered by Google App Engine
This is Rietveld 408576698