Bug 5326 - Scaling problems with viewBox attributes
Summary: Scaling problems with viewBox attributes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P3 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
: 5343 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-10 13:14 PDT by Julien Palmas
Modified: 2005-10-16 02:00 PDT (History)
1 user (show)

See Also:


Attachments
Reduced test case (368 bytes, image/svg+xml)
2005-10-10 13:17 PDT, Julien Palmas
no flags Details
Expected result (13.64 KB, image/png)
2005-10-10 13:18 PDT, Julien Palmas
no flags Details
Set correct default value for align (746 bytes, patch)
2005-10-12 13:46 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Another attempt at fixing this svg (2.01 KB, patch)
2005-10-12 14:14 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Expected result (39.86 KB, image/png)
2005-10-12 14:40 PDT, Julien Palmas
no flags Details
fixes the bug (2.92 KB, patch)
2005-10-12 16:39 PDT, Julien Palmas
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 13:14:52 PDT
An element with a viewBox attribute is not scaled correctly.
The problem is not present in KDE SVN.
Comment 1 Julien Palmas 2005-10-10 13:17:33 PDT
Created attachment 4296 [details]
Reduced test case

The grey rectangle should be scaled inside the black one, but no scaling is
done
Comment 2 Julien Palmas 2005-10-10 13:18:37 PDT
Created attachment 4297 [details]
Expected result

Result obtained with KDE
Comment 3 Eric Seidel (no email) 2005-10-11 03:52:01 PDT
Both FireFox and Opera render this svg just liek we do... I'm not sure what's "expected"
Comment 4 Rob Buis 2005-10-12 13:46:18 PDT
Created attachment 4326 [details]
Set correct default value for align

This may possible help with this bug...
Comment 5 Rob Buis 2005-10-12 14:14:02 PDT
Created attachment 4327 [details]
Another attempt at fixing this svg

Note: this patch is not ready for review!
It is a quick and dirty test to see if it fixes the .svg.
A cleaner way should be found, maybe changing SVGLengthImpl etc.
Comment 6 Julien Palmas 2005-10-12 14:40:02 PDT
Created attachment 4328 [details]
Expected result
Comment 7 Julien Palmas 2005-10-12 16:39:43 PDT
Created attachment 4332 [details]
fixes the bug

This patch is actually joining the 2 patches previously posted by rwlbuis.
The format is now correct.
Comment 8 Eric Seidel (no email) 2005-10-12 17:01:58 PDT
*** Bug 5343 has been marked as a duplicate of this bug. ***
Comment 9 Eric Seidel (no email) 2005-10-13 00:03:28 PDT
Comment on attachment 4332 [details]
fixes the bug

Looks good.  rwlbuis explained this all to me on IRC.  Basically instead of
passing itself as a reference (off of which to base % calculations),
SVGSVGElement is passing the nearest viewport.
Comment 10 Eric Seidel (no email) 2005-10-13 01:25:55 PDT
Landed.