Last Comment Bug 326966 - Reenable SVG foreignobject on trunk
: Reenable SVG foreignobject on trunk
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
: Hixie (not reading bugmail)
Mentors:
Depends on: 328462
Blocks: 234953
  Show dependency treegraph
 
Reported: 2006-02-12 20:18 PST by Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
Modified: 2007-10-14 12:13 PDT (History)
8 users (show)
jwatt: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix (38.53 KB, patch)
2006-02-12 20:27 PST, Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
tor: review+
tor: superreview+
Details | Diff | Review
testcase (2.11 KB, application/xml)
2006-02-12 20:32 PST, Robert O'Callahan (:roc) (Exited; email my personal email if necessary)
no flags Details

Description Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2006-02-12 20:18:51 PST
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.
Comment 1 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2006-02-12 20:27:08 PST
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.
Comment 2 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2006-02-12 20:30:35 PST
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.
Comment 3 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2006-02-12 20:32:58 PST
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 4 tor 2006-02-20 13:39:34 PST
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.
Comment 5 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2006-02-20 16:33:44 PST
checked in
Comment 6 Jonathan Watt [:jwatt] 2007-10-14 12:13:08 PDT
in-testsuite-

Note You need to log in before you can comment on or make changes to this bug.