Ignore:
Timestamp:
Jul 16, 2012, 12:09:57 PM (13 years ago)
Author:
tony@chromium.org
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/css-grid-layout/containing-block-grids.html

    r121464 r122747  
    1313</head>
    1414<body>
    15 <p>Grids can act as containing blocks for positioned content.
    16 <div class="relative-positioned-grid" style="display: -webkit-grid"><div style="background-color: green; left: 0; top: 0"></div>
    17 <div class="relative-positioned-inline-grid" style="display: -webkit-inline-grid"><div style="background-color:green; left: 0; top: 0"></div>
    18 </p>
     15<p>Grids can act as containing blocks for positioned content.</p>
     16<div class="relative-positioned-grid" style="display: -webkit-grid"><div style="background-color: green; left: 0; top: 0"></div></div>
     17<div class="relative-positioned-inline-grid" style="display: -webkit-inline-grid"><div style="background-color:green; left: 0; top: 0"></div></div>
    1918</body>
    2019</html>
Note: See TracChangeset for help on using the changeset viewer.