Changeset 136660 in webkit


Ignore:
Timestamp:
Dec 5, 2012 2:24:55 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Flex item auto margins in the cross direction should safe center
https://bugs.webkit.org/show_bug.cgi?id=103919

Reviewed by Ojan Vafai.

Source/WebCore:

Do not apply auto margins for cross axis if there's no alignment
space available.

Test: css3/flexbox/flex-flow-auto-margins-no-available-space.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::alignChildren): Make sure we pass a
positive value for availableAlignmentSpace to
updateAutoMarginsInCrossAxis().

LayoutTests:

  • css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt: Added.
  • css3/flexbox/flex-flow-auto-margins-no-available-space.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r136659 r136660  
     12012-12-05  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Flex item auto margins in the cross direction should safe center
     4        https://bugs.webkit.org/show_bug.cgi?id=103919
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/flexbox/flex-flow-auto-margins-no-available-space-expected.txt: Added.
     9        * css3/flexbox/flex-flow-auto-margins-no-available-space.html: Added.
     10
    1112012-12-05  Mike West  <mkwst@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r136657 r136660  
     12012-12-05  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Flex item auto margins in the cross direction should safe center
     4        https://bugs.webkit.org/show_bug.cgi?id=103919
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Do not apply auto margins for cross axis if there's no alignment
     9        space available.
     10
     11        Test: css3/flexbox/flex-flow-auto-margins-no-available-space.html
     12
     13        * rendering/RenderFlexibleBox.cpp:
     14        (WebCore::RenderFlexibleBox::alignChildren): Make sure we pass a
     15        positive value for availableAlignmentSpace to
     16        updateAutoMarginsInCrossAxis().
     17
    1182012-12-05  Mike West  <mkwst@chromium.org>
    219
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r136656 r136660  
    781781void RenderFlexibleBox::updateAutoMarginsInMainAxis(RenderBox* child, LayoutUnit autoMarginOffset)
    782782{
     783    ASSERT(autoMarginOffset >= 0);
     784
    783785    if (isHorizontalFlow()) {
    784786        if (child->style()->marginLeft().isAuto())
     
    811813{
    812814    ASSERT(!child->isOutOfFlowPositioned());
     815    ASSERT(availableAlignmentSpace >= 0);
    813816
    814817    bool isHorizontal = isHorizontalFlow();
     
    12961299            }
    12971300
    1298             if (updateAutoMarginsInCrossAxis(child, availableAlignmentSpaceForChild(lineCrossAxisExtent, child)))
     1301            if (updateAutoMarginsInCrossAxis(child, std::max(LayoutUnit(0), availableAlignmentSpaceForChild(lineCrossAxisExtent, child))))
    12991302                continue;
    13001303
Note: See TracChangeset for help on using the changeset viewer.