W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

Re: [whatwg] Including HTML more directly into SVG

From: Elliott Sprehn <esprehn@gmail.com>
Date: Tue, 11 Sep 2012 01:45:34 -0700
Message-ID: <CAPJYB1gPwbK28WSzwuDpihYpEjkZgjYo0bD1TT5s7NcD1WU-Cw@mail.gmail.com>
To: Robin Berjon <robin@w3.org>
Cc: WHATWG <whatwg@whatwg.org>, "Tab Atkins Jr." <jackalmage@gmail.com>
On Tue, Sep 11, 2012 at 1:32 AM, Robin Berjon <robin@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
Received on Tuesday, 11 September 2012 08:46:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC