[Bug 23368] New: Clarify that it is permitted to declare the namespace of the xlink: prefix on the <html> element.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23368

            Bug ID: 23368
           Summary: Clarify that it is permitted to declare the namespace
                    of the xlink: prefix on the <html> element.
           Product: HTML WG
           Version: unspecified
          Hardware: PC
               URL: http://www.w3.org/TR/html5/dom.html#global-attributes
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: CR HTML5 spec
          Assignee: robin@w3.org
          Reporter: xn--mlform-iua@xn--mlform-iua.no
        QA Contact: public-html-bugzilla@w3.org
                CC: public-html-admin@w3.org

CURRENTLY: The section on global attributes states:

]] In HTML documents, elements in the HTML namespace may have an xmlns
attribute specified, if, and only if, it has the exact value
"http://www.w3.org/1999/xhtml". This does not apply to XML documents.
 NOTE: In HTML, the xmlns attribute has absolutely no effect. It is basically a
talisman. It is allowed merely to make migration to and from XHTML mildly
easier. When parsed by an HTML parser, the attribute ends up in no namespace,
not the "http://www.w3.org/2000/xmlns/" namespace like namespace declaration
attributes in XML do.
[[
  (http://www.w3.org/TR/html5/dom.html#global-attributes)


PROPOSAL: Add a statement saying roughly this:

]] In HTML documents, elements in the HTML namespace may also have an
xmlns:xlink attribute, if, and only if, it has the exact value
"http://www.w3.org/1999/xlink". Preferrably, it should be declared on the root
element.
 NOTE: Like for the xmlns atteribute, it has no effect in HTML. It is allowed
partly to make migration to and from XHTML midly easier and partly because it
(in the XHTML serialisation) is an author convenience as it frees authors from
having to declare it on each and every foreign content context (svg or math
elements). As the HTML syntax doesn't need it to be delclared at all, the
permission to declare it on the HTML root element makes the authoring similar
for the two syntaxes.
[[


Example:

    <html xmlns:xlink="http://www.w3.org/1999/xlink">

Being allowed to declare the xlink prefix on the root element has the advantage
that it is not necessary to remember to declare it on the root element of the
<svg> or <math> element. It is thus a convenience that simplifies authoring.

The polyglot markup specification already permits this usage, on the assumption
that HTML5 already permits it. But the NU validator does not allow it.

The HTML5 spec says, about the HTML syntax (thus: not about the XHTML syntax):
http://www.w3.org/TR/html5/syntax.html#attributes-0

]]
   [ … snip … ]
   xlink | XMLNS namespace | xmlns:xlink
   No other namespaced attribute can be expressed in the HTML syntax.
[[

The disadvantage of allowing declaration on the root element is that it could
perhaps lead authors to auto insert the declaration even when not needed. Other
than that, I don’t think there are other disadvantages.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 26 September 2013 14:13:49 UTC