Closed Bug 326966 Opened 18 years ago Closed 18 years ago

Reenable SVG foreignobject on trunk


(Core :: SVG, defect)

Not set





(Reporter: roc, Assigned: roc)




(2 files)

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.
Attached patch fixSplinter Review
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.
Attachment #211678 - Flags: superreview?(tor)
Attachment #211678 - Flags: review?(tor)
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.
Attached file 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.
Blocks: 326978
No longer blocks: 326978
Comment on attachment 211678 [details] [diff] [review]

Change the uuid on nsISVGRendererCanvas.

Change the test in to only enable for cairo-gfx.

With that, r=tor.
Attachment #211678 - Flags: superreview?(tor)
Attachment #211678 - Flags: superreview+
Attachment #211678 - Flags: review?(tor)
Attachment #211678 - Flags: review+
checked in
Closed: 18 years ago
Resolution: --- → FIXED
Depends on: 328462
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.