Ignore:
Timestamp:
Oct 13, 2014, 1:44:24 AM (11 years ago)
Author:
svillar@igalia.com
Message:

[CSS Grid Layout] Pass the valid set of tracks to grow beyond growth limits
https://bugs.webkit.org/show_bug.cgi?id=137253

Reviewed by Darin Adler.

Source/WebCore:

Section 10.4 of the specs describe how to resolve content based
track sizing functions. Among others it describes the "distribute
extra space" algorithm. The 3rd bullet of that algorithm specifies
how to distribute (and also the target tracks) the extra space
once all the tracks have reached their growth limits.

Our implementation had 2 problems. First we were not passing a
valid subset of tracks (instead we were always using all of
them). Now we use a function that filters the right tracks to be
the target of the extra space distribution depending on whether
we're computing the min track function or the max track function.

Secondly the algorithm that was distributing the extra space was
not using that list of passed in tracks (it iterated over all of
them). From now on it will use the set of tracks selected using
the filter function described above.

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
(WebCore::RenderGrid::distributeSpaceToTracks):

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

(WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
(WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):

LayoutTests:

  • fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt:
  • fast/css-grid-layout/grid-content-sized-columns-resolution.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt

    r174006 r174643  
    1111PASS window.getComputedStyle(gridMaxContentAndMinContentFixed, '').getPropertyValue('-webkit-grid-template-columns') is "70px 20px"
    1212PASS window.getComputedStyle(gridMaxContentAndMaxContentFixed, '').getPropertyValue('-webkit-grid-template-columns') is "55px 35px"
     13PASS window.getComputedStyle(gridMinContentFixedAndAutoAboveLimits, '').getPropertyValue('-webkit-grid-template-columns') is "15px 95px"
     14PASS window.getComputedStyle(gridMaxContentFixedAndAutoAboveLimits, '').getPropertyValue('-webkit-grid-template-columns') is "65px 85px"
     15PASS window.getComputedStyle(gridMinContentFixedAndFixedFixedAndAuto, '').getPropertyValue('-webkit-grid-template-columns') is "20px 20px 60px"
     16PASS window.getComputedStyle(gridAutoAndFixedFixedAndMaxContentFixed, '').getPropertyValue('-webkit-grid-template-columns') is "40px 20px 90px"
    1317PASS successfullyParsed is true
    1418
     
    2630XXXX XXXX
    2731XXXX XXXX
     32XXXX XXXX
     33XXXXXXXXXXX
     34XXXX XXXX
     35XXXXXXXXXXXXXXX
     36XXXX XXXX
     37XXXXXXXXXX
     38XXXX XXXX
     39XXXXXXXXXXXXXXX
Note: See TracChangeset for help on using the changeset viewer.