Bug 76559

Summary: SVG animation repaint issue with image and dynamic clipPath
Product: WebKit Reporter: Kelly Norton <knorton>
Component: SVGAssignee: Kelly Norton <knorton>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, kling, krit, rwlbuis, webkit.review.bot, zherczeg, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 10403    
Attachments:
Description Flags
Reproducing Case
none
Reproducing Case w/ Red+Green
none
Patch
none
Patch
none
Patch
none
Patch v2 zherczeg: review+

Kelly Norton
Reported 2012-01-18 11:41:27 PST
Created attachment 122971 [details] Reproducing Case When a clip-path affecting an image is updated dynamically, the bounds of the image are not properly updated causing incorrect damage rectangle calculation on the next repaint.
Attachments
Reproducing Case (1.10 KB, image/svg+xml)
2012-01-18 11:41 PST, Kelly Norton
no flags
Reproducing Case w/ Red+Green (1.46 KB, image/svg+xml)
2012-01-20 07:02 PST, Kelly Norton
no flags
Patch (9.24 KB, patch)
2012-01-20 13:23 PST, Kelly Norton
no flags
Patch (155.95 KB, patch)
2012-01-22 10:57 PST, Nikolas Zimmermann
no flags
Patch (156.18 KB, patch)
2012-01-22 11:56 PST, Nikolas Zimmermann
no flags
Patch v2 (147.62 KB, patch)
2012-01-23 02:33 PST, Nikolas Zimmermann
zherczeg: review+
Dirk Schulze
Comment 1 2012-01-19 08:35:48 PST
It would be great if you can use red and green boxes. If you can see red somewhere you know that the test fails. Right now I can see two different results between Safari and WebKit trunk and I am still not sure what I should see.
Kelly Norton
Comment 2 2012-01-20 07:02:21 PST
Created attachment 123310 [details] Reproducing Case w/ Red+Green I'm also seeing slightly different repaint patterns. However, each should show some red with this one.
Kelly Norton
Comment 3 2012-01-20 13:23:18 PST
Nikolas Zimmermann
Comment 4 2012-01-21 00:38:28 PST
Comment on attachment 123368 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=123368&action=review r- because of the test. Thanks for tackling this problem! > Source/WebCore/rendering/svg/RenderSVGImage.h:44 > + virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; } Who is calling this? It's not clear from the patch, that this is the actual bug fix :-) > ChangeLog:8 > + * ManualTests/svg-repaint-image-clip-path.svg: Added. A manual test should really be avoided here, it's too important to not automatize it. Can you look at creating a dynamic testcase? I'd imagine doing this via a <script>, and a setTimeout(..., 0) - that should be enough to trigger it, no?
Nikolas Zimmermann
Comment 5 2012-01-22 10:57:27 PST
Nikolas Zimmermann
Comment 6 2012-01-22 10:59:11 PST
It turns out that Kellys fix was not 100% correct - I hit a smiler bug that can also be fixed, when changing this patch a little, so I uploaded a new version based on Kellys, including the layout test that I asked for (which uses layoutTestController.display() to check repainting).
WebKit Review Bot
Comment 7 2012-01-22 10:59:50 PST
Attachment 123488 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1 Last 3072 characters of output: utTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86, debug, cpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86, debug, gpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86, release, cpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86, release, gpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86_64, debug, cpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86_64, debug, gpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86_64, release, cpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] ERROR: FAILURES FOR <lucid, x86_64, release, gpu> in /mnt/git/webkit-style-queue/LayoutTests/platform/chromium/test_expectations.txt ERROR: Line:3927 Path does not exist. svg/filters/feImage-preserveAspectRatio.svg LayoutTests/platform/chromium/test_expectations.txt:3927: Path does not exist. svg/filters/feImage-preserveAspectRatio.svg [test/expectations] [2] Total errors found: 32 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Review Bot
Comment 8 2012-01-22 11:49:45 PST
Comment on attachment 123488 [details] Patch Attachment 123488 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11179067 New failing tests: svg/repaint/image-with-clip-path.svg svg/custom/relative-sized-image.xhtml
Nikolas Zimmermann
Comment 9 2012-01-22 11:56:03 PST
Zoltan Herczeg
Comment 10 2012-01-23 02:08:05 PST
Comment on attachment 123499 [details] Patch Some comments: View in context: https://bugs.webkit.org/attachment.cgi?id=123499&action=review > Source/WebCore/ChangeLog:14 > + The logic is also inconsistent, compared to the other renderes. renderers > Source/WebCore/rendering/svg/RenderSVGImage.cpp:78 > + if (oldBoundaries != m_objectBoundingBox) { > + m_imageResource->setContainerSizeForRenderer(enclosingIntRect(m_objectBoundingBox).size()); > + m_needsBoundariesUpdate = true; > + return true; > + } > + > + return false; WebKit prefers early return, I would swap these two branches. > Source/WebCore/rendering/svg/RenderSVGImage.cpp:86 > + updateImageViewport(); This function is defined as returning with bool but its return value is unused. Why? > LayoutTests/svg/repaint/image-with-clip-path-expected.txt:1 > +Bug 76559: After 200ms, A single green 50x50 rectangle should appear with center at 200, 50. All red should disappear when the green square appears. What is the reason of the gray background?
Nikolas Zimmermann
Comment 11 2012-01-23 02:19:39 PST
(In reply to comment #10) > renderers Fixed. > WebKit prefers early return, I would swap these two branches. Fixed. > > Source/WebCore/rendering/svg/RenderSVGImage.cpp:86 > > + updateImageViewport(); > > This function is defined as returning with bool but its return value is unused. Why? The bool is onlly used from SVGImageElement, when it determines if the bounds changed, and if so, it'll call setNeedsLayout(true) on the renderer. It serves two purposes. > > LayoutTests/svg/repaint/image-with-clip-path-expected.txt:1 > > +Bug 76559: After 200ms, A single green 50x50 rectangle should appear with center at 200, 50. All red should disappear when the green square appears. > > What is the reason of the gray background? layoutTestController.display() to test the repainting - I'll change the text color to make it more readable.
Nikolas Zimmermann
Comment 12 2012-01-23 02:33:44 PST
Created attachment 123533 [details] Patch v2
Zoltan Herczeg
Comment 13 2012-01-23 03:59:25 PST
> layoutTestController.display() to test the repainting - I'll change the text color to make it more readable. I don't see any text anymore...
Zoltan Herczeg
Comment 14 2012-01-23 04:29:59 PST
> I don't see any text anymore... Ok, so it helps to keep the png platform independent.
Zoltan Herczeg
Comment 15 2012-01-23 04:31:38 PST
Comment on attachment 123533 [details] Patch v2 r=me nice patch
Nikolas Zimmermann
Comment 16 2012-01-23 04:48:47 PST
Nikolas Zimmermann
Comment 17 2012-01-26 07:50:39 PST
(In reply to comment #16) > Committed r105613: <http://trac.webkit.org/changeset/105613> The new test is flaky under guard malloc, filed bug 77103 for this.
Note You need to log in before you can comment on or make changes to this bug.