Changeset 216536 in webkit


Ignore:
Timestamp:
May 9, 2017 1:48:20 PM (7 years ago)
Author:
jfernandez@igalia.com
Message:

space-evenly misbehaves with flexbox
https://bugs.webkit.org/show_bug.cgi?id=170445

Reviewed by David Hyatt.

Source/WebCore:

The CSS Box Alignment specification defines the <content-distribution>
set as some of the allowed values for the Content Distribution
properties, align-content and justify-content. The 'space-evenly' value
is not among the ones allowed for these properties according to the CSS
Flexible Box specification.

The CSS Flexbible box specification states that it must follow the CSS
Box Alignment specification, so this new value must be considered as
part of an upgraded level of the spec, which should be implemented
eventually.

Since we have already shipped an implementation of the new CSS Box
Alignment values for CSS Grid Layout, we need to implement it for
Flexbox as well.

No new tests, but several new test cases added.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::initialJustifyContentOffset):
(WebCore::justifyContentSpaceBetweenChildren):
(WebCore::initialAlignContentOffset):
(WebCore::alignContentSpaceBetweenChildren):

LayoutTests:

Added test cases for the 'space-evenly' value for align-content and justify-content.

  • css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line-expected.txt:
  • css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html:
  • css3/flexbox/css-properties-expected.txt:
  • css3/flexbox/css-properties.html:
  • css3/flexbox/flex-justify-content-expected.txt:
  • css3/flexbox/flex-justify-content.html:
  • css3/flexbox/multiline-align-content-expected.txt:
  • css3/flexbox/multiline-align-content-horizontal-column-expected.txt:
  • css3/flexbox/multiline-align-content-horizontal-column.html:
  • css3/flexbox/multiline-align-content.html:
  • css3/flexbox/resources/flexbox.css:

(.align-content-space-around):
(.justify-content-space-around):

  • css3/flexbox/true-centering-expected.txt:
  • css3/flexbox/true-centering.html:
Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r216532 r216536  
     12017-05-09  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        space-evenly misbehaves with flexbox
     4        https://bugs.webkit.org/show_bug.cgi?id=170445
     5
     6        Reviewed by David Hyatt.
     7
     8        Added test cases for the 'space-evenly' value for align-content and justify-content.
     9
     10        * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line-expected.txt:
     11        * css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html:
     12        * css3/flexbox/css-properties-expected.txt:
     13        * css3/flexbox/css-properties.html:
     14        * css3/flexbox/flex-justify-content-expected.txt:
     15        * css3/flexbox/flex-justify-content.html:
     16        * css3/flexbox/multiline-align-content-expected.txt:
     17        * css3/flexbox/multiline-align-content-horizontal-column-expected.txt:
     18        * css3/flexbox/multiline-align-content-horizontal-column.html:
     19        * css3/flexbox/multiline-align-content.html:
     20        * css3/flexbox/resources/flexbox.css:
     21        (.align-content-space-around):
     22        (.justify-content-space-around):
     23        * css3/flexbox/true-centering-expected.txt:
     24        * css3/flexbox/true-centering.html:
     25
    1262017-05-09  Matt Lewis  <jlewis3@apple.com>
    227
  • trunk/LayoutTests/css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line-expected.txt

    r213149 r216536  
    1212PASS .default, .verticalWriting 11
    1313PASS .default, .verticalWriting 12
     14PASS .default, .verticalWriting 13
    1415Test for BUG=324178: Chrome incorrectly honors "align-content" in "flex-wrap: wrap" flex containers that only have a single line
    1516
     17This text should be at the top of its container
    1618This text should be at the top of its container
    1719This text should be at the top of its container
  • trunk/LayoutTests/css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html

    r213149 r216536  
    4444<div data-offset-y="0">This text should be at the top of its container</div>
    4545</div>
     46<div class="default" style="align-content: space-evenly">
     47<div data-offset-y="0">This text should be at the top of its container</div>
     48</div>
    4649<div class="default" style="align-content: stretch">
    4750<div data-offset-y="0">This text should be at the top of its container</div>
  • trunk/LayoutTests/css3/flexbox/css-properties-expected.txt

    r213149 r216536  
    2727PASS flexbox.style.justifyContent is "space-between"
    2828PASS window.getComputedStyle(flexbox, null).justifyContent is "space-between"
     29PASS flexbox.style.justifyContent is "space-evenly"
     30PASS window.getComputedStyle(flexbox, null).justifyContent is "space-evenly"
    2931PASS flexbox.style.justifyContent is ""
    3032PASS window.getComputedStyle(flexbox, null).justifyContent is "normal"
     
    211213PASS flexbox.style.alignContent is "space-around"
    212214PASS window.getComputedStyle(flexbox, null).alignContent is "space-around"
     215PASS flexbox.style.alignContent is "space-evenly"
     216PASS window.getComputedStyle(flexbox, null).alignContent is "space-evenly"
    213217PASS flexbox.style.alignContent is "stretch"
    214218PASS window.getComputedStyle(flexbox, null).alignContent is "stretch"
  • trunk/LayoutTests/css3/flexbox/css-properties.html

    r213149 r216536  
    7676shouldBeEqualToString('window.getComputedStyle(flexbox, null).justifyContent', 'space-between');
    7777
     78flexbox.style.justifyContent = 'space-evenly';
     79shouldBeEqualToString('flexbox.style.justifyContent', 'space-evenly');
     80shouldBeEqualToString('window.getComputedStyle(flexbox, null).justifyContent', 'space-evenly');
     81
    7882flexbox.style.justifyContent = '';
    7983shouldBeEqualToString('flexbox.style.justifyContent', '');
     
    302306shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignContent', 'space-around');
    303307
     308flexbox.style.alignContent = 'space-evenly';
     309shouldBeEqualToString('flexbox.style.alignContent', 'space-evenly');
     310shouldBeEqualToString('window.getComputedStyle(flexbox, null).alignContent', 'space-evenly');
     311
    304312flexbox.style.alignContent = 'stretch';
    305313shouldBeEqualToString('flexbox.style.alignContent', 'stretch');
  • trunk/LayoutTests/css3/flexbox/flex-justify-content-expected.txt

    r213149 r216536  
    1515PASS .flexbox 14
    1616PASS .flexbox 15
     17PASS .flexbox 16
     18PASS .flexbox 17
     19PASS .flexbox 18
     20PASS .flexbox 19
     21PASS .flexbox 20
    1722
  • trunk/LayoutTests/css3/flexbox/flex-justify-content.html

    r213149 r216536  
    9797<div class="flexbox" style="justify-content: space-around"></div>
    9898
     99<div class="flexbox" style="justify-content: space-evenly">
     100  <div data-expected-width="100" data-offset-x="75" style="flex: 1 0 0; max-width: 100px;"></div>
     101  <div data-expected-width="100" data-offset-x="250" style="width: 100px;"></div>
     102  <div data-expected-width="100" data-offset-x="425" style="width: 100px;"></div>
     103</div>
     104
     105<div class="flexbox" style="justify-content: space-evenly">
     106  <div data-expected-width="200" data-offset-x="0" style="flex: 1 100px;"></div>
     107  <div data-expected-width="200" data-offset-x="200" style="flex: 1 100px;"></div>
     108  <div data-expected-width="200" data-offset-x="400" style="flex: 1 100px;"></div>
     109</div>
     110
     111<!-- If there's only one child, we justify-content: center. -->
     112<div class="flexbox" style="justify-content: space-evenly">
     113  <div data-expected-width="100" data-offset-x="250" style="flex: 1 0 0; max-width: 100px;"></div>
     114</div>
     115
     116<!-- True centering on overflow. -->
     117<div class="flexbox" style="justify-content: space-evenly">
     118  <div data-expected-width="800" data-offset-x="-100" style="width: 800px;"></div>
     119</div>
     120
     121<!-- Make sure we don't crash with no children. -->
     122<div class="flexbox" style="justify-content: space-evenly"></div>
     123
    99124<!-- margin:auto applies before justify-content. -->
    100125<div class="flexbox" style="justify-content: flex-end">
  • trunk/LayoutTests/css3/flexbox/multiline-align-content-expected.txt

    r213149 r216536  
    3636PASS .flexbox 35
    3737PASS .flexbox 36
     38PASS .flexbox 37
     39PASS .flexbox 38
     40PASS .flexbox 39
     41PASS .flexbox 40
     42PASS .flexbox 41
     43PASS .flexbox 42
     44PASS .flexbox 43
     45PASS .flexbox 44
    3846Test to make sure that align-content works properly.
    3947
  • trunk/LayoutTests/css3/flexbox/multiline-align-content-horizontal-column-expected.txt

    r213149 r216536  
    4848PASS .flexbox 47
    4949PASS .flexbox 48
     50PASS .flexbox 49
     51PASS .flexbox 50
     52PASS .flexbox 51
     53PASS .flexbox 52
     54PASS .flexbox 53
     55PASS .flexbox 54
     56PASS .flexbox 55
     57PASS .flexbox 56
    5058horizontal-tb ltr column wrap align-content-flex-start
    5159horizontal-tb ltr column wrap align-content-flex-end
     
    5361horizontal-tb ltr column wrap align-content-space-between
    5462horizontal-tb ltr column wrap align-content-space-around
     63horizontal-tb ltr column wrap align-content-space-evenly
    5564horizontal-tb ltr column wrap align-content-stretch
    5665horizontal-tb ltr column wrap-reverse align-content-flex-start
     
    5968horizontal-tb ltr column wrap-reverse align-content-space-between
    6069horizontal-tb ltr column wrap-reverse align-content-space-around
     70horizontal-tb ltr column wrap-reverse align-content-space-evenly
    6171horizontal-tb ltr column wrap-reverse align-content-stretch
    6272horizontal-tb rtl column wrap align-content-flex-start
     
    6575horizontal-tb rtl column wrap align-content-space-between
    6676horizontal-tb rtl column wrap align-content-space-around
     77horizontal-tb rtl column wrap align-content-space-evenly
    6778horizontal-tb rtl column wrap align-content-stretch
    6879horizontal-tb rtl column wrap-reverse align-content-flex-start
     
    7182horizontal-tb rtl column wrap-reverse align-content-space-between
    7283horizontal-tb rtl column wrap-reverse align-content-space-around
     84horizontal-tb rtl column wrap-reverse align-content-space-evenly
    7385horizontal-tb rtl column wrap-reverse align-content-stretch
    7486horizontal-tb ltr column-reverse wrap align-content-flex-start
     
    7789horizontal-tb ltr column-reverse wrap align-content-space-between
    7890horizontal-tb ltr column-reverse wrap align-content-space-around
     91horizontal-tb ltr column-reverse wrap align-content-space-evenly
    7992horizontal-tb ltr column-reverse wrap align-content-stretch
    8093horizontal-tb ltr column-reverse wrap-reverse align-content-flex-start
     
    8396horizontal-tb ltr column-reverse wrap-reverse align-content-space-between
    8497horizontal-tb ltr column-reverse wrap-reverse align-content-space-around
     98horizontal-tb ltr column-reverse wrap-reverse align-content-space-evenly
    8599horizontal-tb ltr column-reverse wrap-reverse align-content-stretch
    86100horizontal-tb rtl column-reverse wrap align-content-flex-start
     
    89103horizontal-tb rtl column-reverse wrap align-content-space-between
    90104horizontal-tb rtl column-reverse wrap align-content-space-around
     105horizontal-tb rtl column-reverse wrap align-content-space-evenly
    91106horizontal-tb rtl column-reverse wrap align-content-stretch
    92107horizontal-tb rtl column-reverse wrap-reverse align-content-flex-start
     
    95110horizontal-tb rtl column-reverse wrap-reverse align-content-space-between
    96111horizontal-tb rtl column-reverse wrap-reverse align-content-space-around
     112horizontal-tb rtl column-reverse wrap-reverse align-content-space-evenly
    97113horizontal-tb rtl column-reverse wrap-reverse align-content-stretch
    98114
  • trunk/LayoutTests/css3/flexbox/multiline-align-content-horizontal-column.html

    r213149 r216536  
    4848    align-content: space-around;
    4949}
     50.align-content-space-evenly {
     51    align-content: space-evenly;
     52}
    5053.align-content-stretch {
    5154    align-content: stretch;
     
    7578                    'space-between': [0, 500],
    7679                    'space-around': [100, 400],
    77                     'stretch': [0, 300],
    78                 },
    79                 'wrap-reverse': {
    80                     'flex-start': [500, 400],
    81                     'flex-end': [100, 0],
    82                     'center': [300, 200],
    83                     'space-between': [500, 0],
    84                     'space-around': [400, 100],
     80                    'space-evenly': [133, 367],
     81                    'stretch': [0, 300],
     82                },
     83                'wrap-reverse': {
     84                    'flex-start': [500, 400],
     85                    'flex-end': [100, 0],
     86                    'center': [300, 200],
     87                    'space-between': [500, 0],
     88                    'space-around': [400, 100],
     89                    'space-evenly': [367, 133],
    8590                    'stretch': [300, 0],
    8691                },
     
    9398                    'space-between': [500, 0],
    9499                    'space-around': [400, 100],
    95                     'stretch': [300, 0],
    96                 },
    97                 'wrap-reverse': {
    98                     'flex-start': [0, 100],
    99                     'flex-end': [400, 500],
    100                     'center': [200, 300],
    101                     'space-between': [0, 500],
    102                     'space-around': [100, 400],
     100                    'space-evenly': [367, 133],
     101                    'stretch': [300, 0],
     102                },
     103                'wrap-reverse': {
     104                    'flex-start': [0, 100],
     105                    'flex-end': [400, 500],
     106                    'center': [200, 300],
     107                    'space-between': [0, 500],
     108                    'space-around': [100, 400],
     109                    'space-evenly': [133, 367],
    103110                    'stretch': [0, 300],
    104111                },
     
    114121                    'space-between': [0, 500],
    115122                    'space-around': [100, 400],
    116                     'stretch': [0, 300],
    117                 },
    118                 'wrap-reverse': {
    119                     'flex-start': [500, 400],
    120                     'flex-end': [100, 0],
    121                     'center': [300, 200],
    122                     'space-between': [500, 0],
    123                     'space-around': [400, 100],
     123                    'space-evenly': [133, 367],
     124                    'stretch': [0, 300],
     125                },
     126                'wrap-reverse': {
     127                    'flex-start': [500, 400],
     128                    'flex-end': [100, 0],
     129                    'center': [300, 200],
     130                    'space-between': [500, 0],
     131                    'space-around': [400, 100],
     132                    'space-evenly': [367, 133],
    124133                    'stretch': [300, 0],
    125134                },
     
    132141                    'space-between': [500, 0],
    133142                    'space-around': [400, 100],
    134                     'stretch': [300, 0],
    135                 },
    136                 'wrap-reverse': {
    137                     'flex-start': [0, 100],
    138                     'flex-end': [400, 500],
    139                     'center': [200, 300],
    140                     'space-between': [0, 500],
    141                     'space-around': [100, 400],
     143                    'space-evenly': [367, 133],
     144                    'stretch': [300, 0],
     145                },
     146                'wrap-reverse': {
     147                    'flex-start': [0, 100],
     148                    'flex-end': [400, 500],
     149                    'center': [200, 300],
     150                    'space-between': [0, 500],
     151                    'space-around': [100, 400],
     152                    'space-evenly': [133, 367],
    142153                    'stretch': [0, 300],
    143154                },
     
    173184var directions = ['ltr', 'rtl'];
    174185var wraps = ['wrap', 'wrap-reverse'];
    175 var alignContents = ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch'];
     186var alignContents = ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch'];
    176187
    177188writingModes.forEach(function(writingMode) {
  • trunk/LayoutTests/css3/flexbox/multiline-align-content.html

    r213149 r216536  
    107107</div>
    108108
     109<div data-expected-height="120" class="flexbox horizontal" style="align-content: space-evenly">
     110  <div data-offset-x="0" data-offset-y="15" data-expected-height="20"></div>
     111  <div data-offset-x="100" data-offset-y="15" data-expected-height="20"></div>
     112  <div data-offset-x="0" data-offset-y="50" data-expected-height="20"></div>
     113  <div data-offset-x="0" data-offset-y="85" data-expected-height="20"></div>
     114</div>
     115
    109116<div data-expected-height="120" class="flexbox horizontal" style="align-content: space-around">
    110117  <div data-offset-x="0" data-offset-y="10" data-expected-height="20"></div>
     
    153160</div>
    154161
     162<!-- If we overflow, we should true center. -->
     163<div data-expected-height="30" class="flexbox horizontal" style="align-content: space-evenly; height: 30px">
     164  <div data-offset-x="0" data-offset-y="-15" data-expected-height="20"></div>
     165  <div data-offset-x="100" data-offset-y="-15" data-expected-height="20"></div>
     166  <div data-offset-x="0" data-offset-y="5" data-expected-height="20"></div>
     167  <div data-offset-x="0" data-offset-y="25" data-expected-height="20"></div>
     168</div>
     169
    155170<!-- Stretch should only grow, not shrink. -->
    156171<div data-expected-height="30" class="flexbox horizontal" style="align-content: stretch; height: 30px">
     
    166181<div data-expected-height="30" class="flexbox horizontal" style="align-content: space-around; height: 30px">
    167182</div>
     183<div data-expected-height="30" class="flexbox horizontal" style="align-content: space-evenly; height: 30px">
     184</div>
    168185<div data-expected-height="30" class="flexbox horizontal" style="align-content: stretch; height: 30px">
    169186</div>
     
    174191</div>
    175192<div data-expected-height="30" class="flexbox horizontal" style="align-content: space-around; height: 30px">
     193  <div data-offset-x="0" data-offset-y="0" data-expected-height="30"></div>
     194</div>
     195<div data-expected-height="30" class="flexbox horizontal" style="align-content: space-evenly; height: 30px">
    176196  <div data-offset-x="0" data-offset-y="0" data-expected-height="30"></div>
    177197</div>
     
    221241  <div data-offset-x="50" data-offset-y="0" data-expected-width="20"></div>
    222242  <div data-offset-x="10" data-offset-y="0" data-expected-width="20"></div>
     243</div>
     244
     245<div data-expected-width="120" class="flexbox vertical-rl" style="align-content: space-evenly">
     246  <div data-offset-x="85" data-offset-y="0" data-expected-width="20"></div>
     247  <div data-offset-x="85" data-offset-y="10" data-expected-width="20"></div>
     248  <div data-offset-x="50" data-offset-y="0" data-expected-width="20"></div>
     249  <div data-offset-x="15" data-offset-y="0" data-expected-width="20"></div>
    223250</div>
    224251
     
    262289</div>
    263290
     291<!-- If we overflow, we should true center. -->
     292<div data-expected-width="30" class="flexbox vertical-rl" style="align-content: space-evenly; width: 30px;">
     293  <div data-offset-x="25" data-offset-y="0" data-expected-width="20"></div>
     294  <div data-offset-x="25" data-offset-y="10" data-expected-width="20"></div>
     295  <div data-offset-x="5" data-offset-y="0" data-expected-width="20"></div>
     296  <div data-offset-x="-15" data-offset-y="0" data-expected-width="20"></div>
     297</div>
     298
    264299<!-- Stretch should only grow, not shrink. -->
    265300<div data-expected-width="30" class="flexbox vertical-rl" style="align-content: stretch; width: 30px;">
     
    275310<div data-expected-width="30" class="flexbox vertical-rl" style="align-content: space-around; width: 30px">
    276311</div>
     312<div data-expected-width="30" class="flexbox vertical-rl" style="align-content: space-evenly; width: 30px">
     313</div>
    277314<div data-expected-width="30" class="flexbox vertical-rl" style="align-content: stretch; width: 30px">
    278315</div>
     
    285322  <div data-offset-x="0" data-offset-y="0" data-expected-width="30"></div>
    286323</div>
     324<div data-expected-width="30" class="flexbox vertical-rl" style="align-content: space-evenly; width: 30px">
     325  <div data-offset-x="0" data-offset-y="0" data-expected-width="30"></div>
     326</div>
    287327<div data-expected-width="30" class="flexbox vertical-rl" style="align-content: stretch; width: 30px">
    288328  <div data-offset-x="0" data-offset-y="0" data-expected-width="30"></div>
  • trunk/LayoutTests/css3/flexbox/resources/flexbox.css

    r145937 r216536  
    7171    align-content: space-around;
    7272}
     73.align-content-space-around {
     74    -webkit-align-content: space-evenly;
     75    align-content: space-evenly;
     76}
    7377.align-content-stretch {
    7478    -webkit-align-content: stretch;
     
    142146    justify-content: space-around;
    143147}
     148.justify-content-space-around {
     149    -webkit-justify-content: space-evenly;
     150    justify-content: space-evenly;
     151}
  • trunk/LayoutTests/css3/flexbox/true-centering-expected.txt

    r213149 r216536  
    3131PASS .flexbox 30
    3232PASS .flexbox 31
     33PASS .flexbox 32
    3334horizontal-tb ltr row
    3435horizontal-tb rtl row
  • trunk/LayoutTests/css3/flexbox/true-centering.html

    r213149 r216536  
    8080</div>
    8181
     82<div class="flexbox" style="align-items: center; justify-content: space-evenly;">
     83    <div data-offset-x="-10" data-offset-y="-5"></div>
     84    <div data-offset-x="50" data-offset-y="-5"></div>
     85</div>
     86
    8287<div class="flexbox" style="align-items: flex-start; justify-content: flex-start;">
    8388    <div data-offset-x=0 data-offset-y=0></div>
  • trunk/Source/WebCore/ChangeLog

    r216535 r216536  
     12017-05-09  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        space-evenly misbehaves with flexbox
     4        https://bugs.webkit.org/show_bug.cgi?id=170445
     5
     6        Reviewed by David Hyatt.
     7
     8        The CSS Box Alignment specification defines the <content-distribution>
     9        set as some of the allowed values for the Content Distribution
     10        properties, align-content and justify-content. The 'space-evenly' value
     11        is not among the ones allowed for these properties according to the CSS
     12        Flexible Box specification.
     13
     14        The CSS Flexbible box specification states that it must follow the CSS
     15        Box Alignment specification, so this new value must be considered as
     16        part of an upgraded level of the spec, which should be implemented
     17        eventually.
     18
     19        Since we have already shipped an implementation of the new CSS Box
     20        Alignment values for CSS Grid Layout, we need to implement it for
     21        Flexbox as well.
     22
     23        No new tests, but several new test cases added.
     24
     25        * rendering/RenderFlexibleBox.cpp:
     26        (WebCore::initialJustifyContentOffset):
     27        (WebCore::justifyContentSpaceBetweenChildren):
     28        (WebCore::initialAlignContentOffset):
     29        (WebCore::alignContentSpaceBetweenChildren):
     30
    1312017-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
    232
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r213748 r216536  
    12921292            return availableFreeSpace / 2;
    12931293    }
     1294    if (justifyContentDistribution == ContentDistributionSpaceEvenly) {
     1295        if (availableFreeSpace > 0 && numberOfChildren)
     1296            return availableFreeSpace / (numberOfChildren + 1);
     1297        // Fallback to 'center'
     1298        return availableFreeSpace / 2;
     1299    }
    12941300    return 0;
    12951301}
     
    13021308        if (justifyContentDistribution == ContentDistributionSpaceAround)
    13031309            return availableFreeSpace / numberOfChildren;
     1310        if (justifyContentDistribution == ContentDistributionSpaceEvenly)
     1311            return availableFreeSpace / (numberOfChildren + 1);
    13041312    }
    13051313    return 0;
     
    16471655            return availableFreeSpace / 2;
    16481656    }
     1657    if (alignContentDistribution == ContentDistributionSpaceEvenly) {
     1658        if (availableFreeSpace > 0)
     1659            return availableFreeSpace / (numberOfLines + 1);
     1660        // Fallback to 'center'
     1661        return availableFreeSpace / 2;
     1662    }
    16491663    return LayoutUnit();
    16501664}
     
    16571671        if (alignContentDistribution == ContentDistributionSpaceAround || alignContentDistribution == ContentDistributionStretch)
    16581672            return availableFreeSpace / numberOfLines;
     1673        if (alignContentDistribution == ContentDistributionSpaceEvenly)
     1674            return availableFreeSpace / (numberOfLines + 1);
    16591675    }
    16601676    return LayoutUnit();
Note: See TracChangeset for help on using the changeset viewer.