Re: Resolving URIs in shadow trees

At 06:35 AM 8/2/2005, Boris Zbarsky wrote:
>Jon Ferraiolo wrote:
>>Maybe the rules is that first you call getElementById() on the 
>><shadowTree> and then if no match is found then call it on ownerDocument. 
>>What do you think?
>
>Hmm... Under what circumstances would these two calls ever give different 
>results, given the uniqueness requirements on IDs?

Here is the interesting case. Suppose your <xbl:template> includes an 
<svg:linearGradient id="foo"> element which is referenced by another 
element within the template, such as <rect fill="url(#foo)".../>. When the 
binding occurs, the template gets cloned. If there are two bound elements 
using this binding, then the template will be cloned twice, and the two 
shadow trees will have the same ownerDocument.

What do we want to do about this possibility? Do we want to say it is an 
error? If it is an error, do we want to require user agents to go into 
error mode in some sort of spectacular manner? Or treat it as an error, but 
require user agents to how to handle this error condition in a standard manner?

 From a developer convenience perspective, why not loosen the rules and say 
that ID uniqueness is only necessary within each individual document tree 
and each individual shadow tree? That's what makes sense to me.

Jon


>-Boris

Received on Tuesday, 2 August 2005 14:23:31 UTC