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

Re: setAttributeNS(): should it change the namespace prefix?

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 29 Nov 2011 15:24:07 -0800
Message-ID: <CA+c2ei80fRKWuiAXpc6qzJ1-=w65pcUQiqMrPqbSib-K5M8UGA@mail.gmail.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: "www-dom@w3.org" <www-dom@w3.org>
On Tuesday, November 29, 2011, Anne van Kesteren <annevk@opera.com> wrote:
> document.head.setAttributeNS("test", "x:a", "a")
> document.head.setAttributeNS("test", "e:a", "b")
>
> Should the result be an attribute "x:a" or "e:a"? Gecko says "e:a",
Opera/Webkit say "x:a". Making the prefix member of an attribute completely
immutable seems somewhat preferable to me. Opinions?

This is somewhat off-topic, but I'm actually hoping that we can get rid of
namespaced attributes. They create a lot of silly performance issues (even
if you never ever use namespaced attributes or
setAttributeNS/getAttributeNS) and implementation complexity. Not to
mention that people very often misunderstand how they work and think that
prefix-less attributes belong to the same namespace as the owner element or
use the default (prefixless-xmlns declared) namespace.

There's a very good chance that this doesn't work, but it seems worth
trying. It would be a very nice simplification in Gecko, and would
measurably improve the speed of setAttribute.

/ Jonas
Received on Tuesday, 29 November 2011 23:25:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT