[css-grid] Not painting item that overflows the grid container and tracks on scroll
Reported by
sannesch...@gmail.com,
Jan 9 2018
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Example URL: https://codepen.io/anon/pen/aEqYEe Steps to reproduce the problem: 1. Go to URL or copy paste it in a html document and load thee page 2. Scroll 3. See that the text is disappearing. I think it's some memory issue so it might work on computers with different memory sizes or graphic cards (testing on macbook pro 16GB), if so, edit the file and add much more text to see the bug. FF and Safari just show all text when scrolling. I can see "bbbbbb" but "ccccc" and "ddddd" is not visible. What is the expected behavior? That you see all the text. aaaa, bbbb, cccc and dddd What went wrong? The screen gets completely blank/white. Also if you refresh the page the whole page is completely white until you start scrolling up. It's weird cause you scroll the text disappears when you scroll up just a bit it doesn't return, it returns after a bit more scrolling. Looks like some buffer that is being cleared or something. 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: 63.0.3239.132 Channel: stable OS Version: OS X 10.12.6 Flash Version: When you remove the line-height property, it displays all text. But i have noticed some more Grid bugs when refreshing the page when having scrolled and on a refresh the text is not visible after a refresh (it was visible before a refresh), as soon as i start scrolling up a bit, the text returns.
,
Jan 10 2018
,
Jan 10 2018
Able to reproduce the issue on reported chrome version 63.0.3239.132 and on the latest canary 65.0.3315.0 using Windows 10, Mac 10.13.1 and Ubuntu 14.04. As per comment#1 suspecting the same Change log: https://chromium.googlesource.com/chromium/src/+log/ac874de1..b25a9d3a?pretty=fuller Suspecting: r423839 = da340247a837f07594b3fcfb59a4e4493dc0fd45 Review URL: https://codereview.chromium.org/2398043002 @rego@igalia.com: Please help in re-assigning it to others if not related to your change. Thanks!
,
Jan 10 2018
Thanks for the bug report. The issue is related with the painting optimizations of CSS Grid Layout that are only present in Chromiun (and not in WebKit). I've verified that if we use regular painting from BlockPainter instead of the optimizations in GridPainter the item is properly painted on scroll. The grid container in my example has 2 rows: 200px 0px. And only one huge item on the first row. For some reason, the painting code at some moment during scrolling consider that it shouldn't paint the item somehow. Note that having only one 200px row fixes the problem. I don't believe that specific commit has anything to do with the issue, but of course we need to investigate and fix it.
,
Jan 10 2018
After debugging a little bit the issue, the problem is that the item's size is 100x200, so it doesn't overflow the grid area. But the contents of the item overflow the grid area and we're not taking that into account, which makes that we don't paint the item when the local_visual_rect (cull rect) is moved down. The related code is in GridPainter::PaintChildren(): https://chromium.googlesource.com/chromium/src/+/9fc9bd0a46cdaf404da5f6a6bf7818721c554e2d/third_party/WebKit/Source/core/paint/GridPainter.cpp#47
,
Jan 10 2018
Not a P1 regression for tracking purposes if nobody caught it in 7 releases.
,
Jan 11 2018
,
Jan 18 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f52219fdc7968529a0e9530c8da04fe7d4f46b3e commit f52219fdc7968529a0e9530c8da04fe7d4f46b3e Author: Manuel Rego Casasnovas <rego@igalia.com> Date: Thu Jan 18 06:09:52 2018 [css-grid] Fix painting of grid items with overflowing contents On Grid Layout we've an optimization on the painting code, to avoid painting the whole grid. We look for the dirtied grid areas and paint only the items on those areas. At the same time we keep a list of the items overflowing its area, and we paint them too. The problem found on the bug is that the item is not overflowing the grid area, but the contents of the item are overflowing it. We were using FrameRect() to check this, which returns the size of the item, but we need to check also the overflowing contents, so the patch uses FrameRect() for the position (which takes into account the margins) and VisualOverflowRect() for the size. That way the items with overflowing contents are always painted. On the test we need 2 tracks, because of how GridPainter::DirtiedGridAreas() is implemented. It's using std::upper_bound() which returns the last element if none of them is greater than the one passed. This makes that the items on the last cell are painted even in the cases fixed by this patch, as the last cell is considered to be dirty in those situations. BUG= 800386 TEST=fast/css-grid-layout/grid-painting-item-overflow.html Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I59521880207b75a5541a0e0c25e214d309e90661 Reviewed-on: https://chromium-review.googlesource.com/860660 Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#530068} [add] https://crrev.com/f52219fdc7968529a0e9530c8da04fe7d4f46b3e/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-painting-item-overflow-expected.html [add] https://crrev.com/f52219fdc7968529a0e9530c8da04fe7d4f46b3e/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-painting-item-overflow.html [modify] https://crrev.com/f52219fdc7968529a0e9530c8da04fe7d4f46b3e/third_party/WebKit/Source/core/layout/LayoutGrid.cpp [modify] https://crrev.com/f52219fdc7968529a0e9530c8da04fe7d4f46b3e/third_party/WebKit/Source/core/paint/GridPainter.cpp
,
Jan 18 2018
,
Jan 21 2018
Thank you! Tested it in Canary and it all works. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by woxxom@gmail.com
, Jan 9 2018