Position grid items by row/column index
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 19:09:57 +0000 (19:09 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 19:09:57 +0000 (19:09 +0000)
commitc5e0c17a0bf60eadb643786baf41a9a5d96644a5
tree22f653c2a160deee7dda290f62d41f19af0f0c73
parent99dc55ce6c18072fe4a86f47dbb26e8015d939d9
Position grid items by row/column index
https://bugs.webkit.org/show_bug.cgi?id=91293

Reviewed by Ojan Vafai.

Source/WebCore:

Do some initial grid positioning. Only handle the simple case where tracks are
fixed values and don't properly size the grid items. This gives us something to
work with and starts implementing the "Grid Track Sizing Algorithm":
http://dev.w3.org/csswg/css3-grid-layout/#grid-track-sizing-algorithm0

Test: fast/css-grid-layout/place-cell-by-index.html

* rendering/RenderGrid.cpp:
(RenderGrid::GridTrack): Data structure for holding the track size. UsedBreadth matches the terminology
used in the spec.
(WebCore::RenderGrid::layoutBlock): Pull in some boiler plate code and put the
grid specific code in layoutGridItems.
(WebCore::RenderGrid::computedUsedBreadthOfGridTracks): Implement part of the grid track sizing algorithm.
(WebCore::RenderGrid::layoutGridItems): Compute the size of grid tracks, layout and position children.
(WebCore::RenderGrid::findChildLogicalPosition): Map track sizes to the actual position of the child.
* rendering/RenderGrid.h:
* rendering/style/RenderStyle.h: Just return a copy of Length rather than a reference to Length. This seems
more consistent with other getters that return a Length.

LayoutTests:

Add a test for grid layout in each writing mode direction.  The height in vertical writing mode is incorrect for now.

* fast/css-grid-layout/containing-block-grids-expected.html: Scope <p> around text only.
* fast/css-grid-layout/containing-block-grids.html: Fix missing closing </div>.
* fast/css-grid-layout/place-cell-by-index-expected.txt: Added.
* fast/css-grid-layout/place-cell-by-index.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/containing-block-grids-expected.html
LayoutTests/fast/css-grid-layout/containing-block-grids.html
LayoutTests/fast/css-grid-layout/place-cell-by-index-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/place-cell-by-index.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h
Source/WebCore/rendering/style/RenderStyle.h