1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-02 20:00:05 +02:00
Files
minifyfromhtml/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js
s2 a4b62da0ba use terser and clean-css directly
create a sourcemap as well by default
2020-02-13 15:39:37 +01:00

28 lines
715 B
JavaScript

"use strict";
const whatwgURL = require("whatwg-url");
const HTMLElementImpl = require("./HTMLElement-impl").implementation;
const { fallbackBaseURL } = require("../helpers/document-base-url");
class HTMLBaseElementImpl extends HTMLElementImpl {
get href() {
const document = this._ownerDocument;
const url = this.hasAttributeNS(null, "href") ? this.getAttributeNS(null, "href") : "";
const parsed = whatwgURL.parseURL(url, { baseURL: fallbackBaseURL(document) });
if (parsed === null) {
return url;
}
return whatwgURL.serializeURL(parsed);
}
set href(value) {
this.setAttributeNS(null, "href", value);
}
}
module.exports = {
implementation: HTMLBaseElementImpl
};