W3C home > Mailing lists > Public > www-svg@w3.org > February 2006

Re: SVGT 1.2: <use> and <foreignObject>

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 21 Feb 2006 11:14:48 +1100
To: www-svg@w3.org
Message-ID: <20060221001448.GB2037@port.mcc.id.au>

Hi Jon.

Jon Ferraiolo:
> Regarding the complexities of svg:use with non-SVG content, based on
> your list below, it sounds as if we need to include a warning in the SVG
> spec about attempting to have an svg:use reference a subtree which
> includes any svg:foreignObject elements (or when XBL kicks in, a shadow
> tree with svg:foreignObject), saying that some of the processing model
> for svg:use might not be possible, such as when an svg:foreignObject
> references a browser plugin or native controls.

I have a related question regarding externally reference documents.
Consider this example:

  <svg xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2">
    <animation width="100" height="100" xlink:href="anim.svg"/>
    <animation x="100" width="100" height="100" xlink:href="anim.svg"
               begin="5s"/>
  </svg>

Since the two links to the same IRI will be to the same instance of the
document, the two animations should be synchronised, correct?  So when
the second instance of the animation begins, it will be synced 5s in to
the animation so that it renders the same as the first animation?

I would like to know what happens if all references to a document are
removed and then one is re-added.  For example:

  <svg xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink"
       xmlns:ev="http://www.w3.org/2001/xml-events" version="1.2">

    <script type="application/ecmascript">
      var a;
    </script>

    <animation id="a" width="100" height="100" xlink:href="anim.svg"/>

    <set attributeName="display" to="inline" begin="5s">
      <handler ev:event="begin">
        // At 5s, remove the animation element.
        a = document.getElementById('a');
        a.parentNode.removeChild(a);
      </handler>
    </set>

    <set attributeName="display" to="inline" begin="10s">
      <handler ev:event="begin">
        // At 10s, re-insert the animation element.
        document.documentElement.appendChild(a);
      </handler>
    </set>
  </svg>

After t = 5s, there will be no more references to the anim.svg document.
When the animation element is reinserted into the document, should its
timeline begin again at 0s, as if it were the first time it was being
referenced?  Can the UA discard the in-memory document between 5s and
10s to conserve memory, or is it required to keep it until the primary
document ends?  If it is required to do this, a running document that
references many resource documents (even if there is only one referenced
at a time) will effectively leak memory.  In this case, perhaps the
'discard' element could be modified so that it can reference a whole
resource document.  I am not sure what the behaviour should be if a
resource document that is still referenced is discarded, though.

Thanks,

Cameron

-- 
 Cameron McCormack			ICQ: 26955922
 cam (at) mcc.id.au			MSN: cam (at) mcc.id.au
 http://mcc.id.au/			JBR: heycam (at) jabber.org
Received on Tuesday, 21 February 2006 00:15:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:53 UTC