Bug 17633 - SVG: modifying x & y attribute of text element from JS fails
Summary: SVG: modifying x & y attribute of text element from JS fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-01 20:32 PST by Andre-John Mas
Modified: 2008-03-30 10:18 PDT (History)
0 users

See Also:


Attachments
Test case illustrating the issue (2.11 KB, image/svg+xml)
2008-03-01 20:35 PST, Andre-John Mas
no flags Details
Updated test-case, removing unnecessary alerts (1.87 KB, image/svg+xml)
2008-03-01 20:36 PST, Andre-John Mas
no flags Details
First attempt (8.89 KB, patch)
2008-03-30 03:38 PDT, Rob Buis
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre-John Mas 2008-03-01 20:32:56 PST
Tested with nightly of 2008-03-01

If you try modifying the x and y attributes of a text element they are ignored, from Javascript, when they should be taken into account. In other words if I change x from 200 to 300, then the object remains at 200. I have compared this behaviour with Opera 9.5 and Firefox where the object moves.

This behaviour should be corrected in Webkit.
Comment 1 Andre-John Mas 2008-03-01 20:35:03 PST
Created attachment 19478 [details]
Test case illustrating the issue

I have attached a test case which illustrates the issue. Here you see that both rectangles are moved to the new location (correct behaviour), but not the text element (incorrect behaviour).
Comment 2 Andre-John Mas 2008-03-01 20:36:41 PST
Created attachment 19479 [details]
Updated test-case, removing unnecessary alerts
Comment 3 Adam Rofer 2008-03-20 10:57:15 PDT
Possibly related to Bug 15799 ? 
Comment 4 Andre-John Mas 2008-03-20 11:25:39 PDT
Just an extra note: doing the same manipulation of other elements such as 'rectangle' works.
Comment 5 Rob Buis 2008-03-30 03:38:42 PDT
Created attachment 20211 [details]
First attempt

This should fix the bug. It does not cover setting for example rotate on text though. Also I intend this so far only for <text>, not <tspan>. I think we should make seperate bugs for them and ofcourse also testcase(s) for those bugs.
Cheers,

Rob.
Comment 6 Oliver Hunt 2008-03-30 04:26:56 PDT
Comment on attachment 20211 [details]
First attempt

Looks good.  I'd like the testcase to be pure text output though -- dumpAsText() is your friend :D
Comment 7 Rob Buis 2008-03-30 10:17:18 PDT
Hi Oliver,

(In reply to comment #6)
> (From update of attachment 20211 [details] [edit])
> Looks good.  I'd like the testcase to be pure text output though --
> dumpAsText() is your friend :D

I didnt see a way to make it work that way. The test relies on the end position
of the text. Eric didnt see an (easy) way either. Anyway, let me know if you feel I missed an opportunity to use dumpAsText here, then I will replace the testcase.
Cheers,

Rob.
Comment 8 Rob Buis 2008-03-30 10:18:35 PDT
Fixed by #31441.