Sha256: 7f588eb3e64040610d02bf72d6611f65ad2b9cb921956510ce9a3e0a7692ed1f

Contents?: true

Size: 700 Bytes

Versions: 3

Compression:

Stored size: 700 Bytes

Contents

"use strict";
const HTMLElementImpl = require("./HTMLElement-impl").implementation;
const whatwgURL = require("whatwg-url");
const fallbackBaseURL = require("../helpers/document-base-url").fallbackBaseURL;

class HTMLBaseElement extends HTMLElementImpl {
  get href() {
    const document = this._ownerDocument;

    const url = this.hasAttribute("href") ? this.getAttribute("href") : "";
    const parsed = whatwgURL.parseURL(url, { baseURL: fallbackBaseURL(document) });

    if (parsed === "failure") {
      return url;
    }

    return whatwgURL.serializeURL(parsed);
  }

  set href(value) {
    this.setAttribute("href", value);
  }
}

module.exports = {
  implementation: HTMLBaseElement
};

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js
lanes-0.8.0 node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js
select_all-rails-0.3.1 node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js