For testing purposes, it's really helpful to have a way to transform arbitrary content with rotations etc. Now that frame display lists have landed we can reenable foreignobject in a reasonable way (reasonable enough that events and painting work without much hacking). I will attach a patch that does just that, along with a swag of fixes that make foreignobject actually work OK in the current world.
12 years ago
Created attachment 211678 [details] [diff] [review] fix Here it is. I think the logic is pretty straightforward. I've made mRect always have a position of (0,0). With arbitrary transforms, mRect never makes sense except insofar as the child frames of the foreignobject care about it. Setting mRect's origin is just confusing. This paints and handles events OK. There are some serious problems left that have to be fixed on their own: -- invalidation doesn't work, so dynamic changes to the foreignobject content don't repaint correctly. You should always force a manual repaint of the window before you conclude that the rendering is incorrect! I plan to fix this when the view manager is removed. -- caret doesn't work right. This depends on the general caret rework which we should be able to complete soon. -- scrolling is broken. We need to just disable bitblt scrolling in non-rectilinear situations, but depends on invalidation working in any case. -- I believe IME will be broken. -- combobox dropdowns will appear in the wrong place. it's not 100% clear how this should work... We'll probably find more. Nevertheless it is possible to surf the web inside a transformed IFRAME. Landing this will make it possible to do much more interesting testing of stuff like native theme handling.
BTW compilation of nsSVGForeignObjectFrame was broken on the trunk. I tried to fix it by copy-pasting filter support, since I didn't feel like refactoring large quantities of SVG code right away. I did remove duplicated matrix-setting code, and change some code to use nsSVGUtils::TransformPoint. I also created nsSVGForeignObjectFrame.h so nsLayoutUtils could get to it to help with transforming event coordinates.
Created attachment 211679 [details] testcase This is an example file that's helpful for playing with this patch. It includes an IFRAME in which you can load any page you like.
Comment on attachment 211678 [details] [diff] [review] fix Change the uuid on nsISVGRendererCanvas. Change the test in configure.in to only enable for cairo-gfx. With that, r=tor.