New issue
Advanced search Search tips

Issue 600680 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 79180



Sign in to add a comment

[css-grid] Painting issue in RTL

Project Member Reported by r...@igalia.com, Apr 5 2016

Issue description


We've an optimization in the grid painting code (GridPainter::paintChildren()).
So we don't paint all the children always, but only the ones that are in the visible area (localPaintInvalidationRect).

For this we use the info stored in LayoutGrid::m_column|rowPositions, but the problem is that the information we're storing in RTL causes that some items that should be actually painted are not.
If you check the attached example and you play with the scroll in the <iframe> you'll see the issues.

If we avoid the optimization and paint all the children the issue disappears.
 
grid-iframe-bug.html
522 bytes View Download
grid-iframe-current.png
790 bytes View Download
grid-iframe-expected.png
1.1 KB View Download

Comment 1 by r...@igalia.com, Apr 11 2016

Owner: r...@igalia.com
Status: Assigned (was: Available)
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53cea4d18b15b735c4ab6cd85cfcb3cc07593452

commit 53cea4d18b15b735c4ab6cd85cfcb3cc07593452
Author: rego <rego@igalia.com>
Date: Wed Apr 13 21:15:18 2016

[css-grid] Fix painting in RTL

Due to the optimization we've in GridPainter that only paints
the grid items in the cells affected by the paint invalidation rect,
we've an issue using direction RTL, as the cells to be painted
were wrongly detected.

The problem is that LayoutGrid::columnPositions() is not returning
physical positions in the case of RTL, so we need to translate that
vector before calling dirtiedGridAreas().
As we're changing the order of the tracks in the new translated Vector
we need to change the GridSpan we get as result from dirtiedGridAreas().

Created a helper function LayoutGrid::translateRTLCoordinate()
and used it in the different parts of the code where we need to do
this conversion.

TEST=fast/css-grid-layout/grid-painting-rtl.html

BUG= 600680 

Review URL: https://codereview.chromium.org/1873163002

Cr-Commit-Position: refs/heads/master@{#387090}

[add] https://crrev.com/53cea4d18b15b735c4ab6cd85cfcb3cc07593452/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-painting-rtl-expected.html
[add] https://crrev.com/53cea4d18b15b735c4ab6cd85cfcb3cc07593452/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-painting-rtl.html
[modify] https://crrev.com/53cea4d18b15b735c4ab6cd85cfcb3cc07593452/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
[modify] https://crrev.com/53cea4d18b15b735c4ab6cd85cfcb3cc07593452/third_party/WebKit/Source/core/layout/LayoutGrid.h
[modify] https://crrev.com/53cea4d18b15b735c4ab6cd85cfcb3cc07593452/third_party/WebKit/Source/core/paint/GridPainter.cpp

Comment 3 by r...@igalia.com, Apr 13 2016

Status: Fixed (was: Assigned)

Sign in to add a comment