Bug 13828

Summary: x/y values on rootmost <svg> elements should be ignored
Product: WebKit Reporter: Antoine Quint <ml>
Component: SVGAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Test case for x/y attributes on root-most <svg> element
none
First attempt
oliver: review+
new fix for feature-branch oliver: review+

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.