Skip to content

Commit

Permalink
👽️ Finally upgrade NWSAPI from v2.2.0 to v2.2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Aug 12, 2024
1 parent d73f723 commit 4af12e9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Add `CustomElement.defineStateVariable(name, config)` static method
* Add `CustomElement#setState(name, value)` and `CustomElement#getState(name)` methods
* Make *template slots* behave more like vanilla custom element slots
* Finally upgrade NWSAPI from v2.2.0 to v2.2.12

## 2.3.19 (2024-04-13)

Expand Down
1 change: 1 addition & 0 deletions lib/core/hawkejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ Main.setMethod(function createElement(name, xml) {
result._l_tag_name = name;
result.nodeName = uname;
result.tagName = uname;
result.localName = name.toLowerCase();
}
}

Expand Down
23 changes: 23 additions & 0 deletions lib/dom/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,29 @@ function isDataString(str) {
return str[0] == 'd' && str[1] == 'a' && str[2] == 't' && str[3] == 'a' && str[4] == '-';
}

/**
* Refer NS methods to their regular counterparts
*
* @author Jelle De Loecker <[email protected]>
* @since 2.4.0
* @version 2.4.0
*/
function setNSStubs(...names) {
for (let name of names) {
Element.setMethod(name + 'NS', function(ns, ...args) {
return this[name](...args);
});
}
}

setNSStubs(
'getElementsByTagName',
'hasAttribute',
'getAttribute',
'setAttribute',
'removeAttribute'
);

/**
* Elements are node type 1
*
Expand Down
1 change: 1 addition & 0 deletions lib/element/custom_element.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ Element.constitute(function registerElement() {
this.setProperty('nodeName', tag_name);
this.setProperty('tagName', upper_tag);
this.setProperty('_l_node_name', lower_name);
this.setProperty('localName', lower_name);
this.setProperty('_l_tag_name', upper_tag.toLowerCase());

if (Blast.isNode) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"main": "./lib/init.js",
"repository": "[email protected]:11ways/hawkejs.git",
"dependencies": {
"nwsapi" : "2.2.0",
"nwsapi" : "2.2.12",
"protoblast" : "~0.9.3"
},
"devDependencies": {
Expand Down

0 comments on commit 4af12e9

Please sign in to comment.