Re: [svg2] Should <use> be allowed to reference <view> elements?
Erik Dahlström <[email protected]>
| Newsgroups | gmane.comp.web.svg |
|---|---|
| Message-ID | <[email protected]> |
Having two inline svg fragments and making one reference the other was the use-case I was after, avoiding the need for having external files*. Example: <html> <svg>... <view id="foo"/></svg> <svg><use xlink:href="#foo"/></svg> </html> My reason for finding this was because I wanted to quickly make an example to test out viewTarget :) And to answer Cameron's comment about <view> applying to the outermost <svg> parent, that's fine for the use-case above. The main point is that <view> essentially behaves like an <svg> or <symbol>, so why should it be different than those for <use>? Cheers /ed * Note that data URIs with a fragment part isn't supported in all browsers, so that's unfortunately not an option either. On Thu, 05 Nov 2015 00:08:24 +0100, Amelia Bellamy-Royds <[email protected]> wrote: > As far as referencing a view in the same document, the circular reference > issues would come into effect, similar to a <use> referencing the parent > <svg> element. However, if you wanted to <use> a particular view of an > SVG > in a different file, it could be useful. > > From an authoring perspective, > > <use href="otherFile.svg#view" /> > > isn't that much different from > > <image href="otherFile.svg#view" /> > > except that you should get style inheritance for the <use>. > > > From an implementation perspective, however, we'd need special rules to > enable this. Basically, you would be re-using the <svg> (and all it's > child content), but with the modified attributes, title, and desc from > the > view. > > ~Amelia > > On 4 November 2015 at 15:28, Cameron McCormack <[email protected]> wrote: > >> On 4 Nov 2015, at 8:13 pm, Erik Dahlström <[email protected]> >> wrote: >> >> a <view> element defines a view for its parent <svg> element. The <use> >> element is allowed to reference <svg> elements. So, should <use> be >> allowed >> to reference a <view> element? >> >> >> In http://www.w3.org/2015/08/25-svg-minutes.html#item03 we resolved that >> <view> doesn’t define a view for its closest ancestor <svg>, but the >> outer >> <svg>. If we allowed <use> to reference <view>, and if we were >> consistent >> with this decision, it wouldn’t be so useful.