[whatwg] Including HTML more directly into SVG

Elliott Sprehn esprehn at gmail.com
Tue Sep 11 01:45:34 PDT 2012


On Tue, Sep 11, 2012 at 1:32 AM, Robin Berjon <robin at w3.org> wrote:
> On 11/09/2012 10:15 , Elliott Sprehn wrote:
>>
>> ...
>
>> SVG has a totally different font and styling model, different kinds of
>> animations, filters, etc. The paragraph and span concept in SVG
>> wouldn't be the same thing so it's not an antipattern. You would have
>> to specify some kind of x/y coordinate and the width since SVG doesn't
>> have a flow concept so there would be nothing to size or place
>> against.
>
>
> That's precisely what Tab's proposal fixes.
>

Perhaps I don't understand, but I don't see how Tab's proposal
addresses what to size against. If I add a <p> element, there's
nothing to size it against except the containing <svg> element.

ex.

<svg>
<g>
  <rect x="0" y="0" width="100%" height="100%" fill="yellow"/>
  <path d="M90,40L40,270L260,270L210,40z" fill="none" stroke="black"
stroke-width="5"/>
  <p>Some text goes here.</p>
</g>
</svg>

Tab, What controls the width and x/y of the <p> ?

>
>
>> Might be nice to add an <html> element with x/y width/height
>> attributes to make <foreignObject> easier though!
>
>
> I'm not sure how that would help. However, <foreignObject size=auto> would
> do the trick IMHO (I'm concerned that making it more automatic might have
> nasty corner cases). We could even make a new, less horrible name for it,
> like <css>.

SVG also has CSS though, I don't understand how <css> implies "now
you're in HTML mode".

- E



More information about the whatwg mailing list