Bug 83189 - Canvas inside SVG(foreignObject) positioning error
Summary: Canvas inside SVG(foreignObject) positioning error
Status: RESOLVED DUPLICATE of bug 23113
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac (Intel) OS X 10.6
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2012-04-04 12:07 PDT by olamothe
Modified: 2022-06-01 19:37 PDT (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description olamothe 2012-04-04 12:07:58 PDT
A positioning error occur when a canvas is placed inside a foreignObject tag. If the canvas is drawn with hardware acceleration , the transform attribute is not applied correctly.
Probably related in some way to : https://bugs.webkit.org/show_bug.cgi?id=71819

Step to reproduce :

Go to  : http://jsfiddle.net/olamothe/QZRf3/ 
Change the canvas width between 256<-->257

Actual results :

The transform attribute is not applied correctly when the canvas size is over 257. Canvas is moved to (0,0)

Expected results :

Canvas should always be at (100,100) I.E : the transform-translate attribute

Additional information :

Chrome 18.0.1025.142
Mac OS X 10.6.8

The underlying problem is not really the canvas size, it's actually when the canvas is being rendered with the aid of the hardware. It just so happen that in chrome 18 , canvas over 256 pixel in width or height are rendered with the aid of the GPU. The same effect can be achieved with safari 5.1.5 if you force it to render with hardware ( eg : -webkit-transform : translateZ(0) )
It is also not only linked to the canvas tag. For example if you replace the canvas with a div in the jsfiddle , and apply a CSS 3d transform, the same thing happen.
Comment 1 Dmitrijs Balcers 2022-04-14 01:24:33 PDT
I have reproduced the same issue.
Comment 2 Ahmad Saleem 2022-06-01 16:24:53 PDT
I am still able to reproduce this using attached test case in Safari 15.5 and Safari Technical Preview 146 on macOS 12.4. Thanks!
Comment 3 Radar WebKit Bug Importer 2022-06-01 18:36:35 PDT
Comment 4 Simon Fraser (smfr) 2022-06-01 19:37:25 PDT

*** This bug has been marked as a duplicate of bug 23113 ***