W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2005

user-determined ID attributes

From: Jorgen Horstink <dom@jorgenhorstink.nl>
Date: Sat, 1 Oct 2005 10:24:34 +0200
Message-ID: <1128155074.433e47c286578@webmail.eatserver.nl>
To: www-dom@w3.org

I am totally new to DOM, so sorry for spamming the mailinglist the past two


"If the parameter isId is true, this method declares the specified attribute to
be a user-determined ID attribute." [1]

"NOT_FOUND_ERR: Raised if the specified node is not an attribute of this
element." [1]

So this basically implies you cannot register an attribute to be an
user-determined ID attribute when it is not set yet.

Element.setIdAttribute('foo', true); // raises an exception
Element.setAttribute('foo', 'bar');
Document.getElementById('foo'); // won't work

Secondly it implies one can register multiple user-determined ID attributes to
an element. How should a browser vendor implement Docuement.getElementById?
Lookup table are necessary. So then I thought, why is there no getIdAttributes
method on the Element interface? Returning a NodeList of attributes with isId
set true (attributes are notes after all, right?).

I'd extend the IDL Definition:

interface Element : Node {


  NodeList getIdAttributes();

silly idea or not?


Received on Saturday, 1 October 2005 08:24:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:12 UTC