Skip to content

Commit

Permalink
Fix attribute local name (#230)
Browse files Browse the repository at this point in the history
Co-authored-by: Sampo Kivistö <[email protected]>
  • Loading branch information
Havunen and Havunen committed Oct 22, 2023
1 parent be5b87c commit 61610da
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cjs/interface/attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const QUOTE = /"/g;
*/
class Attr extends Node {
constructor(ownerDocument, name, value = '') {
super(ownerDocument, '#attribute', ATTRIBUTE_NODE);
super(ownerDocument, name, ATTRIBUTE_NODE);
this.ownerElement = null;
this.name = String(name);
this[VALUE] = String(value);
Expand Down
2 changes: 1 addition & 1 deletion esm/interface/attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const QUOTE = /"/g;
*/
export class Attr extends Node {
constructor(ownerDocument, name, value = '') {
super(ownerDocument, '#attribute', ATTRIBUTE_NODE);
super(ownerDocument, name, ATTRIBUTE_NODE);
this.ownerElement = null;
this.name = String(name);
this[VALUE] = String(value);
Expand Down
2 changes: 2 additions & 0 deletions test/html/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ node.firstElementChild.insertAdjacentText('afterend', '<OK>');
assert(node.toString(), '<div>beforebegin<p>afterbegin!beforeend</p>&lt;OK&gt;afterend</div>', 'insertAdjacentText works');

node.setAttribute('a', '1');
assert(node.attributes[0].name, 'a')
assert(node.attributes[0].localName, 'a')
node.setAttribute('b', '2');
node.removeAttributeNode(node.attributes[1]);

Expand Down
2 changes: 1 addition & 1 deletion worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4441,7 +4441,7 @@ const QUOTE = /"/g;
*/
let Attr$1 = class Attr extends Node$1 {
constructor(ownerDocument, name, value = '') {
super(ownerDocument, '#attribute', ATTRIBUTE_NODE);
super(ownerDocument, name, ATTRIBUTE_NODE);
this.ownerElement = null;
this.name = $String(name);
this[VALUE] = $String(value);
Expand Down

0 comments on commit 61610da

Please sign in to comment.