Bug 21910 - REGRESSION (r37146): SVG-as-image is not rendered
: REGRESSION (r37146): SVG-as-image is not rendered
Status: RESOLVED FIXED
: WebKit
Layout and Rendering
: 528+ (Nightly build)
: Macintosh Mac OS X 10.5
: P1 Major
Assigned To:
:
: InRadar, LayoutTestFailure, Regression
: 12095 21322
:
  Show dependency treegraph
 
Reported: 2008-10-27 18:02 PST by
Modified: 2008-12-30 21:20 PST (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-10-27 18:02:10 PST
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 From 2008-10-28 16:31:31 PST -------
This looks like rdar://problem/6326892
------- Comment #2 From 2008-10-28 16:32:25 PST -------
... which I tracked to http://trac.webkit.org/changeset/37146
------- Comment #3 From 2008-10-28 16:43:56 PST -------
Which is hyatt's.
------- Comment #4 From 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 From 2008-11-07 14:39:38 PST -------
Hm, that change doesn't fix <img src="foo.svg">
------- Comment #6 From 2008-11-07 14:39:59 PST -------
Maybe call 
   m_frame->view()->resize(size());
in SVGImage::draw()?
------- Comment #7 From 2008-12-23 20:55:22 PST -------
Created an attachment (id=26233) [details]
Patch, changelog, fixed testcases
------- Comment #8 From 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 From 2008-12-24 10:01:31 PST -------
Simon Fraser is my hero.
------- Comment #10 From 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 From 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 From 2008-12-30 21:20:17 PST -------
*** Bug 17552 has been marked as a duplicate of this bug. ***