Changeset 124793 in webkit


Ignore:
Timestamp:
Aug 6, 2012 12:17:20 PM (12 years ago)
Author:
ojan@chromium.org
Message:

need tests to ensure flexboxes play nicely with box-sizing
https://bugs.webkit.org/show_bug.cgi?id=70771

Reviewed by Tony Chang.

Source/WebCore:

Anytime we grab the width/height off of the RenderStyle, we need to adjust
it for box-sizing. Fortunately, we only do this two places in RenderFlexibleBox.
Also, delete crossAxisLength since it's unused.

Test: css3/flexbox/box-sizing.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):

  • rendering/RenderFlexibleBox.h:

LayoutTests:

  • css3/flexbox/box-sizing-expected.txt: Added.
  • css3/flexbox/box-sizing.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r124792 r124793  
     12012-07-31  Ojan Vafai  <ojan@chromium.org>
     2
     3        need tests to ensure flexboxes play nicely with box-sizing
     4        https://bugs.webkit.org/show_bug.cgi?id=70771
     5
     6        Reviewed by Tony Chang.
     7
     8        * css3/flexbox/box-sizing-expected.txt: Added.
     9        * css3/flexbox/box-sizing.html: Added.
     10
    1112012-08-06  John J. Barton  <johnjbarton@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r124792 r124793  
     12012-07-31  Ojan Vafai  <ojan@chromium.org>
     2
     3        need tests to ensure flexboxes play nicely with box-sizing
     4        https://bugs.webkit.org/show_bug.cgi?id=70771
     5
     6        Reviewed by Tony Chang.
     7
     8        Anytime we grab the width/height off of the RenderStyle, we need to adjust
     9        it for box-sizing. Fortunately, we only do this two places in RenderFlexibleBox.
     10        Also, delete crossAxisLength since it's unused.
     11
     12        Test: css3/flexbox/box-sizing.html
     13
     14        * rendering/RenderFlexibleBox.cpp:
     15        (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
     16        * rendering/RenderFlexibleBox.h:
     17
    1182012-08-06  John J. Barton  <johnjbarton@chromium.org>
    219
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r124278 r124793  
    361361}
    362362
    363 Length RenderFlexibleBox::crossAxisLength() const
    364 {
    365     return isHorizontalFlow() ? style()->height() : style()->width();
    366 }
    367 
    368363void RenderFlexibleBox::setCrossAxisExtent(LayoutUnit extent)
    369364{
     
    411406    if (heightIncludingScrollbar == -1)
    412407        return -1;
    413     return std::max(LayoutUnit(0), heightIncludingScrollbar - scrollbarLogicalHeight());
     408    return std::max(LayoutUnit(0), computeContentBoxLogicalHeight(heightIncludingScrollbar) - scrollbarLogicalHeight());
    414409}
    415410
     
    610605        return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child);
    611606    }
    612     return std::max(LayoutUnit(0), minimumValueForLength(flexBasis, mainAxisContentExtent(), view()));
     607    LayoutUnit extent = minimumValueForLength(flexBasis, mainAxisContentExtent(), view());
     608    extent = isColumnFlow() ? child->computeContentBoxLogicalHeight(extent) : child->computeContentBoxLogicalWidth(extent);
     609    return std::max(LayoutUnit(0), extent);
    613610}
    614611
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.h

    r124279 r124793  
    7878    bool isLeftToRightFlow() const;
    7979    bool isMultiline() const;
    80     Length crossAxisLength() const;
    8180    Length flexBasisForChild(RenderBox* child) const;
    8281    void setCrossAxisExtent(LayoutUnit);
Note: See TracChangeset for help on using the changeset viewer.