Reduce the children repaints when moved multiple times during the layout
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 09:54:12 +0000 (09:54 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 09:54:12 +0000 (09:54 +0000)
commitbdcc64712f6b1c00665fcf392b9240c34abd471a
treedae53595648c09e21fe32043444411f80aec9750
parent18e23c6c25c19fff9d2ea51f5ceec13e300ef7c6
Reduce the children repaints when moved multiple times during the layout
https://bugs.webkit.org/show_bug.cgi?id=103510

Reviewed by Darin Adler.

Source/WebCore:

Cache the children positions before the layout and move to the
final position after the layout.

Test: css3/flexbox/repaint-column-reverse.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::OrderIterator::OrderIterator): Do not
call first() on the consructor.
(WebCore::RenderFlexibleBox::layoutBlock): Use a Vector with the
children frame rects before the layout and call
repaintChildrenDuringLayoutIfMoved() to repaint the children that
have been moved.
(WebCore::RenderFlexibleBox::appendChildrenFrameRects): Return a
Vector with children frame rects.
(WebCore::RenderFlexibleBox::repaintChildrenDuringLayoutIfMoved):
Call repaintDuringLayoutIfMoved() for every children using the old
frame rects.
(WebCore::RenderFlexibleBox::setFlowAwareLocationForChild): Do not
call repaintDuringLayoutIfMoved().
(WebCore::RenderFlexibleBox::layoutFlexItems): Make sure the
passed iterator points to the first child.
* rendering/RenderFlexibleBox.h:

LayoutTests:

Add test to check that for flex items moved multiple times during the
layout, only the initial and final positions are repainted.

* css3/flexbox/repaint-column-reverse-expected.txt: Added.
* css3/flexbox/repaint-column-reverse.html: Added.
* platform/chromium-linux/css3/flexbox/repaint-column-reverse-expected.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/repaint-column-reverse-expected.txt [new file with mode: 0644]
LayoutTests/css3/flexbox/repaint-column-reverse.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/css3/flexbox/repaint-column-reverse-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h