Bug 13828 - x/y values on rootmost <svg> elements should be ignored
Summary: x/y values on rootmost <svg> elements should be ignored
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-22 13:45 PDT by Antoine Quint
Modified: 2007-10-02 21:36 PDT (History)
0 users

See Also:


Attachments
Test case for x/y attributes on root-most <svg> element (899 bytes, application/xhtml+xml)
2007-05-22 13:51 PDT, Antoine Quint
no flags Details
First attempt (53.56 KB, patch)
2007-05-25 10:18 PDT, Rob Buis
oliver: review+
Details | Formatted Diff | Diff
new fix for feature-branch (6.14 KB, patch)
2007-10-02 19:51 PDT, Eric Seidel (no email)
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2007-05-22 13:45:12 PDT
Any <svg> element that is the root of an SVG fragment should have its x and y attributes ignored as per the SVG 1.1 specification. WebKit currently treats those as CSS left/top offsets, or so it seems.
Comment 1 Antoine Quint 2007-05-22 13:51:50 PDT
Created attachment 14664 [details]
Test case for x/y attributes on root-most <svg> element

For the test to pass, the green SVG square should be rendered aligned to the top-left of the red CSS-rendered square, which is 10 pixels wider and taller.
Comment 2 Rob Buis 2007-05-25 10:18:44 PDT
Created attachment 14724 [details]
First attempt

Not that happy with the checks, but I think it is the safest way.
Cheers,

Rob.
Comment 3 Oliver Hunt 2007-05-25 16:34:40 PDT
Comment on attachment 14724 [details]
First attempt

i find myself wondering whether
else {
+            rootX += x().value();
+            rootY += y().value();
         }
should account for tx, ty

though the more i think about the less i think it should.. hmmm...

also the += can just be + now


fianlly, the layout test in this case can *probably* be text only... eg. eventController.dumpAsText
or somthing
Comment 4 Oliver Hunt 2007-05-27 03:04:45 PDT
Comment on attachment 14724 [details]
First attempt

R=me, following discussion on irc

pixel test is necessary as screenctm and layout/painting follow completely different paths
Comment 5 Oliver Hunt 2007-05-27 13:01:26 PDT
Landed r21820
Comment 6 Eric Seidel (no email) 2007-10-02 10:19:33 PDT
svg/custom/rootmost-svg-xy-attrs seems to be failing on feature branch.  Perhaps this patch was forgotten during the merge?
Comment 7 Eric Seidel (no email) 2007-10-02 19:51:12 PDT
Created attachment 16510 [details]
new fix for feature-branch
Comment 8 Eric Seidel (no email) 2007-10-02 21:36:33 PDT
Laded as r25957.