[Webkit-unassigned] [Bug 34521] New: Apply preserveAspectRatio and synthesize viewboxes in <img>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 3 05:06:02 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34521

           Summary: Apply preserveAspectRatio and synthesize viewboxes in
                    <img>
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: lstorset at opera.com
                CC: lstorset at opera.com


Created an attachment (id=48014)
 --> (https://bugs.webkit.org/attachment.cgi?id=48014)
Test case

(First mentioned on webkit-dev [3])

As far as I can tell from the latest nightly builds (and the latest Chrome
release on Linux), WebKit will render an SVG in <img> much like a bitmap:
it will resolve the width and height of the image and stretch it to fill
the content box. It will respect any viewbox (presumably synthesizing one
if it is missing), but preserveAspectRatio [1] seems not to be applied to
an SVG in <img>, and the default rendering (whether there is a viewbox or
not) is as if preserveAspectRatio="none".

Opera (Presto engine) will also resolve image dimensions and synthesize
missing viewboxes, and will synthesize a viewBox if it can, as outlined
in SVG WG ISSUE-2258 [2], and applies preserveAspectRatio as specified in
SVG 1.1 (note that pAR has a default value 'xMidYMid meet'). The viewBox
(whether specified or synthetic) are used together with pAR when rendering
the SVG into the viewport established by the <img> element.

The attached images and test case illustrate the two renderings.

We believe that not applying the pAR on svg in <img> means that WebKit
has invalid rendering behaviour according to the SVG 1.1 specification.

To enhance cross-browser compatibility it would be good if WebKit also
considered synthesizing viewBoxes as outlined in [2], as this makes it
easier to reuse existing svg content created by svg editors such as
Inkscape (such content most often has a width and height, but lacks a
viewBox).

[1] http://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute
[2] http://www.w3.org/Graphics/SVG/WG/track/issues/2258
[3] https://lists.webkit.org/pipermail/webkit-dev/2010-February/011514.html

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list