Skip to content

Conversation

@SimonSapin
Copy link
Contributor

It was removed in 23f06fe, presumably accidentally.

It includes a normative statements that was missing for the ED:

In CSS Namespaces a namespace name consisting of the empty string is taken to represent the null namespace or lack of a namespace.

It was removed in
w3c@23f06fe,
presumably accidentally.

It includes a normative statements that was missing for the ED:

> In CSS Namespaces a namespace name consisting of the empty string
> is taken to represent the null namespace or lack of a namespace.
@SimonSapin
Copy link
Contributor Author

SimonSapin commented May 17, 2017

CC @tabatkins, @bzbarsky

And because I don’t want to throw it away, here is the evidence I gathered this morning to argue for a normative spec change, before I realized the statement I wanted was already in the spec, just not in the ED.

Empty string namespace name/URL v.s. no namespace.

The css-namespaces spec distinguishes these two cases:

https://drafts.csswg.org/css-namespaces/#syntax

All strings—including the empty string and strings representing invalid URIs—are valid namespace names in @namespace declarations.

https://drafts.csswg.org/css-namespaces/#css-qualified-name

The prefix of a qualified name may be omitted to indicate that the name belongs to no namespace, i.e. that the namespace name part of the expanded name has no value.


However, the rest of the platform ensure that it is not possible for an element’s or attribute’s name to have an empty string namespace name, as opposed to no namespace. Any attempt to construct the former results in the latter.

Or, equivalently, the empty namespace name and the lack and namespace can be considered to be the same thing.

https://dom.spec.whatwg.org/#namespaces

To validate and extract a namespace and qualifiedName, run these steps:

  1. If namespace is the empty string, set it to null.
  2. […]

https://dom.spec.whatwg.org/#locate-a-namespace

[…] an attribute whose namespace is the XMLNS namespace, namespace prefix is null, and local name is "xmlns", then return its value if it is not the empty string, and null otherwise.

https://www.w3.org/TR/REC-xml-names/#iri-use

The empty string, though it is a legal URI reference, cannot be used as a namespace name.

https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl

Namespace constraint: No Prefix Undeclaring
In a namespace declaration for a prefix (i.e., where the NSAttName is a PrefixedAttName), the attribute value MUST NOT be empty.

https://www.w3.org/TR/REC-xml-names/#defaulting

The attribute value in a default namespace declaration MAY be empty. This has the same effect, within the scope of the declaration, of there being no default namespace.


These tests pass in all of Firefox, Chromium, Safari, and Edge:

(They are served with a Content-Type: application/xml HTTP response header, so they’re parsed with the XML parser rather than the HTML parser.)

@gsnedders gsnedders added the css-namespaces-3 Current Work label May 25, 2017
@gsnedders gsnedders requested a review from fantasai May 25, 2017 09:44
@fantasai fantasai merged commit 3bbd997 into w3c:master May 31, 2017
@SimonSapin SimonSapin deleted the namespaces-terminology branch May 31, 2017 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

css-namespaces-3 Current Work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants