Gecko:SVGLayout
Jump to navigation
Jump to search
SVG layout is a bit weak. Here are some use cases that don't work with existing standards or our implementation:
- Wrap an SVG container around an auto-height HTML element (e.g., to rotate it, or to apply a filter).
I think there's just no way to do this right now. SVG does not support inside-out sizing.
- XUL + SVG? Not sure what the typical use case is here.
Some suggestions:
- Treat <svg> as a replaced element (default inline). (I think we're already doing this?) Change the SVG spec for compound SVG documents so that if the "width" or "height" attributes are missing, instead of using "100%" (whatever that means) as the intrinsic width or height, we use the dimension(s) of the rectangle that encloses the element's contents' overflow area.
- Make the "width" and "height" attributes optional on foreignObject. We'll compute an intrinsic width or height and use that.
Actually I think this is enough to solve my SVG container problem. Then I can just write
<svg style="display:block;" width="100%" xmlns="...">
<foreignObject transform="..." width="100%">
<div xmlns="...">
</div>
</foreignObject>
</svg>