Changeset 132395 in webkit


Ignore:
Timestamp:
Oct 24, 2012 1:46:45 PM (12 years ago)
Author:
tony@chromium.org
Message:

Setting width of a flexitem causes the adjacent flex item to be displayed poorly.
https://bugs.webkit.org/show_bug.cgi?id=99925

Reviewed by Ojan Vafai.

Source/WebCore:

Make sure that we always repaint when moving a child. This is similar to what RenderDeprecatedFlexibleBox does.

Test: css3/flexbox/repaint-during-resize-no-flex.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::setFlowAwareLocationForChild): Move logic for repaining into the helper method
for setting the location of a child.
(WebCore::RenderFlexibleBox::layoutColumnReverse): Remove code for repaint since it's now in setFlowAwareLocationForChild.
(WebCore::RenderFlexibleBox::adjustAlignmentForChild): Remove code for repaint since it's now in setFlowAwareLocationForChild.

LayoutTests:

Add a repaint test. The render tree should be cross platform, but due to
slight color differences in the grey overlay, the png can't be shared.

  • css3/flexbox/repaint-during-resize-no-flex-expected.txt: Added.
  • css3/flexbox/repaint-during-resize-no-flex.html: Added.
  • platform/chromium-linux/css3/flexbox/repaint-during-resize-no-flex-expected.png: Added.
  • platform/chromium/TestExpectations:
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r132394 r132395  
     12012-10-24  Tony Chang  <tony@chromium.org>
     2
     3        Setting width of a flexitem causes the adjacent flex item to be displayed poorly.
     4        https://bugs.webkit.org/show_bug.cgi?id=99925
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Add a repaint test.  The render tree should be cross platform, but due to
     9        slight color differences in the grey overlay, the png can't be shared.
     10
     11        * css3/flexbox/repaint-during-resize-no-flex-expected.txt: Added.
     12        * css3/flexbox/repaint-during-resize-no-flex.html: Added.
     13        * platform/chromium-linux/css3/flexbox/repaint-during-resize-no-flex-expected.png: Added.
     14        * platform/chromium/TestExpectations:
     15
    1162012-10-24  Simon Fraser  <simon.fraser@apple.com>
    217
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r132394 r132395  
    40414041webkit.org/b/99873 platform/chromium/virtual/gpu/fast/canvas/webgl/array-bounds-clamping.html [ Text ]
    40424042
     4043webkit.org/b/99925 [ Win Mac ] css3/flexbox/repaint-during-resize-no-flex.html [ Missing ImageOnlyFailure ]
     4044
    40434045# These tests are failing already and because of virtual test suite for deferred
    40444046# image decoding they need to be suppressed again.
  • trunk/Source/WebCore/ChangeLog

    r132394 r132395  
     12012-10-24  Tony Chang  <tony@chromium.org>
     2
     3        Setting width of a flexitem causes the adjacent flex item to be displayed poorly.
     4        https://bugs.webkit.org/show_bug.cgi?id=99925
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Make sure that we always repaint when moving a child. This is similar to what RenderDeprecatedFlexibleBox does.
     9
     10        Test: css3/flexbox/repaint-during-resize-no-flex.html
     11
     12        * rendering/RenderFlexibleBox.cpp:
     13        (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild): Move logic for repaining into the helper method
     14        for setting the location of a child.
     15        (WebCore::RenderFlexibleBox::layoutColumnReverse): Remove code for repaint since it's now in setFlowAwareLocationForChild.
     16        (WebCore::RenderFlexibleBox::adjustAlignmentForChild): Remove code for repaint since it's now in setFlowAwareLocationForChild.
     17
    1182012-10-24  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r132136 r132395  
    662662void RenderFlexibleBox::setFlowAwareLocationForChild(RenderBox* child, const LayoutPoint& location)
    663663{
     664    LayoutRect oldFrameRect = child->frameRect();
     665
    664666    if (isHorizontalFlow())
    665667        child->setLocation(location);
    666668    else
    667669        child->setLocation(location.transposedPoint());
     670
     671    // If the child moved, we have to repaint it as well as any floating/positioned
     672    // descendants. An exception is if we need a layout. In this case, we know we're going to
     673    // repaint ourselves (and the child) anyway.
     674    // FIXME: In some cases, we might overpaint as we move a child multiple times. We could reduce
     675    // overpainting by keeping track of the original position of a child and running this check on
     676    // the final position.
     677    if (!selfNeedsLayout() && child->checkForRepaintDuringLayout())
     678        child->repaintDuringLayoutIfMoved(oldFrameRect);
    668679}
    669680
     
    11431154        mainAxisOffset -= mainAxisExtentForChild(child) + flowAwareMarginEndForChild(child);
    11441155
    1145         LayoutRect oldRect = child->frameRect();
    11461156        setFlowAwareLocationForChild(child, LayoutPoint(mainAxisOffset, crossAxisOffset + flowAwareMarginBeforeForChild(child)));
    1147         if (!selfNeedsLayout() && child->checkForRepaintDuringLayout())
    1148             child->repaintDuringLayoutIfMoved(oldRect);
    11491157
    11501158        mainAxisOffset -= flowAwareMarginStartForChild(child);
     
    12171225    }
    12181226
    1219     LayoutRect oldRect = child->frameRect();
    12201227    setFlowAwareLocationForChild(child, flowAwareLocationForChild(child) + LayoutSize(0, delta));
    1221 
    1222     // If the child moved, we have to repaint it as well as any floating/positioned
    1223     // descendants. An exception is if we need a layout. In this case, we know we're going to
    1224     // repaint ourselves (and the child) anyway.
    1225     if (!selfNeedsLayout() && child->checkForRepaintDuringLayout())
    1226         child->repaintDuringLayoutIfMoved(oldRect);
    12271228}
    12281229
Note: See TracChangeset for help on using the changeset viewer.