Skip to content

Commit e5b0aaf

Browse files
committed
Use qualifiedName rather than name
Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=28109.
1 parent 9202ada commit e5b0aaf

File tree

2 files changed

+192
-175
lines changed

2 files changed

+192
-175
lines changed

dom.bs

Lines changed: 82 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ method, when invoked, must run these steps:
10411041
<p>The
10421042
<dfn method for=EventTarget><code>removeEventListener(<var>type</var>, <var>callback</var>, <var>capture</var>)</code></dfn>
10431043
method, when invoked, must, if there is an <a>event listener</a> in the associated list of
1044-
<a>event listeners</a> whose <b>type</b> is <var>name</var>, <b>callback</b> is <var>callback</var>,
1044+
<a>event listeners</a> whose <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>,
10451045
and <b>capture</b> is <var>capture</var>, set that <a>event listener</a>'s <b>removed flag</b> and
10461046
remove it from the associated list of <a>event listeners</a>.
10471047

@@ -3963,7 +3963,7 @@ interface Document : Node {
39633963
Node adoptNode(Node node);
39643964

39653965
[NewObject] Attr createAttribute(DOMString localName);
3966-
[NewObject] Attr createAttributeNS(DOMString? namespace, DOMString name);
3966+
[NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName);
39673967

39683968
[NewObject] Event createEvent(DOMString interface);
39693969

@@ -4623,14 +4623,15 @@ method, when invoked, must run these steps:
46234623
</ol>
46244624

46254625
The
4626-
<dfn method for="Document">createAttributeNS(<var>namespace</var>, <var>name</var>)</dfn>
4626+
<dfn method for="Document"><code>createAttributeNS(<var>namespace</var>, <var>qualifiedName</var>)</code></dfn>
46274627
method, when invoked, must run these steps:
46284628

46294629
<ol>
4630-
<li>Let <var>namespace</var>, <var>prefix</var>, and <var>localName</var> be the result of passing
4631-
<var>namespace</var> and <var>name</var> to <a>validate and extract</a>. Rethrow any exceptions.
4630+
<li><p>Let <var>namespace</var>, <var>prefix</var>, and <var>localName</var> be the result of
4631+
passing <var>namespace</var> and <var>qualifiedName</var> to <a>validate and extract</a>. Rethrow
4632+
any exceptions.
46324633

4633-
<li>Return a new <a>attribute</a> whose <a for=Attr>namespace</a> is <var>namespace</var>,
4634+
<li><p>Return a new <a>attribute</a> whose <a for=Attr>namespace</a> is <var>namespace</var>,
46344635
<a for=Attr>namespace prefix</a> is <var>prefix</var>, and <a for=Attr>local name</a> is
46354636
<var>localName</var>.
46364637
</ol>
@@ -5020,16 +5021,16 @@ interface Element : Node {
50205021
boolean hasAttributes();
50215022
[SameObject] readonly attribute NamedNodeMap attributes;
50225023
sequence&lt;DOMString> getAttributeNames();
5023-
DOMString? getAttribute(DOMString name);
5024+
DOMString? getAttribute(DOMString qualifiedName);
50245025
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
5025-
void setAttribute(DOMString name, DOMString value);
5026-
void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
5027-
void removeAttribute(DOMString name);
5026+
void setAttribute(DOMString qualifiedName, DOMString value);
5027+
void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value);
5028+
void removeAttribute(DOMString qualifiedName);
50285029
void removeAttributeNS(DOMString? namespace, DOMString localName);
5029-
boolean hasAttribute(DOMString name);
5030+
boolean hasAttribute(DOMString qualifiedName);
50305031
boolean hasAttributeNS(DOMString? namespace, DOMString localName);
50315032

5032-
Attr? getAttributeNode(DOMString name);
5033+
Attr? getAttributeNode(DOMString qualifiedName);
50335034
Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
50345035
Attr? setAttributeNode(Attr attr);
50355036
Attr? setAttributeNodeNS(Attr attr);
@@ -5146,23 +5147,21 @@ run these steps:
51465147

51475148
<hr>
51485149

5149-
To <dfn export id=concept-element-attributes-get-by-name>get an attribute by name</dfn>
5150-
given a <var>name</var> and <a for="/">element</a>
5151-
<var>element</var>, run these steps:
5150+
To <dfn export id=concept-element-attributes-get-by-name>get an attribute by name</dfn> given a
5151+
<var>qualifiedName</var> and <a for="/">element</a> <var>element</var>, run these steps:
51525152

51535153
<ol>
5154-
<li>If <var>element</var> is in the <a>HTML namespace</a> and its
5155-
<a>node document</a> is an
5156-
<a>HTML document</a>, let <var>name</var> be
5157-
<a>converted to ASCII lowercase</a>.
5154+
<li><p>If <var>element</var> is in the <a>HTML namespace</a> and its <a>node document</a> is an
5155+
<a>HTML document</a>, let <var>qualifiedName</var> be <a>converted to ASCII lowercase</a>.
51585156

5159-
<li>Return the first <a>attribute</a> in <var>element</var>'s <a for=Element>attribute list</a>
5160-
whose <a for=Attr>qualified name</a> is <var>name</var>, and null otherwise.
5157+
<li><p>Return the first <a>attribute</a> in <var>element</var>'s <a for=Element>attribute list</a>
5158+
whose <a for=Attr>qualified name</a> is <var>qualifiedName</var>, and null otherwise.
51615159
</ol>
51625160

5163-
To <dfn export id=concept-element-attributes-get-by-namespace>get an attribute by namespace and local name</dfn>
5164-
given a <var>namespace</var>, <var>localName</var>, and
5165-
<a for="/">element</a> <var>element</var>, run these steps:
5161+
To
5162+
<dfn export id=concept-element-attributes-get-by-namespace>get an attribute by namespace and local name</dfn>
5163+
given a <var>namespace</var>, <var>localName</var>, and <a for="/">element</a> <var>element</var>,
5164+
run these steps:
51665165

51675166
<ol>
51685167
<li>If <var>namespace</var> is the empty string, set it to null.
@@ -5229,19 +5228,17 @@ using a <var>localName</var> and <var>value</var>, and an optional <var>prefix</
52295228

52305229
To
52315230
<dfn export id=concept-element-attributes-remove-by-name>remove an attribute by name</dfn>
5232-
given a <var>name</var> and <a for="/">element</a>
5233-
<var>element</var>, run these steps:
5231+
given a <var>qualifiedName</var> and <a for="/">element</a> <var>element</var>, run these steps:
52345232

52355233
<ol>
5236-
<li>Let <var>attr</var> be the result of
5234+
<li><p>Let <var>attr</var> be the result of
52375235
<a lt="get an attribute by name">getting an attribute</a> given
5238-
<var>name</var> and <var>element</var>.
5236+
<var>qualifiedName</var> and <var>element</var>.
52395237

5240-
<li>If <var>attr</var> is non-null,
5241-
<a lt="remove an attribute">remove</a> it from
5238+
<li><p>If <var>attr</var> is non-null, <a lt="remove an attribute">remove</a> it from
52425239
<var>element</var>.
52435240

5244-
<li>Return <var>attr</var>.
5241+
<li><p>Return <var>attr</var>.
52455242
</ol>
52465243

52475244
To
@@ -5425,15 +5422,17 @@ the <a for=Attr>qualified names</a> of the <a>attributes</a> in the <a>context o
54255422
<p class=note>These are not guaranteed to be unique.<!-- A theoretical getAttributeNamesNS() could
54265423
return an array of unique two-value-arrays. -->
54275424

5428-
The <dfn method for="Element">getAttribute(<var>name</var>)</dfn> method must run these steps:
5425+
The <dfn method for="Element"><code>getAttribute(<var>qualifiedName</var>)</code></dfn> method, when
5426+
invoked, must run these steps:
5427+
54295428
<ol>
5430-
<li>Let <var>attr</var> be the result of
5431-
<a lt="get an attribute by name">getting an attribute</a> given
5432-
<var>name</var> and the <a>context object</a>.
5429+
<li><p>Let <var>attr</var> be the result of
5430+
<a lt="get an attribute by name">getting an attribute</a> given <var>qualifiedName</var> and the
5431+
<a>context object</a>.
54335432

5434-
<li>If <var>attr</var> is null, return null.
5433+
<li><p>If <var>attr</var> is null, return null.
54355434

5436-
<li>Return <var>attr</var>'s <a for=Attr>value</a>.
5435+
<li><p>Return <var>attr</var>'s <a for=Attr>value</a>.
54375436
</ol>
54385437

54395438
The
@@ -5451,57 +5450,48 @@ method must run the following steps:
54515450
<li>Return <var>attr</var>'s <a for=Attr>value</a>.
54525451
</ol>
54535452

5454-
The <dfn method for="Element"><code>setAttribute(<var>name</var>, <var>value</var>)</code></dfn>
5455-
method must run these steps:
5453+
The
5454+
<dfn method for="Element"><code>setAttribute(<var>qualifiedName</var>, <var>value</var>)</code></dfn>
5455+
method, when invoked, must run these steps:
54565456

54575457
<ol>
5458-
<li>If <var>name</var> does not match the
5459-
<code><a type>Name</a></code> production in XML,
5460-
<a>throw</a> an
5461-
{{InvalidCharacterError}} exception.
5458+
<li><p>If <var>qualifiedName</var> does not match the <code><a type>Name</a></code> production in
5459+
XML, <a>throw</a> an {{InvalidCharacterError}} exception.
54625460

5463-
<li>If the <a>context object</a> is in the <a>HTML namespace</a> and its
5464-
<a>node document</a> is an <a>HTML document</a>, let <var>name</var> be
5465-
<a>converted to ASCII lowercase</a>.
5461+
<li><p>If the <a>context object</a> is in the <a>HTML namespace</a> and its <a>node document</a> is
5462+
an <a>HTML document</a>, let <var>qualifiedName</var> be <a>converted to ASCII lowercase</a>.
54665463

5467-
<li>Let <var>attribute</var> be the first <a>attribute</a> in <a>context object</a>'s
5468-
<a for=Element>attribute list</a> whose <a for=Attr>qualified name</a> is <var>name</var>, and null
5469-
otherwise.
5464+
<li><p>Let <var>attribute</var> be the first <a>attribute</a> in <a>context object</a>'s
5465+
<a for=Element>attribute list</a> whose <a for=Attr>qualified name</a> is <var>qualifiedName</var>,
5466+
and null otherwise.
54705467
<!-- This is step 2 of "get an attribute by name", modified as appropriate -->
54715468

5472-
<li>If <var>attribute</var> is null, create an
5473-
<a>attribute</a> whose
5474-
<a for="Attr">local name</a> is <var>name</var> and
5475-
<a for=Attr>value</a> is <var>value</var>,
5476-
<a lt="append an attribute">append</a> this
5477-
<a>attribute</a> to the <a>context object</a>'s
5478-
<a for=Element>attribute list</a>, and then terminate these
5479-
steps.
5469+
<li><p>If <var>attribute</var> is null, create an <a>attribute</a> whose
5470+
<a for="Attr">local name</a> is <var>qualifiedName</var> and <a for=Attr>value</a> is
5471+
<var>value</var>, <a lt="append an attribute">append</a> this <a>attribute</a> to the
5472+
<a>context object</a>'s <a for=Element>attribute list</a>, and then terminate these steps.
54805473

5481-
<li><a lt="change an attribute">Change</a>
5482-
<var>attribute</var> from <a>context object</a> to
5474+
<li><p><a lt="change an attribute">Change</a> <var>attribute</var> from <a>context object</a> to
54835475
<var>value</var>.
54845476
</ol>
54855477

54865478
The
5487-
<dfn method for="Element">setAttributeNS(<var>namespace</var>, <var>name</var>, <var>value</var>)</dfn>
5488-
method must run these steps:
5479+
<dfn method for="Element"><code>setAttributeNS(<var>namespace</var>, <var>qualifiedName</var>, <var>value</var>)</code></dfn>
5480+
method, when invoked, must run these steps:
54895481

54905482
<ol>
5491-
<li>Let <var>namespace</var>, <var>prefix</var>, and <var>localName</var> be the result of passing
5492-
<var>namespace</var> and <var>name</var> to <a>validate and extract</a>. Rethrow any exceptions.
5483+
<li><p>Let <var>namespace</var>, <var>prefix</var>, and <var>localName</var> be the result of
5484+
passing <var>namespace</var> and <var>qualifiedName</var> to <a>validate and extract</a>. Rethrow
5485+
any exceptions.
54935486

5494-
<li><a>Set an attribute value</a>
5495-
for the <a>context object</a> using
5496-
<var>localName</var>, <var>value</var>, and also
5497-
<var>prefix</var> and <var>namespace</var>.
5487+
<li><p><a>Set an attribute value</a> for the <a>context object</a> using <var>localName</var>,
5488+
<var>value</var>, and also <var>prefix</var> and <var>namespace</var>.
54985489
</ol>
54995490

55005491
The
5501-
<dfn method for="Element">removeAttribute(<var>name</var>)</dfn>
5502-
method must
5503-
<a lt="remove an attribute by name">remove an attribute</a> given
5504-
<var>name</var> and the <a>context object</a>, and then return undefined.
5492+
<dfn method for="Element"><code>removeAttribute(<var>qualifiedName</var>)</code></dfn>
5493+
method, when invoked, must <a lt="remove an attribute by name">remove an attribute</a> given
5494+
<var>qualifiedName</var> and the <a>context object</a>, and then return undefined.
55055495

55065496
The
55075497
<dfn method for="Element">removeAttributeNS(<var>namespace</var>, <var>localName</var>)</dfn>
@@ -5510,20 +5500,21 @@ method must
55105500
given <var>namespace</var>, <var>localName</var>, and the
55115501
<a>context object</a>, and then return undefined.
55125502

5513-
<p>The <dfn method for="Element"><code>hasAttribute(<var>name</var>)</code></dfn> method, when
5514-
invoked, must run these steps:
5503+
<p>The <dfn method for="Element"><code>hasAttribute(<var>qualifiedName</var>)</code></dfn> method,
5504+
when invoked, must run these steps:
55155505

55165506
<ol>
55175507
<li><p>If the <a>context object</a> is in the <a>HTML namespace</a> and its <a>node document</a> is
5518-
an <a>HTML document</a>, let <var>name</var> be <a>converted to ASCII lowercase</a>.
5508+
an <a>HTML document</a>, let <var>qualifiedName</var> be <a>converted to ASCII lowercase</a>.
55195509

55205510
<li><p>Return true if the <a>context object</a> <a lt="has an attribute">has</a> an
5521-
<a>attribute</a> whose <a for=Attr>qualified name</a> is <var>name</var>, and false otherwise.
5511+
<a>attribute</a> whose <a for=Attr>qualified name</a> is <var>qualifiedName</var>, and false
5512+
otherwise.
55225513
</ol>
55235514

55245515
The
5525-
<dfn method for="Element">hasAttributeNS(<var>namespace</var>, <var>localName</var>)</dfn>
5526-
method must run these steps:
5516+
<dfn method for="Element"><code>hasAttributeNS(<var>namespace</var>, <var>localName</var>)</code></dfn>
5517+
method, when invoked, must run these steps:
55275518

55285519
<ol>
55295520
<li>If <var>namespace</var> is the empty string, set it to null.
@@ -5539,13 +5530,13 @@ method must run these steps:
55395530
<hr>
55405531

55415532
The
5542-
<dfn method for="Element">getAttributeNode(<var>name</var>)</dfn>
5533+
<dfn method for="Element"><code>getAttributeNode(<var>qualifiedName</var>)</code></dfn>
55435534
method, when invoked, must return the result of
55445535
<a lt="get an attribute by name">getting an attribute</a> given
5545-
<var>name</var> and the <a>context object</a>.
5536+
<var>qualifiedName</var> and the <a>context object</a>.
55465537

55475538
The
5548-
<dfn method for="Element">getAttributeNodeNS(<var>namespace</var>, <var>localName</var>)</dfn>
5539+
<dfn method for="Element"><code>getAttributeNodeNS(<var>namespace</var>, <var>localName</var>)</code></dfn>
55495540
method, when invoked, must return the result of
55505541
<a lt="get an attribute by namespace and local name">getting an attribute</a> given
55515542
<var>namespace</var>, <var>localName</var>, and the <a>context object</a>.
@@ -5556,7 +5547,7 @@ invoked, must return the result of <a lt="set an attribute">setting an attribute
55565547
<var>attr</var> and the <a>context object</a>. Rethrow any exceptions.
55575548

55585549
The
5559-
<dfn method for="Element">removeAttributeNode(<var>attr</var>)</dfn>
5550+
<dfn method for="Element"><code>removeAttributeNode(<var>attr</var>)</code></dfn>
55605551
method, when invoked, must run these steps:
55615552

55625553
<ol>
@@ -5656,11 +5647,11 @@ for the <a>context object</a>.
56565647
interface NamedNodeMap {
56575648
readonly attribute unsigned long length;
56585649
getter Attr? item(unsigned long index);
5659-
getter Attr? getNamedItem(DOMString name);
5650+
getter Attr? getNamedItem(DOMString qualifiedName);
56605651
Attr? getNamedItemNS(DOMString? namespace, DOMString localName);
56615652
Attr? setNamedItem(Attr attr);
56625653
Attr? setNamedItemNS(Attr attr);
5663-
Attr removeNamedItem(DOMString name);
5654+
Attr removeNamedItem(DOMString qualifiedName);
56645655
Attr removeNamedItemNS(DOMString? namespace, DOMString localName);
56655656
};
56665657
</pre>
@@ -5705,11 +5696,10 @@ when invoked, must run these steps:
57055696
<a for=Attr>qualified names</a> of the <a>attributes</a> in the
57065697
<a for=NamedNodeMap>attribute list</a>, in order.
57075698

5708-
The
5709-
<dfn method for="NamedNodeMap">getNamedItem(<var>name</var>)</dfn>
5699+
The <dfn method for="NamedNodeMap"><code>getNamedItem(<var>qualifiedName</var>)</code></dfn>
57105700
method, when invoked, must return the result of
5711-
<a lt="get an attribute by name">getting an attribute</a> given
5712-
<var>name</var> and <a for=NamedNodeMap>element</a>.
5701+
<a lt="get an attribute by name">getting an attribute</a> given <var>qualifiedName</var> and
5702+
<a for=NamedNodeMap>element</a>.
57135703

57145704
The
57155705
<dfn method for="NamedNodeMap">getNamedItemNS(<var>namespace</var>, <var>localName</var>)</dfn>
@@ -5722,19 +5712,18 @@ The <dfn method for="NamedNodeMap"><code>setNamedItem(<var>attr</var>)</code></d
57225712
<dfn method for="NamedNodeMap"><code>setNamedItemNS(<var>attr</var>)</code></dfn>
57235713
methods, when invoked, must return the result of <a lt="set an attribute">setting an attribute</a> given <var>attr</var> and <a for=NamedNodeMap>element</a>. Rethrow any exceptions.
57245714

5725-
The
5726-
<dfn method for="NamedNodeMap">removeNamedItem(<var>name</var>)</dfn>
5715+
The <dfn method for="NamedNodeMap"><code>removeNamedItem(<var>qualifiedName</var>)</code></dfn>
57275716
method, when invoked, must run these steps:
57285717

57295718
<ol>
5730-
<li>Let <var>attr</var> be the result of
5719+
<li><p>Let <var>attr</var> be the result of
57315720
<a lt="remove an attribute by name">removing an attribute</a> given
5732-
<var>name</var> and <a for=NamedNodeMap>element</a>.
5721+
<var>qualifiedName</var> and <a for=NamedNodeMap>element</a>.
57335722

5734-
<li>If <var>attr</var> is null, <a>throw</a> a
5723+
<li><p>If <var>attr</var> is null, <a>throw</a> a
57355724
{{NotFoundError}} exception.
57365725

5737-
<li>Return <var>attr</var>.
5726+
<li><p>Return <var>attr</var>.
57385727
</ol>
57395728

57405729
The

0 commit comments

Comments
 (0)