Changeset 121611 in webkit


Ignore:
Timestamp:
Jun 29, 2012 7:36:41 PM (12 years ago)
Author:
tony@chromium.org
Message:

Allow align-self: stretch to cause the item size to shrink below its intrinsic size
https://bugs.webkit.org/show_bug.cgi?id=90304

Reviewed by Ojan Vafai.

Source/WebCore:

The spec used to say that stretch could only make items grow, but now
it allows items to shrink.
http://dev.w3.org/csswg/css3-flexbox/#align-items-stretch

Tests: css3/flexbox/flex-align-stretch.html Updated expectations.

css3/flexbox/child-overflow.html Updated expectations.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):

LayoutTests:

  • css3/flexbox/child-overflow-expected.html:
  • css3/flexbox/child-overflow.html:
  • css3/flexbox/flex-align-stretch.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121610 r121611  
     12012-06-29  Tony Chang  <tony@chromium.org>
     2
     3        Allow align-self: stretch to cause the item size to shrink below its intrinsic size
     4        https://bugs.webkit.org/show_bug.cgi?id=90304
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/flexbox/child-overflow-expected.html:
     9        * css3/flexbox/child-overflow.html:
     10        * css3/flexbox/flex-align-stretch.html:
     11
    1122012-06-29  James Weatherall  <wez@chromium.org>
    213
  • trunk/LayoutTests/css3/flexbox/child-overflow-expected.html

    r111214 r121611  
    3030</head>
    3131<body>
    32     <p>Scrollbars should work in all the flexboxes. The first and third
    33     columns should overflow the logical height. Each row should be aligned
     32    <p>Scrollbars should work in all the flexboxes. Each row should be aligned
    3433    to the same corner.</p>
    3534
    36     <div class="container bottomLeft"><div style="height: auto; position: absolute; bottom: 0"><div></div></div></div>
    3735    <div class="container bottomLeft"><div><div></div></div></div>
    38     <div class="container bottomLeft"><div style="height: auto; position: absolute; bottom: 0"><div></div></div></div>
     36    <div class="container bottomLeft"><div><div></div></div></div>
     37    <div class="container bottomLeft"><div><div></div></div></div>
    3938    <div class="container bottomLeft"><div><div></div></div></div>
    4039    <br>
    41     <div class="container topRight"><div style="width: auto; overflow-x: hidden; overflow-y: scroll; position: absolute; right: 0"><div></div></div></div>
    4240    <div class="container topRight"><div><div></div></div></div>
    43     <div class="container topRight"><div style="width: auto; overflow-x: hidden; overflow-y: scroll; position: absolute; right: 0"><div></div></div></div>
     41    <div class="container topRight"><div><div></div></div></div>
     42    <div class="container topRight"><div><div></div></div></div>
    4443    <div class="container topRight"><div><div></div></div></div>
    4544    <br>
    46     <div class="container"><div style="width: auto; overflow-x: hidden; overflow-y: scroll; position: absolute;"><div></div></div></div>
    4745    <div class="container"><div><div></div></div></div>
    48     <div class="container"><div style="width: auto; overflow-x: hidden; overflow-y: scroll; position: absolute;"><div></div></div></div>
     46    <div class="container"><div><div></div></div></div>
     47    <div class="container"><div><div></div></div></div>
    4948    <div class="container"><div><div></div></div></div>
    5049    <br>
    51     <div class="container"><div style="height: auto"><div></div></div></div>
    5250    <div class="container"><div><div></div></div></div>
    53     <div class="container"><div style="height: auto"><div></div></div></div>
     51    <div class="container"><div><div></div></div></div>
     52    <div class="container"><div><div></div></div></div>
    5453    <div class="container"><div><div></div></div></div>
    5554
  • trunk/LayoutTests/css3/flexbox/child-overflow.html

    r117385 r121611  
    6363</head>
    6464<body>
    65     <p>Scrollbars should work in all the flexboxes. The first and third
    66     columns should overflow the logical height. Each row should be aligned
     65    <p>Scrollbars should work in all the flexboxes. Each row should be aligned
    6766    to the same corner.</p>
    6867</body>
  • trunk/LayoutTests/css3/flexbox/flex-align-stretch.html

    r119990 r121611  
    8383</div>
    8484
    85 <!-- When overflowing the height, align-items: stretch doesn't cause the flex item to get smaller. -->
    8685<div class="flexbox" style="height: 50px; width: 600px;">
    87   <div data-expected-height="60" style="background-color: yellow; width: 300px">
     86  <div data-expected-height="50" style="background-color: yellow; width: 300px">
    8887    <div data-expected-height="60" style="height: 60px; width: 10px; background-color: orange"></div>
    8988  </div>
    9089</div>
    9190
    92 <!-- In the column case, the width of the flex item is constrained by the width of the flexbox, so align-items: stretch doesn't change the width. -->
    9391<div class="flexbox" style="-webkit-flex-direction: column; width: 100px;">
    9492  <div data-expected-width="100" data-expected-height="50" style="background-color: yellow;">
  • trunk/Source/WebCore/ChangeLog

    r121610 r121611  
     12012-06-29  Tony Chang  <tony@chromium.org>
     2
     3        Allow align-self: stretch to cause the item size to shrink below its intrinsic size
     4        https://bugs.webkit.org/show_bug.cgi?id=90304
     5
     6        Reviewed by Ojan Vafai.
     7
     8        The spec used to say that stretch could only make items grow, but now
     9        it allows items to shrink.
     10        http://dev.w3.org/csswg/css3-flexbox/#align-items-stretch
     11
     12        Tests: css3/flexbox/flex-align-stretch.html Updated expectations.
     13               css3/flexbox/child-overflow.html Updated expectations.
     14
     15        * rendering/RenderFlexibleBox.cpp:
     16        (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
     17
    1182012-06-29  James Weatherall  <wez@chromium.org>
    219
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r121123 r121611  
    11991199        LayoutUnit logicalHeightBefore = child->logicalHeight();
    12001200        LayoutUnit stretchedLogicalHeight = child->logicalHeight() + availableAlignmentSpaceForChild(lineCrossAxisExtent, child);
    1201         if (stretchedLogicalHeight < logicalHeightBefore)
    1202             return;
    12031201
    12041202        child->setLogicalHeight(stretchedLogicalHeight);
Note: See TracChangeset for help on using the changeset viewer.