Created attachment 132756 [details] test case (requires island.svg) # Overview When I use an SVG image with the img tag and set its width to 100%, the image will look pixellated (as if it were a scaled-up bitmap) if the image's container is wider than the SVG's own size (set with `width`, `height`, and `viewBox`). # Steps to reproduce 1) View attached test case in a browser window. 2) Ensure that the browser window is significantly wider than 300 pixels. Most normal desktop browser window widths should work. # Actual results The black stroke looks fuzzy and pixellated. # Expected results The black stroke should look smoothly scaled up as in the browsers that display this OK (see below) # Build Date & Platform The first WebKit nightly that I noticed this behavior in is 5.1.3 (7534.53.10, r111220). # Additional Builds and Platforms Safari 5.1.3 (7534.53.10)/OS X: OK Safari/iOS 5.1 (9B176): OK Chrome 17.0.963.79/OS X: FAIL Chrome 17.0.963.79/Vista: FAIL Firefox 11.0/OS X: OK IE 9.0.8112.16421/Vista: OK
Created attachment 132757 [details] image that triggers this behavior
Comment on attachment 132756 [details] test case (requires island.svg) ><!DOCTYPE html> ><html lang="en-US"> ><head> > <meta charset="UTF-8" /> > <title>Untitled</title> ></head> ><body> > ><img style='width: 100%;' src='https://bugs.webkit.org/attachment.cgi?id=132757'> > ><p>The above image should be smooth at any size. The black stroke around the edge should not look pixellated even if the browser window is twice (or more) times as wide as the image's 300 pixels of width.</p> > ></body> ></html>
Bug confirmed. If you add "height: 100%" the pixelation stops. I guess I know whats going wrong, investigating.
Created attachment 133631 [details] Patch
Comment on attachment 133631 [details] Patch Attachment 133631 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12131063 New failing tests: platform/chromium/media/video-scales-in-media-document.html fast/writing-mode/block-level-images.html media/video-aspect-ratio.html media/video-transformed.html fast/table/quote-text-around-iframe.html media/video-layer-crash.html media/video-colorspace-yuv422.html media/video-colorspace-yuv420.html
Created attachment 133632 [details] Archive of layout-test-results from ec2-cr-linux-04 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-04 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
(In reply to comment #6) > Created an attachment (id=133632) [details] > Archive of layout-test-results from ec2-cr-linux-04 Wow, this is the first time the bot was so kind to offer me these results :-) Exactly what I was looking for.
Comment on attachment 132756 [details] test case (requires island.svg) I included the original island.svg testcase, with some slight changes in the patch.
Created attachment 133677 [details] Patch v2
Comment on attachment 133677 [details] Patch v2 Attachment 133677 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12133453 New failing tests: fast/images/zoomed-img-size.html fast/writing-mode/block-level-images.html tables/mozilla/bugs/bug67915-1.html tables/mozilla/bugs/bug12709.html css1/formatting_model/floating_elements.html fast/repaint/block-layout-inline-children-replaced.html tables/mozilla/bugs/bug96343.html tables/mozilla_expected_failures/bugs/bug85016.html
Created attachment 133688 [details] Archive of layout-test-results from ec2-cr-linux-04 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-04 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Created attachment 133777 [details] Patch v3 Fix rounding differences, restore truncate intrinsicRatio to int behavior, we can only fix this for real once the sub pixel layout branch is fully merged
Comment on attachment 133777 [details] Patch v3 Attachment 133777 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12134796 New failing tests: tables/mozilla_expected_failures/bugs/bug85016.html fast/writing-mode/block-level-images.html
Created attachment 133790 [details] Archive of layout-test-results from ec2-cr-linux-02 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-02 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Created attachment 134002 [details] Patch v4
Comment on attachment 134002 [details] Patch v4 View in context: https://bugs.webkit.org/attachment.cgi?id=134002&action=review r=me > Source/WebCore/rendering/RenderImage.cpp:512 > + // Propagate container size to image resource. > + IntSize containerSize = IntSize(contentWidth(), contentHeight()); Unnecessary copy.
Committed r112229: <http://trac.webkit.org/changeset/112229>
Thanks for the quick review, landed with the fix included. Nathan, please verify your problems are gone - if you find more SVGImage problems, I'm happy to hear about them.
(In reply to comment #18) > Thanks for the quick review, landed with the fix included. > Nathan, please verify your problems are gone - if you find more SVGImage problems, I'm happy to hear about them. Works for me. Thanks!
Reopening to attach new patch.
Created attachment 135129 [details] Patch
Comment on attachment 135129 [details] Patch Just put up this patch to make it easier to see the changes i"m about to commit.
Committed r112904: <http://trac.webkit.org/changeset/112904>