mirror of
https://gitlab.com/octtspacc/sitoctt
synced 2025-06-05 22:09:20 +02:00
.
This commit is contained in:
41
node_modules/@mixmark-io/domino/NamedNodeMap.js
generated
vendored
Normal file
41
node_modules/@mixmark-io/domino/NamedNodeMap.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
module.exports = NamedNodeMap;
|
||||
|
||||
var utils = require('./utils');
|
||||
|
||||
/* This is a hacky implementation of NamedNodeMap, intended primarily to
|
||||
* satisfy clients (like dompurify and the web-platform-tests) which check
|
||||
* to ensure that Node#attributes instanceof NamedNodeMap. */
|
||||
|
||||
function NamedNodeMap(element) {
|
||||
this.element = element;
|
||||
}
|
||||
Object.defineProperties(NamedNodeMap.prototype, {
|
||||
length: { get: utils.shouldOverride },
|
||||
item: { value: utils.shouldOverride },
|
||||
|
||||
getNamedItem: { value: function getNamedItem(qualifiedName) {
|
||||
return this.element.getAttributeNode(qualifiedName);
|
||||
} },
|
||||
getNamedItemNS: { value: function getNamedItemNS(namespace, localName) {
|
||||
return this.element.getAttributeNodeNS(namespace, localName);
|
||||
} },
|
||||
setNamedItem: { value: utils.nyi },
|
||||
setNamedItemNS: { value: utils.nyi },
|
||||
removeNamedItem: { value: function removeNamedItem(qualifiedName) {
|
||||
var attr = this.element.getAttributeNode(qualifiedName);
|
||||
if (attr) {
|
||||
this.element.removeAttribute(qualifiedName);
|
||||
return attr;
|
||||
}
|
||||
utils.NotFoundError();
|
||||
} },
|
||||
removeNamedItemNS: { value: function removeNamedItemNS(ns, lname) {
|
||||
var attr = this.element.getAttributeNodeNS(ns, lname);
|
||||
if (attr) {
|
||||
this.element.removeAttributeNS(ns, lname);
|
||||
return attr;
|
||||
}
|
||||
utils.NotFoundError();
|
||||
} },
|
||||
});
|
Reference in New Issue
Block a user