Add node modules and compiled JavaScript from main
This commit is contained in:
parent
1021f818b9
commit
feeb5f7b58
7748 changed files with 1825934 additions and 2 deletions
60
node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
generated
vendored
Normal file
60
node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
"use strict";
|
||||
|
||||
const { setAnExistingAttributeValue } = require("../attributes.js");
|
||||
const NodeImpl = require("../nodes/Node-impl.js").implementation;
|
||||
const { ATTRIBUTE_NODE } = require("../node-type.js");
|
||||
|
||||
exports.implementation = class AttrImpl extends NodeImpl {
|
||||
constructor(globalObject, args, privateData) {
|
||||
super(globalObject, args, privateData);
|
||||
|
||||
this._namespace = privateData.namespace !== undefined ? privateData.namespace : null;
|
||||
this._namespacePrefix = privateData.namespacePrefix !== undefined ? privateData.namespacePrefix : null;
|
||||
this._localName = privateData.localName;
|
||||
this._value = privateData.value !== undefined ? privateData.value : "";
|
||||
this._element = privateData.element !== undefined ? privateData.element : null;
|
||||
|
||||
this.nodeType = ATTRIBUTE_NODE;
|
||||
this.specified = true;
|
||||
}
|
||||
|
||||
get namespaceURI() {
|
||||
return this._namespace;
|
||||
}
|
||||
|
||||
get prefix() {
|
||||
return this._namespacePrefix;
|
||||
}
|
||||
|
||||
get localName() {
|
||||
return this._localName;
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this._qualifiedName;
|
||||
}
|
||||
|
||||
get nodeName() {
|
||||
return this._qualifiedName;
|
||||
}
|
||||
|
||||
get value() {
|
||||
return this._value;
|
||||
}
|
||||
set value(value) {
|
||||
setAnExistingAttributeValue(this, value);
|
||||
}
|
||||
|
||||
get ownerElement() {
|
||||
return this._element;
|
||||
}
|
||||
|
||||
get _qualifiedName() {
|
||||
// https://dom.spec.whatwg.org/#concept-attribute-qualified-name
|
||||
if (this._namespacePrefix === null) {
|
||||
return this._localName;
|
||||
}
|
||||
|
||||
return this._namespacePrefix + ":" + this._localName;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue