Changeset 100365 in webkit


Ignore:
Timestamp:
Nov 15, 2011 4:29:12 PM (12 years ago)
Author:
ojan@chromium.org
Message:

implement flex-align for flex-flow: column
https://bugs.webkit.org/show_bug.cgi?id=70754

Reviewed by David Hyatt.

Source/WebCore:

Tests: css3/flexbox/flex-align-column.html

css3/flexbox/line-wrapping.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
When flexitems are column, they should size to the intrinsic width unless flex-flow is stretch.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::alignChildrenBlockDirection):
This was just using the wrong, non-flow-aware method.

LayoutTests:

  • css3/flexbox/flex-align-column-expected.txt: Added.
  • css3/flexbox/flex-align-column.html: Added.

Tests the basic flex-align cases with column.

  • css3/flexbox/line-wrapping-expected.txt: Added.
  • css3/flexbox/line-wrapping.html: Added.

This tests that wrapping inside flexitems uses the correct width.
Notably, auto-sizing properly falls back on the initial containing block.

Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100364 r100365  
     12011-10-28  Ojan Vafai  <ojan@chromium.org>
     2
     3        implement flex-align for flex-flow: column
     4        https://bugs.webkit.org/show_bug.cgi?id=70754
     5
     6        Reviewed by David Hyatt.
     7
     8        * css3/flexbox/flex-align-column-expected.txt: Added.
     9        * css3/flexbox/flex-align-column.html: Added.
     10        Tests the basic flex-align cases with column.
     11
     12        * css3/flexbox/line-wrapping-expected.txt: Added.
     13        * css3/flexbox/line-wrapping.html: Added.
     14        This tests that wrapping inside flexitems uses the correct width.
     15        Notably, auto-sizing properly falls back on the initial containing block.
     16
    1172011-11-15  Peter Kasting  <pkasting@google.com>
    218
     
    338354
    339355        * platform/chromium/test_expectations.txt:
     356
     3572011-10-28  Ojan Vafai  <ojan@chromium.org>
     358
     359        Overflow and relayout are broken in the new flexboxes
     360        https://bugs.webkit.org/show_bug.cgi?id=71161
     361
     362        Reviewed by David Hyatt.
     363
     364        * css3/flexbox/auto-height-dynamic-expected.txt: Added.
     365        * css3/flexbox/auto-height-dynamic.html: Added.
     366        * css3/flexbox/flex-item-child-overflow-expected.html: Added.
     367        * css3/flexbox/flex-item-child-overflow.html: Added.
    340368
    3413692011-10-28  Ojan Vafai  <ojan@chromium.org>
  • trunk/Source/WebCore/ChangeLog

    r100353 r100365  
     12011-10-28  Ojan Vafai  <ojan@chromium.org>
     2
     3        implement flex-align for flex-flow: column
     4        https://bugs.webkit.org/show_bug.cgi?id=70754
     5
     6        Reviewed by David Hyatt.
     7
     8        Tests: css3/flexbox/flex-align-column.html
     9               css3/flexbox/line-wrapping.html
     10
     11        * rendering/RenderBox.cpp:
     12        (WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
     13        When flexitems are column, they should size to the intrinsic width unless flex-flow is stretch.
     14
     15        * rendering/RenderFlexibleBox.cpp:
     16        (WebCore::RenderFlexibleBox::alignChildrenBlockDirection):
     17        This was just using the wrong, non-flow-aware method.
     18
    1192011-11-15  Jochen Eisinger  <jochen@chromium.org>
    220
     
    138156        (WebCore::PointerLock::create):
    139157        * page/PointerLock.idl: Renamed from Source/WebCore/page/MouseLockable.idl.
     158
     1592011-10-28  Ojan Vafai  <ojan@chromium.org>
     160
     161        Overflow and relayout are broken in the new flexboxes
     162        https://bugs.webkit.org/show_bug.cgi?id=71161
     163
     164        Reviewed by David Hyatt.
     165
     166        Tests: css3/flexbox/auto-height-dynamic.html
     167               css3/flexbox/flex-item-child-overflow-expected.html
     168               css3/flexbox/flex-item-child-overflow.html
     169
     170        * rendering/RenderFlexibleBox.cpp:
     171        (WebCore::RenderFlexibleBox::layoutBlock):
     172        -Always set the logical height to 0 to start with to ensure we don't
     173        use the height from the previous layout when we are computing the
     174        intrinsic size of the flexbox.
     175        -Call computeOverflow after computeLogicalHeight so that flex-item's children's
     176        overflow is properly rendered.
     177
     178        (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection):
     179        -Now that we setLogicalHeight in layoutBlock, we no longer need to do it here.
     180        -Refactor flipping code. The behavior is the same, but the variable names are just
     181        more correct.
    140182
    1411832011-10-28  Ojan Vafai  <ojan@chromium.org>
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r100048 r100365  
    18011801            return true;
    18021802    }
     1803
     1804    if (parent()->isFlexibleBox())
     1805        return true;
    18031806
    18041807    // Flexible horizontal boxes lay out children at their intrinsic widths.  Also vertical boxes
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r100324 r100365  
    722722            if (height.isAuto()) {
    723723                // FIXME: Clamp to max-height once it's spec'ed (should we align towards the start or center?).
    724                 LayoutUnit stretchedHeight = logicalHeightForChild(child) + RenderFlexibleBox::availableAlignmentSpaceForChild(child);
     724                LayoutUnit stretchedHeight = crossAxisExtentForChild(child) + RenderFlexibleBox::availableAlignmentSpaceForChild(child);
    725725                if (isHorizontalFlow())
    726726                    child->setHeight(stretchedHeight);
Note: See TracChangeset for help on using the changeset viewer.