Bug 148070 - [CSS Grid Layout] Relayout whenever Box Alignment properties change
Summary: [CSS Grid Layout] Relayout whenever Box Alignment properties change
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Javier Fernandez
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 60731 91512
  Show dependency treegraph
 
Reported: 2015-08-16 15:24 PDT by Javier Fernandez
Modified: 2015-09-17 02:13 PDT (History)
9 users (show)

See Also:


Attachments
Patch (37.60 KB, patch)
2015-08-27 07:43 PDT, Javier Fernandez
no flags Details | Formatted Diff | Diff
Patch (37.75 KB, patch)
2015-09-09 15:18 PDT, Javier Fernandez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Fernandez 2015-08-16 15:24:05 PDT
Since we need to resolve 'auto' values on alignment properties at layout time, we must force a relayout whenever these properties change.

Additionally, we perform grid items location during the grid container layout, hence we need to trigger it as well if any of these properties chance. However, only stretching implies a size change, so perhaps we can look for smarter ways to re-alig grid items without forcing an expensive relayout.
Comment 1 Javier Fernandez 2015-08-27 07:43:11 PDT
Created attachment 260054 [details]
Patch
Comment 2 Dave Hyatt 2015-09-09 14:23:47 PDT
Comment on attachment 260054 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=260054&action=review

r-

> Source/WebCore/rendering/RenderGrid.cpp:285
> +                child->setChildNeedsLayout();

This should change to:

child->setChildNeedsLayout(MarkOnlyThis).

Shouldn't positioned objects be skipped by the for loop? It seems like you are checking all children, but don't you only need to check children that are actually part of the grid?
Comment 3 Javier Fernandez 2015-09-09 15:18:05 PDT
Created attachment 260879 [details]
Patch
Comment 4 WebKit Commit Bot 2015-09-17 02:13:50 PDT
Comment on attachment 260879 [details]
Patch

Clearing flags on attachment: 260879

Committed r189910: <http://trac.webkit.org/changeset/189910>
Comment 5 WebKit Commit Bot 2015-09-17 02:13:55 PDT
All reviewed patches have been landed.  Closing bug.