Bug 21910 - REGRESSION (r37146): SVG-as-image is not rendered
Summary: REGRESSION (r37146): SVG-as-image is not rendered
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P1 Major
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar, LayoutTestFailure, Regression
: 17552 (view as bug list)
Depends on: 12095 21322
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-27 18:02 PDT by Pierre-Olivier Latour
Modified: 2008-12-30 21:20 PST (History)
5 users (show)

See Also:


Attachments
Patch, changelog, fixed testcases (8.80 KB, patch)
2008-12-23 20:55 PST, Simon Fraser (smfr)
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Olivier Latour 2008-10-27 18:02:10 PDT
While re-doing the image bases for https://bugs.webkit.org/show_bug.cgi?id=21821, we noticed that these pixel tests are currently failing (SVG does not seem to be rendering):

fast/backgrounds/svg-as-background-1.html
fast/backgrounds/svg-as-background-2.html
fast/backgrounds/svg-as-background-3.html
fast/backgrounds/svg-as-background-5.html
fast/backgrounds/svg-as-background-6.html
fast/backgrounds/svg-as-mask.html
fast/borders/svg-as-border-image-2.html
fast/borders/svg-as-border-image.html
fast/images/svg-as-background.html
fast/images/svg-as-image.html
fast/images/svg-as-relative-image.html
fast/images/svg-as-tiled-background.html
Comment 1 David Harrison 2008-10-28 16:31:31 PDT
This looks like rdar://problem/6326892
Comment 2 David Harrison 2008-10-28 16:32:25 PDT
... which I tracked to http://trac.webkit.org/changeset/37146
Comment 3 Simon Fraser (smfr) 2008-10-28 16:43:56 PDT
Which is hyatt's.
Comment 4 Simon Fraser (smfr) 2008-11-07 14:39:21 PST
Maybe fix:

diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp
index 4427277..33a6d56 100644
--- a/WebCore/svg/graphics/SVGImage.cpp
+++ b/WebCore/svg/graphics/SVGImage.cpp
@@ -72,6 +72,10 @@ void SVGImage::setContainerSize(const IntSize& containerSize)
 
     if (!m_frame || !m_frame->document())
         return;
+    
+    if (m_frame->view())
+        m_frame->view()->resize(containerSize);
+    
     SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_frame->document())->rootElement();
     if (!rootElement)
         return;

However, LayoutTests/fast/backgrounds/svg-as-background-5.html still renders all red until you cause a repaint to happen. The other tests work.
Comment 5 Simon Fraser (smfr) 2008-11-07 14:39:38 PST
Hm, that change doesn't fix <img src="foo.svg">
Comment 6 Simon Fraser (smfr) 2008-11-07 14:39:59 PST
Maybe call 
   m_frame->view()->resize(size());
in SVGImage::draw()?
Comment 7 Simon Fraser (smfr) 2008-12-23 20:55:22 PST
Created attachment 26233 [details]
Patch, changelog, fixed testcases
Comment 8 Simon Fraser (smfr) 2008-12-23 21:20:34 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-1-expected.checksum
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-1-expected.png
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-2-expected.checksum
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-2-expected.png
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-3-expected.checksum
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-3-expected.png
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-4-expected.checksum
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-4-expected.png
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-6-expected.checksum
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-background-6-expected.png
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-mask-expected.checksum
	M	LayoutTests/platform/mac/fast/backgrounds/svg-as-mask-expected.png
	M	LayoutTests/platform/mac/svg/W3C-SVG-1.1/struct-image-05-b-expected.checksum
	M	LayoutTests/platform/mac/svg/W3C-SVG-1.1/struct-image-05-b-expected.png
	M	WebCore/ChangeLog
	M	WebCore/svg/graphics/SVGImage.cpp
Committed r39462
Comment 9 Eric Seidel (no email) 2008-12-24 10:01:31 PST
Simon Fraser is my hero.
Comment 10 Simon Fraser (smfr) 2008-12-24 13:40:05 PST
Some more bases that I missed:
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	M	LayoutTests/platform/mac/fast/images/svg-as-background-expected.checksum
	M	LayoutTests/platform/mac/fast/images/svg-as-background-expected.png
	M	LayoutTests/platform/mac/fast/images/svg-as-image-expected.checksum
	M	LayoutTests/platform/mac/fast/images/svg-as-image-expected.png
	M	LayoutTests/platform/mac/fast/images/svg-as-relative-image-expected.checksum
	M	LayoutTests/platform/mac/fast/images/svg-as-relative-image-expected.png
Committed r39469
Comment 11 Simon Fraser (smfr) 2008-12-26 10:59:35 PST
Final test fixing:
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	M	LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.checksum
	M	LayoutTests/platform/mac/fast/borders/svg-as-border-image-2-expected.png
	M	LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.checksum
	M	LayoutTests/platform/mac/fast/borders/svg-as-border-image-expected.png
Committed r39479
Comment 12 Simon Fraser (smfr) 2008-12-30 21:20:17 PST
*** Bug 17552 has been marked as a duplicate of this bug. ***