Bug 5337 - SVG paths with no 'd' attribute are not rendered
Summary: SVG paths with no 'd' attribute are not rendered
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Nobody
URL: http://www.dotuscomus.com/svg/gallop....
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2005-10-11 03:08 PDT by Eric Seidel (no email)
Modified: 2007-06-12 12:12 PDT (History)
2 users (show)

See Also:


Attachments
SVG non-well-formedness test case (902 bytes, image/svg+xml)
2005-10-16 16:48 PDT, Daniel Udey
no flags Details
Reduced test case (414 bytes, image/svg+xml)
2005-10-30 04:33 PST, Julien Palmas
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2005-10-11 03:08:02 PDT
SVG shows up blank

Further reduction would be necessary to determine why this is the case.  My console shows this error:

[163:139]: ERROR: expected '>'
Comment 1 Daniel Udey 2005-10-16 16:48:06 PDT
Created attachment 4373 [details]
SVG non-well-formedness test case

The problem arises because the SVG document is not well-formed XML. Attached is
a sample test case. The original file had three <path> elements which lacked a
'd' attribute. It appears the author intended to rely on the <animate> element
to provide the initial value; unfortunately, the DTD does not allow for this;
an initial attribute must be provided; however, it does work in other
implementations which ignore the error silently and do support the <animate>
element.

The actual reason that the SVG document shows up blank is because the <animate>
element is not (properly?) supported in the WebKit implementation of SVG; as
such, the element remains with no 'd' attribute, and there is nothing for
WebKit to draw.

The attached file has both a <path> element with a correct initial value, as
well as one which is empty. The error given ("ERROR: expected '>'") is still
printed to the console, though the error does not provide adequate information
on what the problem is. WebKit does continue to render the SVG file properly,
however; the 'error' is actually more of a warning that the SVG engine could
not find an attribute it expected.

Possible behaviour might be to throw an error when WebKit encounters such a
<path> element (as occurs with invalid XHTML), or to silently ignore it in case
it is used later (for example, by the <animate> element).

It may also be worth noting that the DTD referenced in the original document is
a 404, though that did not seem to have any impact on the document. This test
case uses the proper SVG 1.1 DTD.
Comment 2 Daniel Udey 2005-10-16 18:49:53 PDT
After further testing, I've discovered that the ERROR message printed to the console.log is a separate issue 
relating to the XML prolog, which has now been reported as bug 5396.
Comment 3 Julien Palmas 2005-10-30 04:33:38 PST
Created attachment 4537 [details]
Reduced test case

Better reduced test case
Does not display ERROR: expected '>' as this moved to
http://bugzilla.opendarwin.org/show_bug.cgi?id=5396

Like you said before, the "d" attribute for <path> is #REQUIRED in the spec. I
need to check if the <animate attributeName="d"> can be considered as providing
the "d" attribute to its parent node. My first impression is that as long as
there is no "d" specified in <path> (like the DTD requires), it is normal that
we don't render anything.
Comment 4 Eric Seidel (no email) 2006-01-26 14:18:35 PST
I believe this has been "fixed", however <animate> doesn't work in TOT.
Comment 5 Nikolas Zimmermann 2007-06-12 12:12:00 PDT
It's fixed. Link is dead.