Make getCTM and getScreenCTM compatible with other browsers
Categories
(Core :: SVG, enhancement, P3)
Tracking
()
| Webcompat Priority | P2 |
People
(Reporter: jwatt, Unassigned)
References
Details
(4 keywords, Whiteboard: [layout:backlog:quality] webcompat:risk-moderate )
Comment 1•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•5 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #0)
The behavior of getCTM and getScreenCTM in other browsers is fairly useless
in certain scenarios, but we've basically lost the battle to get them to
change to our more useful interpretation of the spec. We should align with
that behavior for sake of web compatibility.
Relating to getCTM, I believe the battle on the interpretation of the wording in the spec, in particular that of the nearestViewportElement, was always a lost cause. In the Bug 873106 discussion, Robert says:
"nearestViewportElement
The element which established the current viewport. Often, the nearest ancestor ‘svg’ element. Null if the current element is the outermost svg element.
So the nearestViewportElement is null
SVGMatrix getCTM()
Returns the transformation matrix from current user units (i.e., after application of the ‘transform’ attribute, if any) to the viewport coordinate system for the nearestViewportElement.
So we need to return the transformation matrix to the viewport coordinate system for something which is null"
The last sentence is wrong. "Null" is the nearest ancestor, where it doesn't exist.
The (unnecessary) sentence "Null if the current element is the outermost svg element" means "in the case of the outermost svg element, the nearestViewportElement is null", certainly not the outermost svg element, for which, yes, you can and must return the transformation matrix to the viewport coordinate system.
"Null [nearestViewportElement] if the current element is the outermost svg element" can not refer to the current element, since its descendant status is under investigation, and therefore does exist.
Independently of the interpretation, if we agree that in the case of the outermost svg element the nearestViewportElement is null, which we do, that doesn't justify to ignore the concrete element under analysis (the outermost svg element when it comes to it at the end of the chain). Therefore, add and stop, not just stop. This workaround pseudo code yields the same result of getCTM().e in all other implementations:
while (nearestViewportElement != null) {
x += nearestViewportElement.x
}
As things stand, the only way to skip the FF test whenever needed in applications and libraries, would be to just keep the workaround and discard getCTM(). That would be a shame, wouldn't it?
No matter what, to align seems the only sensible solution, and the sooner the better :)
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
| Comment hidden (obsolete) |
Updated•4 years ago
|
Comment 6•3 years ago
|
||
Possible duplicate of bug 1610093 ?
Comment 7•3 years ago
|
||
That's certainly the main issue that's left now, but this is a meta bug that's supposed to cover everything we find. The issues in comment 1 are both fixed now for instance.
Updated•3 years ago
|
Comment 8•2 years ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.
For more information, please visit auto_nag documentation.
| Reporter | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 9•1 year ago
|
||
Based on the webcompat report (https://webcompat.com/issues/35154), the issue is still reproducible on both Firefox 126 and 128.
Environment:
Operating system: OnePlus 6 A6000 (Android 11)
Firefox version: Nightly 128.0a1-20240522214846 (Build #2016022415) / Release 126.0-20240509170740
Updated•11 months ago
|
Description
•