Sha256: 96f0f31e8b9ec5ae2717cfd9407cdf297585350b971c9c561fce2d3f5ca26851

Contents?: true

Size: 1.48 KB

Versions: 46

Compression:

Stored size: 1.48 KB

Contents

"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;
  }
};

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
clapton-0.0.6 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
clapton-0.0.5 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
clapton-0.0.4 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
clapton-0.0.3 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
clapton-0.0.2 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
clapton-0.0.1 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.72.2 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.72.1 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.72.0 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.71.0 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.70.2 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.70.1 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.70.0 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.69.0 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.68.2 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.68.1 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.68.0 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.67.1 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.67.0 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js
appmap-0.66.2 ./node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js