RESOLVED FIXED 5361
Pattern element coordinate problems
https://bugs.webkit.org/show_bug.cgi?id=5361
Summary Pattern element coordinate problems
Nicholas Shanks
Reported 2005-10-13 01:35:58 PDT
At the URL given, in Opera 8.5, the character talking in the first frame has a beard, which isn't drawn in Safari.
Attachments
reduced test‐case (16.40 KB, image/svg+xml)
2005-10-13 02:09 PDT, Nicholas Shanks
no flags
Reduced test case (334 bytes, image/svg+xml)
2005-10-13 08:28 PDT, Julien Palmas
no flags
Wrong result (37.17 KB, image/png)
2005-10-13 08:29 PDT, Julien Palmas
no flags
Good result (37.96 KB, image/png)
2005-10-13 08:29 PDT, Julien Palmas
no flags
Proposed patch (1.14 KB, patch)
2005-10-21 10:36 PDT, Julien Palmas
eric: review-
Better patch (2.00 KB, patch)
2005-10-21 11:38 PDT, Julien Palmas
eric: review+
Nicholas Shanks
Comment 1 2005-10-13 01:38:43 PDT
Actually, both of them have missing stubble. It might be that it's supposed to have an alpha value, but Opera is rendering it as 1.0 (black) instead of grey, and Safari is rendering it as 0.0 (white).
Nicholas Shanks
Comment 2 2005-10-13 02:09:33 PDT
Created attachment 4336 [details] reduced test&#8208;case The bug is when a fill attribute refers to a <pattern> element by fragment ID using "url(#fragment)"
Eric Seidel (no email)
Comment 3 2005-10-13 02:25:39 PDT
Adding NeedsReduction keyword, the test case ideally should only be a couple lines.
Julien Palmas
Comment 4 2005-10-13 08:28:26 PDT
Created attachment 4343 [details] Reduced test case There are 2 know bugs in http://www.pandimaniacs.com/index.php?mode=svg&lang=en. The first one is related with the use of viewBox. We really have to fix the coordinates calculation when using this attribute as many SVGs use this. The second bug (see the atteched reduced test case) is a coordinate generation problem as well, but when using the pattern element. In this example, the first (top-left) red <rect> should be rendered at (10.10) but it is rendered at (0.0). NOTE : the patternUnits="userSpaceOnUse" is important in this example. It means that the coordinate system used for the pattern element (ie: for its x, y, width and height values) is the same as the coordinate system of the black rectangle.
Julien Palmas
Comment 5 2005-10-13 08:29:29 PDT
Created attachment 4344 [details] Wrong result
Julien Palmas
Comment 6 2005-10-13 08:29:49 PDT
Created attachment 4345 [details] Good result
Julien Palmas
Comment 7 2005-10-13 08:33:16 PDT
MacDome, could you set the keyword to "HasReduction" and the summary to something like "Pattern element coordinate problem" ? Thanks
Julien Palmas
Comment 8 2005-10-21 10:36:16 PDT
Created attachment 4438 [details] Proposed patch KRenderingPaintServerPatternQuartz was checking boundingBoxMode() of KRenderingPaintServerPattern to shift the coordinates of the <pattern>. That's not necessary as the x() and y() coordinates are already shifted thanks to the baseVal() method. By the way, the same code was already commented out a line 135
Julien Palmas
Comment 9 2005-10-21 11:38:58 PDT
Created attachment 4439 [details] Better patch Removes unnecessary comments
Eric Seidel (no email)
Comment 10 2005-10-21 15:25:09 PDT
Comment on attachment 4438 [details] Proposed patch We don't generally commit commented out code.
Eric Seidel (no email)
Comment 11 2005-10-21 15:26:19 PDT
Comment on attachment 4439 [details] Better patch Looks fine, I'll test again before committing.
Eric Seidel (no email)
Comment 12 2005-10-23 23:54:52 PDT
Fixed.
Note You need to log in before you can comment on or make changes to this bug.