Ignore:
Timestamp:
Aug 28, 2013, 9:48:53 AM (12 years ago)
Author:
sergio@webkit.org
Message:

[CSS Grid Layout] Handle 'span' positions during layout
https://bugs.webkit.org/show_bug.cgi?id=119756

Reviewed by Andreas Kling.

From Blink r149133 by <jchaffraix@chromium.org>

Source/WebCore:

Properly handle the 'span' keyword during layout. We only had
parsing support so far but with this change we are able to
recognize these positions and act accordingly.

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::resolveGridPositionsFromStyle):
(WebCore::RenderGrid::resolveGridPositionAgainstOppositePosition):

  • rendering/RenderGrid.h:
  • rendering/style/GridPosition.h:

(WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):

LayoutTests:

Added some new test cases to verify that we properly resolve
'span' positions.

  • fast/css-grid-layout/grid-item-negative-position-resolution-expected.txt:
  • fast/css-grid-layout/grid-item-negative-position-resolution.html:
  • fast/css-grid-layout/grid-item-spanning-resolution-expected.txt:
  • fast/css-grid-layout/grid-item-spanning-resolution.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderGrid.h

    r154731 r154753  
    6060
    6161    struct GridSpan {
     62        static PassOwnPtr<GridSpan> create(size_t initialPosition, size_t finalPosition)
     63        {
     64            return adoptPtr(new GridSpan(initialPosition, finalPosition));
     65        }
     66
    6267        GridSpan(size_t initialPosition, size_t finalPosition)
    6368            : initialPositionIndex(initialPosition)
     
    131136    PassOwnPtr<GridSpan> resolveGridPositionsFromStyle(const RenderBox*, TrackSizingDirection) const;
    132137    size_t resolveGridPositionFromStyle(const GridPosition&, GridPositionSide) const;
     138    PassOwnPtr<GridSpan> resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const;
    133139
    134140    LayoutUnit gridAreaBreadthForChild(const RenderBox* child, TrackSizingDirection, const Vector<GridTrack>&) const;
Note: See TracChangeset for help on using the changeset viewer.