Re: [whatwg] SVG cloning elements from HTML5

[plain-text email, please. HTML emails rarely survive
plain-text-ification unscathed.]

On Mon, Jun 23, 2014 at 11:35 PM, Gavin Kistner <> wrote:
> On 24 Jun 2014, at 05:25, Robert O'Callahan <> wrote:
>> On Thu, Jun 19, 2014 at 4:33 AM, Tab Atkins Jr. <>
>> wrote:
>>> Allowing html directly in svg is definitely the right answer. Parsing
>>> shouldn't be too hard, and defining the layout model would be pretty
>>> trivial.
>> For layout, we could do this:
>> 1) When an HTML element is a child of an SVG element, perform CSS layout of
>> the HTML element treating the nearest SVG viewport as the containing block.
>> Its user-space width and height become the width and height of the
>> containing block in CSS pixels.
>> 2) Treat such HTML elements as "position:relative".
> We should also support position:absolute. Given that this can then be
> changed, what happens for position:static? Ignored? Just flow within the
> school container?
> I agree that position:relative is a desirable default in this case, but if
> position:static can be supported then I (lightly) argue that a special case
> to change the default value inside SVG is a bad idea. It's more code, and
> less expected for end users.

Okay, changing my mind a little bit.  Giving more thought here, I
think we should:

1. Define that the SVG layout model is a thing.  <svg> elements
trigger it automatically, probably via "display-inside: svg
!important;" in the UA stylesheet.  (This allows "display: whatever;"
on <svg> elements to still work correctly, as it would only be able to
change display-outside.)

2. Other SVG elements propagate the SVG layout model.  This is maybe
via a "display-outside:svg" rule on "svg|*:not(svg)".  We can tweak
what approach we use here.

3. Everything in the SVG layout model is positioned relative to the
root of an SVG layout model, using x and y properties.

4. That's it.  Normal HTML elements use display:inline or
display:block or whatever, so they dont' propagate the model; they
position themselves via x/y, but their children lay out normally.

You can then use 'position' as usual if you want to abspos or
whatever, but given the standard position:static, x/y is where it's


Received on Tuesday, 24 June 2014 19:51:22 UTC