Ignore:
Timestamp:
Aug 28, 2013, 2:58:33 AM (12 years ago)
Author:
sergio@webkit.org
Message:

[CSS Grid Layout] infinity should be defined as a negative value
https://bugs.webkit.org/show_bug.cgi?id=107053

Reviewed by Andreas Kling.

From Blink r154805 by <jchaffraix@chromium.org>

Source/WebCore:

Reject negative values for track-breadth at parse time as
mentioned in the latest versions of the spec.

Added some extra checks to the existing tests.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseGridBreadth):

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeUsedBreadthOfMaxLength):

LayoutTests:

Added some new test cases to check that track-breadth cannot be a
negative value, either it's a length, a percentage...

  • fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
  • fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt:
  • fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js:
  • fast/css-grid-layout/resources/grid-columns-rows-get-set.js:
File:
1 edited

Legend:

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

    r154546 r154730  
    3434namespace WebCore {
    3535
    36 static const int infinity = intMaxForLayoutUnit;
     36static const int infinity = -1;
    3737
    3838class GridTrack {
     
    304304    if (trackLength.isFixed() || trackLength.isPercent() || trackLength.isViewportPercentage()) {
    305305        LayoutUnit computedBreadth = computeUsedBreadthOfSpecifiedLength(direction, trackLength);
    306         // FIXME: We should ASSERT that computedBreadth cannot return infinity but it's currently
    307         // possible. See https://bugs.webkit.org/show_bug.cgi?id=107053
     306        ASSERT(computedBreadth != infinity);
    308307        return computedBreadth;
    309308    }
Note: See TracChangeset for help on using the changeset viewer.