santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cantor, Scott" <canto...@osu.edu>
Subject Re: Id Resolution Observations and Suggestions
Date Mon, 09 Jan 2012 17:55:27 GMT
On 1/9/12 11:31 AM, "Colm O hEigeartaigh" <coheigea@apache.org> wrote:
>
>Ok, so if I'm understanding you correctly, the purpose of the tree
>search is to ensure that no two Elements are registered by the same Id
>and so there is no ambiguity about what Document.getElementById()
>returns. But it does not guard against the fact that there could be
>two Elements in the document tree with the exact same Id, where one is
>registered as an Id and the other isn't. Is this correct?

Yes, because it allows the application to know that *it* knows what
getElementById will return to both it and the library. If there are
duplicates, then the result being undefined, you can't assume anything
about what was returned to each part independently. If there are no
duplicates, then you do know, provided nothing changes the DOM in between
in this area.

What this is for (to me) is getting around the lack of reference caching.
If that exists, you don't need it, you just compare the cached reference
node to what you expect. But today, that caching is not widely available
(e.g. not available in the old API, or in C++).

-- Scott


Mime
View raw message