Changeset 146371 in webkit


Ignore:
Timestamp:
Mar 20, 2013, 11:50:01 AM (13 years ago)
Author:
jchaffraix@webkit.org
Message:

[CSS Grid Layout] Improper repainting when grid item change their position
https://bugs.webkit.org/show_bug.cgi?id=112749

Reviewed by Ojan Vafai.

Source/WebCore:

Tests: fast/css-grid-layout/grid-element-change-columns-repaint.html

fast/css-grid-layout/grid-element-change-rows-repaint.html
fast/css-grid-layout/grid-item-change-column-repaint.html
fast/css-grid-layout/grid-item-change-row-repaint.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::layoutGridItems):
Added a call to repaintDuringLayoutIfMoved to repaint moving grid items.

LayoutTests:

  • fast/css-grid-layout/grid-element-change-columns-repaint-expected.txt: Added.
  • fast/css-grid-layout/grid-element-change-columns-repaint.html: Added.
  • fast/css-grid-layout/grid-element-change-rows-repaint-expected.txt: Added.
  • fast/css-grid-layout/grid-element-change-rows-repaint.html: Added.

Those are added testing for the grid element's change. They were already passing due to
the LayoutRepainter in RenderGrid::layoutBlock.

  • fast/css-grid-layout/grid-item-change-column-repaint-expected.txt: Added.
  • fast/css-grid-layout/grid-item-change-column-repaint.html: Added.
  • fast/css-grid-layout/grid-item-change-row-repaint-expected.txt: Added.
  • fast/css-grid-layout/grid-item-change-row-repaint.html: Added.

New testing, was failing before this change.

Location:
trunk
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r146361 r146371  
     12013-03-20  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [CSS Grid Layout] Improper repainting when grid item change their position
     4        https://bugs.webkit.org/show_bug.cgi?id=112749
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * fast/css-grid-layout/grid-element-change-columns-repaint-expected.txt: Added.
     9        * fast/css-grid-layout/grid-element-change-columns-repaint.html: Added.
     10        * fast/css-grid-layout/grid-element-change-rows-repaint-expected.txt: Added.
     11        * fast/css-grid-layout/grid-element-change-rows-repaint.html: Added.
     12        Those are added testing for the grid element's change. They were already passing due to
     13        the LayoutRepainter in RenderGrid::layoutBlock.
     14
     15        * fast/css-grid-layout/grid-item-change-column-repaint-expected.txt: Added.
     16        * fast/css-grid-layout/grid-item-change-column-repaint.html: Added.
     17        * fast/css-grid-layout/grid-item-change-row-repaint-expected.txt: Added.
     18        * fast/css-grid-layout/grid-item-change-row-repaint.html: Added.
     19        New testing, was failing before this change.
     20
    1212013-03-20  Rouslan Solomakhin  <rouslan@chromium.org>
    222
  • trunk/Source/WebCore/ChangeLog

    r146366 r146371  
     12013-03-20  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [CSS Grid Layout] Improper repainting when grid item change their position
     4        https://bugs.webkit.org/show_bug.cgi?id=112749
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Tests: fast/css-grid-layout/grid-element-change-columns-repaint.html
     9               fast/css-grid-layout/grid-element-change-rows-repaint.html
     10               fast/css-grid-layout/grid-item-change-column-repaint.html
     11               fast/css-grid-layout/grid-item-change-row-repaint.html
     12
     13        * rendering/RenderGrid.cpp:
     14        (WebCore::RenderGrid::layoutGridItems):
     15        Added a call to repaintDuringLayoutIfMoved to repaint moving grid items.
     16
    1172013-03-20  Arvid Nilsson  <anilsson@rim.com>
    218
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r145840 r146371  
    664664        child->setOverrideContainingBlockContentLogicalHeight(overrideContainingBlockContentLogicalHeight);
    665665
     666        LayoutRect oldChildRect = child->frameRect();
     667
    666668        // FIXME: Grid items should stretch to fill their cells. Once we
    667669        // implement grid-{column,row}-align, we can also shrink to fit. For
     
    671673        // FIXME: Handle border & padding on the grid element.
    672674        child->setLogicalLocation(childPosition);
     675
     676        // If the child moved, we have to repaint it as well as any floating/positioned
     677        // descendants. An exception is if we need a layout. In this case, we know we're going to
     678        // repaint ourselves (and the child) anyway.
     679        if (!selfNeedsLayout() && child->checkForRepaintDuringLayout())
     680            child->repaintDuringLayoutIfMoved(oldChildRect);
    673681    }
    674682
Note: See TracChangeset for help on using the changeset viewer.