Dynamic background color changes do not update until a layout is forced
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 19:59:12 +0000 (19:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 19:59:12 +0000 (19:59 +0000)
commit3634aa2bba20362673bd34c473e7e94e0f608967
tree0aa32a7be65a803ef480fb2298de63095a9d1ee7
parent38d6d06b4ff9ddc841ccd63a9ec7f9b5f60fd26d
Dynamic background color changes do not update until a layout is forced
https://bugs.webkit.org/show_bug.cgi?id=131623

Source/WebCore:

Compute correct repaint rect for decorated RenderSVGRoots.

The current implementation of clippedOverflowRectForRepaint() uses the
generic repaint-rect calculations in SVGRenderSupport. Those in turn make
use of repaintRectInLocalCoordinates(), which for RenderSVGRoot is the
union of the painted children (w/ some expansion). If there're no children,
or they do not fill the entire content box, then a repaint would not
repaint the correct parts.
Fix by calculating the union of the border-box and the SVG content
when the SVG root is decorated (has background/border/etc.)

Adapted from a Chromium patch by fs@opera.com
https://src.chromium.org/viewvc/blink?revision=170890&view=revision

Patch by Antoine Quint <graouts@apple.com> on 2015-10-09
Reviewed by Darin Adler.

Tests: svg/repaint/add-background-property-on-root.html
       svg/repaint/add-border-property-on-root.html
       svg/repaint/add-outline-property-on-root.html
       svg/repaint/change-background-color.html
       svg/repaint/remove-background-property-on-root.html
       svg/repaint/remove-border-property-on-root.html
       svg/repaint/remove-outline-property-on-root.html

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
(WebCore::RenderSVGRoot::styleDidChange):
(WebCore::RenderSVGRoot::clippedOverflowRectForRepaint):

LayoutTests:

Add some new tests checking that dynamically updating the "background",
"border" and "outline" CSS properties repaint correctly and rebase a few
existing tests that yield the same rendered results but slightly different
DRT output.

Patch by Antoine Quint <graouts@apple.com> on 2015-10-09
Reviewed by Darin Adler.

* platform/mac/fast/repaint/moving-shadow-on-container-expected.txt:
* platform/mac/svg/custom/simple-text-double-shadow-expected.txt:
* svg/css/composite-shadow-example-expected.txt:
* svg/css/composite-shadow-with-opacity-expected.txt:
* svg/repaint/add-background-property-on-root-expected.html: Added.
* svg/repaint/add-background-property-on-root.html: Added.
* svg/repaint/add-border-property-on-root-expected.html: Added.
* svg/repaint/add-border-property-on-root.html: Added.
* svg/repaint/add-outline-property-on-root-expected.html: Added.
* svg/repaint/add-outline-property-on-root.html: Added.
* svg/repaint/change-background-color-expected.html: Added.
* svg/repaint/change-background-color.html: Added.
* svg/repaint/remove-background-property-on-root-expected.html: Added.
* svg/repaint/remove-background-property-on-root.html: Added.
* svg/repaint/remove-border-property-on-root-expected.html: Added.
* svg/repaint/remove-border-property-on-root.html: Added.
* svg/repaint/remove-outline-property-on-root-expected.html: Added.
* svg/repaint/remove-outline-property-on-root.html: Added.
* svg/repaint/repaint-webkit-svg-shadow-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/fast/repaint/moving-shadow-on-container-expected.txt
LayoutTests/platform/mac/svg/custom/simple-text-double-shadow-expected.txt
LayoutTests/svg/css/composite-shadow-example-expected.txt
LayoutTests/svg/css/composite-shadow-with-opacity-expected.txt
LayoutTests/svg/repaint/add-background-property-on-root-expected.html [new file with mode: 0644]
LayoutTests/svg/repaint/add-background-property-on-root.html [new file with mode: 0644]
LayoutTests/svg/repaint/add-border-property-on-root-expected.html [new file with mode: 0644]
LayoutTests/svg/repaint/add-border-property-on-root.html [new file with mode: 0644]
LayoutTests/svg/repaint/add-outline-property-on-root-expected.html [new file with mode: 0644]
LayoutTests/svg/repaint/add-outline-property-on-root.html [new file with mode: 0644]
LayoutTests/svg/repaint/change-background-color-expected.html [new file with mode: 0644]
LayoutTests/svg/repaint/change-background-color.html [new file with mode: 0644]
LayoutTests/svg/repaint/remove-background-property-on-root-expected.html [new file with mode: 0644]
LayoutTests/svg/repaint/remove-background-property-on-root.html [new file with mode: 0644]
LayoutTests/svg/repaint/remove-border-property-on-root-expected.html [new file with mode: 0644]
LayoutTests/svg/repaint/remove-border-property-on-root.html [new file with mode: 0644]
LayoutTests/svg/repaint/remove-outline-property-on-root-expected.html [new file with mode: 0644]
LayoutTests/svg/repaint/remove-outline-property-on-root.html [new file with mode: 0644]
LayoutTests/svg/repaint/repaint-webkit-svg-shadow-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGRoot.cpp