Bug 124345 - [CSS Grid Layout] Fix positioning of grid items with margins
Summary: [CSS Grid Layout] Fix positioning of grid items with margins
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sergio Villar Senin
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 60731 123994
  Show dependency treegraph
 
Reported: 2013-11-14 04:47 PST by Sergio Villar Senin
Modified: 2013-11-27 00:40 PST (History)
12 users (show)

See Also:


Attachments
Patch (21.44 KB, patch)
2013-11-14 05:11 PST, Sergio Villar Senin
hyatt: review+
eflews.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Villar Senin 2013-11-14 04:47:24 PST
There are some FIXME's in the code mentioning that we aren't considering the margins in the layouting of the grid items. Apart from that margins should be also considered when computing the grid's intrinsic size. Fixing this would involve merging these two changes from Blink:

    Positioning should account for the grid items' margins
    
    This change just adds the margin before / start to the grid items'
    positions. In order to get consistent behavior, we now have to call
    findChildLogicalPosition after layout (that's where we compute the
    margins).
    
    Also removed some FIXMEs that were handled in the code.
    
    Review URL: https://chromiumcodereview.appspot.com/23463036

and

    RenderGrid should include grid items' margins in its intrinsic size
    
    To match flexbox and the author's intent, the grid element's intrinsic
    logical widths should account for the fixed margins on any grid items'.
    The change is straightforward and moves the code from RenderFlexibleBox
    to RenderBlock for easy sharing.
    
    Review URL: https://chromiumcodereview.appspot.com/24031007
Comment 1 Sergio Villar Senin 2013-11-14 05:11:27 PST
Created attachment 216923 [details]
Patch
Comment 2 EFL EWS Bot 2013-11-14 05:23:39 PST
Comment on attachment 216923 [details]
Patch

Attachment 216923 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/22640307
Comment 3 Sergio Villar Senin 2013-11-25 01:08:27 PST
(In reply to comment #2)
> (From update of attachment 216923 [details])
> Attachment 216923 [details] did not pass efl-wk2-ews (efl-wk2):
> Output: http://webkit-queues.appspot.com/results/22640307

The patch is ready for review. That failure in the efl EWS affected some other bugs and is not related to the actual patch.
Comment 4 Sergio Villar Senin 2013-11-26 08:47:10 PST
dhyatt is the refactoring of marginIntrinsicLogicalWidthForChild() compatible with your ongoing RenderBlockFlow work?
Comment 5 Dave Hyatt 2013-11-26 09:51:29 PST
Comment on attachment 216923 [details]
Patch

r=me
Comment 6 Sergio Villar Senin 2013-11-27 00:40:40 PST
Committed r159809: <http://trac.webkit.org/changeset/159809>