NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 967 - xmlns attribute incorrectly accepted with any value
xmlns attribute incorrectly accepted with any value
Status: NEW
Product: Validator.nu
Classification: Unclassified
Component: HTML parser
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-05 23:41 CET by Jukka K. Korpela
Modified: 2013-03-06 02:49 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jukka K. Korpela 2013-03-05 23:41:55 CET
The following passes:

<!DOCTYPE html>
<title></title>
<body xmlns=what?>

It should not, because:

“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".”
  http://www.w3.org/TR/html5/dom.html#global-attributes

It seems that there is no check on the value of the xmlns attribute.
Comment 1 Michael[tm] Smith 2013-03-06 02:49:14 CET
The logic for emitting an error message for this in the htmlparser code:

http://hg.mozilla.org/projects/htmlparser/file/201db4e17f31/src/nu/validator/htmlparser/impl/TreeBuilder.java#l4695

Why that code only seems to get reached for the <html xmlns=foo> case but not for any other elements, I don't know. I'll try to get it figured out unless Henri beats me to it.