This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25098 - Clarifications on "legacy reasons" for namespace URI
Summary: Clarifications on "legacy reasons" for namespace URI
Status: RESOLVED WORKSFORME
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-19 14:20 UTC by Sebastian Müller
Modified: 2014-03-19 20:56 UTC (History)
3 users (show)

See Also:


Attachments

Description Sebastian Müller 2014-03-19 14:20:33 UTC
In the DOM 4 Spec it says here:

http://dom.spec.whatwg.org/#interface-attr

[[
For legacy reasons, attributes also have an associated name, namespace, and namespace prefix.
]]


I understand that "name" and maybe even "namespace prefix" exist for legacy reasons and might not need to be there if not for backwards compatibility.

However I do not understand why "namespace" - (the URI) is mentioned in this sentence, unless you do not want to support namespaced attributes anymore. 

Without the namespace property I don't see any way of iterating over all attributes of an element and finding out which namespace they belong to.

Please clarify whether "namespaces" will not be supported anymore other than for legacy reasons (which would mean that a number of XML documents (e.g. most SVG documents) could not be parsed anymore), or that only the "name" property is there for legacy reasons, because it can be deduced from the other properties.

My suggested alternative wording would be:

"Attributes can have an associated namespace and namespace prefix. For legacy reasons they also have an associated name."
Comment 1 Anne 2014-03-19 14:51:04 UTC
They are supported, they are just not encouraged. New attributes will not be namespaced. SVG barely has namespaced attributes and is looking into replacements for those that are.
Comment 2 Sebastian Müller 2014-03-19 15:30:09 UTC
Re: barely used namespaced attributes in SVG:

I doubt that the "image" element is barely used in SVG and it requires the xlink namespace for the reference to the image.
The same holds true for the "use" element. 

At least one of those two is part of every non-trivial SVG file I have seen for the past years. 
Also I don't see that they are "looking into replacements" for these - at least the w3c SVG 2.0 working draft still uses these namespaced attributes...

Don't forget that modern, complex, corporate single page web apps will have to work with XML that is neither HTML, nor SVG and that the concept of namespaced attributes has been there for *a very long time* and therefore quite a number of XML schemas make use of it, e.g. SOAP and XAML. 

So unless you want to deprecate XML 1.1 I don't see how you can discourage the use of namespaced attributes and thus they should not be marked as *legacy*. Someone is going to use this as an argument to remove it from some proprietary implementation and that would be bad.
Comment 3 Anne 2014-03-19 15:34:08 UTC
Well, XML 1.1 is not even implemented.

And nothing is deprecated. It just says these exist for legacy reasons, which is quite true, because anything new we design will not rely on them.
Comment 4 Sebastian Müller 2014-03-19 16:16:05 UTC
Sorry, that was my fault. I did not mean "XML 1.1", I confused versions with editions and mixed in the XML namespace standard and got all wrong. Apologies for the confusion.

I was referring to the XML standard that defined namespaced attributes, which is valid and used in all of todays SVG, SOAP, XAML, and many XML Schema files. I was under the impression that the DOM API that is discussed is the DOM API that will be used for parsing XML files that have been loaded, e.g. through XMLHttpRequests. And just because "anything new that w3 and whatwg design will not contain namespaced attributes anymore" shouldn't mean that they should not be used in XML documents that are parsed by the browser at all. Or am I misunderstanding something here?

-Thanks - Sebastian
Comment 5 Anne 2014-03-19 16:19:35 UTC
No you're not, it can indeed be used for that. However, again, that is legacy, not something we would have designed this way today.
Comment 6 Tab Atkins Jr. 2014-03-19 20:56:20 UTC
(In reply to Sebastian Müller from comment #2)
> Re: barely used namespaced attributes in SVG:
> 
> I doubt that the "image" element is barely used in SVG and it requires the
> xlink namespace for the reference to the image.
> The same holds true for the "use" element. 
> 
> At least one of those two is part of every non-trivial SVG file I have seen
> for the past years. 
> Also I don't see that they are "looking into replacements" for these - at
> least the w3c SVG 2.0 working draft still uses these namespaced attributes...

SVG2 is planning on dropping all namespaced attributes.  The change hasn't been made yet, but it's been discussed and planned for some time.

(Technically, SVG2 will still accept them, but will also accept attributes in the null namespace, with a consistent rule for how to disambiguate when both are specified.)