Skip to content

Misalignment between spec and WPT for "validate and extract" #1387

Closed
@shannonbooth

Description

@shannonbooth

What is the issue with the DOM Standard?

WPT has tests such as the following: https://github.com/web-platform-tests/wpt/blob/856c33e87e61f513ddc81e082f78b6d24027e83d/dom/nodes/Document-createElementNS.js#L69

edit: These two tests also run into this issue:

Where qualified name in validate and extract (in this case, ":foo") ends up being something that begins with a colon.

As I understand, this means that when we strictly split that prefix on ":", splitResult[0] ends up being the empty string, and localName is foo.

Therefore when we hit step 5.

  1. If prefix is not a valid namespace prefix, then throw an "InvalidCharacterError" DOMException.

Since prefix is the empty string, a DOMException is thrown as the empty string is not a valid namespace. Sidenote: This step also can result in "null" being passed into the AO which expects a string.

I can get all WPT tests passing if:

  1. If prefix is not a valid namespace prefix, then throw an "InvalidCharacterError" DOMException.

Is changed to:

  1. If prefix non-null and not the empty string and and is not a valid namespace prefix, then throw an "InvalidCharacterError" DOMException.

And:

  1. If prefix is non-null and namespace is null, then throw a "NamespaceError" DOMException.

Is changed to:

  1. If prefix is non-null and prefix is not the empty string and namespace is null, then throw a "NamespaceError" DOMException.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions