This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Some valid html attributes have namespaces: http://www.w3.org/html/wg/drafts/html/master/single-page.html#attributes-0 Because the attributeChanged callback does not specify the attribute's namespace, it's not possible to differentiate the following: xuse.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'foo') or xuse.setAttribute('xlink:href', 'foo') and xuse.setAttribute('href', 'foo') One way to fix this may be to just add an optional 4th argument to the attributeChanged callback for the namespace if it is not html.
(In reply to Philip Rogers from comment #0) > One way to fix this may be to just add an optional 4th argument to the > attributeChanged callback for the namespace if it is not html. If it's not null; xuse.setAttribute("href", "foo") sets the "href" attribute in the null namespace.
Note that SVG is dropping all of its extra namespaces in SVG2, so we can likely just ignore this.
(In reply to Tab Atkins Jr. from comment #2) > Note that SVG is dropping all of its extra namespaces in SVG2, so we can > likely just ignore this. I would <3 that. Philip?
(In reply to Dimitri Glazkov from comment #3) > (In reply to Tab Atkins Jr. from comment #2) > > Note that SVG is dropping all of its extra namespaces in SVG2, so we can > > likely just ignore this. > > I would <3 that. Philip? I would <3 that too. I've suggested this to the SVG2 WG at http://lists.w3.org/Archives/Public/www-svg/2014Jan/0018.html
Should this callback not be aligned with mutation observers? We decided to allow for namespaces explicitly there.
(In reply to Anne from comment #5) > Should this callback not be aligned with mutation observers? We decided to > allow for namespaces explicitly there. I guess this depends on whether we want to keep truly namespaced attributes in HTML, or deprecate them.
Well, unless we are removing setAttributeNS(), we'll have to deal somehow. But I guess I could see us not supporting that for custom elements.
(In reply to Anne from comment #7) > Well, unless we are removing setAttributeNS(), we'll have to deal somehow. > But I guess I could see us not supporting that for custom elements. Here's one idea: https://github.com/dglazkov/webcomponents/pull/2 WDYT?
It's close, but you actually want to queue for attribute's local name and namespace, not it's name and namespace. That would align with what we do for mutation observers and is the actual data you need to deal with namespaced attributes properly.
(In reply to Anne from comment #9) > It's close, but you actually want to queue for attribute's local name and > namespace, not it's name and namespace. That would align with what we do for > mutation observers and is the actual data you need to deal with namespaced > attributes properly. https://github.com/w3c/webcomponents/pull/13 ?
Seems this was fixed, no?
Moved to https://github.com/w3c/webcomponents/issues/168