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
Once you have thrown for all QName cases, you can no longer throw for Name cases. Tested as part of #423.

Also cleanup createElementNS()'s domintro.

Fixes #671 and closes #675.
  • Loading branch information
annevk authored Jan 27, 2021
1 parent 816bbfb commit c80cbf5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,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 @@ -5049,15 +5049,13 @@ for <a>this</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 Expand Up @@ -9992,6 +9990,7 @@ Brandon Payton,
Brandon Slade,
Brandon Wallace,
Brian Kardell,
C. Scott Ananian,
Cameron McCormack,
Chris Dumez,
Chris Paris,
Expand Down

0 comments on commit c80cbf5

Please sign in to comment.