Re: [whatwg] SVG cloning elements from HTML5

On Wed, Jun 25, 2014 at 7:05 AM, David Dailey <ddailey@zoominternet.net> wrote:
> Might it be possible, in some wonderful future, to simply say
>
> <path d="M 32 55 111 41 157 106 120 145 25 98 z" fill="url(#I)" /> where I is an image,
> or
> <path d="M 32 55 111 41 157 106 120 145 25 98 z" fill="url(#T)" /> where T is a text,
> or
> <path d="M 32 55 111 41 157 106 120 145 25 98 z" fill="url(#V)" /> where V is a video,
>
> In addition to the current
>
> <path d="M 32 55 111 41 157 106 120 145 25 98 z" fill="url(#G)" /> where G is a gradient?

Yes, via the element() function
<http://dev.w3.org/csswg/css-images/#element-notation>.  This is
probably already possible in Firefox, using the -moz-element()
function.  Allowing it *directly* is a slightly more difficult task
that might not ever happen, but it's a tiny amount of script to make
it work through element().  (Create an HTMLVideoElement, set its
src/etc, put it in CSS.elementSources
<http://dev.w3.org/csswg/css-images/#elementsources>, ref it as
fill="element(#foo)", then call video.play() or whatever.)

~TJ

Received on Wednesday, 25 June 2014 19:28:41 UTC