Closed
Bug 331421
Opened 19 years ago
Closed 15 years ago
mouse event coordinates are not transformed for HTML inside a svg:foreignObject
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: ted, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
903 bytes,
application/xml
|
Details |
In mouse event handlers on HTML elements inside a svg:foreignObject, the event coordinates (e.g. .clientX) are not transformed. This works poorly for things like Google Maps.
Reporter | ||
Comment 1•19 years ago
|
||
Click to change the position of the little black div. The HTML is rotated by 90 degrees. Remember to invalidate the area to see the changes.
Reporter | ||
Comment 2•18 years ago
|
||
foreignObject requires height parameters now apparently.
Attachment #215972 -
Attachment is obsolete: true
Comment 3•18 years ago
|
||
if you run the test case via chrome it seems to work
Comment 4•18 years ago
|
||
I can see the problem you have. You're embedding third party content into a page which you're rotating (or otherwise transforming) and you still require any mouse event handling code in the third party content to work. The problem is that fixing this would require us to look up the parent chain of the mouse event target for each mouse event - including across document boundaries(!) - to figure out the global transform on the content. I guess the event coordinates would also need to change as it propagated along the target chain. This would introduce a fair bit of overhead for mouse events, and unfortunately I think changing the coordinates in either of the above ways would conflict with existing specifications and content.
This can and should be fixed. There is nothing unreasonable about it. The .client coordinates for events fired inside the IFRAME should be relative to the top-left of the IFRAME, no spec issues there.
Comment 6•17 years ago
|
||
Yeah, on reflection you're right. However, there's still the performance issue. nsDOMUIEvent::GetClientPoint seems nasty already, and I don't immediately see a good way to fit in the transforms that intermediary SVG may add.
I don't think performance is an issue. Events aren't fired at a high rate, nor do scripts need to get their client coordinates many times.
We probably should add a virtual TransformPoint method to nsIFrame.
Comment 8•17 years ago
|
||
The testcase seems to work now.
Updated•15 years ago
|
Assignee: general → nobody
QA Contact: ian → general
Reporter | ||
Comment 9•15 years ago
|
||
Dunno when this got fixed, but WFM.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•