Changeset 125262 in webkit


Ignore:
Timestamp:
Aug 10, 2012 2:06:20 AM (12 years ago)
Author:
tony@chromium.org
Message:

implement display: -webkit-inline-flex
https://bugs.webkit.org/show_bug.cgi?id=77772

Reviewed by Ojan Vafai.

Source/WebCore:

The crashes last time were because we were marking too much of the tree for relayout. During some editing
operations, this causes a layout when we're in an inconsistent state.

Tests: css3/flexbox/inline-flex-crash.html

css3/flexbox/inline-flex-crash2.html
css3/flexbox/inline-flex.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Only layout the child.
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Only layout the child.
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Only layout the child.

  • rendering/style/RenderStyle.h: Include INLINE_FLEX as an inline and replaced display type.

LayoutTests:

Include 2 crash tests that caused this to be reverted the last time.

  • css3/flexbox/inline-flex-crash-expected.txt: Added.
  • css3/flexbox/inline-flex-crash.html: Added.
  • css3/flexbox/inline-flex-crash2-expected.txt: Added.
  • css3/flexbox/inline-flex-crash2.html: Added.
  • css3/flexbox/inline-flex-expected.html: Added.
  • css3/flexbox/inline-flex.html: Added.
Location:
trunk
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r125259 r125262  
     12012-08-10  Tony Chang  <tony@chromium.org>
     2
     3        implement display: -webkit-inline-flex
     4        https://bugs.webkit.org/show_bug.cgi?id=77772
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Include 2 crash tests that caused this to be reverted the last time.
     9
     10        * css3/flexbox/inline-flex-crash-expected.txt: Added.
     11        * css3/flexbox/inline-flex-crash.html: Added.
     12        * css3/flexbox/inline-flex-crash2-expected.txt: Added.
     13        * css3/flexbox/inline-flex-crash2.html: Added.
     14        * css3/flexbox/inline-flex-expected.html: Added.
     15        * css3/flexbox/inline-flex.html: Added.
     16
    1172012-08-10  Zan Dobersek  <zandobersek@gmail.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r125261 r125262  
     12012-08-10  Tony Chang  <tony@chromium.org>
     2
     3        implement display: -webkit-inline-flex
     4        https://bugs.webkit.org/show_bug.cgi?id=77772
     5
     6        Reviewed by Ojan Vafai.
     7
     8        The crashes last time were because we were marking too much of the tree for relayout. During some editing
     9        operations, this causes a layout when we're in an inconsistent state.
     10
     11        Tests: css3/flexbox/inline-flex-crash.html
     12               css3/flexbox/inline-flex-crash2.html
     13               css3/flexbox/inline-flex.html
     14
     15        * rendering/RenderFlexibleBox.cpp:
     16        (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Only layout the child.
     17        (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Only layout the child.
     18        (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Only layout the child.
     19        * rendering/style/RenderStyle.h: Include INLINE_FLEX as an inline and replaced display type.
     20
    1212012-08-10  Vineet Chaudhary  <rgf748@motorola.com>
    222
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r125055 r125262  
    781781        if (hasOrthogonalFlow(child) && (flexBasisForChild(child).isAuto() || childMainAxisMin.isAuto())) {
    782782            if (!relayoutChildren)
    783                 child->setChildNeedsLayout(true);
     783                child->setChildNeedsLayout(true, MarkOnlyThis);
    784784            child->layoutIfNeeded();
    785785        }
     
    10201020        setLogicalOverrideSize(child, childPreferredSize);
    10211021        // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905.
    1022         child->setChildNeedsLayout(true);
     1022        child->setChildNeedsLayout(true, MarkOnlyThis);
    10231023        child->layoutIfNeeded();
    10241024
     
    12441244            child->setOverrideLogicalContentHeight(child->logicalHeight() - child->borderAndPaddingLogicalHeight());
    12451245            child->setLogicalHeight(0);
    1246             child->setChildNeedsLayout(true);
     1246            child->setChildNeedsLayout(true, MarkOnlyThis);
    12471247            child->layoutIfNeeded();
    12481248        }
     
    12511251        LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child);
    12521252        child->setOverrideLogicalContentWidth(std::max(ZERO_LAYOUT_UNIT, childWidth));
    1253         child->setChildNeedsLayout(true);
     1253        child->setChildNeedsLayout(true, MarkOnlyThis);
    12541254        child->layoutIfNeeded();
    12551255    }
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r124452 r125262  
    17411741    bool isDisplayReplacedType(EDisplay display) const
    17421742    {
    1743         return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_TABLE || display == INLINE_GRID;
     1743        return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_FLEX || display == INLINE_TABLE || display == INLINE_GRID;
    17441744    }
    17451745
Note: See TracChangeset for help on using the changeset viewer.