Bug 5331 - Percentage values for width, height, rx and ry not rendered correctly
Summary: Percentage values for width, height, rx and ry not rendered correctly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
: 6599 (view as bug list)
Depends on:
Blocks: 6011
  Show dependency treegraph
 
Reported: 2005-10-10 18:44 PDT by Julien Palmas
Modified: 2006-01-26 01:32 PST (History)
2 users (show)

See Also:


Attachments
reduced test case (122 bytes, image/svg+xml)
2005-10-12 17:54 PDT, Julien Palmas
no flags Details
Temporary patch (1.80 KB, patch)
2005-10-23 04:31 PDT, Julien Palmas
no flags Details | Formatted Diff | Diff
Testcase for percentage sized rect (168 bytes, image/svg+xml)
2006-01-22 03:28 PST, Joost de Valk (AlthA)
no flags Details
Testcase for percentage rounded rectangle (184 bytes, image/svg+xml)
2006-01-22 03:34 PST, Joost de Valk (AlthA)
no flags Details
patch fixing issue (4.76 KB, patch)
2006-01-22 15:57 PST, Alexander Kellett
eric: review-
Details | Formatted Diff | Diff
Patch with corrected comments, and test case demonstrating incorrect fix. (6.88 KB, patch)
2006-01-22 16:48 PST, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Simple test case (168 bytes, image/svg+xml)
2006-01-22 16:49 PST, Eric Seidel (no email)
no flags Details
latest patch with code removal and corrected comments (4.57 KB, patch)
2006-01-25 13:36 PST, Alexander Kellett
no flags Details | Formatted Diff | Diff
svn-create-patch version of previous patch for WebCore (4.69 KB, patch)
2006-01-25 13:47 PST, Alexander Kellett
eric: review+
Details | Formatted Diff | Diff
layouttests patch (851 bytes, patch)
2006-01-25 13:48 PST, Alexander Kellett
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Palmas 2005-10-10 18:44:48 PDT
Both of these attributes are defined as #IMPLIED in the DTD. Webkit+svg fails to define them correctly if 
missing.

An example is here :
http://www.croczilla.com/svg/samples/tiger/tiger.svg

Just add width="800" or anything else in the <svg> element and the problem disappears.

You can also check with drawTest. The rendering is done, but not on the white background.
Comment 1 Julien Palmas 2005-10-12 17:54:02 PDT
Created attachment 4335 [details]
reduced test case
Comment 2 Julien Palmas 2005-10-23 04:29:36 PDT
When width or height are not specified in the <svg> element, they are implied as 100% (according to the 
spec) but the render fails, 100% is not mapped to the actual window size

Same thing for an element like <rect> with width or height set with percentage. The element will not 
render.

This bug is specific to OSX.
Comment 3 Julien Palmas 2005-10-23 04:31:44 PDT
Created attachment 4446 [details]
Temporary patch

A simple patch to handle the case where only width or height is not specified
in the <svg> element.
Comment 4 Eric Seidel (no email) 2005-12-13 00:27:08 PST
This is still a bug in TOT.
Comment 5 Eric Seidel (no email) 2006-01-15 03:00:29 PST
Looks OK, but might be because we're not clipping the <svg>:
http://bugzilla.opendarwin.org/show_bug.cgi?id=6093
Comment 6 Joost de Valk (AlthA) 2006-01-22 03:26:41 PST
*** Bug 6599 has been marked as a duplicate of this bug. ***
Comment 7 Joost de Valk (AlthA) 2006-01-22 03:28:20 PST
Created attachment 5830 [details]
Testcase for percentage sized rect
Comment 8 Joost de Valk (AlthA) 2006-01-22 03:29:09 PST
Comment on attachment 4446 [details]
Temporary patch

This code is no longer usable... Submitter: please set a review flag next time.
Comment 9 Joost de Valk (AlthA) 2006-01-22 03:30:35 PST
Increasing to P2, SVG without support for % for scaling .... well you get it :)
Comment 10 Joost de Valk (AlthA) 2006-01-22 03:33:06 PST
Changing subject, rounded corners don't work either, testcase forthcoming.
Comment 11 Joost de Valk (AlthA) 2006-01-22 03:34:15 PST
Created attachment 5833 [details]
Testcase for percentage rounded rectangle
Comment 12 Alexander Kellett 2006-01-22 15:57:32 PST
Created attachment 5854 [details]
patch fixing issue
Comment 13 Eric Seidel (no email) 2006-01-22 16:19:10 PST
Comment on attachment 5854 [details]
patch fixing issue

I'm not sure this fix is really complete (What about % used for text or images, or <svg>?) I also think the comment could be cleaner.  I can fix the comments on landing since they're trivial issues, and we'll use other bugs to track the missing support.
Comment 14 Eric Seidel (no email) 2006-01-22 16:47:47 PST
Comment on attachment 5854 [details]
patch fixing issue

Actually looking at this further, this does not fix the issue.  I'm posting a patch which contains slightly modified comments, as well as a test case which demonstrates how this patch is incorrrect.
Comment 15 Eric Seidel (no email) 2006-01-22 16:48:32 PST
Created attachment 5857 [details]
Patch with corrected comments, and test case demonstrating incorrect fix.
Comment 16 Eric Seidel (no email) 2006-01-22 16:49:40 PST
Created attachment 5858 [details]
Simple test case
Comment 17 Alexander Kellett 2006-01-25 13:36:40 PST
Created attachment 5959 [details]
latest patch with code removal and corrected comments
Comment 18 Alexander Kellett 2006-01-25 13:47:32 PST
Created attachment 5960 [details]
svn-create-patch version of previous patch for WebCore
Comment 19 Alexander Kellett 2006-01-25 13:48:14 PST
Created attachment 5961 [details]
layouttests patch
Comment 20 Eric Seidel (no email) 2006-01-25 14:29:28 PST
Comment on attachment 5960 [details]
svn-create-patch version of previous patch for WebCore

Looks great! r=me.
Comment 21 Eric Seidel (no email) 2006-01-25 14:31:29 PST
Comment on attachment 5961 [details]
layouttests patch

I'll tweak this a bit when I land, but looks good.  Thanks again.  r=me.
Comment 22 Eric Seidel (no email) 2006-01-26 01:32:17 PST
Thanks again Alexander.