Bug 148071

Summary: [CSS Grid Layout] auto-margins alignment does not work for heights
Product: WebKit Reporter: Javier Fernandez <jfernandez>
Component: Layout and RenderingAssignee: Javier Fernandez <jfernandez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, esprehn+autocc, glenn, hyatt, jfernandez, kondapallykalyan, rego, svillar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 60731    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Javier Fernandez 2015-08-16 15:29:58 PDT
Grid Layout specification states that grid items should be centered horizontally when using auto margins.

https://drafts.csswg.org/css-grid/#auto-margins

Right now, we only manage vertical alignment with auto margins.
Comment 1 Javier Fernandez 2015-08-26 06:16:57 PDT
Created attachment 259945 [details]
Patch
Comment 2 Sergio Villar Senin 2015-08-31 08:09:16 PDT
Comment on attachment 259945 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        implements the expected behavior in the row-axis.

Where's the code refactoring?

> Source/WebCore/rendering/RenderGrid.cpp:1204
> +        // We need pending layouts to be done in order to compute auto-margins properly.

Duplicate comment.
Comment 3 Javier Fernandez 2015-08-31 08:26:28 PDT
Comment on attachment 259945 [details]
Patch

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

>> Source/WebCore/ChangeLog:11
>> +        implements the expected behavior in the row-axis.
> 
> Where's the code refactoring?

I meant the code removal from RenderBox to handle style changes affecting margin computation, so it's handled now in the new resetAutoMarginsAndLogicalTopInColumnAxis instead.
Comment 4 Javier Fernandez 2015-08-31 08:31:26 PDT
Created attachment 260283 [details]
Patch
Comment 5 Javier Fernandez 2015-08-31 08:35:47 PDT
Comment on attachment 259945 [details]
Patch

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

>>> Source/WebCore/ChangeLog:11
>>> +        implements the expected behavior in the row-axis.
>> 
>> Where's the code refactoring?
> 
> I meant the code removal from RenderBox to handle style changes affecting margin computation, so it's handled now in the new resetAutoMarginsAndLogicalTopInColumnAxis instead.

I agree that is not a very clear sentence, because I talk about that removal later. So I'll remove it from the ChangeLog.
Comment 6 Javier Fernandez 2015-08-31 08:36:46 PDT
Created attachment 260284 [details]
Patch
Comment 7 WebKit Commit Bot 2015-08-31 09:30:25 PDT
Comment on attachment 260284 [details]
Patch

Clearing flags on attachment: 260284

Committed r189169: <http://trac.webkit.org/changeset/189169>
Comment 8 WebKit Commit Bot 2015-08-31 09:30:30 PDT
All reviewed patches have been landed.  Closing bug.