Changeset 111103 in webkit


Ignore:
Timestamp:
Mar 16, 2012 6:29:39 PM (12 years ago)
Author:
tony@chromium.org
Message:

Unreviewed, rolling out r111094.
http://trac.webkit.org/changeset/111094
https://bugs.webkit.org/show_bug.cgi?id=80882

broke test on chromium-win

Source/WebCore:

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::alignChildren):

  • rendering/RenderFlexibleBox.h:

(RenderFlexibleBox):

LayoutTests:

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r111098 r111103  
     12012-03-16  Tony Chang  <tony@chromium.org>
     2
     3        Unreviewed, rolling out r111094.
     4        http://trac.webkit.org/changeset/111094
     5        https://bugs.webkit.org/show_bug.cgi?id=80882
     6
     7        broke test on chromium-win
     8
     9        * css3/flexbox/child-overflow-expected.html:
     10        * css3/flexbox/child-overflow.html:
     11        * css3/flexbox/flex-align-stretch-expected.txt:
     12        * css3/flexbox/flex-align-stretch.html:
     13
    1142012-03-16  Tom Sepez  <tsepez@chromium.org>
    215
  • trunk/LayoutTests/css3/flexbox/child-overflow-expected.html

    r111094 r111103  
    55.container {
    66    display: inline-block;
    7     margin-right: 30px;
    8     width: 100px;
    9     height: 100px;
    10     border: 5px solid pink;
    11     position: relative;
     7    margin-right: 5px;
    128}
    139
    1410.container > div {
     11    border: 5px solid pink;
    1512    overflow: auto;
     13    height: 100px;
    1614    width: 100px;
    17     height: 100px;
    1815}
    1916
     
    2320    background: -webkit-radial-gradient(center, ellipse cover, rgba(30,87,153,1) 0%,rgba(89,148,202,1) 62%,rgba(95,154,207,0.7) 68%,rgba(125,185,232,0) 100%);
    2421}
    25 
    26 p {
    27     margin-bottom: 30px;
    28 }
    2922</style>
    3023</head>
    3124<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
    34     to the same corner.</p>
     25    <p>Scrollbars should work in all the flexboxes and each row should show four identical boxes.</p>
     26</body>
     27<script>
     28var origins = ['', 'bottomLeft', 'topRight', ''];
    3529
    36     <div class="container bottomLeft"><div style="height: auto; position: absolute; bottom: 0"><div></div></div></div>
    37     <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>
    39     <div class="container bottomLeft"><div><div></div></div></div>
    40     <br>
    41     <div class="container topRight"><div style="width: auto; overflow-x: hidden; overflow-y: scroll; position: absolute; right: 0"><div></div></div></div>
    42     <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>
    44     <div class="container topRight"><div><div></div></div></div>
    45     <br>
    46     <div class="container"><div style="width: auto; overflow-x: hidden; overflow-y: scroll; position: absolute;"><div></div></div></div>
    47     <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>
    49     <div class="container"><div><div></div></div></div>
    50     <br>
    51     <div class="container"><div style="height: auto"><div></div></div></div>
    52     <div class="container"><div><div></div></div></div>
    53     <div class="container"><div style="height: auto"><div></div></div></div>
    54     <div class="container"><div><div></div></div></div>
    55 
    56 <script>
     30origins.forEach(function(origin) {
     31    for (var i = 0; i < 4; ++i) {
     32        var containerClass = 'container ' + origin;
     33        document.body.innerHTML +=
     34            "<div class='" + containerClass + "'>" +
     35            "<div><div></div></div>" +
     36            "</div>";
     37    }
     38    document.body.innerHTML += "<br>";
     39});
    5740
    5841Array.prototype.forEach.call(document.querySelectorAll('.bottomLeft'), function(element) {
  • trunk/LayoutTests/css3/flexbox/child-overflow.html

    r111094 r111103  
    55.container {
    66    display: inline-block;
    7     margin-right: 30px;
     7    margin-right: 5px;
    88}
    99
     
    5656    background: -webkit-radial-gradient(center, ellipse cover, rgba(30,87,153,1) 0%,rgba(89,148,202,1) 62%,rgba(95,154,207,0.7) 68%,rgba(125,185,232,0) 100%);
    5757}
    58 
    59 p {
    60     margin-bottom: 30px;
    61 }
    6258</style>
    6359</head>
    6460<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
    67     to the same corner.</p>
     61    <p>Scrollbars should work in all the flexboxes and each row should show four identical boxes.</p>
    6862</body>
    6963<script>
    70 var writingModes = ['horizontal-bt', 'vertical-rl', 'vertical-lr', 'horizontal-tb'];
     64var writingModes = ['horizontal-tb', 'horizontal-bt', 'vertical-rl', 'vertical-lr'];
    7165var flexDirections = ['row', 'column', 'row-reverse', 'column-reverse'];
    7266writingModes.forEach(function(writingMode) {
     
    7973            "<div style='width: -webkit-flex(0 1 auto); height: -webkit-flex(0 1 auto)'><div></div></div>" +
    8074            "</div>" +
    81             "</div> ";
     75            "</div>";
    8276    });
    8377    document.body.innerHTML += "<br>";
  • trunk/LayoutTests/css3/flexbox/flex-align-stretch-expected.txt

    r111094 r111103  
    33PASS
    44PASS
    5 PASS
    6 PASS
  • trunk/LayoutTests/css3/flexbox/flex-align-stretch.html

    r111094 r111103  
    8383</div>
    8484
    85 <!-- When overflowing the height, flex-align: stretch doesn't cause the flex item to get smaller. -->
    86 <div class="flexbox" style="height: 50px; width: 600px;">
    87   <div data-expected-height="60" style="background-color: yellow; width: 300px">
    88     <div data-expected-height="60" style="height: 60px; width: 10px; background-color: orange"></div>
    89   </div>
    90 </div>
    91 
    92 <!-- In the column case, the width of the flex item is constrained by the width of the flexbox, so flex-align: stretch doesn't change the width. -->
    93 <div class="flexbox" style="-webkit-flex-direction: column; width: 100px;">
    94   <div data-expected-width="100" data-expected-height="50" style="background-color: yellow;">
    95     <div data-expected-width="200" style="height: 50px; width: 200px; background-color: orange"></div>
    96   </div>
    97 </div>
    98 
    9985</html>
  • trunk/Source/WebCore/ChangeLog

    r111102 r111103  
     12012-03-16  Tony Chang  <tony@chromium.org>
     2
     3        Unreviewed, rolling out r111094.
     4        http://trac.webkit.org/changeset/111094
     5        https://bugs.webkit.org/show_bug.cgi?id=80882
     6
     7        broke test on chromium-win
     8
     9        * rendering/RenderFlexibleBox.cpp:
     10        (WebCore::RenderFlexibleBox::alignChildren):
     11        * rendering/RenderFlexibleBox.h:
     12        (RenderFlexibleBox):
     13
    1142012-03-16  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r111094 r111103  
    975975            break;
    976976        case AlignStretch: {
    977             applyStretchAlignmentToChild(child, lineCrossAxisExtent);
     977            if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) {
     978                LayoutUnit logicalHeightBefore = child->logicalHeight();
     979                LayoutUnit stretchedLogicalHeight = child->logicalHeight() + availableAlignmentSpaceForChild(lineCrossAxisExtent, child);
     980                child->setLogicalHeight(stretchedLogicalHeight);
     981                child->computeLogicalHeight();
     982
     983                if (child->logicalHeight() != logicalHeightBefore) {
     984                    child->setOverrideHeight(child->logicalHeight());
     985                    child->setLogicalHeight(0);
     986                    child->setChildNeedsLayout(true);
     987                    child->layoutIfNeeded();
     988                }
     989            } else if (isColumnFlow() && child->style()->logicalWidth().isAuto() && isMultiline()) {
     990                // FIXME: Handle min-width and max-width.
     991                LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child);
     992                child->setOverrideWidth(std::max(0, childWidth));
     993                child->setChildNeedsLayout(true);
     994                child->layoutIfNeeded();
     995            }
    978996            // Since wrap-reverse flips cross start and cross end, strech children should be aligned with the cross end.
    979997            if (style()->flexWrap() == FlexWrapReverse)
     
    10121030}
    10131031
    1014 void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox* child, LayoutUnit lineCrossAxisExtent)
    1015 {
    1016     if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) {
    1017         LayoutUnit logicalHeightBefore = child->logicalHeight();
    1018         LayoutUnit stretchedLogicalHeight = child->logicalHeight() + availableAlignmentSpaceForChild(lineCrossAxisExtent, child);
    1019         if (stretchedLogicalHeight < logicalHeightBefore)
    1020             return;
    1021 
    1022         child->setLogicalHeight(stretchedLogicalHeight);
    1023         child->computeLogicalHeight();
    1024 
    1025         if (child->logicalHeight() != logicalHeightBefore) {
    1026             child->setOverrideHeight(child->logicalHeight());
    1027             child->setLogicalHeight(0);
    1028             child->setChildNeedsLayout(true);
    1029             child->layoutIfNeeded();
    1030         }
    1031     } else if (isColumnFlow() && child->style()->logicalWidth().isAuto() && isMultiline()) {
    1032         // FIXME: Handle min-width and max-width.
    1033         LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child);
    1034         child->setOverrideWidth(std::max(0, childWidth));
    1035         child->setChildNeedsLayout(true);
    1036         child->layoutIfNeeded();
    1037     }
    1038 }
    1039 
    10401032void RenderFlexibleBox::flipForRightToLeftColumn(FlexOrderIterator& iterator)
    10411033{
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.h

    r111094 r111103  
    113113    void layoutColumnReverse(const OrderedFlexItemList&, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace);
    114114    void alignChildren(const OrderedFlexItemList&, LayoutUnit lineCrossAxisExtent, LayoutUnit maxAscent);
    115     void applyStretchAlignmentToChild(RenderBox*, LayoutUnit lineCrossAxisExtent);
    116115    void flipForRightToLeftColumn(FlexOrderIterator&);
    117116    void flipForWrapReverse(FlexOrderIterator&, const WrapReverseContext&);
Note: See TracChangeset for help on using the changeset viewer.