W3C home > Mailing lists > Public > www-svg@w3.org > April 2011

[Bug 12540] New: Reevaluate handling of invalid viewBox values

From: <bugzilla@jessica.w3.org>
Date: Fri, 22 Apr 2011 17:04:14 +0000
To: www-svg@w3.org
Message-ID: <bug-12540-2017@http.www.w3.org/Bugs/Public/>

           Summary: Reevaluate handling of invalid viewBox values
           Product: SVG
           Version: SVG 2.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Transformations
        AssignedTo: schepers@w3.org
        ReportedBy: jwatt@jwatt.org
         QAContact: www-svg@w3.org

About the viewBox attribute's 'width' and 'height' components, the spec says "A
value of zero disables rendering of the element":


However, Opera, Webkit and IE9 all display SVG files where the viewBox's
width/height has a value of zero. E.g.:


Actually it's not quite so simple. Consider an SVG file containing the
following markup:

<svg xmlns="http://www.w3.org/2000/svg"
     viewBox="0 0 0 0">
  <rect height="100%" width="100%" fill="orange"/>
  <rect height="100" width="100" fill="pink"/>

IE shows both the orange and pink rects, so it seems to ignore the invalid
viewBox attribute completely. Opera and Webkit both display the pink rect, but
do not display the orange rect, so they seem to be ignoring the invalid
(singular) implicit transform implied by the viewBox attribute, but seem to
still be resolving percentage lengths against the viewBox (any percentage of
zero is zero, so the orange rect's dimensions resolve to 0px x 0px).

Mozilla displays none of the SVG at all, since it follows the spec on this

I'm happy for Mozilla to either continue to follow what the spec currently says
to do, or to agree to change the spec to do what IE9 does (ignore the broken
viewBox completely), but I don't think that the Opera/Webkit behavior is good.
Either way we should agree on interop behavior here.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Friday, 22 April 2011 17:04:15 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:24 UTC