Scrollbars aren't removed unless content shrinks to the size of the scrollable minus the width of a scrollbar
Reported by
joolscha...@gmail.com,
Aug 2 2016
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 Example URL: https://jsfiddle.net/JoolsCaesar/mr5k477t/ Steps to reproduce the problem: 1. Navigate to jsfiddle above 2. Use buttons to change content size 3. Press "Tiny", "Small", "Goldilocks", "Big", "Goldilocks", "Small" "Tiny" What is the expected behavior? The scrollbars should disappear whenever you press "Small" or "Goldilocks", even if you previously press "Big". What went wrong? Scrollbars won't disappear until you press "Tiny" because this makes the content 20px (> a 17px scrollbar) less than the scrollable div. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 52.0.2743.82 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 22.0 r0 Works properly in Firefox, IE11, Edge
,
Sep 14 2016
This seems to have become even more broken in the latest release of Chrome. Once you make the content too big for the container, removing the scroll bars by shrinking the content has essentially become a brain teaser. You have to play with the different content heights switching from one unnecessary scrollbar to another until your unnecessary scrollbar is a horizontal one and then hit "Tiny".
,
Sep 14 2016
^ That's an animated gif btw. You'll need to click through to view it.
,
Oct 4 2016
Fortunately in my case I have complete control over the size of the content and scrollable so I was able to use this workaround, which just sets the overflow to hidden whenever I know there shouldn't be scrollbars. Adding it here in case it's useful to anyone waiting for a fix: https://jsfiddle.net/JoolsCaesar/mr5k477t/2/ Obviously this will only work if your content doesn't have any overflow and if you want to support a dynamic sized viewer, you'll need to run it in some kind of resize handler.
,
Oct 4 2016
I've just realised that my jsfiddle reveals a second bug, which is probably related to the worsening of the original bug. Chrome has stopped detecting when you should have scrollbars, rather than just failing to detect when you shouldn't have them. If you click the "Big" button in the original jsfiddle (https://jsfiddle.net/JoolsCaesar/mr5k477t/), you should get both horizontal and vertical scrollbars. This is because the introduction of the vertical scrollbar means that your view narrow enough to require a horizontal scrollbar. However Chrome only gives you a vertical scrollbar and if you inspect the content element in the debugger, you will see that there is a portion of it that you can't view. All other major browsers give you both horizontal and vertical scrollbars.
,
Oct 4 2016
Raised https://bugs.chromium.org/p/chromium/issues/detail?id=652694 to cover bug of false negatives in scrollbar detection.
,
Oct 4 2016
,
Oct 20 2016
This works in Firefox and Internet Explorer 11. Interoperability issue.
,
Oct 20 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 30 2017
,
Oct 31 2017
press Big, we shall see vertical scrollbar as the height changes to 110, now press Goldilocks we expect no scrollbars should be present as height resumes back to 100. Instead, we observe horizontal scrollbar without thumb been created.
Reason:
In UpdateAfterLayout for LayoutBlockFlow DIV id='scroller' , computeScrollbarExistence , computes needs_horizontal_scrollbar as true, because of which we create the horizontalScrollbar.
Now again because of in_overflow_relayout_, we UpdateAfterLayout, now this time we recompute scrollbar existence, now it computes needs_horizontal_scrollbar as false. But this is not applied because scrollbars are frozen in the overflow relayout.
scrollbars_are_frozen = true as in_overflow_relayout_ = true;
scrollbars_will_change is false though horizontal_scrollbar_should_change is true;
as scrollbars_will_change is false we are not able to destory createdHorizontalScrollbar.
bool scrollbars_are_frozen =
(in_overflow_relayout_ && !allow_second_overflow_relayout_) ||
FreezeScrollbarsScope::ScrollbarsAreFrozen();
allow_second_overflow_relayout_ = false; //
bool scrollbars_will_change =
!scrollbars_are_frozen &&
(horizontal_scrollbar_should_change || vertical_scrollbar_should_change);
if (scrollbars_will_change) {
SetHasHorizontalScrollbar(needs_horizontal_scrollbar);
SetHasVerticalScrollbar(needs_vertical_scrollbar);
}
,
Nov 2 2017
https://chromium-review.googlesource.com/c/chromium/src/+/750530
,
Nov 3 2017
Implementing https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp?rcl=db884f9b13453f9401433df7784f5838cbad96b6&l=1366 // TODO(pdr): Extend this logic to work with all overflow boxes. This TODO could solve the problem. overflow:auto scrollbars are not removed in the first layout for the div scrollbar. wdyt ?
,
Nov 3 2017
I made a fixup @ https://chromium-review.googlesource.com/c/chromium/src/+/750530 please share inputs on this.
,
Nov 21 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d846997cba4ba0b47e521aa30a3fcdf7f4afbe20 commit d846997cba4ba0b47e521aa30a3fcdf7f4afbe20 Author: MuVen <sataya.m@samsung.com> Date: Tue Nov 21 06:51:59 2017 Create scrollbar's if scroll size is greater than visible size. Create scrollbar's if scroll width/height is greater than the visible size width/height with scrollbars. Bug: 633602 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Iccbda9a28c4406868a31be3691b729678ab6644f Reviewed-on: https://chromium-review.googlesource.com/750530 Commit-Queue: Mu Ven <sataya.m@samsung.com> Reviewed-by: Stefan Zager <szager@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/master@{#518159} [add] https://crrev.com/d846997cba4ba0b47e521aa30a3fcdf7f4afbe20/third_party/WebKit/LayoutTests/scrollbars/destroy-scrollbar-if-scrollsizes-lesser-than-contentsizes.html [modify] https://crrev.com/d846997cba4ba0b47e521aa30a3fcdf7f4afbe20/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
,
Nov 21 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/264ffbd68fbac550b9d953b4a793aa7db9bb5d92 commit 264ffbd68fbac550b9d953b4a793aa7db9bb5d92 Author: Takeshi Yoshino <tyoshino@chromium.org> Date: Tue Nov 21 08:55:22 2017 Revert "Create scrollbar's if scroll size is greater than visible size." This reverts commit d846997cba4ba0b47e521aa30a3fcdf7f4afbe20. Reason for revert: Speculatively revert to make bots green Original change's description: > Create scrollbar's if scroll size is greater than visible size. > > Create scrollbar's if scroll width/height is greater than the visible > size width/height with scrollbars. > > Bug: 633602 > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Change-Id: Iccbda9a28c4406868a31be3691b729678ab6644f > Reviewed-on: https://chromium-review.googlesource.com/750530 > Commit-Queue: Mu Ven <sataya.m@samsung.com> > Reviewed-by: Stefan Zager <szager@chromium.org> > Reviewed-by: Philip Rogers <pdr@chromium.org> > Cr-Commit-Position: refs/heads/master@{#518159} TBR=szager@chromium.org,pdr@chromium.org,skobes@chromium.org,sataya.m@samsung.com Change-Id: If60bcbbfd28448c15166c09a1ea625b4318b194f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 633602 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/781559 Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org> Commit-Queue: Takeshi Yoshino <tyoshino@chromium.org> Cr-Commit-Position: refs/heads/master@{#518187} [delete] https://crrev.com/97f486c4cd3842ef0982e8b3c61e8d3ce7094e43/third_party/WebKit/LayoutTests/scrollbars/destroy-scrollbar-if-scrollsizes-lesser-than-contentsizes.html [modify] https://crrev.com/264ffbd68fbac550b9d953b4a793aa7db9bb5d92/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
,
Nov 23 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/85c962694ffc1db6310c5eafce79e9ce9f05915a commit 85c962694ffc1db6310c5eafce79e9ce9f05915a Author: MuVen <sataya.m@samsung.com> Date: Thu Nov 23 04:43:20 2017 Create scrollbar's if scroll size is greater than visible size. Create scrollbar's if scroll width/height is greater than the visible size width/height with scrollbars. Bug: 633602 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: If57417a92493b6445eb6948eb99ce5e7e1d23b0b Reviewed-on: https://chromium-review.googlesource.com/781639 Commit-Queue: Mu Ven <sataya.m@samsung.com> Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/master@{#518850} [add] https://crrev.com/85c962694ffc1db6310c5eafce79e9ce9f05915a/third_party/WebKit/LayoutTests/scrollbars/destroy-scrollbar-if-scrollsizes-lesser-than-contentsizes.html [modify] https://crrev.com/85c962694ffc1db6310c5eafce79e9ce9f05915a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
,
Nov 28 2017
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by kochi@chromium.org
, Aug 3 2016Status: Available (was: Unconfirmed)