[whatwg] getElementsByClassName()
Jim Ley
jim.ley at gmail.com
Sat Feb 4 15:53:41 PST 2006
On 2/4/06, Lachlan Hunt <lachlan.hunt at lachy.id.au> wrote:
> One issue with a Selector method though, how do we handle namespace
> prefixes? Selectors states that the mechanism for declaring a namespace
> prefix is left up to the language implementing Selectors. If we say the
> script uses the same prefixes declared in the markup using xmlns:foo="",
> then that ties the JS to the document and other documents that use those
> same prefixes.
I think that would be a bad idea, as I think you are, for the same
reason as the QNames in attribute context we've heard so many times
before from me.
> If we say it uses those declared in CSS with @namespace,
> then that ties the script to the CSS. Would we need another method
> called addNamespace(namespaceURI, prefix)?
Off the top of my head I would suggest a namespace handler object that
exists on the object, and if the stylesheet language of the document
is css it's pre-filled with the namespace's from css. This allows us
to have simple use for the CSS case whilst still supporting the
flexibility to add namespaces later. but that's very much off the top
of my head.
Cheers,
Jim.
More information about the whatwg
mailing list