Changeset 205954 in webkit


Ignore:
Timestamp:
Sep 15, 2016 12:40:20 AM (8 years ago)
Author:
svillar@igalia.com
Message:

[css-grid] Too many gaps with trailing collapsing tracks
https://bugs.webkit.org/show_bug.cgi?id=161905

Reviewed by Darin Adler.

Source/WebCore:

The total number and size of gaps were incorrectly computed whenever there were trailing
collapsed tracks (with collapsed gaps). The problem was that we were trying to optimize too
much the amount of hash table queries required to know the gaps between two lines. We were
considering that a gap always exist between 2 consecutive tracks if the first one is not
empty. That's generally true (for both NOTEMPTY|NOTEMPTY and NOTEMPTY|EMPTY+|NOTEMPTY
sequences) but not for all the cases (NOTEMPTY|EMPTY+).

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::guttersSize):

LayoutTests:

Added new test cases to check that trailing collapsed tracks do not add gutters at the end.

  • fast/css-grid-layout/grid-auto-fit-columns-expected.txt:
  • fast/css-grid-layout/grid-auto-fit-columns.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205953 r205954  
     12016-09-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-grid] Too many gaps with trailing collapsing tracks
     4        https://bugs.webkit.org/show_bug.cgi?id=161905
     5
     6        Reviewed by Darin Adler.
     7
     8        Added new test cases to check that trailing collapsed tracks do not add gutters at the end.
     9
     10        * fast/css-grid-layout/grid-auto-fit-columns-expected.txt:
     11        * fast/css-grid-layout/grid-auto-fit-columns.html:
     12
    1132016-09-15  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns-expected.txt

    r203717 r205954  
    3030PASS
    3131PASS
     32PASS
     33PASS
  • trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns.html

    r203717 r205954  
    1919.gridMultipleNames { grid-template-columns: [start] 20px [foo] 50% repeat(auto-fit, [bar] 20px [start foo]) [foo] 10% [end bar]; }
    2020.gridMultipleTracks { grid-template-columns: [start] 20px repeat(auto-fit, [a] 2em [b c] 10% [d]) [e] minmax(75px, 1fr) [last]; }
     21.gridMinMaxFixedFlex { grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); }
    2122
    2223.item { background-color: cyan; }
     
    151152</div>
    152153
     154<div class="grid gridMinMaxFixedFlex gap">
     155    <div class="item" style="grid-column-start: 1" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="25"></div>
     156</div>
     157
     158<div class="grid gridMinMaxFixedFlex gap">
     159    <div class="item" style="grid-column-start: 1" data-offset-x="0" data-offset-y="0" data-expected-width="90" data-expected-height="25"></div>
     160    <div class="item" style="grid-column-start: 2" data-offset-x="110" data-offset-y="0" data-expected-width="90" data-expected-height="25"></div>
     161</div>
     162
    153163</body>
  • trunk/Source/WebCore/ChangeLog

    r205953 r205954  
     12016-09-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [css-grid] Too many gaps with trailing collapsing tracks
     4        https://bugs.webkit.org/show_bug.cgi?id=161905
     5
     6        Reviewed by Darin Adler.
     7
     8        The total number and size of gaps were incorrectly computed whenever there were trailing
     9        collapsed tracks (with collapsed gaps). The problem was that we were trying to optimize too
     10        much the amount of hash table queries required to know the gaps between two lines. We were
     11        considering that a gap always exist between 2 consecutive tracks if the first one is not
     12        empty. That's generally true (for both NOTEMPTY|NOTEMPTY and NOTEMPTY|EMPTY+|NOTEMPTY
     13        sequences) but not for all the cases (NOTEMPTY|EMPTY+).
     14
     15        * rendering/RenderGrid.cpp:
     16        (WebCore::RenderGrid::guttersSize):
     17
    1182016-09-15  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r205114 r205954  
    545545        if (!isEmptyAutoRepeatTrack(direction, line))
    546546            gapAccumulator += gap;
     547    }
     548
     549    // The above loop adds one extra gap for trailing collapsed tracks.
     550    if (gapAccumulator && isEmptyAutoRepeatTrack(direction, endLine - 1)) {
     551        ASSERT(gapAccumulator >= gap);
     552        gapAccumulator -= gap;
    547553    }
    548554
Note: See TracChangeset for help on using the changeset viewer.