Closed
Bug 293224
Opened 19 years ago
Closed 19 years ago
[FIX]Matrix from getScreenCTM should be to initial viewport space
Categories
(Core :: SVG, defect, P1)
Core
SVG
Tracking
()
VERIFIED
FIXED
mozilla1.8beta4
People
(Reporter: a.neumann, Assigned: jwatt)
References
()
Details
(Keywords: fixed1.8)
Attachments
(4 files, 10 obsolete files)
513 bytes,
image/svg+xml
|
Details | |
4.62 KB,
image/svg+xml
|
Details | |
613 bytes,
image/svg+xml
|
Details | |
8.55 KB,
patch
|
tor
:
review+
tor
:
superreview+
asa
:
approval1.8b4+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050504 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050504 Firefox/1.0+ The .getScreenCTM() method of the root element (documentElement) delivers wrong values when a viewBox is involved. Please have a look at http://www.carto.net/neumann/temp/getscreenctm.svg Clicking on the rectangle should reveal the scale factor and offset values that should change after each window resize. Unfortunately that does not work on Mozilla svg. No matter how a resize the window, mozilla svg always displays the same values. The example works well in ASV6 and Batik. That method is very important to me since almost all of my more complex examples build on this method and won't work without it. Reproducible: Always Actual Results: in Mozilla native SVG the translation values seem to reflect the position of the browser window within the main screen on the computer, but in fact they should represent the offset of the viewBox system within the browser window. The scale values are always at one, but they should reflect the resizing of the viewBox coordinate system. Please compare with ASV6 or the newest Batik about the behaviour.
Comment 1•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Comment 2•19 years ago
|
||
any chnace we might see this in 1.5 ? this is much more important than bug#272630 which this bug depends on.
Comment 3•19 years ago
|
||
move your mouse around. the circle should be under the mouse, but it isnt.
Updated•19 years ago
|
Attachment #182880 -
Attachment is obsolete: true
Comment 5•19 years ago
|
||
ohh ! sorry, uploaded the wrong file ! here is the right testcase !
Attachment #192169 -
Attachment is obsolete: true
Comment 7•19 years ago
|
||
a more complex testcase drag around the white rect, it should allways stay under your mouse pointer.
Attachment #192228 -
Attachment is obsolete: true
Attachment #192267 -
Flags: review?(jonathan.watt)
Assignee | ||
Comment 9•19 years ago
|
||
Holger: Okay, let's fix the bugs in your testcases first. 1) You're mixing up *screen* coordinates with *client* coordinates. You need to use *screenX* and *screenY* when playing with getScreenCTM, not clientX and clientY. 2) Why are you calling getScreenCTM on the 'circle' element's parentNode? If you're using the mouse coordinates to set attributes of the 'circle' element then just call getScreenCTM on it. I'll attach corrected testcases that should work in firefox shortly. Andreas: The SVG file you've linked to doesn't show how you're using getScreenCTM. Are you also mixing up screen and client coordinates? Under what circumstances are you finding it necessary to call getScreenCTM on an 'svg' element. I'd be *very* interested to know of any scenarios where that's really what you want to do. Holger, if you have any I'd like to hear from you too. :-)
Assignee | ||
Comment 10•19 years ago
|
||
Attachment #192199 -
Attachment is obsolete: true
Assignee | ||
Comment 11•19 years ago
|
||
Attachment #192232 -
Attachment is obsolete: true
Comment 12•19 years ago
|
||
i didnt know about screenX/Y, and im not sure i understand the difference to clientX/Y, but it sounds reasonable to use screen coordinates with screenCTM ! unfortunatly using screenX/Y breaks the examples in Batik, but that migth be a batik bug...
Assignee | ||
Comment 13•19 years ago
|
||
From a quick look at batik it seems it's getScreenCTM is more like what you might call a getClientCTM method. :-/ Hence why things worked for you when using the client coordinates.
Comment 14•19 years ago
|
||
yeah , but it seems to me that in ASV6 clientX/Y == screenX/Y. so getScreenCTM() == "getClientCTM" in ASV6 and Batik. if this is implemented correctly ( i do believe what you say is correct ), i see no way to script anything like the testcase in a cross viewer manner.
Attachment #192267 -
Attachment is obsolete: true
Attachment #192267 -
Flags: review?(jonathan.watt)
Assignee | ||
Comment 15•19 years ago
|
||
Actually the fact that ASV6 uses client space for both screenX/Y *and* getScreenCTM means that this isn't a problem in ASV. They might argue that their "screen" is the client area, but who cares. As long as they remain consistant you can use *screen*X/Y and things will work fine. Batik on the other hand is a problem since screenX/Y isn't in the same space as getScreenCTM. I've filed a bug for that. http://issues.apache.org/bugzilla/show_bug.cgi?id=36165
Assignee | ||
Comment 16•19 years ago
|
||
The SVG WG are going to discuss this at their face-to-face next week, and Chris is going to get back to me with their conclusion. I'd recommend you don't go to a lot of effort to change any of your existing scripts until then.
Comment 17•19 years ago
|
||
(In reply to comment #9) > use *screenX* and *screenY* when playing with getScreenCTM, not clientX and clientY. on further testing, i just realized, that this proposal still does not work correctly, it seem getScreenCTM does not take currentTranslate/Scale into account.
Comment 18•19 years ago
|
||
the first testcase with currentScale set to 0.5
Assignee | ||
Updated•19 years ago
|
Attachment #192502 -
Attachment is obsolete: true
Assignee | ||
Comment 19•19 years ago
|
||
Attachment #192503 -
Attachment is obsolete: true
Attachment #194830 -
Attachment is obsolete: true
Assignee | ||
Comment 20•19 years ago
|
||
Assignee | ||
Comment 21•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Summary: method .getScreenCTM on the root element not implemented correctly → Matrix from getScreenCTM should be to initial viewport space
Assignee | ||
Comment 22•19 years ago
|
||
Please ignore comment 9, apparently the use of "screen" in getScreenCTM is just unfortunate naming. getScreenCTM should return the transformation matrix from current user units to the initial viewport coordinate system. In other words, you should use clientX and clientY in conjunction with getScreenCTM to transform cursor coordinates to user space, and not screenX and screenY as I asserted. (This should be publicly clarified by the W3C at a later date.) I've updated the bug summary and testcases. This patch makes our implementation of getScreenCTM return a transform to the same coordinate system as other implementations, and as the spec. was intended to say it should.
Assignee: general → jonathan.watt
Attachment #194938 -
Flags: superreview?(tor)
Attachment #194938 -
Flags: review?(tor)
Assignee | ||
Comment 23•19 years ago
|
||
Requesting blocking1.8b4. Sorry this is so late in the game, but we were waiting on WG clarification. Fixing this is very important for compatibility between SVG implementations. The change is SVG only and should be safe since GetScreenCTM is only used recursively by itself in our code. In other words content is it's only consumer. I'd like to get the patch in for b4 though to get it properly tested.
No longer depends on: 272630
Flags: blocking1.8b4?
Priority: -- → P1
Summary: Matrix from getScreenCTM should be to initial viewport space → [FIX]Matrix from getScreenCTM should be to initial viewport space
Target Milestone: --- → mozilla1.8beta4
Assignee | ||
Comment 24•19 years ago
|
||
(In reply to comment #17) > it seem getScreenCTM does not take currentTranslate/Scale into account. BTW, good catch Holger, and yes, this patch fixes that too.
Assignee | ||
Updated•19 years ago
|
Attachment #194938 -
Flags: superreview?(tor)
Attachment #194938 -
Flags: review?(tor)
Assignee | ||
Comment 25•19 years ago
|
||
Attachment #194938 -
Attachment is obsolete: true
Attachment #194961 -
Flags: superreview?(tor)
Attachment #194961 -
Flags: review?(tor)
Attachment #194961 -
Flags: superreview?(tor)
Attachment #194961 -
Flags: superreview+
Attachment #194961 -
Flags: review?(tor)
Attachment #194961 -
Flags: review+
Assignee | ||
Comment 26•19 years ago
|
||
Comment on attachment 194961 [details] [diff] [review] patch - include currentScale and Translate for <svg><svg></svg></svg> requesting approval1.8b4. see comment 23 for risk.
Attachment #194961 -
Flags: approval1.8b4?
Assignee | ||
Comment 27•19 years ago
|
||
checked in on trunk
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 28•19 years ago
|
||
We should take this if possible for 1.8b4 - it fixes a specification compliance problem that we've been discussing with the SVG WG.
Updated•19 years ago
|
Status: RESOLVED → VERIFIED
Comment 29•19 years ago
|
||
verifying fix. works great, thanks Jonathan, this was just in time ;-)
Updated•19 years ago
|
QA Contact: ian → holger
Updated•19 years ago
|
Attachment #194961 -
Flags: approval1.8b4? → approval1.8b4+
Updated•19 years ago
|
Flags: blocking1.8b4? → blocking1.8b4+
You need to log in
before you can comment on or make changes to this bug.
Description
•