Skip to content

Commit

Permalink
Use a single exception for name validation (follow up)
Browse files Browse the repository at this point in the history
This addresses two cases overlooked by 61f40b0:

* The QName production is a strict subset of the Name production.  To
  avoid confusion, drop "or Name" from the definition of "validate
  a qualifiedName".

* The non-normative "for web developers" text for `createElementNS`
  was not updated by the original commit.

Fixes: whatwg#671
  • Loading branch information
cscott committed Aug 8, 2018
1 parent 28cdb47 commit 7ad34f3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ added.

<p>To <dfn export>validate</dfn> a <var>qualifiedName</var>, <a>throw</a> an
"{{InvalidCharacterError!!exception}}" {{DOMException}} if <var>qualifiedName</var> does not match
the <code><a type>Name</a></code> or <code><a type>QName</a></code> production.
the <code><a type>QName</a></code> production.

To <dfn export>validate and extract</dfn> a <var>namespace</var> and <var>qualifiedName</var>,
run these steps:
Expand Down Expand Up @@ -5021,15 +5021,13 @@ for the <a>context object</a>.
<var>qualifiedName</var> or null. Its <a for=Element>local name</a> will be everything after
"<code>:</code>" (U+003E) in <var>qualifiedName</var> or <var>qualifiedName</var>.

<p>If <var>localName</var> does not match the <code><a type>Name</a></code> production an
<p>If <var>qualifiedName</var> does not match the <code><a type>QName</a></code> production an
"{{InvalidCharacterError!!exception}}" {{DOMException}} will be thrown.

<p>If one of the following conditions is true a "{{NamespaceError!!exception}}" {{DOMException}}
will be thrown:

<ul>
<li><var>localName</var> does not match the
<code><a type>QName</a></code> production.
<li><a for=Element>Namespace prefix</a>
is not null and <var>namespace</var> is the empty string.
<li><a for=Element>Namespace prefix</a>
Expand Down

0 comments on commit 7ad34f3

Please sign in to comment.