Centered auto margin not recalculated when overflow changes on display: grid item
Reported by
andrew.a...@gmail.com,
Oct 19 2017
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: With an element that is `display: grid` and has a scrollbar, and an element that is `margin: auto` for left & right 1. On grid element, change overflow to `hidden` 2. Wait at least 1 frame draw 3. Change grid element overflow back to `auto` What is the expected behavior? Margin auto recalculates and there is no horizontal overflow if none existed before What went wrong? The element with margin auto retains it's previous size and causes a horizontal scrollbar to appear, even if one did not exist before Did this work before? N/A Does this work in other browsers? Yes Chrome version: 61.0.3163.100 Channel: n/a OS Version: 10.0 Flash Version:
,
Oct 23 2017
So if you are seeing the horizontal scrollbar at all, you are seeing the bug. I've tweaked the file to show it a bit clearer. If you load this file, it should start with no horizontal scrollbar, only a vertical one. Clicking hide scrollbars adds `overflow: hidden` to the body, and clicking the show button removes that style. After clicking the show button, there is now a horizontal scrollbar when there shouldn't be. The `margin: auto` on the div element resizes to larger when the scrollbars go away. However, when the scrollbars come back, the margin is not recalculated so it's width is too wide and it creates a horizontal scroll as it overflows the page.
,
Oct 23 2017
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 25 2017
Able to reproduce the issue on windows 10 , Mac os 10.12.6 and ubuntu 14.04 using chrome M62 #62.0.3202.62 and M64 #64.0.3249.0 . This is a Non-Regression issue seen from M57 and the behavior is different earlier to M57 . Marking it as untraiged for further inputs on this. Thanks!
,
Oct 30 2017
,
Oct 30 2017
I've been able to reproduce the issue on linux chrome 63.0.3239.9
,
Nov 2 2017
,
Nov 2 2017
Fix is coming: https://crrev.com/c/751262
,
Nov 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d84d88fc4d3223c89148ef62bc2785410e77fa2e commit d84d88fc4d3223c89148ef62bc2785410e77fa2e Author: Javier Fernandez <jfernandez@igalia.com> Date: Sat Nov 04 10:06:43 2017 [css-grid] Ignore auto-margins in the track sizing algorithm We resolve any auto-margin during the execution of the Grid logic. Even though we compute them again if there is any change requiring to perform a new layout, the previously resolved auto-margins may affect the track sizing computation for content-sized (eg. auto) tracks. We must ignore any 'auto' margin during the track sizing algorithm, so I added additional logic to the utility functions we already have in order to ignore any previously computed 'auto' margin. Bug: 776581 Change-Id: I3a18819feed44d856c3a80d15e387721872b5f98 Reviewed-on: https://chromium-review.googlesource.com/751262 Commit-Queue: Javier Fernandez <jfernandez@igalia.com> Reviewed-by: Manuel Rego Casasnovas <rego@igalia.com> Cr-Commit-Position: refs/heads/master@{#514042} [add] https://crrev.com/d84d88fc4d3223c89148ef62bc2785410e77fa2e/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-auto-margin-expected.html [add] https://crrev.com/d84d88fc4d3223c89148ef62bc2785410e77fa2e/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-scroll-accounts-for-auto-margin.html [modify] https://crrev.com/d84d88fc4d3223c89148ef62bc2785410e77fa2e/third_party/WebKit/Source/core/layout/GridLayoutUtils.cpp [modify] https://crrev.com/d84d88fc4d3223c89148ef62bc2785410e77fa2e/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
,
Nov 4 2017
This issue should be FIXED now, please, verify. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by krajshree@chromium.org
, Oct 23 2017Labels: Needs-Milestone Needs-Feedback
6.5 MB
6.5 MB View Download