1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10:04 +02:00

update node modules

This commit is contained in:
s2
2019-03-29 15:56:41 +01:00
parent f114871153
commit 89c32fb4e6
8347 changed files with 390123 additions and 159877 deletions

152
node_modules/jsdom/lib/api.js generated vendored
View File

@@ -3,7 +3,6 @@ const path = require("path");
const fs = require("pn/fs");
const vm = require("vm");
const toughCookie = require("tough-cookie");
const request = require("request-promise-native");
const sniffHTMLEncoding = require("html-encoding-sniffer");
const whatwgURL = require("whatwg-url");
const whatwgEncoding = require("whatwg-encoding");
@@ -12,13 +11,9 @@ const MIMEType = require("whatwg-mimetype");
const idlUtils = require("./jsdom/living/generated/utils.js");
const VirtualConsole = require("./jsdom/virtual-console.js");
const Window = require("./jsdom/browser/Window.js");
const { domToHtml } = require("./jsdom/browser/domtohtml.js");
const { applyDocumentFeatures } = require("./jsdom/browser/documentfeatures.js");
const { wrapCookieJarForRequest } = require("./jsdom/browser/resource-loader.js");
const { version: packageVersion } = require("../package.json");
const DEFAULT_USER_AGENT = `Mozilla/5.0 (${process.platform}) AppleWebKit/537.36 (KHTML, like Gecko) ` +
`jsdom/${packageVersion}`;
const { fragmentSerialization } = require("./jsdom/living/domparsing/serialization.js");
const ResourceLoader = require("./jsdom/browser/resources/resource-loader.js");
const NoOpResourceLoader = require("./jsdom/browser/resources/no-op-resource-loader.js");
// This symbol allows us to smuggle a non-public option through to the JSDOM constructor, for use by JSDOM.fromURL.
const transportLayerEncodingLabelHiddenOption = Symbol("transportLayerEncodingLabel");
@@ -35,31 +30,14 @@ let sharedFragmentDocument = null;
class JSDOM {
constructor(input, options = {}) {
const { html, encoding } = normalizeHTML(input, options[transportLayerEncodingLabelHiddenOption]);
options = transformOptions(options, encoding);
const mimeType = new MIMEType(options.contentType === undefined ? "text/html" : options.contentType);
const { html, encoding } = normalizeHTML(input, options[transportLayerEncodingLabelHiddenOption], mimeType);
options = transformOptions(options, encoding, mimeType);
this[window] = new Window(options.windowOptions);
// TODO NEWAPI: the whole "features" infrastructure is horrible and should be re-built. When we switch to newapi
// wholesale, or perhaps before, we should re-do it. For now, just adapt the new, nice, public API into the old,
// ugly, internal API.
const features = {
FetchExternalResources: [],
SkipExternalResources: false
};
if (options.resources === "usable") {
features.FetchExternalResources = ["link", "img", "frame", "iframe"];
if (options.windowOptions.runScripts === "dangerously") {
features.FetchExternalResources.push("script");
}
// Note that "img" will be ignored by the code in HTMLImageElement-impl.js if canvas is not installed.
// TODO NEWAPI: clean that up and centralize the logic here.
}
const documentImpl = idlUtils.implForWrapper(this[window]._document);
applyDocumentFeatures(documentImpl, features);
options.beforeParse(this[window]._globalProxy);
@@ -84,24 +62,24 @@ class JSDOM {
}
serialize() {
return domToHtml([idlUtils.implForWrapper(this[window]._document)]);
return fragmentSerialization(idlUtils.implForWrapper(this[window]._document), { requireWellFormed: false });
}
nodeLocation(node) {
if (!idlUtils.implForWrapper(this[window]._document)._parseOptions.locationInfo) {
if (!idlUtils.implForWrapper(this[window]._document)._parseOptions.sourceCodeLocationInfo) {
throw new Error("Location information was not saved for this jsdom. Use includeNodeLocations during creation.");
}
return idlUtils.implForWrapper(node).__location;
return idlUtils.implForWrapper(node).sourceCodeLocation;
}
runVMScript(script) {
runVMScript(script, options) {
if (!vm.isContext(this[window])) {
throw new TypeError("This jsdom was not configured to allow script running. " +
"Use the runScripts option during creation.");
}
return script.runInContext(this[window]);
return script.runInContext(this[window], options);
}
reconfigure(settings) {
@@ -118,11 +96,11 @@ class JSDOM {
}
document._URL = url;
document._origin = whatwgURL.serializeURLOrigin(document._URL);
document.origin = whatwgURL.serializeURLOrigin(document._URL);
}
}
static fragment(string) {
static fragment(string = "") {
if (!sharedFragmentDocument) {
sharedFragmentDocument = (new JSDOM()).window.document;
}
@@ -138,20 +116,20 @@ class JSDOM {
url = parsedURL.href;
options = normalizeFromURLOptions(options);
const requestOptions = {
resolveWithFullResponse: true,
encoding: null, // i.e., give me the raw Buffer
gzip: true,
headers: {
"User-Agent": options.userAgent,
Referer: options.referrer,
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "en"
},
jar: wrapCookieJarForRequest(options.cookieJar)
};
const resourceLoader = resourcesToResourceLoader(options.resources);
const resourceLoaderForInitialRequest = resourceLoader.constructor === NoOpResourceLoader ?
new ResourceLoader() :
resourceLoader;
const req = resourceLoaderForInitialRequest.fetch(url, {
accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
cookieJar: options.cookieJar,
referrer: options.referrer
});
return req.then(body => {
const res = req.response;
return request(url, requestOptions).then(res => {
let transportLayerEncodingLabel;
if ("content-type" in res.headers) {
const mimeType = new MIMEType(res.headers["content-type"]);
@@ -159,13 +137,13 @@ class JSDOM {
}
options = Object.assign(options, {
url: res.request.href + parsedURL.hash,
url: req.href + parsedURL.hash,
contentType: res.headers["content-type"],
referrer: res.request.getHeader("referer"),
referrer: req.getHeader("referer"),
[transportLayerEncodingLabelHiddenOption]: transportLayerEncodingLabel
});
return new JSDOM(res.body, options);
return new JSDOM(body, options);
});
});
}
@@ -193,9 +171,6 @@ function normalizeFromURLOptions(options) {
// Normalization of options which must be done before the rest of the fromURL code can use them, because they are
// given to request()
const normalized = Object.assign({}, options);
if (options.userAgent === undefined) {
normalized.userAgent = DEFAULT_USER_AGENT;
}
if (options.referrer !== undefined) {
normalized.referrer = (new URL(options.referrer)).href;
@@ -228,7 +203,7 @@ function normalizeFromFileOptions(filename, options) {
return normalized;
}
function transformOptions(options, encoding) {
function transformOptions(options, encoding, mimeType) {
const transformed = {
windowOptions: {
// Defaults
@@ -236,33 +211,30 @@ function transformOptions(options, encoding) {
referrer: "",
contentType: "text/html",
parsingMode: "html",
userAgent: DEFAULT_USER_AGENT,
parseOptions: { locationInfo: false },
parseOptions: { sourceCodeLocationInfo: false },
runScripts: undefined,
encoding,
pretendToBeVisual: false,
storageQuota: 5000000,
// Defaults filled in later
resourceLoader: undefined,
virtualConsole: undefined,
cookieJar: undefined
},
// Defaults
resources: undefined,
beforeParse() { }
};
if (options.contentType !== undefined) {
const mimeType = new MIMEType(options.contentType);
if (!mimeType.isHTML() && !mimeType.isXML()) {
throw new RangeError(`The given content type of "${options.contentType}" was not a HTML or XML content type`);
}
transformed.windowOptions.contentType = mimeType.essence;
transformed.windowOptions.parsingMode = mimeType.isHTML() ? "html" : "xml";
// options.contentType was parsed into mimeType by the caller.
if (!mimeType.isHTML() && !mimeType.isXML()) {
throw new RangeError(`The given content type of "${options.contentType}" was not a HTML or XML content type`);
}
transformed.windowOptions.contentType = mimeType.essence;
transformed.windowOptions.parsingMode = mimeType.isHTML() ? "html" : "xml";
if (options.url !== undefined) {
transformed.windowOptions.url = (new URL(options.url)).href;
}
@@ -271,16 +243,12 @@ function transformOptions(options, encoding) {
transformed.windowOptions.referrer = (new URL(options.referrer)).href;
}
if (options.userAgent !== undefined) {
transformed.windowOptions.userAgent = String(options.userAgent);
}
if (options.includeNodeLocations) {
if (transformed.windowOptions.parsingMode === "xml") {
throw new TypeError("Cannot set includeNodeLocations to true with an XML content type");
}
transformed.windowOptions.parseOptions = { locationInfo: true };
transformed.windowOptions.parseOptions = { sourceCodeLocationInfo: true };
}
transformed.windowOptions.cookieJar = options.cookieJar === undefined ?
@@ -291,13 +259,12 @@ function transformOptions(options, encoding) {
(new VirtualConsole()).sendTo(console) :
options.virtualConsole;
if (options.resources !== undefined) {
transformed.resources = String(options.resources);
if (transformed.resources !== "usable") {
throw new RangeError(`resources must be undefined or "usable"`);
}
if (!(transformed.windowOptions.virtualConsole instanceof VirtualConsole)) {
throw new TypeError("virtualConsole must be an instance of VirtualConsole");
}
transformed.windowOptions.resourceLoader = resourcesToResourceLoader(options.resources);
if (options.runScripts !== undefined) {
transformed.windowOptions.runScripts = String(options.runScripts);
if (transformed.windowOptions.runScripts !== "dangerously" &&
@@ -314,12 +281,16 @@ function transformOptions(options, encoding) {
transformed.windowOptions.pretendToBeVisual = Boolean(options.pretendToBeVisual);
}
if (options.storageQuota !== undefined) {
transformed.windowOptions.storageQuota = Number(options.storageQuota);
}
// concurrentNodeIterators??
return transformed;
}
function normalizeHTML(html = "", transportLayerEncodingLabel) {
function normalizeHTML(html = "", transportLayerEncodingLabel, mimeType) {
let encoding = "UTF-8";
if (ArrayBuffer.isView(html)) {
@@ -329,7 +300,10 @@ function normalizeHTML(html = "", transportLayerEncodingLabel) {
}
if (Buffer.isBuffer(html)) {
encoding = sniffHTMLEncoding(html, { defaultEncoding: "windows-1252", transportLayerEncodingLabel });
encoding = sniffHTMLEncoding(html, {
defaultEncoding: mimeType.isXML() ? "UTF-8" : "windows-1252",
transportLayerEncodingLabel
});
html = whatwgEncoding.decode(html, encoding);
} else {
html = String(html);
@@ -338,9 +312,27 @@ function normalizeHTML(html = "", transportLayerEncodingLabel) {
return { html, encoding };
}
function resourcesToResourceLoader(resources) {
switch (resources) {
case undefined: {
return new NoOpResourceLoader();
}
case "usable": {
return new ResourceLoader();
}
default: {
if (!(resources instanceof ResourceLoader)) {
throw new TypeError("resources must be an instance of ResourceLoader");
}
return resources;
}
}
}
exports.JSDOM = JSDOM;
exports.VirtualConsole = VirtualConsole;
exports.CookieJar = CookieJar;
exports.ResourceLoader = ResourceLoader;
exports.toughCookie = toughCookie;

View File

@@ -1,11 +1,11 @@
"use strict";
const vm = require("vm");
const webIDLConversions = require("webidl-conversions");
const { CSSStyleDeclaration } = require("cssstyle");
const { Performance: RawPerformance } = require("w3c-hr-time");
const notImplemented = require("./not-implemented");
const VirtualConsole = require("../virtual-console");
const { define, mixin } = require("../utils");
const Element = require("../living/generated/Element");
const EventTarget = require("../living/generated/EventTarget");
const namedPropertiesWindow = require("../living/named-properties-window");
const cssom = require("cssom");
@@ -23,25 +23,25 @@ const External = require("../living/generated/External");
const Navigator = require("../living/generated/Navigator");
const Performance = require("../living/generated/Performance");
const Screen = require("../living/generated/Screen");
const Storage = require("../living/generated/Storage");
const createAbortController = require("../living/generated/AbortController").createInterface;
const createAbortSignal = require("../living/generated/AbortSignal").createInterface;
const reportException = require("../living/helpers/runtime-script-errors");
const { matchesDontThrow } = require("../living/helpers/selectors");
const { fireAnEvent } = require("../living/helpers/events");
const SessionHistory = require("../living/window/SessionHistory");
const { contextifyWindow } = require("./documentfeatures.js");
const GlobalEventHandlersImpl = require("../living/nodes/GlobalEventHandlers-impl").implementation;
const WindowEventHandlersImpl = require("../living/nodes/WindowEventHandlers-impl").implementation;
const defaultStyleSheet = require("./default-stylesheet");
let parsedDefaultStyleSheet;
// NB: the require() must be after assigning `module.exports` because this require() is circular
// TODO: this above note might not even be true anymore... figure out the cycle and document it, or clean up.
module.exports = Window;
const dom = require("../living");
const cssSelectorSplitRE = /((?:[^,"']|"[^"]*"|'[^']*')+)/;
const defaultStyleSheet = cssom.parse(require("./default-stylesheet"));
dom.Window = Window;
// NOTE: per https://heycam.github.io/webidl/#Global, all properties on the Window object must be own-properties.
@@ -75,6 +75,8 @@ function Window(options) {
///// PRIVATE DATA PROPERTIES
this._resourceLoader = options.resourceLoader;
// vm initialization is deferred until script processing is activated
this._globalProxy = this;
Object.defineProperty(idlUtils.implForWrapper(this), idlUtils.wrapperSymbol, { get: () => this._globalProxy });
@@ -92,16 +94,7 @@ function Window(options) {
url: options.url,
lastModified: options.lastModified,
referrer: options.referrer,
cookie: options.cookie,
deferClose: options.deferClose,
resourceLoader: options.resourceLoader,
concurrentNodeIterators: options.concurrentNodeIterators,
pool: options.pool,
agent: options.agent,
agentClass: options.agentClass,
agentOptions: options.agentOptions,
strictSSL: options.strictSSL,
proxy: options.proxy,
parseOptions: options.parseOptions,
defaultView: this._globalProxy,
global: this
@@ -114,16 +107,7 @@ function Window(options) {
stateObject: null
}, this);
// TODO NEWAPI can remove this
if (options.virtualConsole) {
if (options.virtualConsole instanceof VirtualConsole) {
this._virtualConsole = options.virtualConsole;
} else {
throw new TypeError("options.virtualConsole must be a VirtualConsole (from createVirtualConsole)");
}
} else {
this._virtualConsole = new VirtualConsole();
}
this._virtualConsole = options.virtualConsole;
this._runScripts = options.runScripts;
if (this._runScripts === "outside-only" || this._runScripts === "dangerously") {
@@ -141,6 +125,41 @@ function Window(options) {
this._length = 0;
this._pretendToBeVisual = options.pretendToBeVisual;
this._storageQuota = options.storageQuota;
// Some properties (such as localStorage and sessionStorage) share data
// between windows in the same origin. This object is intended
// to contain such data.
if (options.commonForOrigin && options.commonForOrigin[this._document.origin]) {
this._commonForOrigin = options.commonForOrigin;
} else {
this._commonForOrigin = {
[this._document.origin]: {
localStorageArea: new Map(),
sessionStorageArea: new Map(),
windowsInSameOrigin: [this]
}
};
}
this._currentOriginData = this._commonForOrigin[this._document.origin];
///// WEB STORAGE
this._localStorage = Storage.create([], {
associatedWindow: this,
storageArea: this._currentOriginData.localStorageArea,
type: "localStorage",
url: this._document.documentURI,
storageQuota: this._storageQuota
});
this._sessionStorage = Storage.create([], {
associatedWindow: this,
storageArea: this._currentOriginData.sessionStorageArea,
type: "sessionStorage",
url: this._document.documentURI,
storageQuota: this._storageQuota
});
///// GETTERS
@@ -151,7 +170,7 @@ function Window(options) {
const statusbar = BarProp.create();
const toolbar = BarProp.create();
const external = External.create();
const navigator = Navigator.create([], { userAgent: options.userAgent });
const navigator = Navigator.create([], { userAgent: this._resourceLoader._userAgent });
const performance = Performance.create([], { rawPerformance });
const screen = Screen.create();
@@ -163,7 +182,7 @@ function Window(options) {
return window._globalProxy;
},
get frameElement() {
return window._frameElement;
return idlUtils.wrapperForImpl(window._frameElement);
},
get frames() {
return window._globalProxy;
@@ -215,6 +234,20 @@ function Window(options) {
},
get screen() {
return screen;
},
get localStorage() {
if (this._document.origin === "null") {
throw new DOMException("localStorage is not available for opaque origins", "SecurityError");
}
return this._localStorage;
},
get sessionStorage() {
if (this._document.origin === "null") {
throw new DOMException("sessionStorage is not available for opaque origins", "SecurityError");
}
return this._sessionStorage;
}
});
@@ -370,12 +403,6 @@ function Window(options) {
writable: true
});
function wrapConsoleMethod(method) {
return (...args) => {
window._virtualConsole.emit(method, ...args);
};
}
this.postMessage = postMessage;
this.atob = function (str) {
@@ -469,24 +496,31 @@ function Window(options) {
WebSocketImpl.cleanUpWindow(this);
};
this.getComputedStyle = function (node) {
const nodeImpl = idlUtils.implForWrapper(node);
const s = node.style;
const cs = new CSSStyleDeclaration();
const { forEach } = Array.prototype;
this.getComputedStyle = function (elt) {
elt = Element.convert(elt);
const declaration = new CSSStyleDeclaration();
const { forEach, indexOf } = Array.prototype;
const { style } = elt;
function setPropertiesFromRule(rule) {
if (!rule.selectorText) {
return;
}
const selectors = rule.selectorText.split(cssSelectorSplitRE);
const cssSelectorSplitRe = /((?:[^,"']|"[^"]*"|'[^']*')+)/;
const selectors = rule.selectorText.split(cssSelectorSplitRe);
let matched = false;
for (const selectorText of selectors) {
if (selectorText !== "" && selectorText !== "," && !matched && matchesDontThrow(nodeImpl, selectorText)) {
if (selectorText !== "" && selectorText !== "," && !matched && matchesDontThrow(elt, selectorText)) {
matched = true;
forEach.call(rule.style, property => {
cs.setProperty(property, rule.style.getPropertyValue(property), rule.style.getPropertyPriority(property));
declaration.setProperty(
property,
rule.style.getPropertyValue(property),
rule.style.getPropertyPriority(property)
);
});
}
}
@@ -495,7 +529,7 @@ function Window(options) {
function readStylesFromStyleSheet(sheet) {
forEach.call(sheet.cssRules, rule => {
if (rule.media) {
if (Array.prototype.indexOf.call(rule.media, "screen") !== -1) {
if (indexOf.call(rule.media, "screen") !== -1) {
forEach.call(rule.cssRules, setPropertiesFromRule);
}
} else {
@@ -504,14 +538,17 @@ function Window(options) {
});
}
readStylesFromStyleSheet(defaultStyleSheet);
forEach.call(node.ownerDocument.styleSheets, readStylesFromStyleSheet);
if (!parsedDefaultStyleSheet) {
parsedDefaultStyleSheet = cssom.parse(defaultStyleSheet);
}
readStylesFromStyleSheet(parsedDefaultStyleSheet);
forEach.call(elt.ownerDocument.styleSheets, readStylesFromStyleSheet);
forEach.call(s, property => {
cs.setProperty(property, s.getPropertyValue(property), s.getPropertyPriority(property));
forEach.call(style, property => {
declaration.setProperty(property, style.getPropertyValue(property), style.getPropertyPriority(property));
});
return cs;
return declaration;
};
// The captureEvents() and releaseEvents() methods must do nothing
@@ -521,11 +558,20 @@ function Window(options) {
///// PUBLIC DATA PROPERTIES (TODO: should be getters)
function wrapConsoleMethod(method) {
return (...args) => {
window._virtualConsole.emit(method, ...args);
};
}
this.console = {
assert: wrapConsoleMethod("assert"),
clear: wrapConsoleMethod("clear"),
count: wrapConsoleMethod("count"),
countReset: wrapConsoleMethod("countReset"),
debug: wrapConsoleMethod("debug"),
dir: wrapConsoleMethod("dir"),
dirxml: wrapConsoleMethod("dirxml"),
error: wrapConsoleMethod("error"),
group: wrapConsoleMethod("group"),
groupCollapsed: wrapConsoleMethod("groupCollapsed"),
@@ -546,10 +592,8 @@ function Window(options) {
}
define(this, {
name: "nodejs",
// Node v6 has issues (presumably in the vm module)
// which this property exposes through an XHR test
// status: "",
name: "",
status: "",
devicePixelRatio: 1,
innerWidth: 1024,
innerHeight: 768,
@@ -558,15 +602,12 @@ function Window(options) {
pageXOffset: 0,
pageYOffset: 0,
screenX: 0,
screenLeft: 0,
screenY: 0,
screenTop: 0,
scrollX: 0,
scrollY: 0,
// Not in spec, but likely to be added eventually:
// https://github.com/w3c/csswg-drafts/issues/1091
screenLeft: 0,
screenTop: 0,
alert: notImplementedMethod("window.alert"),
blur: notImplementedMethod("window.blur"),
confirm: notImplementedMethod("window.confirm"),
@@ -591,14 +632,10 @@ function Window(options) {
}
if (window.document.readyState === "complete") {
const ev = window.document.createEvent("HTMLEvents");
ev.initEvent("load", false, false);
window.dispatchEvent(ev);
fireAnEvent("load", window);
} else {
window.document.addEventListener("load", () => {
const ev = window.document.createEvent("HTMLEvents");
ev.initEvent("load", false, false);
window.dispatchEvent(ev);
fireAnEvent("load", window);
});
}
});
@@ -652,3 +689,13 @@ function stopAllTimers(timers) {
timer[1].call(undefined, timer[0]);
});
}
function contextifyWindow(window) {
if (vm.isContext(window)) {
return;
}
vm.createContext(window);
const documentImpl = idlUtils.implForWrapper(window._document);
documentImpl._defaultView = window._globalProxy = vm.runInContext("this", window);
}

View File

@@ -1,55 +0,0 @@
"use strict";
const vm = require("vm");
const idlUtils = require("../living/generated/utils");
exports.availableDocumentFeatures = [
"FetchExternalResources",
"SkipExternalResources"
];
exports.defaultDocumentFeatures = {
FetchExternalResources: ["script", "link"], // omitted by default: "frame"
SkipExternalResources: false
};
exports.applyDocumentFeatures = (documentImpl, features = {}) => {
for (let i = 0; i < exports.availableDocumentFeatures.length; ++i) {
const featureName = exports.availableDocumentFeatures[i];
let featureSource;
if (features[featureName] !== undefined) {
featureSource = features[featureName];
// We have to check the lowercase version also because the Document feature
// methods convert everything to lowercase.
} else if (typeof features[featureName.toLowerCase()] !== "undefined") {
featureSource = features[featureName.toLowerCase()];
} else if (exports.defaultDocumentFeatures[featureName]) {
featureSource = exports.defaultDocumentFeatures[featureName];
} else {
continue;
}
const implImpl = documentImpl._implementation;
implImpl._removeFeature(featureName);
if (featureSource !== undefined) {
if (Array.isArray(featureSource)) {
for (let j = 0; j < featureSource.length; ++j) {
implImpl._addFeature(featureName, featureSource[j]);
}
} else {
implImpl._addFeature(featureName, featureSource);
}
}
}
};
exports.contextifyWindow = window => {
if (vm.isContext(window)) {
return;
}
vm.createContext(window);
const documentImpl = idlUtils.implForWrapper(window._document);
documentImpl._defaultView = window._globalProxy = vm.runInContext("this", window);
};

View File

@@ -1,18 +0,0 @@
"use strict";
const parse5 = require("parse5");
const treeAdapter = require("./parse5-adapter-serialization");
const NODE_TYPE = require("../living/node-type");
exports.domToHtml = iterable => {
let ret = "";
for (const node of iterable) {
if (node.nodeType === NODE_TYPE.DOCUMENT_NODE) {
ret += parse5.serialize(node, { treeAdapter });
} else {
// TODO: maybe parse5 can give us a hook where it serializes the node itself too:
// https://github.com/inikulin/parse5/issues/230
ret += parse5.serialize({ childNodesForSerializing: [node] }, { treeAdapter });
}
}
return ret;
};

View File

@@ -1,34 +1,15 @@
"use strict";
const parse5 = require("parse5");
const sax = require("sax");
const saxes = require("saxes");
const attributes = require("../living/attributes");
const DocumentType = require("../living/generated/DocumentType");
const JSDOMParse5Adapter = require("./parse5-adapter-parsing");
// Horrible monkey-patch to implement https://github.com/inikulin/parse5/issues/237
const OpenElementStack = require("parse5/lib/parser/open_element_stack");
const originalPop = OpenElementStack.prototype.pop;
OpenElementStack.prototype.pop = function (...args) {
const before = this.items[this.stackTop];
originalPop.apply(this, args);
if (before._poppedOffStackOfOpenElements) {
before._poppedOffStackOfOpenElements();
}
};
const originalPush = OpenElementStack.prototype.push;
OpenElementStack.prototype.push = function (...args) {
originalPush.apply(this, args);
const after = this.items[this.stackTop];
if (after._pushedOnStackOfOpenElements) {
after._pushedOnStackOfOpenElements();
}
};
const { HTML_NS } = require("../living/helpers/namespaces");
module.exports = class HTMLToDOM {
constructor(parsingMode) {
this.parser = parsingMode === "xml" ? sax : parse5;
this.parser = parsingMode === "xml" ? saxes : parse5;
}
appendToNode(html, node) {
@@ -44,7 +25,7 @@ module.exports = class HTMLToDOM {
}
_doParse(...args) {
return this.parser === parse5 ? this._parseWithParse5(...args) : this._parseWithSax(...args);
return this.parser === parse5 ? this._parseWithParse5(...args) : this._parseWithSaxes(...args);
}
_parseWithParse5(html, isFragment, contextNode, options = {}) {
@@ -66,90 +47,93 @@ module.exports = class HTMLToDOM {
return contextNode;
}
_parseWithSax(html, isFragment, contextNode) {
const SaxParser = this.parser.parser;
const parser = new SaxParser(/* strict = */true, { xmlns: true, strictEntities: true });
parser.noscript = false;
parser.looseCase = "toString";
const openStack = [contextNode];
parser.ontext = text => {
setChildForSax(openStack[openStack.length - 1], {
type: "text",
data: text
});
};
parser.oncdata = cdata => {
setChildForSax(openStack[openStack.length - 1], {
type: "cdata",
data: cdata
});
};
parser.onopentag = arg => {
const attrs = Object.keys(arg.attributes).map(key => {
const rawAttribute = arg.attributes[key];
_parseWithSaxes(html, isFragment, contextNode) {
const parserOptions = { xmlns: true };
if (isFragment) {
parserOptions.fragment = true;
let { prefix } = rawAttribute;
let localName = rawAttribute.local;
if (prefix === "xmlns" && localName === "") {
// intended weirdness in node-sax, see https://github.com/isaacs/sax-js/issues/165
localName = prefix;
prefix = null;
}
if (prefix === "") {
prefix = null;
}
const namespace = rawAttribute.uri === "" ? null : rawAttribute.uri;
return { name: rawAttribute.name, value: rawAttribute.value, prefix, localName, namespace };
});
const tag = {
type: "tag",
name: arg.local,
prefix: arg.prefix,
namespace: arg.uri,
attributes: attrs
parserOptions.resolvePrefix = prefix => {
// saxes wants undefined as the return value if the prefix is not
// defined, not null.
return contextNode.lookupNamespaceURI(prefix) || undefined;
};
}
const parser = new this.parser.SaxesParser(parserOptions);
const openStack = [contextNode];
const currentDocument = contextNode._ownerDocument || contextNode;
if (arg.local === "script" && arg.uri === "http://www.w3.org/1999/xhtml") {
openStack.push(tag);
} else {
const elem = setChildForSax(openStack[openStack.length - 1], tag);
openStack.push(elem);
parser.ontext = isFragment ?
// In a fragment, all text events produced by saxes must result in a text
// node.
text => {
appendChild(
openStack[openStack.length - 1],
currentDocument.createTextNode(text)
);
} :
// When parsing a whole document, we must ignore those text nodes that are
// produced outside the root element. Saxes produces events for them,
// but DOM trees do not record text outside the root element.
text => {
if (openStack.length > 1) {
appendChild(
openStack[openStack.length - 1],
currentDocument.createTextNode(text)
);
}
};
parser.oncdata = cdata => {
appendChild(
openStack[openStack.length - 1],
currentDocument.createCDATASection(cdata)
);
};
parser.onopentag = tag => {
const { local: tagLocal, uri: tagURI, prefix: tagPrefix, attributes: tagAttributes } = tag;
const elem = currentDocument._createElementWithCorrectElementInterface(tagLocal, tagURI);
elem._prefix = tagPrefix || null;
elem._namespaceURI = tagURI || null;
// We mark a script element as "parser-inserted", which prevents it from
// being immediately executed.
if (tagLocal === "script" && tagURI === HTML_NS) {
elem._parserInserted = true;
}
for (const key of Object.keys(tagAttributes)) {
const { prefix, local, uri, value } = tagAttributes[key];
attributes.setAttributeValue(
elem, local, value, prefix === "" ? null : prefix,
uri === "" ? null : uri
);
}
appendChild(openStack[openStack.length - 1], elem);
openStack.push(elem);
};
parser.onclosetag = () => {
const elem = openStack.pop();
if (elem.constructor.name === "Object") { // we have an empty script tag
setChildForSax(openStack[openStack.length - 1], elem);
// Once a script is populated, we can execute it.
if (elem.localName === "script" && elem.namespaceURI === HTML_NS) {
elem._eval();
}
};
parser.onscript = scriptText => {
const tag = openStack.pop();
tag.children = [{ type: "text", data: scriptText }];
const elem = setChildForSax(openStack[openStack.length - 1], tag);
openStack.push(elem);
};
parser.oncomment = comment => {
setChildForSax(openStack[openStack.length - 1], {
type: "comment",
data: comment
});
appendChild(
openStack[openStack.length - 1],
currentDocument.createComment(comment)
);
};
parser.onprocessinginstruction = pi => {
setChildForSax(openStack[openStack.length - 1], {
type: "directive",
name: "?" + pi.name,
data: "?" + pi.name + " " + pi.body + "?"
});
parser.onprocessinginstruction = ({ target, body }) => {
appendChild(
openStack[openStack.length - 1],
currentDocument.createProcessingInstruction(target, body)
);
};
parser.ondoctype = dt => {
setChildForSax(openStack[openStack.length - 1], {
type: "directive",
name: "!doctype",
data: "!doctype " + dt
});
appendChild(
openStack[openStack.length - 1],
parseDocType(currentDocument, `<!doctype ${dt}>`)
);
const entityMatcher = /<!ENTITY ([^ ]+) "([^"]+)">/g;
let result;
@@ -168,82 +152,20 @@ module.exports = class HTMLToDOM {
}
};
function setChildForSax(parentImpl, node) {
const currentDocument = (parentImpl && parentImpl._ownerDocument) || parentImpl;
let newNode;
let isTemplateContents = false;
switch (node.type) {
case "tag":
case "script":
case "style":
newNode = currentDocument._createElementWithCorrectElementInterface(node.name, node.namespace);
newNode._prefix = node.prefix || null;
newNode._namespaceURI = node.namespace || null;
break;
case "root":
// If we are in <template> then add all children to the parent's _templateContents; skip this virtual root node.
if (parentImpl.tagName === "TEMPLATE" && parentImpl._namespaceURI === "http://www.w3.org/1999/xhtml") {
newNode = parentImpl._templateContents;
isTemplateContents = true;
}
break;
case "text":
// HTML entities should already be decoded by the parser, so no need to decode them
newNode = currentDocument.createTextNode(node.data);
break;
case "cdata":
newNode = currentDocument.createCDATASection(node.data);
break;
case "comment":
newNode = currentDocument.createComment(node.data);
break;
case "directive":
if (node.name[0] === "?" && node.name.toLowerCase() !== "?xml") {
const data = node.data.slice(node.name.length + 1, -1);
newNode = currentDocument.createProcessingInstruction(node.name.substring(1), data);
} else if (node.name.toLowerCase() === "!doctype") {
newNode = parseDocType(currentDocument, "<" + node.data + ">");
}
break;
function appendChild(parent, child) {
if (parent._templateContents) {
// Template elements do not have children but instead store their content
// in a separate hierarchy.
parent._templateContents._insert(child, null);
} else {
parent._insert(child, null);
}
if (!newNode) {
return null;
}
if (node.attributes) {
for (const a of node.attributes) {
attributes.setAttributeValue(newNode, a.localName, a.value, a.prefix, a.namespace);
}
}
if (node.children) {
for (let c = 0; c < node.children.length; c++) {
setChildForSax(newNode, node.children[c]);
}
}
if (!isTemplateContents) {
if (parentImpl._templateContents) {
// Setting innerHTML on a <template>
parentImpl._templateContents.appendChild(newNode);
} else {
parentImpl.appendChild(newNode);
}
}
return newNode;
}
const HTML5_DOCTYPE = /<!doctype html>/i;
const PUBLIC_DOCTYPE = /<!doctype\s+([^\s]+)\s+public\s+"([^"]+)"\s+"([^"]+)"/i;
const SYSTEM_DOCTYPE = /<!doctype\s+([^\s]+)\s+system\s+"([^"]+)"/i;
const CUSTOM_NAME_DOCTYPE = /<!doctype\s+([^\s>]+)/i;
function parseDocType(doc, html) {
if (HTML5_DOCTYPE.test(html)) {
@@ -260,9 +182,8 @@ function parseDocType(doc, html) {
return createDocumentTypeInternal(doc, systemPieces[1], "", systemPieces[2]);
}
// Shouldn't get here (the parser shouldn't let us know about invalid doctypes), but our logic likely isn't
// real-world perfect, so let's fallback.
return createDocumentTypeInternal(doc, "html", "", "");
const namePiece = CUSTOM_NAME_DOCTYPE.exec(html)[1] || "html";
return createDocumentTypeInternal(doc, namePiece, "", "");
}
function createDocumentTypeInternal(ownerDocument, name, publicId, systemId) {

View File

@@ -1,15 +1,53 @@
"use strict";
const DocumentType = require("../living/generated/DocumentType");
const DocumentFragment = require("../living/generated/DocumentFragment");
const Text = require("../living/generated/Text");
const Comment = require("../living/generated/Comment");
const attributes = require("../living/attributes");
const nodeTypes = require("../living/node-type");
const serializationAdapter = require("./parse5-adapter-serialization");
const serializationAdapter = require("../living/domparsing/parse5-adapter-serialization");
const OpenElementStack = require("parse5/lib/parser/open-element-stack");
const OpenElementStackOriginalPop = OpenElementStack.prototype.pop;
const OpenElementStackOriginalPush = OpenElementStack.prototype.push;
module.exports = class JSDOMParse5Adapter {
constructor(documentImpl) {
this._documentImpl = documentImpl;
// Since the createElement hook doesn't provide the parent element, we keep track of this using _currentElement:
// https://github.com/inikulin/parse5/issues/285
this._currentElement = undefined;
// Horrible monkey-patch to implement https://github.com/inikulin/parse5/issues/237
const adapter = this;
OpenElementStack.prototype.push = function (...args) {
OpenElementStackOriginalPush.apply(this, args);
adapter._currentElement = this.current;
const after = this.items[this.stackTop];
if (after._pushedOnStackOfOpenElements) {
after._pushedOnStackOfOpenElements();
}
};
OpenElementStack.prototype.pop = function (...args) {
const before = this.items[this.stackTop];
OpenElementStackOriginalPop.apply(this, args);
adapter._currentElement = this.current;
if (before._poppedOffStackOfOpenElements) {
before._poppedOffStackOfOpenElements();
}
};
}
_ownerDocument() {
// The _currentElement is undefined when parsing elements at the root of the document. In this case we would
// fallback to the global _documentImpl.
return this._currentElement ? this._currentElement._ownerDocument : this._documentImpl;
}
createDocument() {
@@ -21,11 +59,13 @@ module.exports = class JSDOMParse5Adapter {
}
createDocumentFragment() {
return DocumentFragment.createImpl([], { ownerDocument: this._documentImpl });
return DocumentFragment.createImpl([], { ownerDocument: this._currentElement._ownerDocument });
}
createElement(localName, namespace, attrs) {
const element = this._documentImpl._createElementWithCorrectElementInterface(localName, namespace);
const ownerDocument = this._ownerDocument();
const element = ownerDocument._createElementWithCorrectElementInterface(localName, namespace);
element._namespaceURI = namespace;
this.adoptAttributes(element, attrs);
@@ -37,7 +77,8 @@ module.exports = class JSDOMParse5Adapter {
}
createCommentNode(data) {
return Comment.createImpl([], { data, ownerDocument: this._documentImpl });
const ownerDocument = this._ownerDocument();
return Comment.createImpl([], { data, ownerDocument });
}
appendChild(parentNode, newNode) {
@@ -49,22 +90,25 @@ module.exports = class JSDOMParse5Adapter {
}
setTemplateContent(templateElement, contentFragment) {
// This code makes the glue between jsdom and parse5 HTMLTemplateElement parsing:
//
// * jsdom during the construction of the HTMLTemplateElement (for example when create via
// `document.createElement("template")`), creates a DocumentFragment and set it into _templateContents.
// * parse5 when parsing a <template> tag creates an HTMLTemplateElement (`createElement` adapter hook) and also
// create a DocumentFragment (`createDocumentFragment` adapter hook).
//
// At this point we now have to replace the one created in jsdom with one created by parse5.
const { _ownerDocument, _host } = templateElement._templateContents;
contentFragment._ownerDocument = _ownerDocument;
contentFragment._host = _host;
templateElement._templateContents = contentFragment;
}
setDocumentType(document, name, publicId, systemId) {
// parse5 sometimes gives us these as null.
if (name === null) {
name = "";
}
if (publicId === null) {
publicId = "";
}
if (systemId === null) {
systemId = "";
}
const ownerDocument = this._ownerDocument();
const documentType = DocumentType.createImpl([], { name, publicId, systemId, ownerDocument });
const documentType = DocumentType.createImpl([], { name, publicId, systemId, ownerDocument: this._documentImpl });
document.appendChild(documentType);
}
@@ -82,8 +126,8 @@ module.exports = class JSDOMParse5Adapter {
if (lastChild && lastChild.nodeType === nodeTypes.TEXT_NODE) {
lastChild.data += text;
} else {
const textNode = Text.createImpl([], { data: text, ownerDocument: this._documentImpl });
const ownerDocument = this._ownerDocument();
const textNode = Text.createImpl([], { data: text, ownerDocument });
parentNode.appendChild(textNode);
}
}
@@ -93,8 +137,8 @@ module.exports = class JSDOMParse5Adapter {
if (previousSibling && previousSibling.nodeType === nodeTypes.TEXT_NODE) {
previousSibling.data += text;
} else {
const textNode = Text.createImpl([], { data: text, ownerDocument: this._documentImpl });
const ownerDocument = this._ownerDocument();
const textNode = Text.createImpl([], { data: text, ownerDocument });
parentNode.insertBefore(textNode, referenceNode);
}
}

View File

@@ -1,275 +0,0 @@
"use strict";
const MIMEType = require("whatwg-mimetype");
const parseDataURL = require("data-urls");
const sniffHTMLEncoding = require("html-encoding-sniffer");
const whatwgEncoding = require("whatwg-encoding");
const fs = require("fs");
const request = require("request");
const { documentBaseURLSerialized } = require("../living/helpers/document-base-url");
const NODE_TYPE = require("../living/node-type");
/* eslint-disable no-restricted-modules */
// TODO: stop using the built-in URL in favor of the spec-compliant whatwg-url package
// This legacy usage is in the process of being purged.
const URL = require("url");
/* eslint-enable no-restricted-modules */
const IS_BROWSER = Object.prototype.toString.call(process) !== "[object process]";
function createResourceLoadHandler(element, resourceUrl, document, loadCallback) {
if (loadCallback === undefined) {
loadCallback = () => {
// do nothing
};
}
return (err, data, response) => {
const ev = document.createEvent("HTMLEvents");
if (!err) {
try {
loadCallback.call(element, data, resourceUrl, response);
ev.initEvent("load", false, false);
} catch (e) {
err = e;
}
}
if (err) {
if (!err.isAbortError) {
ev.initEvent("error", false, false);
ev.error = err;
element.dispatchEvent(ev);
const error = new Error(`Could not load ${element.localName}: "${resourceUrl}"`);
error.detail = err;
error.type = "resource loading";
document._defaultView._virtualConsole.emit("jsdomError", error);
}
} else {
element.dispatchEvent(ev);
}
};
}
exports.readFile = function (filePath, { defaultEncoding, detectMetaCharset }, callback) {
const readableStream = fs.createReadStream(filePath);
let data = Buffer.alloc(0);
readableStream.on("error", callback);
readableStream.on("data", chunk => {
data = Buffer.concat([data, chunk]);
});
readableStream.on("end", () => {
// Not passing default encoding means binary
if (defaultEncoding) {
const encoding = detectMetaCharset ?
sniffHTMLEncoding(data, { defaultEncoding }) :
whatwgEncoding.getBOMEncoding(data) || defaultEncoding;
const decoded = whatwgEncoding.decode(data, encoding);
callback(null, decoded, { headers: { "content-type": "text/plain;charset=" + encoding } });
} else {
callback(null, data);
}
});
return {
abort() {
readableStream.destroy();
const error = new Error("request canceled by user");
error.isAbortError = true;
callback(error);
}
};
};
function readDataURL(dataURL, { defaultEncoding, detectMetaCharset }, callback) {
try {
const parsed = parseDataURL(dataURL);
// If default encoding does not exist, pass on binary data.
if (defaultEncoding) {
const sniffOptions = {
transportLayerEncodingLabel: parsed.mimeType.parameters.get("charset"),
defaultEncoding
};
const encoding = detectMetaCharset ?
sniffHTMLEncoding(parsed.body, sniffOptions) :
whatwgEncoding.getBOMEncoding(parsed.body) ||
whatwgEncoding.labelToName(parsed.mimeType.parameters.get("charset")) ||
defaultEncoding;
const decoded = whatwgEncoding.decode(parsed.body, encoding);
parsed.mimeType.parameters.set("charset", encoding);
callback(null, decoded, { headers: { "content-type": parsed.mimeType.toString() } });
} else {
callback(null, parsed.body, { headers: { "content-type": parsed.mimeType.toString() } });
}
} catch (err) {
callback(err, null);
}
return null;
}
// NOTE: request wraps tough-cookie cookie jar
// (see: https://github.com/request/request/blob/master/lib/cookies.js).
// Therefore, to pass our cookie jar to the request, we need to create
// request's wrapper and monkey patch it with our jar.
exports.wrapCookieJarForRequest = cookieJar => {
const jarWrapper = request.jar();
jarWrapper._jar = cookieJar;
return jarWrapper;
};
function fetch(urlObj, options, callback) {
if (urlObj.protocol === "data:") {
return readDataURL(urlObj.href, options, callback);
} else if (urlObj.hostname) {
return exports.download(urlObj, options, callback);
}
const filePath = urlObj.pathname
.replace(/^file:\/\//, "")
.replace(/^\/([a-z]):\//i, "$1:/")
.replace(/%20/g, " ");
return exports.readFile(filePath, options, callback);
}
exports.enqueue = function (element, resourceUrl, callback) {
const document = element.nodeType === NODE_TYPE.DOCUMENT_NODE ? element : element._ownerDocument;
if (document._queue) {
const loadHandler = createResourceLoadHandler(element, resourceUrl || document.URL, document, callback);
return document._queue.push(loadHandler);
}
return () => {
// do nothing in queue-less documents
};
};
exports.download = function (url, options, callback) {
const requestOptions = {
pool: options.pool,
agent: options.agent,
agentOptions: options.agentOptions,
agentClass: options.agentClass,
strictSSL: options.strictSSL,
gzip: true,
jar: exports.wrapCookieJarForRequest(options.cookieJar),
encoding: null,
headers: {
"User-Agent": options.userAgent,
"Accept-Language": "en",
Accept: options.accept || "*/*"
}
};
if (options.referrer && !IS_BROWSER) {
requestOptions.headers.referer = options.referrer;
}
if (options.proxy) {
requestOptions.proxy = options.proxy;
}
Object.assign(requestOptions.headers, options.headers);
const { defaultEncoding, detectMetaCharset } = options;
const req = request(url, requestOptions, (error, response, bufferData) => {
if (!error) {
// If default encoding does not exist, pass on binary data.
if (defaultEncoding) {
const contentType = MIMEType.parse(response.headers["content-type"]) || new MIMEType("text/plain");
const sniffOptions = {
transportLayerEncodingLabel: contentType.parameters.get("charset"),
defaultEncoding
};
const encoding = detectMetaCharset ?
sniffHTMLEncoding(bufferData, sniffOptions) :
whatwgEncoding.getBOMEncoding(bufferData) ||
whatwgEncoding.labelToName(contentType.parameters.get("charset")) ||
defaultEncoding;
const decoded = whatwgEncoding.decode(bufferData, encoding);
contentType.parameters.set("charset", encoding);
response.headers["content-type"] = contentType.toString();
callback(null, decoded, response);
} else {
callback(null, bufferData, response);
}
} else {
callback(error, null, response);
}
});
return {
abort() {
req.abort();
const error = new Error("request canceled by user");
error.isAbortError = true;
callback(error);
}
};
};
exports.load = function (element, urlString, options, callback) {
const document = element._ownerDocument;
const documentImpl = document.implementation;
if (!documentImpl._hasFeature("FetchExternalResources", element.tagName.toLowerCase())) {
return;
}
if (documentImpl._hasFeature("SkipExternalResources", urlString)) {
return;
}
const urlObj = URL.parse(urlString);
const enqueued = exports.enqueue(element, urlString, callback);
const customLoader = document._customResourceLoader;
const requestManager = document._requestManager;
const cookieJar = document._cookieJar;
options.accept = element._accept;
options.cookieJar = cookieJar;
options.referrer = document.URL;
options.pool = document._pool;
options.agentOptions = document._agentOptions;
options.strictSSL = document._strictSSL;
options.proxy = document._proxy;
options.userAgent = document._defaultView.navigator.userAgent;
let req = null;
function wrappedEnqueued() {
if (req && requestManager) {
requestManager.remove(req);
}
// do not trigger if the window is closed
if (element._ownerDocument && element._ownerDocument.defaultView.document) {
enqueued.apply(this, arguments);
}
}
if (typeof customLoader === "function") {
req = customLoader(
{
element,
url: urlObj,
cookie: cookieJar.getCookieStringSync(urlObj, { http: true }),
baseUrl: documentBaseURLSerialized(document),
defaultFetch(fetchCallback) {
return fetch(urlObj, options, fetchCallback);
}
},
wrappedEnqueued
);
} else {
req = fetch(urlObj, options, wrappedEnqueued);
}
if (req && requestManager) {
requestManager.add(req);
}
};

View File

@@ -0,0 +1,114 @@
"use strict";
class QueueItem {
constructor(onLoad, onError, dependentItem) {
this.onLoad = onLoad;
this.onError = onError;
this.data = null;
this.error = null;
this.dependentItem = dependentItem;
}
}
/**
* AsyncResourceQueue is the queue in charge of run the async scripts
* and notify when they finish.
*/
module.exports = class AsyncResourceQueue {
constructor() {
this.items = new Set();
this.dependentItems = new Set();
}
count() {
return this.items.size + this.dependentItems.size;
}
_notify() {
if (this._listener) {
this._listener();
}
}
_check(item) {
let promise;
if (item.onError && item.error) {
promise = item.onError(item.error);
} else if (item.onLoad && item.data) {
promise = item.onLoad(item.data);
}
promise
.then(() => {
this.items.delete(item);
this.dependentItems.delete(item);
if (this.count() === 0) {
this._notify();
}
});
}
setListener(listener) {
this._listener = listener;
}
push(request, onLoad, onError, dependentItem) {
const q = this;
const item = new QueueItem(onLoad, onError, dependentItem);
q.items.add(item);
return request
.then(data => {
item.data = data;
if (dependentItem && !dependentItem.finished) {
q.dependentItems.add(item);
return q.items.delete(item);
}
if (onLoad) {
return q._check(item);
}
q.items.delete(item);
if (q.count() === 0) {
q._notify();
}
return null;
})
.catch(err => {
item.error = err;
if (dependentItem && !dependentItem.finished) {
q.dependentItems.add(item);
return q.items.delete(item);
}
if (onError) {
return q._check(item);
}
q.items.delete(item);
if (q.count() === 0) {
q._notify();
}
return null;
});
}
notifyItem(syncItem) {
for (const item of this.dependentItems) {
if (item.dependentItem === syncItem) {
this._check(item);
}
}
}
};

View File

@@ -0,0 +1,8 @@
"use strict";
const ResourceLoader = require("./resource-loader.js");
module.exports = class NoOpResourceLoader extends ResourceLoader {
fetch() {
return null;
}
};

View File

@@ -0,0 +1,95 @@
"use strict";
const idlUtils = require("../../living/generated/utils");
const { fireAnEvent } = require("../../living/helpers/events");
module.exports = class PerDocumentResourceLoader {
constructor(document) {
this._document = document;
this._defaultEncoding = document._encoding;
this._resourceLoader = document._defaultView ? document._defaultView._resourceLoader : null;
this._requestManager = document._requestManager;
this._queue = document._queue;
this._deferQueue = document._deferQueue;
this._asyncQueue = document._asyncQueue;
}
fetch(url, { element, onLoad, onError }) {
const request = this._resourceLoader.fetch(url, {
cookieJar: this._document._cookieJar,
element: idlUtils.wrapperForImpl(element),
referrer: this._document.URL
});
if (request === null) {
return null;
}
this._requestManager.add(request);
const onErrorWrapped = error => {
this._requestManager.remove(request);
if (onError) {
onError(error);
}
fireAnEvent("error", element);
const err = new Error(`Could not load ${element.localName}: "${url}"`);
err.type = "resource loading";
err.detail = error;
this._document._defaultView._virtualConsole.emit("jsdomError", err);
return Promise.resolve();
};
const onLoadWrapped = data => {
this._requestManager.remove(request);
this._addCookies(url, request.response ? request.response.headers : {});
try {
const result = onLoad ? onLoad(data) : undefined;
return Promise.resolve(result)
.then(() => {
fireAnEvent("load", element);
return Promise.resolve();
})
.catch(err => {
return onErrorWrapped(err);
});
} catch (err) {
return onErrorWrapped(err);
}
};
if (element.localName === "script" && element.hasAttribute("async")) {
this._asyncQueue.push(request, onLoadWrapped, onErrorWrapped, this._queue.getLastScript());
} else if (element.localName === "script" && element.hasAttribute("defer")) {
this._deferQueue.push(request, onLoadWrapped, onErrorWrapped, false, element);
} else {
this._queue.push(request, onLoadWrapped, onErrorWrapped, false, element);
}
return request;
}
_addCookies(url, headers) {
let cookies = headers["set-cookie"];
if (!cookies) {
return;
}
if (!Array.isArray(cookies)) {
cookies = [cookies];
}
cookies.forEach(cookie => {
this._document._cookieJar.setCookieSync(cookie, url, { http: true, ignoreError: true });
});
}
};

View File

@@ -0,0 +1,33 @@
"use strict";
/**
* Manage all the request and it is able to abort
* all pending request.
*/
module.exports = class RequestManager {
constructor() {
this.openedRequests = [];
}
add(req) {
this.openedRequests.push(req);
}
remove(req) {
const idx = this.openedRequests.indexOf(req);
if (idx !== -1) {
this.openedRequests.splice(idx, 1);
}
}
close() {
for (const openedRequest of this.openedRequests) {
openedRequest.abort();
}
this.openedRequests = [];
}
size() {
return this.openedRequests.length;
}
};

View File

@@ -0,0 +1,113 @@
"use strict";
const fs = require("fs");
const { parseURL } = require("whatwg-url");
const dataURLFromRecord = require("data-urls").fromURLRecord;
const request = require("request-promise-native");
const wrapCookieJarForRequest = require("../../living/helpers/wrap-cookie-jar-for-request");
const packageVersion = require("../../../../package.json").version;
const IS_BROWSER = Object.prototype.toString.call(process) !== "[object process]";
module.exports = class ResourceLoader {
constructor({
strictSSL = true,
proxy = undefined,
userAgent = `Mozilla/5.0 (${process.platform || "unknown OS"}) AppleWebKit/537.36 ` +
`(KHTML, like Gecko) jsdom/${packageVersion}`
} = {}) {
this._strictSSL = strictSSL;
this._proxy = proxy;
this._userAgent = userAgent;
}
_readFile(filePath) {
let readableStream;
let abort; // Native Promises doesn't have an "abort" method.
/*
* Creating a promise for two reason:
* 1. fetch always return a promise.
* 2. We need to add an abort handler.
*/
const promise = new Promise((resolve, reject) => {
readableStream = fs.createReadStream(filePath);
let data = Buffer.alloc(0);
abort = reject;
readableStream.on("error", reject);
readableStream.on("data", chunk => {
data = Buffer.concat([data, chunk]);
});
readableStream.on("end", () => {
resolve(data);
});
});
promise.abort = () => {
readableStream.destroy();
const error = new Error("request canceled by user");
error.isAbortError = true;
abort(error);
};
return promise;
}
_getRequestOptions({ cookieJar, referrer, accept = "*/*" }) {
const requestOptions = {
encoding: null,
gzip: true,
jar: wrapCookieJarForRequest(cookieJar),
strictSSL: this._strictSSL,
proxy: this._proxy,
forever: true,
headers: {
"User-Agent": this._userAgent,
"Accept-Language": "en",
Accept: accept
}
};
if (referrer && !IS_BROWSER) {
requestOptions.headers.referer = referrer;
}
return requestOptions;
}
fetch(urlString, options = {}) {
const url = parseURL(urlString);
if (!url) {
return Promise.reject(new Error(`Tried to fetch invalid URL ${urlString}`));
}
switch (url.scheme) {
case "data": {
return Promise.resolve(dataURLFromRecord(url).body);
}
case "http":
case "https": {
const requestOptions = this._getRequestOptions(options);
return request(urlString, requestOptions);
}
case "file": {
// TODO: Improve the URL => file algorithm. See https://github.com/jsdom/jsdom/pull/2279#discussion_r199977987
const filePath = urlString
.replace(/^file:\/\//, "")
.replace(/^\/([a-z]):\//i, "$1:/")
.replace(/%20/g, " ");
return this._readFile(filePath);
}
default: {
return Promise.reject(new Error(`Tried to fetch URL ${urlString} with invalid scheme ${url.scheme}`));
}
}
}
};

View File

@@ -0,0 +1,142 @@
"use strict";
/**
* Queue for all the resources to be download except async scripts.
* Async scripts have their own queue AsyncResourceQueue.
*/
module.exports = class ResourceQueue {
constructor({ paused, asyncQueue } = {}) {
this.paused = Boolean(paused);
this._asyncQueue = asyncQueue;
}
getLastScript() {
let head = this.tail;
while (head) {
if (head.isScript) {
return head;
}
head = head.prev;
}
return null;
}
_moreScripts() {
let found = false;
let head = this.tail;
while (head && !found) {
found = head.isScript;
head = head.prev;
}
return found;
}
_notify() {
if (this._listener) {
this._listener();
}
}
setListener(listener) {
this._listener = listener;
}
push(request, onLoad, onError, keepLast, element) {
const isScript = element ? element.localName === "script" : false;
if (!request) {
if (isScript && !this._moreScripts()) {
return onLoad();
}
request = new Promise(resolve => resolve());
}
const q = this;
const item = {
isScript,
err: null,
element,
fired: false,
data: null,
keepLast,
prev: q.tail,
check() {
if (!q.paused && !this.prev && this.fired) {
let promise;
if (this.err && onError) {
promise = onError(this.err);
}
if (!this.err && onLoad) {
promise = onLoad(this.data);
}
Promise.resolve(promise)
.then(() => {
if (this.next) {
this.next.prev = null;
this.next.check();
} else { // q.tail===this
q.tail = null;
q._notify();
}
this.finished = true;
if (q._asyncQueue) {
q._asyncQueue.notifyItem(this);
}
});
}
}
};
if (q.tail) {
if (q.tail.keepLast) {
// if the tail is the load event in document and we receive a new element to load
// we should add this new request before the load event.
if (q.tail.prev) {
q.tail.prev.next = item;
}
item.prev = q.tail.prev;
q.tail.prev = item;
item.next = q.tail;
} else {
q.tail.next = item;
q.tail = item;
}
} else {
q.tail = item;
}
return request
.then(data => {
item.fired = 1;
item.data = data;
item.check();
})
.catch(err => {
item.fired = true;
item.err = err;
item.check();
});
}
resume() {
if (!this.paused) {
return;
}
this.paused = false;
let head = this.tail;
while (head && head.prev) {
head = head.prev;
}
if (head) {
head.check();
}
}
};

View File

@@ -1,10 +1,9 @@
"use strict";
const { setupForSimpleEventAccessors } = require("../helpers/create-event-accessor");
const { fireAnEvent } = require("../helpers/events");
const EventTargetImpl = require("../events/EventTarget-impl").implementation;
const Event = require("../generated/Event");
class AbortSignalImpl extends EventTargetImpl {
constructor(args, privateData) {
super();
@@ -27,13 +26,7 @@ class AbortSignalImpl extends EventTargetImpl {
}
this.abortAlgorithms.clear();
this._dispatch(Event.createImpl(
[
"abort",
{ bubbles: false, cancelable: false }
],
{ isTrusted: true }
));
fireAnEvent("abort", this);
}
_addAlgorithm(algorithm) {

View File

@@ -2,6 +2,8 @@
const DOMException = require("domexception");
const attrGenerated = require("./generated/Attr");
const { asciiLowercase } = require("./helpers/strings");
const { HTML_NS } = require("./helpers/namespaces");
const { queueAttributeMutationRecord } = require("./helpers/mutation-observers");
// The following three are for https://dom.spec.whatwg.org/#concept-element-attribute-has. We don't just have a
// predicate tester since removing that kind of flexibility gives us the potential for better future optimizations.
@@ -23,6 +25,9 @@ exports.hasAttributeByNameNS = function (element, namespace, localName) {
exports.changeAttribute = function (element, attribute, value) {
// https://dom.spec.whatwg.org/#concept-element-attributes-change
const { _localName, _namespace, _value } = attribute;
queueAttributeMutationRecord(element, _localName, _namespace, _value);
const oldValue = attribute._value;
attribute._value = value;
@@ -33,9 +38,10 @@ exports.changeAttribute = function (element, attribute, value) {
exports.appendAttribute = function (element, attribute) {
// https://dom.spec.whatwg.org/#concept-element-attributes-append
const attributeList = element._attributeList;
const { _localName, _namespace } = attribute;
queueAttributeMutationRecord(element, _localName, _namespace, null);
// TODO mutation observer stuff
const attributeList = element._attributeList;
attributeList.push(attribute);
attribute._element = element;
@@ -57,9 +63,10 @@ exports.appendAttribute = function (element, attribute) {
exports.removeAttribute = function (element, attribute) {
// https://dom.spec.whatwg.org/#concept-element-attributes-remove
const attributeList = element._attributeList;
const { _localName, _namespace, _value } = attribute;
queueAttributeMutationRecord(element, _localName, _namespace, _value);
// TODO mutation observer stuff
const attributeList = element._attributeList;
for (let i = 0; i < attributeList.length; ++i) {
if (attributeList[i] === attribute) {
@@ -86,9 +93,10 @@ exports.removeAttribute = function (element, attribute) {
exports.replaceAttribute = function (element, oldAttr, newAttr) {
// https://dom.spec.whatwg.org/#concept-element-attributes-replace
const attributeList = element._attributeList;
const { _localName, _namespace, _value } = oldAttr;
queueAttributeMutationRecord(element, _localName, _namespace, _value);
// TODO mutation observer stuff
const attributeList = element._attributeList;
for (let i = 0; i < attributeList.length; ++i) {
if (attributeList[i] === oldAttr) {
@@ -117,7 +125,7 @@ exports.replaceAttribute = function (element, oldAttr, newAttr) {
exports.getAttributeByName = function (element, name) {
// https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name
if (element._namespaceURI === "http://www.w3.org/1999/xhtml" &&
if (element._namespaceURI === HTML_NS &&
element._ownerDocument._parsingMode === "html") {
name = asciiLowercase(name);
}

View File

@@ -3,6 +3,7 @@
const DOMException = require("domexception");
const idlUtils = require("../generated/utils.js");
const attributes = require("../attributes.js");
const { HTML_NS } = require("../helpers/namespaces");
exports.implementation = class NamedNodeMapImpl {
constructor(args, privateData) {
@@ -28,7 +29,7 @@ exports.implementation = class NamedNodeMapImpl {
get [idlUtils.supportedPropertyNames]() {
const names = new Set(this._attributeList.map(a => a._qualifiedName));
const el = this._element;
if (el._namespaceURI === "http://www.w3.org/1999/xhtml" && el._ownerDocument._parsingMode === "html") {
if (el._namespaceURI === HTML_NS && el._ownerDocument._parsingMode === "html") {
for (const name of names) {
const lowercaseName = name.toLowerCase();
if (lowercaseName !== name) {

View File

@@ -1,9 +1,9 @@
"use strict";
const ValidityState = require("../generated/ValidityState");
const Event = require("../generated/Event");
const { isDisabled } = require("../helpers/form-controls");
const { closest } = require("../helpers/traversal");
const { fireAnEvent } = require("../helpers/events");
exports.implementation = class DefaultConstraintValidationImpl {
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-cva-willvalidate
@@ -26,7 +26,7 @@ exports.implementation = class DefaultConstraintValidationImpl {
if (this._satisfiesConstraints()) {
return true;
}
this.dispatchEvent(Event.createImpl(["invalid", { cancelable: true }]));
fireAnEvent("invalid", this, undefined, { cancelable: true });
return false;
}

View File

@@ -1,6 +1,5 @@
"use strict";
const Document = require("../generated/Document");
const { applyDocumentFeatures } = require("../../browser/documentfeatures");
exports.implementation = class DOMParserImpl {
parseFromString(string, contentType) {
@@ -38,17 +37,13 @@ function createScriptingDisabledDocument(parsingMode, contentType, string) {
options: {
parsingMode,
encoding: "UTF-8",
contentType
contentType,
readyState: "complete",
scriptingDisabled: true
// TODO: somehow set URL to active document's URL
}
});
// "scripting enabled" set to false
applyDocumentFeatures(document, {
FetchExternalResources: [],
SkipExternalResources: false
});
if (string !== undefined) {
document._htmlToDom.appendToDocument(string, document);
}

View File

@@ -1,7 +1,7 @@
"use strict";
const idlUtils = require("../living/generated/utils");
const nodeTypes = require("../living/node-type");
const { domSymbolTree } = require("../living/helpers/internal-constants");
const idlUtils = require("../generated/utils");
const nodeTypes = require("../node-type");
const { domSymbolTree } = require("../helpers/internal-constants");
// Serialization only requires a subset of the tree adapter interface.
// Tree traversing
@@ -31,7 +31,6 @@ exports.getTemplateContent = templateElement => templateElement._templateContent
exports.getDocumentMode = document => document._mode;
// Node types
exports.isTextNode = node => node.nodeType === nodeTypes.TEXT_NODE;
exports.isCommentNode = node => node.nodeType === nodeTypes.COMMENT_NODE;
@@ -39,3 +38,10 @@ exports.isCommentNode = node => node.nodeType === nodeTypes.COMMENT_NODE;
exports.isDocumentTypeNode = node => node.nodeType === nodeTypes.DOCUMENT_TYPE_NODE;
exports.isElementNode = node => node.nodeType === nodeTypes.ELEMENT_NODE;
// Source code location
exports.setNodeSourceCodeLocation = (node, location) => {
node.sourceCodeLocation = location;
};
exports.getNodeSourceCodeLocation = node => node.sourceCodeLocation;

View File

@@ -0,0 +1,39 @@
"use strict";
const { produceXMLSerialization } = require("w3c-xmlserializer");
const parse5 = require("parse5");
const utils = require("../generated/utils");
const treeAdapter = require("./parse5-adapter-serialization");
const NODE_TYPE = require("../node-type");
const NAMESPACES = require("../helpers/namespaces");
function htmlSerialization(node) {
if (
node.nodeType === NODE_TYPE.ELEMENT_NODE &&
node.namespaceURI === NAMESPACES.HTML_NS &&
node.tagName === "TEMPLATE"
) {
node = node.content;
}
return parse5.serialize(node, { treeAdapter });
}
module.exports.fragmentSerialization = (node, { requireWellFormed }) => {
const contextDocument =
node.nodeType === NODE_TYPE.DOCUMENT_NODE ? node : node._ownerDocument;
if (contextDocument._parsingMode === "html") {
return htmlSerialization(node);
}
const childNodes = node.childNodesForSerializing || node.childNodes;
let serialized = "";
for (let i = 0; i < childNodes.length; ++i) {
serialized += produceXMLSerialization(
utils.wrapperForImpl(childNodes[i] || childNodes.item(i)),
requireWellFormed
);
}
return serialized;
};

View File

@@ -1,5 +1,6 @@
"use strict";
const idlUtils = require("../generated/utils");
const EventInit = require("../generated/EventInit");
class EventImpl {
@@ -29,12 +30,21 @@ class EventImpl {
this._stopPropagationFlag = false;
this._stopImmediatePropagationFlag = false;
this._canceledFlag = false;
this._inPassiveListenerFlag = false;
this._dispatchFlag = false;
this._path = [];
this.isTrusted = privateData.isTrusted || false;
this.timeStamp = Date.now();
}
// https://dom.spec.whatwg.org/#set-the-canceled-flag
_setTheCanceledFlag() {
if (this.cancelable && !this._inPassiveListenerFlag) {
this._canceledFlag = true;
}
}
get srcElement() {
return this.target;
}
@@ -44,8 +54,8 @@ class EventImpl {
}
set returnValue(v) {
if (this.cancelable && v === false) {
this._canceledFlag = true;
if (v === false) {
this._setTheCanceledFlag();
}
}
@@ -73,9 +83,88 @@ class EventImpl {
}
preventDefault() {
if (this.cancelable) {
this._canceledFlag = true;
this._setTheCanceledFlag();
}
// https://dom.spec.whatwg.org/#dom-event-composedpath
// Current implementation is based of https://whatpr.org/dom/699.html#dom-event-composedpath
// due to a bug in composed path implementation https://github.com/whatwg/dom/issues/684
composedPath() {
const composedPath = [];
const { currentTarget, _path: path } = this;
if (path.length === 0) {
return composedPath;
}
composedPath.push(currentTarget);
let currentTargetIndex = 0;
let currentTargetHiddenSubtreeLevel = 0;
for (let index = path.length - 1; index >= 0; index--) {
const { item, rootOfClosedTree, slotInClosedTree } = path[index];
if (rootOfClosedTree) {
currentTargetHiddenSubtreeLevel++;
}
if (item === idlUtils.implForWrapper(currentTarget)) {
currentTargetIndex = index;
break;
}
if (slotInClosedTree) {
currentTargetHiddenSubtreeLevel--;
}
}
let currentHiddenLevel = currentTargetHiddenSubtreeLevel;
let maxHiddenLevel = currentTargetHiddenSubtreeLevel;
for (let i = currentTargetIndex - 1; i >= 0; i--) {
const { item, rootOfClosedTree, slotInClosedTree } = path[i];
if (rootOfClosedTree) {
currentHiddenLevel++;
}
if (currentHiddenLevel <= maxHiddenLevel) {
composedPath.unshift(idlUtils.wrapperForImpl(item));
}
if (slotInClosedTree) {
currentHiddenLevel--;
if (currentHiddenLevel < maxHiddenLevel) {
maxHiddenLevel = currentHiddenLevel;
}
}
}
currentHiddenLevel = currentTargetHiddenSubtreeLevel;
maxHiddenLevel = currentTargetHiddenSubtreeLevel;
for (let index = currentTargetIndex + 1; index < path.length; index++) {
const { item, rootOfClosedTree, slotInClosedTree } = path[index];
if (slotInClosedTree) {
currentHiddenLevel++;
}
if (currentHiddenLevel <= maxHiddenLevel) {
composedPath.push(idlUtils.wrapperForImpl(item));
}
if (rootOfClosedTree) {
currentHiddenLevel--;
if (currentHiddenLevel < maxHiddenLevel) {
maxHiddenLevel = currentHiddenLevel;
}
}
}
return composedPath;
}
_initialize(type, bubbles, cancelable) {

View File

@@ -1,10 +1,15 @@
"use strict";
const DOMException = require("domexception");
const reportException = require("../helpers/runtime-script-errors");
const { domSymbolTree } = require("../helpers/internal-constants");
const idlUtils = require("../generated/utils");
const {
isNode, isShadowRoot, isSlotable, getRoot, getEventTargetParent,
isShadowInclusiveAncestor, retarget
} = require("../helpers/shadow-dom");
const Event = require("../generated/Event").interface;
const MouseEvent = require("../generated/MouseEvent");
class EventTargetImpl {
constructor() {
@@ -19,7 +24,7 @@ class EventTargetImpl {
throw new TypeError("Only undefined, null, an object, or a function are allowed for the callback parameter");
}
options = normalizeEventHandlerOptions(options, ["capture", "once"]);
options = normalizeEventHandlerOptions(options, ["capture", "once", "passive"]);
if (callback === null) {
return;
@@ -82,63 +87,154 @@ class EventTargetImpl {
return this._dispatch(eventImpl);
}
_dispatch(eventImpl, targetOverride) {
// https://dom.spec.whatwg.org/#get-the-parent
_getTheParent() {
return null;
}
// https://dom.spec.whatwg.org/#concept-event-dispatch
// legacyOutputDidListenersThrowFlag optional parameter is not necessary here since it is only used by indexDB.
_dispatch(eventImpl, targetOverride /* , legacyOutputDidListenersThrowFlag */) {
let targetImpl = this;
let clearTargets = false;
let activationTarget = null;
eventImpl._dispatchFlag = true;
eventImpl.target = targetOverride || this;
const eventPath = [];
let { target } = eventImpl;
let targetParent = domSymbolTree.parent(target);
while (targetParent) {
eventPath.push(targetParent);
target = targetParent;
targetParent = domSymbolTree.parent(targetParent);
}
if (eventImpl.type !== "load" && target._defaultView) {
// https://html.spec.whatwg.org/#events-and-the-window-object
eventPath.push(idlUtils.implForWrapper(target._defaultView));
}
targetOverride = targetOverride || targetImpl;
let relatedTarget = retarget(eventImpl.relatedTarget, targetImpl);
eventImpl.eventPhase = Event.CAPTURING_PHASE;
for (let i = eventPath.length - 1; i >= 0; --i) {
if (eventImpl._stopPropagationFlag) {
break;
if (targetImpl !== relatedTarget || targetImpl === eventImpl.relatedTarget) {
const touchTargets = [];
appendToEventPath(eventImpl, targetImpl, targetOverride, relatedTarget, touchTargets, false);
const isActivationEvent = MouseEvent.isImpl(eventImpl) && eventImpl.type === "click";
if (isActivationEvent && targetImpl._hasActivationBehavior) {
activationTarget = targetImpl;
}
const object = eventPath[i];
const objectImpl = idlUtils.implForWrapper(object) || object; // window :(
const eventListeners = objectImpl._eventListeners[eventImpl.type];
invokeEventListeners(eventListeners, object, eventImpl);
}
let slotInClosedTree = false;
let slotable = isSlotable(targetImpl) && targetImpl._assignedSlot ? targetImpl : null;
let parent = getEventTargetParent(targetImpl, eventImpl);
eventImpl.eventPhase = Event.AT_TARGET;
// Populate event path
// https://dom.spec.whatwg.org/#event-path
while (parent !== null) {
if (slotable !== null) {
if (parent.localName !== "slot") {
throw new Error(`JSDOM Internal Error: Expected parent to be a Slot`);
}
if (!eventImpl._stopPropagationFlag) {
if (this._eventListeners[eventImpl.type]) {
const eventListeners = this._eventListeners[eventImpl.type];
invokeEventListeners(eventListeners, eventImpl.target, eventImpl);
}
}
slotable = null;
if (eventImpl.bubbles) {
eventImpl.eventPhase = Event.BUBBLING_PHASE;
for (let i = 0; i < eventPath.length; ++i) {
if (eventImpl._stopPropagationFlag) {
break;
const parentRoot = getRoot(parent);
if (isShadowRoot(parentRoot) && parentRoot.mode === "closed") {
slotInClosedTree = true;
}
}
const object = eventPath[i];
const objectImpl = idlUtils.implForWrapper(object) || object; // window :(
const eventListeners = objectImpl._eventListeners[eventImpl.type];
invokeEventListeners(eventListeners, object, eventImpl);
if (isSlotable(parent) && parent._assignedSlot) {
slotable = parent;
}
relatedTarget = retarget(eventImpl.relatedTarget, parent);
if (
(isNode(parent) && isShadowInclusiveAncestor(getRoot(targetImpl), parent)) ||
idlUtils.wrapperForImpl(parent).constructor.name === "Window"
) {
if (isActivationEvent && eventImpl.bubbles && activationTarget === null &&
parent._hasActivationBehavior) {
activationTarget = parent;
}
appendToEventPath(eventImpl, parent, null, relatedTarget, touchTargets, slotInClosedTree);
} else if (parent === relatedTarget) {
parent = null;
} else {
targetImpl = parent;
if (isActivationEvent && activationTarget === null && targetImpl._hasActivationBehavior) {
activationTarget = targetImpl;
}
appendToEventPath(eventImpl, parent, targetImpl, relatedTarget, touchTargets, slotInClosedTree);
}
if (parent !== null) {
parent = getEventTargetParent(parent, eventImpl);
}
slotInClosedTree = false;
}
let clearTargetsTupleIndex = -1;
for (let i = eventImpl._path.length - 1; i >= 0 && clearTargetsTupleIndex === -1; i--) {
if (eventImpl._path[i].target !== null) {
clearTargetsTupleIndex = i;
}
}
const clearTargetsTuple = eventImpl._path[clearTargetsTupleIndex];
clearTargets =
(isNode(clearTargetsTuple.target) && isShadowRoot(getRoot(clearTargetsTuple.target))) ||
(isNode(clearTargetsTuple.relatedTarget) && isShadowRoot(getRoot(clearTargetsTuple.relatedTarget)));
eventImpl.eventPhase = Event.CAPTURING_PHASE;
if (activationTarget !== null && activationTarget._legacyPreActivationBehavior) {
activationTarget._legacyPreActivationBehavior();
}
for (let i = eventImpl._path.length - 1; i >= 0; --i) {
const tuple = eventImpl._path[i];
if (tuple.target === null) {
invokeEventListeners(tuple, eventImpl);
}
}
for (let i = 0; i < eventImpl._path.length; i++) {
const tuple = eventImpl._path[i];
if (tuple.target !== null) {
eventImpl.eventPhase = Event.AT_TARGET;
} else {
eventImpl.eventPhase = Event.BUBBLING_PHASE;
}
if (
(eventImpl.eventPhase === Event.BUBBLING_PHASE && eventImpl.bubbles) ||
eventImpl.eventPhase === Event.AT_TARGET
) {
invokeEventListeners(tuple, eventImpl);
}
}
}
eventImpl.eventPhase = Event.NONE;
eventImpl.currentTarget = null;
eventImpl._path = [];
eventImpl._dispatchFlag = false;
eventImpl._stopPropagationFlag = false;
eventImpl._stopImmediatePropagationFlag = false;
eventImpl.eventPhase = Event.NONE;
eventImpl.currentTarget = null;
if (clearTargets) {
eventImpl.target = null;
eventImpl.relatedTarget = null;
}
if (activationTarget !== null) {
if (!eventImpl._canceledFlag) {
activationTarget._activationBehavior();
} else if (activationTarget._legacyCanceledActivationBehavior) {
activationTarget._legacyCanceledActivationBehavior();
}
}
return !eventImpl._canceledFlag;
}
}
@@ -147,41 +243,67 @@ module.exports = {
implementation: EventTargetImpl
};
function invokeEventListeners(listeners, target, eventImpl) {
// https://dom.spec.whatwg.org/#concept-event-listener-invoke
function invokeEventListeners(tuple, eventImpl) {
const tupleIndex = eventImpl._path.indexOf(tuple);
for (let i = tupleIndex; i >= 0; i--) {
const t = eventImpl._path[i];
if (t.target) {
eventImpl.target = t.target;
break;
}
}
eventImpl.relatedTarget = idlUtils.wrapperForImpl(tuple.relatedTarget);
if (eventImpl._stopPropagationFlag) {
return;
}
eventImpl.currentTarget = idlUtils.wrapperForImpl(tuple.item);
const listeners = tuple.item._eventListeners;
innerInvokeEventListeners(eventImpl, listeners);
}
// https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke
function innerInvokeEventListeners(eventImpl, listeners) {
let found = false;
const { type, target } = eventImpl;
const wrapper = idlUtils.wrapperForImpl(target);
const document = target._ownerDocument || (wrapper && (wrapper._document || wrapper._ownerDocument));
// Will be falsy for windows that have closed
if (!document) {
return;
if (!listeners || !listeners[type]) {
return found;
}
// workaround for events emitted on window (window-proxy)
// the wrapper is the root window instance, but we only want to expose the vm proxy at all times
if (wrapper._document && wrapper.constructor.name === "Window") {
target = idlUtils.implForWrapper(wrapper._document)._defaultView;
}
eventImpl.currentTarget = target;
if (!listeners) {
return;
}
// Copy event listeners before iterating since the list can be modified during the iteration.
const handlers = listeners[type].slice();
const handlers = listeners.slice();
for (let i = 0; i < handlers.length; ++i) {
if (eventImpl._stopImmediatePropagationFlag) {
return;
for (let i = 0; i < handlers.length; i++) {
const listener = handlers[i];
const { capture, once, passive } = listener.options;
// Check if the event listener has been removed since the listeners has been cloned.
if (!listeners[type].includes(listener)) {
continue;
}
const listener = handlers[i];
const { capture, once/* , passive */ } = listener.options;
found = true;
if (listeners.indexOf(listener) === -1 ||
(eventImpl.eventPhase === Event.CAPTURING_PHASE && !capture) ||
(eventImpl.eventPhase === Event.BUBBLING_PHASE && capture)) {
if (
(eventImpl.eventPhase === Event.CAPTURING_PHASE && !capture) ||
(eventImpl.eventPhase === Event.BUBBLING_PHASE && capture)
) {
continue;
}
if (once) {
listeners.splice(listeners.indexOf(listener), 1);
listeners[type].splice(listeners[type].indexOf(listener), 1);
}
if (passive) {
eventImpl._inPassiveListenerFlag = true;
}
try {
@@ -190,7 +312,7 @@ function invokeEventListeners(listeners, target, eventImpl) {
listener.callback.handleEvent(idlUtils.wrapperForImpl(eventImpl));
}
} else {
listener.callback.call(idlUtils.wrapperForImpl(eventImpl.currentTarget), idlUtils.wrapperForImpl(eventImpl));
listener.callback.call(eventImpl.currentTarget, idlUtils.wrapperForImpl(eventImpl));
}
} catch (e) {
let window = null;
@@ -210,7 +332,15 @@ function invokeEventListeners(listeners, target, eventImpl) {
}
// Errors in window-less documents just get swallowed... can you think of anything better?
}
eventImpl._inPassiveListenerFlag = false;
if (eventImpl._stopImmediatePropagationFlag) {
return found;
}
}
return found;
}
/**
@@ -241,3 +371,19 @@ function normalizeEventHandlerOptions(options, defaultBoolKeys) {
return returnValue;
}
// https://dom.spec.whatwg.org/#concept-event-path-append
function appendToEventPath(eventImpl, target, targetOverride, relatedTarget, touchTargets, slotInClosedTree) {
const itemInShadowTree = isNode(target) && isShadowRoot(getRoot(target));
const rootOfClosedTree = isShadowRoot(target) && target.mode === "closed";
eventImpl._path.push({
item: target,
itemInShadowTree,
target: targetOverride,
relatedTarget,
touchTargets,
rootOfClosedTree,
slotInClosedTree
});
}

View File

@@ -0,0 +1,23 @@
"use strict";
const UIEventImpl = require("./UIEvent-impl").implementation;
const InputEventInit = require("../generated/InputEventInit");
// https://w3c.github.io/uievents/#interface-inputevent
class InputEventImpl extends UIEventImpl {
initInputEvent(type, bubbles, cancelable, data, isComposing) {
if (this._dispatchFlag) {
return;
}
this.initUIEvent(type, bubbles, cancelable);
this.data = data;
this.isComposing = isComposing;
}
}
InputEventImpl.defaultInit = InputEventInit.convert(undefined);
module.exports = {
implementation: InputEventImpl
};

View File

@@ -0,0 +1,26 @@
"use strict";
const EventImpl = require("./Event-impl").implementation;
const StorageEventInit = require("../generated/StorageEventInit");
// https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface
class StorageEventImpl extends EventImpl {
initStorageEvent(type, bubbles, cancelable, key, oldValue, newValue, url, storageArea) {
if (this._dispatchFlag) {
return;
}
this.initEvent(type, bubbles, cancelable);
this.key = key;
this.oldValue = oldValue;
this.newValue = newValue;
this.url = url;
this.storageArea = storageArea;
}
}
StorageEventImpl.defaultInit = StorageEventInit.convert(undefined);
module.exports = {
implementation: StorageEventImpl
};

View File

@@ -7,6 +7,7 @@ const DOMException = require("domexception");
const EventTargetImpl = require("../events/EventTarget-impl").implementation;
const ProgressEvent = require("../generated/ProgressEvent");
const { setupForSimpleEventAccessors } = require("../helpers/create-event-accessor");
const { fireAnEvent } = require("../helpers/events");
const READY_STATES = Object.freeze({
EMPTY: 0,
@@ -58,8 +59,7 @@ class FileReaderImpl extends EventTargetImpl {
}
_fireProgressEvent(name, props) {
const event = ProgressEvent.createImpl([name, Object.assign({ bubbles: false, cancelable: false }, props)], {});
this.dispatchEvent(event);
fireAnEvent(name, this, ProgressEvent, props);
}
_readFile(file, format, encoding) {

View File

@@ -1,3 +0,0 @@
"use strict";
exports.formData = Symbol("entries");

View File

@@ -7,34 +7,20 @@ const impl = utils.implSymbol;
module.exports = {
createInterface: function(defaultPrivateData = {}) {
function AbortController() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'AbortController'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class AbortController {
constructor() {
return iface.setup(Object.create(new.target.prototype));
}
iface.setup(this);
}
abort() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(AbortController, "prototype", {
value: AbortController.prototype,
writable: false,
enumerable: false,
configurable: false
});
AbortController.prototype.abort = function abort() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].abort();
}
return this[impl].abort();
};
Object.defineProperty(AbortController.prototype, "signal", {
get() {
get signal() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -42,19 +28,13 @@ module.exports = {
return utils.getSameObject(this, "signal", () => {
return utils.tryWrapperForImpl(this[impl]["signal"]);
});
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(AbortController.prototype, {
abort: { enumerable: true },
signal: { enumerable: true },
[Symbol.toStringTag]: { value: "AbortController", configurable: true }
});
Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {
value: "AbortController",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
create(constructorArgs, privateData) {
let obj = Object.create(AbortController.prototype);
@@ -81,8 +61,6 @@ module.exports = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -8,43 +8,28 @@ const EventTarget = require("./EventTarget.js");
module.exports = {
createInterface: function(defaultPrivateData = {}) {
function AbortSignal() {
throw new TypeError("Illegal constructor");
}
class AbortSignal extends EventTarget.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(AbortSignal.prototype, EventTarget.interface.prototype);
Object.setPrototypeOf(AbortSignal, EventTarget.interface);
Object.defineProperty(AbortSignal, "prototype", {
value: AbortSignal.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(AbortSignal.prototype, "aborted", {
get() {
get aborted() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["aborted"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(AbortSignal.prototype, "onabort", {
get() {
get onabort() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onabort"]);
},
}
set(V) {
set onabort(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -52,19 +37,13 @@ module.exports = {
V = utils.tryImplForWrapper(V);
this[impl]["onabort"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(AbortSignal.prototype, {
aborted: { enumerable: true },
onabort: { enumerable: true },
[Symbol.toStringTag]: { value: "AbortSignal", configurable: true }
});
Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {
value: "AbortSignal",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
create(constructorArgs, privateData) {
let obj = Object.create(AbortSignal.prototype);
@@ -93,8 +72,6 @@ module.exports = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -20,6 +20,18 @@ module.exports = {
ret[key] = false;
}
}
{
const key = "passive";
let value = obj === undefined || obj === null ? undefined : obj[key];
if (value !== undefined) {
value = conversions["boolean"](value, { context: context + " has member passive that" });
ret[key] = value;
} else {
ret[key] = false;
}
}
},
convert(obj, { context = "The provided value" } = {}) {

View File

@@ -0,0 +1,30 @@
"use strict";
const conversions = require("webidl-conversions");
const utils = require("./utils.js");
module.exports = {
convertInherit(obj, ret, { context = "The provided value" } = {}) {
{
const key = "flatten";
let value = obj === undefined || obj === null ? undefined : obj[key];
if (value !== undefined) {
value = conversions["boolean"](value, { context: context + " has member flatten that" });
ret[key] = value;
} else {
ret[key] = false;
}
}
},
convert(obj, { context = "The provided value" } = {}) {
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
throw new TypeError(`${context} is not an object.`);
}
const ret = Object.create(null);
module.exports.convertInherit(obj, ret, { context });
return ret;
}
};

View File

@@ -5,92 +5,60 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function Attr() {
throw new TypeError("Illegal constructor");
}
class Attr {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(Attr, "prototype", {
value: Attr.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(Attr.prototype, "namespaceURI", {
get() {
get namespaceURI() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["namespaceURI"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "prefix", {
get() {
get prefix() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["prefix"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "localName", {
get() {
get localName() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["localName"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["name"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "nodeName", {
get() {
get nodeName() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["nodeName"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "value", {
get() {
get value() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["value"];
},
}
set(V) {
set value(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -98,22 +66,17 @@ Object.defineProperty(Attr.prototype, "value", {
V = conversions["DOMString"](V, { context: "Failed to set the 'value' property on 'Attr': The provided value" });
this[impl]["value"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "nodeValue", {
get() {
get nodeValue() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["nodeValue"];
},
}
set(V) {
set nodeValue(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -124,22 +87,17 @@ Object.defineProperty(Attr.prototype, "nodeValue", {
});
this[impl]["nodeValue"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "textContent", {
get() {
get textContent() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["textContent"];
},
}
set(V) {
set textContent(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -150,45 +108,37 @@ Object.defineProperty(Attr.prototype, "textContent", {
});
this[impl]["textContent"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "ownerElement", {
get() {
get ownerElement() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["ownerElement"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Attr.prototype, "specified", {
get() {
get specified() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["specified"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(Attr.prototype, {
namespaceURI: { enumerable: true },
prefix: { enumerable: true },
localName: { enumerable: true },
name: { enumerable: true },
nodeName: { enumerable: true },
value: { enumerable: true },
nodeValue: { enumerable: true },
textContent: { enumerable: true },
ownerElement: { enumerable: true },
specified: { enumerable: true },
[Symbol.toStringTag]: { value: "Attr", configurable: true }
});
Object.defineProperty(Attr.prototype, Symbol.toStringTag, {
value: "Attr",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -248,8 +198,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,37 +5,23 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function BarProp() {
throw new TypeError("Illegal constructor");
}
class BarProp {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(BarProp, "prototype", {
value: BarProp.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(BarProp.prototype, "visible", {
get() {
get visible() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["visible"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(BarProp.prototype, {
visible: { enumerable: true },
[Symbol.toStringTag]: { value: "BarProp", configurable: true }
});
Object.defineProperty(BarProp.prototype, Symbol.toStringTag, {
value: "BarProp",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -95,8 +81,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,122 +6,99 @@ const utils = require("./utils.js");
const convertBlobPropertyBag = require("./BlobPropertyBag.js").convert;
const impl = utils.implSymbol;
function Blob() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'Blob'. Please use the 'new' operator; this constructor " + "cannot be called as a function."
);
}
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
if (!utils.isObject(curArg)) {
throw new TypeError("Failed to construct 'Blob': parameter 1" + " is not an iterable object.");
} else {
const V = [];
const tmp = curArg;
for (let nextItem of tmp) {
if (module.exports.is(nextItem)) {
nextItem = utils.implForWrapper(nextItem);
} else if (nextItem instanceof ArrayBuffer) {
} else if (ArrayBuffer.isView(nextItem)) {
} else {
nextItem = conversions["USVString"](nextItem, {
context: "Failed to construct 'Blob': parameter 1" + "'s element"
});
class Blob {
constructor() {
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
if (!utils.isObject(curArg)) {
throw new TypeError("Failed to construct 'Blob': parameter 1" + " is not an iterable object.");
} else {
const V = [];
const tmp = curArg;
for (let nextItem of tmp) {
if (module.exports.is(nextItem)) {
nextItem = utils.implForWrapper(nextItem);
} else if (nextItem instanceof ArrayBuffer) {
} else if (ArrayBuffer.isView(nextItem)) {
} else {
nextItem = conversions["USVString"](nextItem, {
context: "Failed to construct 'Blob': parameter 1" + "'s element"
});
}
V.push(nextItem);
}
V.push(nextItem);
curArg = V;
}
curArg = V;
}
args.push(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertBlobPropertyBag(curArg, { context: "Failed to construct 'Blob': parameter 2" });
args.push(curArg);
{
let curArg = arguments[1];
curArg = convertBlobPropertyBag(curArg, { context: "Failed to construct 'Blob': parameter 2" });
args.push(curArg);
}
return iface.setup(Object.create(new.target.prototype), args);
}
iface.setup(this, args);
}
Object.defineProperty(Blob, "prototype", {
value: Blob.prototype,
writable: false,
enumerable: false,
configurable: false
});
Blob.prototype.slice = function slice() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = conversions["long long"](curArg, {
context: "Failed to execute 'slice' on 'Blob': parameter 1",
clamp: true
});
slice() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["long long"](curArg, {
context: "Failed to execute 'slice' on 'Blob': parameter 2",
clamp: true
});
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = conversions["long long"](curArg, {
context: "Failed to execute 'slice' on 'Blob': parameter 1",
clamp: true
});
}
args.push(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, { context: "Failed to execute 'slice' on 'Blob': parameter 3" });
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["long long"](curArg, {
context: "Failed to execute 'slice' on 'Blob': parameter 2",
clamp: true
});
}
args.push(curArg);
}
args.push(curArg);
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, { context: "Failed to execute 'slice' on 'Blob': parameter 3" });
}
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].slice(...args));
}
return utils.tryWrapperForImpl(this[impl].slice(...args));
};
Object.defineProperty(Blob.prototype, "size", {
get() {
get size() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["size"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Blob.prototype, "type", {
get() {
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["type"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(Blob.prototype, {
slice: { enumerable: true },
size: { enumerable: true },
type: { enumerable: true },
[Symbol.toStringTag]: { value: "Blob", configurable: true }
});
Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
value: "Blob",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -181,8 +158,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,27 +6,14 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const Text = require("./Text.js");
function CDATASection() {
throw new TypeError("Illegal constructor");
class CDATASection extends Text.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
}
Object.setPrototypeOf(CDATASection.prototype, Text.interface.prototype);
Object.setPrototypeOf(CDATASection, Text.interface);
Object.defineProperty(CDATASection, "prototype", {
value: CDATASection.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(CDATASection.prototype, {
[Symbol.toStringTag]: { value: "CDATASection", configurable: true }
});
Object.defineProperty(CDATASection.prototype, Symbol.toStringTag, {
value: "CDATASection",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -88,8 +75,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -9,245 +9,235 @@ const Node = require("./Node.js");
const ChildNode = require("./ChildNode.js");
const NonDocumentTypeChildNode = require("./NonDocumentTypeChildNode.js");
function CharacterData() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(CharacterData.prototype, Node.interface.prototype);
Object.setPrototypeOf(CharacterData, Node.interface);
Object.defineProperty(CharacterData, "prototype", {
value: CharacterData.prototype,
writable: false,
enumerable: false,
configurable: false
});
CharacterData.prototype.substringData = function substringData(offset, count) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class CharacterData extends Node.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'substringData' on 'CharacterData': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'substringData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'substringData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
return this[impl].substringData(...args);
};
CharacterData.prototype.appendData = function appendData(data) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'appendData' on 'CharacterData': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'appendData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
return this[impl].appendData(...args);
};
CharacterData.prototype.insertData = function insertData(offset, data) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'insertData' on 'CharacterData': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'insertData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'insertData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
return this[impl].insertData(...args);
};
CharacterData.prototype.deleteData = function deleteData(offset, count) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'deleteData' on 'CharacterData': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'deleteData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'deleteData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
return this[impl].deleteData(...args);
};
CharacterData.prototype.replaceData = function replaceData(offset, count, data) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 3) {
throw new TypeError(
"Failed to execute 'replaceData' on 'CharacterData': 3 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'replaceData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'replaceData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
{
let curArg = arguments[2];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceData' on 'CharacterData': parameter 3"
});
args.push(curArg);
}
return this[impl].replaceData(...args);
};
CharacterData.prototype.before = function before() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'before' on 'CharacterData': parameter " + (i + 1)
});
substringData(offset, count) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
return this[impl].before(...args);
};
CharacterData.prototype.after = function after() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'after' on 'CharacterData': parameter " + (i + 1)
});
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'substringData' on 'CharacterData': 2 arguments required, but only " +
arguments.length +
" present."
);
}
args.push(curArg);
}
return this[impl].after(...args);
};
CharacterData.prototype.replaceWith = function replaceWith() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceWith' on 'CharacterData': parameter " + (i + 1)
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'substringData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
args.push(curArg);
}
return this[impl].replaceWith(...args);
};
CharacterData.prototype.remove = function remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
{
let curArg = arguments[1];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'substringData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
return this[impl].substringData(...args);
}
return this[impl].remove();
};
appendData(data) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(CharacterData.prototype, "data", {
get() {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'appendData' on 'CharacterData': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'appendData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
return this[impl].appendData(...args);
}
insertData(offset, data) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'insertData' on 'CharacterData': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'insertData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'insertData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
return this[impl].insertData(...args);
}
deleteData(offset, count) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'deleteData' on 'CharacterData': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'deleteData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'deleteData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
return this[impl].deleteData(...args);
}
replaceData(offset, count, data) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 3) {
throw new TypeError(
"Failed to execute 'replaceData' on 'CharacterData': 3 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'replaceData' on 'CharacterData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'replaceData' on 'CharacterData': parameter 2"
});
args.push(curArg);
}
{
let curArg = arguments[2];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceData' on 'CharacterData': parameter 3"
});
args.push(curArg);
}
return this[impl].replaceData(...args);
}
before() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'before' on 'CharacterData': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].before(...args);
}
after() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'after' on 'CharacterData': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].after(...args);
}
replaceWith() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceWith' on 'CharacterData': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].replaceWith(...args);
}
remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].remove();
}
get data() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["data"];
},
}
set(V) {
set data(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -258,58 +248,49 @@ Object.defineProperty(CharacterData.prototype, "data", {
});
this[impl]["data"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(CharacterData.prototype, "length", {
get() {
get length() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["length"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(CharacterData.prototype, "previousElementSibling", {
get() {
get previousElementSibling() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["previousElementSibling"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(CharacterData.prototype, "nextElementSibling", {
get() {
get nextElementSibling() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["nextElementSibling"]);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(CharacterData.prototype, {
substringData: { enumerable: true },
appendData: { enumerable: true },
insertData: { enumerable: true },
deleteData: { enumerable: true },
replaceData: { enumerable: true },
before: { enumerable: true },
after: { enumerable: true },
replaceWith: { enumerable: true },
remove: { enumerable: true },
data: { enumerable: true },
length: { enumerable: true },
previousElementSibling: { enumerable: true },
nextElementSibling: { enumerable: true },
[Symbol.toStringTag]: { value: "CharacterData", configurable: true },
[Symbol.unscopables]: { value: { before: true, after: true, replaceWith: true, remove: true }, configurable: true }
});
Object.defineProperty(CharacterData.prototype, Symbol.toStringTag, {
value: "CharacterData",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -371,8 +352,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,101 +6,84 @@ const utils = require("./utils.js");
const isNode = require("./Node.js").is;
const impl = utils.implSymbol;
function ChildNode() {
throw new TypeError("Illegal constructor");
class ChildNode {
constructor() {
throw new TypeError("Illegal constructor");
}
before() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'before' on 'ChildNode': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].before(...args);
}
after() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'after' on 'ChildNode': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].after(...args);
}
replaceWith() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceWith' on 'ChildNode': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].replaceWith(...args);
}
remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].remove();
}
}
Object.defineProperty(ChildNode, "prototype", {
value: ChildNode.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(ChildNode.prototype, {
before: { enumerable: true },
after: { enumerable: true },
replaceWith: { enumerable: true },
remove: { enumerable: true },
[Symbol.toStringTag]: { value: "ChildNode", configurable: true },
[Symbol.unscopables]: { value: { before: true, after: true, replaceWith: true, remove: true }, configurable: true }
});
ChildNode.prototype.before = function before() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'before' on 'ChildNode': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].before(...args);
};
ChildNode.prototype.after = function after() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'after' on 'ChildNode': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].after(...args);
};
ChildNode.prototype.replaceWith = function replaceWith() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceWith' on 'ChildNode': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].replaceWith(...args);
};
ChildNode.prototype.remove = function remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].remove();
};
Object.defineProperty(ChildNode.prototype, Symbol.unscopables, {
value: {
before: true,
after: true,
replaceWith: true,
remove: true
},
writable: false,
enumerable: false,
configurable: true
});
Object.defineProperty(ChildNode.prototype, Symbol.toStringTag, {
value: "ChildNode",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -160,8 +143,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,90 +7,57 @@ const convertCloseEventInit = require("./CloseEventInit.js").convert;
const impl = utils.implSymbol;
const Event = require("./Event.js");
function CloseEvent(type) {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'CloseEvent'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class CloseEvent extends Event.interface {
constructor(type) {
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'CloseEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'CloseEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertCloseEventInit(curArg, { context: "Failed to construct 'CloseEvent': parameter 2" });
args.push(curArg);
}
return iface.setup(Object.create(new.target.prototype), args);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'CloseEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'CloseEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertCloseEventInit(curArg, { context: "Failed to construct 'CloseEvent': parameter 2" });
args.push(curArg);
}
iface.setup(this, args);
}
Object.setPrototypeOf(CloseEvent.prototype, Event.interface.prototype);
Object.setPrototypeOf(CloseEvent, Event.interface);
Object.defineProperty(CloseEvent, "prototype", {
value: CloseEvent.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(CloseEvent.prototype, "wasClean", {
get() {
get wasClean() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["wasClean"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(CloseEvent.prototype, "code", {
get() {
get code() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["code"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(CloseEvent.prototype, "reason", {
get() {
get reason() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["reason"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(CloseEvent.prototype, {
wasClean: { enumerable: true },
code: { enumerable: true },
reason: { enumerable: true },
[Symbol.toStringTag]: { value: "CloseEvent", configurable: true }
});
Object.defineProperty(CloseEvent.prototype, Symbol.toStringTag, {
value: "CloseEvent",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -152,8 +119,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,44 +6,22 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const CharacterData = require("./CharacterData.js");
function Comment() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'Comment'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
}
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'Comment': parameter 1" });
} else {
curArg = "";
class Comment extends CharacterData.interface {
constructor() {
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'Comment': parameter 1" });
} else {
curArg = "";
}
args.push(curArg);
}
args.push(curArg);
return iface.setup(Object.create(new.target.prototype), args);
}
iface.setup(this, args);
}
Object.setPrototypeOf(Comment.prototype, CharacterData.interface.prototype);
Object.setPrototypeOf(Comment, CharacterData.interface);
Object.defineProperty(Comment, "prototype", {
value: Comment.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(Comment.prototype, Symbol.toStringTag, {
value: "Comment",
writable: false,
enumerable: false,
configurable: true
});
Object.defineProperties(Comment.prototype, { [Symbol.toStringTag]: { value: "Comment", configurable: true } });
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -105,8 +83,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,133 +7,109 @@ const convertCompositionEventInit = require("./CompositionEventInit.js").convert
const impl = utils.implSymbol;
const UIEvent = require("./UIEvent.js");
function CompositionEvent(type) {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'CompositionEvent'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'CompositionEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'CompositionEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertCompositionEventInit(curArg, { context: "Failed to construct 'CompositionEvent': parameter 2" });
args.push(curArg);
}
iface.setup(this, args);
}
Object.setPrototypeOf(CompositionEvent.prototype, UIEvent.interface.prototype);
Object.setPrototypeOf(CompositionEvent, UIEvent.interface);
Object.defineProperty(CompositionEvent, "prototype", {
value: CompositionEvent.prototype,
writable: false,
enumerable: false,
configurable: false
});
CompositionEvent.prototype.initCompositionEvent = function initCompositionEvent(typeArg) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'initCompositionEvent' on 'CompositionEvent': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 2"
});
} else {
curArg = false;
class CompositionEvent extends UIEvent.interface {
constructor(type) {
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'CompositionEvent': 1 argument required, but only " + arguments.length + " present."
);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 3"
});
} else {
curArg = false;
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'CompositionEvent': parameter 1" });
args.push(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[3];
if (curArg !== undefined) {
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = utils.tryImplForWrapper(curArg);
}
} else {
curArg = null;
{
let curArg = arguments[1];
curArg = convertCompositionEventInit(curArg, { context: "Failed to construct 'CompositionEvent': parameter 2" });
args.push(curArg);
}
args.push(curArg);
return iface.setup(Object.create(new.target.prototype), args);
}
{
let curArg = arguments[4];
if (curArg !== undefined) {
initCompositionEvent(typeArg) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'initCompositionEvent' on 'CompositionEvent': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 5"
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 1"
});
} else {
curArg = "";
args.push(curArg);
}
args.push(curArg);
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 2"
});
} else {
curArg = false;
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 3"
});
} else {
curArg = false;
}
args.push(curArg);
}
{
let curArg = arguments[3];
if (curArg !== undefined) {
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = utils.tryImplForWrapper(curArg);
}
} else {
curArg = null;
}
args.push(curArg);
}
{
let curArg = arguments[4];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 5"
});
} else {
curArg = "";
}
args.push(curArg);
}
return this[impl].initCompositionEvent(...args);
}
return this[impl].initCompositionEvent(...args);
};
Object.defineProperty(CompositionEvent.prototype, "data", {
get() {
get data() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["data"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(CompositionEvent.prototype, {
initCompositionEvent: { enumerable: true },
data: { enumerable: true },
[Symbol.toStringTag]: { value: "CompositionEvent", configurable: true }
});
Object.defineProperty(CompositionEvent.prototype, Symbol.toStringTag, {
value: "CompositionEvent",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -195,8 +171,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,120 +7,96 @@ const convertCustomEventInit = require("./CustomEventInit.js").convert;
const impl = utils.implSymbol;
const Event = require("./Event.js");
function CustomEvent(type) {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'CustomEvent'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'CustomEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'CustomEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertCustomEventInit(curArg, { context: "Failed to construct 'CustomEvent': parameter 2" });
args.push(curArg);
}
iface.setup(this, args);
}
Object.setPrototypeOf(CustomEvent.prototype, Event.interface.prototype);
Object.setPrototypeOf(CustomEvent, Event.interface);
Object.defineProperty(CustomEvent, "prototype", {
value: CustomEvent.prototype,
writable: false,
enumerable: false,
configurable: false
});
CustomEvent.prototype.initCustomEvent = function initCustomEvent(type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'initCustomEvent' on 'CustomEvent': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 2"
});
} else {
curArg = false;
class CustomEvent extends Event.interface {
constructor(type) {
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'CustomEvent': 1 argument required, but only " + arguments.length + " present."
);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 3"
});
} else {
curArg = false;
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'CustomEvent': parameter 1" });
args.push(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[3];
if (curArg !== undefined) {
curArg = conversions["any"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 4"
});
} else {
curArg = null;
{
let curArg = arguments[1];
curArg = convertCustomEventInit(curArg, { context: "Failed to construct 'CustomEvent': parameter 2" });
args.push(curArg);
}
args.push(curArg);
return iface.setup(Object.create(new.target.prototype), args);
}
return this[impl].initCustomEvent(...args);
};
Object.defineProperty(CustomEvent.prototype, "detail", {
get() {
initCustomEvent(type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'initCustomEvent' on 'CustomEvent': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 2"
});
} else {
curArg = false;
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 3"
});
} else {
curArg = false;
}
args.push(curArg);
}
{
let curArg = arguments[3];
if (curArg !== undefined) {
curArg = conversions["any"](curArg, {
context: "Failed to execute 'initCustomEvent' on 'CustomEvent': parameter 4"
});
} else {
curArg = null;
}
args.push(curArg);
}
return this[impl].initCustomEvent(...args);
}
get detail() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["detail"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(CustomEvent.prototype, {
initCustomEvent: { enumerable: true },
detail: { enumerable: true },
[Symbol.toStringTag]: { value: "CustomEvent", configurable: true }
});
Object.defineProperty(CustomEvent.prototype, Symbol.toStringTag, {
value: "CustomEvent",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -182,8 +158,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,136 +6,130 @@ const utils = require("./utils.js");
const convertDocumentType = require("./DocumentType.js").convert;
const impl = utils.implSymbol;
function DOMImplementation() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(DOMImplementation, "prototype", {
value: DOMImplementation.prototype,
writable: false,
enumerable: false,
configurable: false
});
DOMImplementation.prototype.createDocumentType = function createDocumentType(qualifiedName, publicId, systemId) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class DOMImplementation {
constructor() {
throw new TypeError("Illegal constructor");
}
if (arguments.length < 3) {
throw new TypeError(
"Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 2"
});
args.push(curArg);
}
{
let curArg = arguments[2];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 3"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].createDocumentType(...args));
};
DOMImplementation.prototype.createDocument = function createDocument(namespace, qualifiedName) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocument' on 'DOMImplementation': parameter 1"
});
createDocumentType(qualifiedName, publicId, systemId) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
if (arguments.length < 3) {
throw new TypeError(
"Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 2"
});
args.push(curArg);
}
{
let curArg = arguments[2];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 3"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].createDocumentType(...args));
}
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocument' on 'DOMImplementation': parameter 2",
treatNullAsEmptyString: true
});
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
createDocument(namespace, qualifiedName) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = convertDocumentType(curArg, {
context: "Failed to execute 'createDocument' on 'DOMImplementation': parameter 3"
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createDocument' on 'DOMImplementation': parameter 1"
});
}
} else {
curArg = null;
args.push(curArg);
}
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].createDocument(...args));
};
DOMImplementation.prototype.createHTMLDocument = function createHTMLDocument() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createHTMLDocument' on 'DOMImplementation': parameter 1"
context: "Failed to execute 'createDocument' on 'DOMImplementation': parameter 2",
treatNullAsEmptyString: true
});
args.push(curArg);
}
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].createHTMLDocument(...args));
};
DOMImplementation.prototype.hasFeature = function hasFeature() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
{
let curArg = arguments[2];
if (curArg !== undefined) {
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = convertDocumentType(curArg, {
context: "Failed to execute 'createDocument' on 'DOMImplementation': parameter 3"
});
}
} else {
curArg = null;
}
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].createDocument(...args));
}
return this[impl].hasFeature();
};
createHTMLDocument() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'createHTMLDocument' on 'DOMImplementation': parameter 1"
});
}
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].createHTMLDocument(...args));
}
Object.defineProperty(DOMImplementation.prototype, Symbol.toStringTag, {
value: "DOMImplementation",
writable: false,
enumerable: false,
configurable: true
hasFeature() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].hasFeature();
}
}
Object.defineProperties(DOMImplementation.prototype, {
createDocumentType: { enumerable: true },
createDocument: { enumerable: true },
createHTMLDocument: { enumerable: true },
hasFeature: { enumerable: true },
[Symbol.toStringTag]: { value: "DOMImplementation", configurable: true }
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -195,8 +189,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,61 +6,45 @@ const utils = require("./utils.js");
const convertSupportedType = require("./SupportedType.js").convert;
const impl = utils.implSymbol;
function DOMParser() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'DOMParser'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class DOMParser {
constructor() {
return iface.setup(Object.create(new.target.prototype));
}
iface.setup(this);
parseFromString(str, type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'parseFromString' on 'DOMParser': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'parseFromString' on 'DOMParser': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertSupportedType(curArg, {
context: "Failed to execute 'parseFromString' on 'DOMParser': parameter 2"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].parseFromString(...args));
}
}
Object.defineProperty(DOMParser, "prototype", {
value: DOMParser.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(DOMParser.prototype, {
parseFromString: { enumerable: true },
[Symbol.toStringTag]: { value: "DOMParser", configurable: true }
});
DOMParser.prototype.parseFromString = function parseFromString(str, type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'parseFromString' on 'DOMParser': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'parseFromString' on 'DOMParser': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertSupportedType(curArg, {
context: "Failed to execute 'parseFromString' on 'DOMParser': parameter 2"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].parseFromString(...args));
};
Object.defineProperty(DOMParser.prototype, Symbol.toStringTag, {
value: "DOMParser",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -120,8 +104,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,24 +5,14 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function DOMStringMap() {
throw new TypeError("Illegal constructor");
class DOMStringMap {
constructor() {
throw new TypeError("Illegal constructor");
}
}
Object.defineProperty(DOMStringMap, "prototype", {
value: DOMStringMap.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(DOMStringMap.prototype, {
[Symbol.toStringTag]: { value: "DOMStringMap", configurable: true }
});
Object.defineProperty(DOMStringMap.prototype, Symbol.toStringTag, {
value: "DOMStringMap",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -82,8 +72,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,198 +5,185 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function DOMTokenList() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(DOMTokenList, "prototype", {
value: DOMTokenList.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(DOMTokenList.prototype, Symbol.iterator, {
writable: true,
enumerable: false,
configurable: true,
value: Array.prototype[Symbol.iterator]
});
DOMTokenList.prototype.forEach = Array.prototype.forEach;
DOMTokenList.prototype.item = function item(index) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class DOMTokenList {
constructor() {
throw new TypeError("Illegal constructor");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'item' on 'DOMTokenList': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'item' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
return this[impl].item(...args);
};
DOMTokenList.prototype.contains = function contains(token) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'contains' on 'DOMTokenList': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'contains' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
return this[impl].contains(...args);
};
DOMTokenList.prototype.add = function add() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'add' on 'DOMTokenList': parameter " + (i + 1)
});
args.push(curArg);
}
return this[impl].add(...args);
};
DOMTokenList.prototype.remove = function remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'remove' on 'DOMTokenList': parameter " + (i + 1)
});
args.push(curArg);
}
return this[impl].remove(...args);
};
DOMTokenList.prototype.toggle = function toggle(token) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'toggle' on 'DOMTokenList': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to execute 'toggle' on 'DOMTokenList': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, { context: "Failed to execute 'toggle' on 'DOMTokenList': parameter 2" });
item(index) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
return this[impl].toggle(...args);
};
DOMTokenList.prototype.replace = function replace(token, newToken) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'item' on 'DOMTokenList': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'item' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
return this[impl].item(...args);
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'replace' on 'DOMTokenList': 2 arguments required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replace' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replace' on 'DOMTokenList': parameter 2"
});
args.push(curArg);
}
return this[impl].replace(...args);
};
contains(token) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
DOMTokenList.prototype.supports = function supports(token) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'contains' on 'DOMTokenList': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'contains' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
return this[impl].contains(...args);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'supports' on 'DOMTokenList': 1 argument required, but only " + arguments.length + " present."
);
add() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'add' on 'DOMTokenList': parameter " + (i + 1)
});
args.push(curArg);
}
return this[impl].add(...args);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'supports' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'remove' on 'DOMTokenList': parameter " + (i + 1)
});
args.push(curArg);
}
return this[impl].remove(...args);
}
return this[impl].supports(...args);
};
DOMTokenList.prototype.entries = Array.prototype.entries;
DOMTokenList.prototype.keys = Array.prototype.keys;
DOMTokenList.prototype.values = Array.prototype[Symbol.iterator];
toggle(token) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(DOMTokenList.prototype, "length", {
get() {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'toggle' on 'DOMTokenList': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'toggle' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'toggle' on 'DOMTokenList': parameter 2"
});
}
args.push(curArg);
}
return this[impl].toggle(...args);
}
replace(token, newToken) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'replace' on 'DOMTokenList': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replace' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replace' on 'DOMTokenList': parameter 2"
});
args.push(curArg);
}
return this[impl].replace(...args);
}
supports(token) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'supports' on 'DOMTokenList': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'supports' on 'DOMTokenList': parameter 1"
});
args.push(curArg);
}
return this[impl].supports(...args);
}
get length() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["length"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(DOMTokenList.prototype, "value", {
get() {
get value() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["value"];
},
}
set(V) {
set value(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -206,26 +193,33 @@ Object.defineProperty(DOMTokenList.prototype, "value", {
});
this[impl]["value"] = V;
},
enumerable: true,
configurable: true
});
DOMTokenList.prototype.toString = function toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["value"];
};
Object.defineProperty(DOMTokenList.prototype, Symbol.toStringTag, {
value: "DOMTokenList",
writable: false,
enumerable: false,
configurable: true
toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["value"];
}
}
Object.defineProperties(DOMTokenList.prototype, {
item: { enumerable: true },
contains: { enumerable: true },
add: { enumerable: true },
remove: { enumerable: true },
toggle: { enumerable: true },
replace: { enumerable: true },
supports: { enumerable: true },
length: { enumerable: true },
value: { enumerable: true },
toString: { enumerable: true },
[Symbol.toStringTag]: { value: "DOMTokenList", configurable: true },
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true },
keys: { value: Array.prototype.keys, configurable: true, enumerable: true, writable: true },
values: { value: Array.prototype[Symbol.iterator], configurable: true, enumerable: true, writable: true },
entries: { value: Array.prototype.entries, configurable: true, enumerable: true, writable: true },
forEach: { value: Array.prototype.forEach, configurable: true, enumerable: true, writable: true }
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -285,8 +279,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

File diff suppressed because it is too large Load Diff

View File

@@ -9,136 +9,119 @@ const Node = require("./Node.js");
const NonElementParentNode = require("./NonElementParentNode.js");
const ParentNode = require("./ParentNode.js");
function DocumentFragment() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'DocumentFragment'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class DocumentFragment extends Node.interface {
constructor() {
return iface.setup(Object.create(new.target.prototype));
}
iface.setup(this);
}
Object.setPrototypeOf(DocumentFragment.prototype, Node.interface.prototype);
Object.setPrototypeOf(DocumentFragment, Node.interface);
Object.defineProperty(DocumentFragment, "prototype", {
value: DocumentFragment.prototype,
writable: false,
enumerable: false,
configurable: false
});
DocumentFragment.prototype.getElementById = function getElementById(elementId) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'getElementById' on 'DocumentFragment': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'getElementById' on 'DocumentFragment': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].getElementById(...args));
};
DocumentFragment.prototype.prepend = function prepend() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'prepend' on 'DocumentFragment': parameter " + (i + 1)
});
getElementById(elementId) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
return this[impl].prepend(...args);
};
DocumentFragment.prototype.append = function append() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'append' on 'DocumentFragment': parameter " + (i + 1)
});
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'getElementById' on 'DocumentFragment': 1 argument required, but only " +
arguments.length +
" present."
);
}
args.push(curArg);
}
return this[impl].append(...args);
};
DocumentFragment.prototype.querySelector = function querySelector(selectors) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'getElementById' on 'DocumentFragment': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].getElementById(...args));
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'querySelector' on 'DocumentFragment': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'querySelector' on 'DocumentFragment': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].querySelector(...args));
};
DocumentFragment.prototype.querySelectorAll = function querySelectorAll(selectors) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
prepend() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'prepend' on 'DocumentFragment': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].prepend(...args);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'querySelectorAll' on 'DocumentFragment': 1 argument required, but only " +
arguments.length +
" present."
);
append() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'append' on 'DocumentFragment': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].append(...args);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'querySelectorAll' on 'DocumentFragment': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].querySelectorAll(...args));
};
Object.defineProperty(DocumentFragment.prototype, "children", {
get() {
querySelector(selectors) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'querySelector' on 'DocumentFragment': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'querySelector' on 'DocumentFragment': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].querySelector(...args));
}
querySelectorAll(selectors) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'querySelectorAll' on 'DocumentFragment': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'querySelectorAll' on 'DocumentFragment': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].querySelectorAll(...args));
}
get children() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -146,58 +129,45 @@ Object.defineProperty(DocumentFragment.prototype, "children", {
return utils.getSameObject(this, "children", () => {
return utils.tryWrapperForImpl(this[impl]["children"]);
});
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(DocumentFragment.prototype, "firstElementChild", {
get() {
get firstElementChild() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["firstElementChild"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(DocumentFragment.prototype, "lastElementChild", {
get() {
get lastElementChild() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["lastElementChild"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(DocumentFragment.prototype, "childElementCount", {
get() {
get childElementCount() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["childElementCount"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(DocumentFragment.prototype, {
getElementById: { enumerable: true },
prepend: { enumerable: true },
append: { enumerable: true },
querySelector: { enumerable: true },
querySelectorAll: { enumerable: true },
children: { enumerable: true },
firstElementChild: { enumerable: true },
lastElementChild: { enumerable: true },
childElementCount: { enumerable: true },
[Symbol.toStringTag]: { value: "DocumentFragment", configurable: true },
[Symbol.unscopables]: { value: { prepend: true, append: true }, configurable: true }
});
Object.defineProperty(DocumentFragment.prototype, Symbol.toStringTag, {
value: "DocumentFragment",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -259,8 +229,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -8,131 +8,111 @@ const impl = utils.implSymbol;
const Node = require("./Node.js");
const ChildNode = require("./ChildNode.js");
function DocumentType() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(DocumentType.prototype, Node.interface.prototype);
Object.setPrototypeOf(DocumentType, Node.interface);
Object.defineProperty(DocumentType, "prototype", {
value: DocumentType.prototype,
writable: false,
enumerable: false,
configurable: false
});
DocumentType.prototype.before = function before() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class DocumentType extends Node.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'before' on 'DocumentType': parameter " + (i + 1)
});
before() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
return this[impl].before(...args);
};
DocumentType.prototype.after = function after() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'after' on 'DocumentType': parameter " + (i + 1)
});
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'before' on 'DocumentType': parameter " + (i + 1)
});
}
args.push(curArg);
}
args.push(curArg);
return this[impl].before(...args);
}
return this[impl].after(...args);
};
DocumentType.prototype.replaceWith = function replaceWith() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceWith' on 'DocumentType': parameter " + (i + 1)
});
after() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
return this[impl].replaceWith(...args);
};
DocumentType.prototype.remove = function remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'after' on 'DocumentType': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].after(...args);
}
return this[impl].remove();
};
replaceWith() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length; i++) {
let curArg = arguments[i];
if (isNode(curArg)) {
curArg = utils.implForWrapper(curArg);
} else {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'replaceWith' on 'DocumentType': parameter " + (i + 1)
});
}
args.push(curArg);
}
return this[impl].replaceWith(...args);
}
Object.defineProperty(DocumentType.prototype, "name", {
get() {
remove() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].remove();
}
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["name"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(DocumentType.prototype, "publicId", {
get() {
get publicId() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["publicId"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(DocumentType.prototype, "systemId", {
get() {
get systemId() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["systemId"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(DocumentType.prototype, {
before: { enumerable: true },
after: { enumerable: true },
replaceWith: { enumerable: true },
remove: { enumerable: true },
name: { enumerable: true },
publicId: { enumerable: true },
systemId: { enumerable: true },
[Symbol.toStringTag]: { value: "DocumentType", configurable: true },
[Symbol.unscopables]: { value: { before: true, after: true, replaceWith: true, remove: true }, configurable: true }
});
Object.defineProperty(DocumentType.prototype, Symbol.toStringTag, {
value: "DocumentType",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -194,8 +174,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

File diff suppressed because it is too large Load Diff

View File

@@ -5,19 +5,12 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function ElementCSSInlineStyle() {
throw new TypeError("Illegal constructor");
}
class ElementCSSInlineStyle {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(ElementCSSInlineStyle, "prototype", {
value: ElementCSSInlineStyle.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(ElementCSSInlineStyle.prototype, "style", {
get() {
get style() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -25,27 +18,20 @@ Object.defineProperty(ElementCSSInlineStyle.prototype, "style", {
return utils.getSameObject(this, "style", () => {
return utils.tryWrapperForImpl(this[impl]["style"]);
});
},
}
set(V) {
set style(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
this.style.cssText = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(ElementCSSInlineStyle.prototype, {
style: { enumerable: true },
[Symbol.toStringTag]: { value: "ElementCSSInlineStyle", configurable: true }
});
Object.defineProperty(ElementCSSInlineStyle.prototype, Symbol.toStringTag, {
value: "ElementCSSInlineStyle",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -105,8 +91,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,24 +5,14 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function ElementContentEditable() {
throw new TypeError("Illegal constructor");
class ElementContentEditable {
constructor() {
throw new TypeError("Illegal constructor");
}
}
Object.defineProperty(ElementContentEditable, "prototype", {
value: ElementContentEditable.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(ElementContentEditable.prototype, {
[Symbol.toStringTag]: { value: "ElementContentEditable", configurable: true }
});
Object.defineProperty(ElementContentEditable.prototype, Symbol.toStringTag, {
value: "ElementContentEditable",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -82,8 +72,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,116 +7,75 @@ const convertErrorEventInit = require("./ErrorEventInit.js").convert;
const impl = utils.implSymbol;
const Event = require("./Event.js");
function ErrorEvent(type) {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'ErrorEvent'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class ErrorEvent extends Event.interface {
constructor(type) {
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'ErrorEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'ErrorEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertErrorEventInit(curArg, { context: "Failed to construct 'ErrorEvent': parameter 2" });
args.push(curArg);
}
return iface.setup(Object.create(new.target.prototype), args);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'ErrorEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'ErrorEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertErrorEventInit(curArg, { context: "Failed to construct 'ErrorEvent': parameter 2" });
args.push(curArg);
}
iface.setup(this, args);
}
Object.setPrototypeOf(ErrorEvent.prototype, Event.interface.prototype);
Object.setPrototypeOf(ErrorEvent, Event.interface);
Object.defineProperty(ErrorEvent, "prototype", {
value: ErrorEvent.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(ErrorEvent.prototype, "message", {
get() {
get message() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["message"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(ErrorEvent.prototype, "filename", {
get() {
get filename() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["filename"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(ErrorEvent.prototype, "lineno", {
get() {
get lineno() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["lineno"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(ErrorEvent.prototype, "colno", {
get() {
get colno() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["colno"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(ErrorEvent.prototype, "error", {
get() {
get error() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["error"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(ErrorEvent.prototype, {
message: { enumerable: true },
filename: { enumerable: true },
lineno: { enumerable: true },
colno: { enumerable: true },
error: { enumerable: true },
[Symbol.toStringTag]: { value: "ErrorEvent", configurable: true }
});
Object.defineProperty(ErrorEvent.prototype, Symbol.toStringTag, {
value: "ErrorEvent",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -178,8 +137,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,175 +6,145 @@ const utils = require("./utils.js");
const convertEventInit = require("./EventInit.js").convert;
const impl = utils.implSymbol;
function Event(type) {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'Event'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
}
if (arguments.length < 1) {
throw new TypeError("Failed to construct 'Event': 1 argument required, but only " + arguments.length + " present.");
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'Event': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertEventInit(curArg, { context: "Failed to construct 'Event': parameter 2" });
args.push(curArg);
}
iface.setup(this, args);
}
Object.defineProperty(Event, "prototype", {
value: Event.prototype,
writable: false,
enumerable: false,
configurable: false
});
Event.prototype.stopPropagation = function stopPropagation() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].stopPropagation();
};
Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].stopImmediatePropagation();
};
Event.prototype.preventDefault = function preventDefault() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].preventDefault();
};
Event.prototype.initEvent = function initEvent(type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'initEvent' on 'Event': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to execute 'initEvent' on 'Event': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, { context: "Failed to execute 'initEvent' on 'Event': parameter 2" });
} else {
curArg = false;
class Event {
constructor(type) {
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'Event': 1 argument required, but only " + arguments.length + " present."
);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, { context: "Failed to execute 'initEvent' on 'Event': parameter 3" });
} else {
curArg = false;
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'Event': parameter 1" });
args.push(curArg);
}
args.push(curArg);
{
let curArg = arguments[1];
curArg = convertEventInit(curArg, { context: "Failed to construct 'Event': parameter 2" });
args.push(curArg);
}
return iface.setup(Object.create(new.target.prototype), args);
}
return this[impl].initEvent(...args);
};
Object.defineProperty(Event.prototype, "type", {
get() {
composedPath() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl].composedPath());
}
stopPropagation() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].stopPropagation();
}
stopImmediatePropagation() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].stopImmediatePropagation();
}
preventDefault() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].preventDefault();
}
initEvent(type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'initEvent' on 'Event': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to execute 'initEvent' on 'Event': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, { context: "Failed to execute 'initEvent' on 'Event': parameter 2" });
} else {
curArg = false;
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["boolean"](curArg, { context: "Failed to execute 'initEvent' on 'Event': parameter 3" });
} else {
curArg = false;
}
args.push(curArg);
}
return this[impl].initEvent(...args);
}
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["type"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "target", {
get() {
get target() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["target"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "srcElement", {
get() {
get srcElement() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["srcElement"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "currentTarget", {
get() {
get currentTarget() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["currentTarget"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "eventPhase", {
get() {
get eventPhase() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["eventPhase"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "cancelBubble", {
get() {
get cancelBubble() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["cancelBubble"];
},
}
set(V) {
set cancelBubble(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -184,48 +154,33 @@ Object.defineProperty(Event.prototype, "cancelBubble", {
});
this[impl]["cancelBubble"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "bubbles", {
get() {
get bubbles() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["bubbles"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "cancelable", {
get() {
get cancelable() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["cancelable"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "returnValue", {
get() {
get returnValue() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["returnValue"];
},
}
set(V) {
set returnValue(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -235,81 +190,62 @@ Object.defineProperty(Event.prototype, "returnValue", {
});
this[impl]["returnValue"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(Event.prototype, "defaultPrevented", {
get() {
get defaultPrevented() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["defaultPrevented"];
},
}
enumerable: true,
configurable: true
});
get composed() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(Event.prototype, "timeStamp", {
get() {
return this[impl]["composed"];
}
get timeStamp() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["timeStamp"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(Event.prototype, {
composedPath: { enumerable: true },
stopPropagation: { enumerable: true },
stopImmediatePropagation: { enumerable: true },
preventDefault: { enumerable: true },
initEvent: { enumerable: true },
type: { enumerable: true },
target: { enumerable: true },
srcElement: { enumerable: true },
currentTarget: { enumerable: true },
eventPhase: { enumerable: true },
cancelBubble: { enumerable: true },
bubbles: { enumerable: true },
cancelable: { enumerable: true },
returnValue: { enumerable: true },
defaultPrevented: { enumerable: true },
composed: { enumerable: true },
timeStamp: { enumerable: true },
[Symbol.toStringTag]: { value: "Event", configurable: true },
NONE: { value: 0, enumerable: true },
CAPTURING_PHASE: { value: 1, enumerable: true },
AT_TARGET: { value: 2, enumerable: true },
BUBBLING_PHASE: { value: 3, enumerable: true }
});
Object.defineProperty(Event, "NONE", {
value: 0,
enumerable: true
Object.defineProperties(Event, {
NONE: { value: 0, enumerable: true },
CAPTURING_PHASE: { value: 1, enumerable: true },
AT_TARGET: { value: 2, enumerable: true },
BUBBLING_PHASE: { value: 3, enumerable: true }
});
Object.defineProperty(Event.prototype, "NONE", {
value: 0,
enumerable: true
});
Object.defineProperty(Event, "CAPTURING_PHASE", {
value: 1,
enumerable: true
});
Object.defineProperty(Event.prototype, "CAPTURING_PHASE", {
value: 1,
enumerable: true
});
Object.defineProperty(Event, "AT_TARGET", {
value: 2,
enumerable: true
});
Object.defineProperty(Event.prototype, "AT_TARGET", {
value: 2,
enumerable: true
});
Object.defineProperty(Event, "BUBBLING_PHASE", {
value: 3,
enumerable: true
});
Object.defineProperty(Event.prototype, "BUBBLING_PHASE", {
value: 3,
enumerable: true
});
Object.defineProperty(Event.prototype, Symbol.toStringTag, {
value: "Event",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -361,18 +297,20 @@ const iface = {
return utils.implForWrapper(obj);
},
_internalSetup(obj) {
Object.defineProperty(obj, "isTrusted", {
get() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
Object.defineProperties(
obj,
utils.getOwnPropertyDescriptors({
get isTrusted() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return obj[impl]["isTrusted"];
}
})
);
return obj[impl]["isTrusted"];
},
enumerable: true,
configurable: false
});
Object.defineProperties(obj, { isTrusted: { configurable: false } });
},
setup(obj, constructorArgs, privateData) {
if (!privateData) privateData = {};
@@ -382,8 +320,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -28,6 +28,18 @@ module.exports = {
ret[key] = false;
}
}
{
const key = "composed";
let value = obj === undefined || obj === null ? undefined : obj[key];
if (value !== undefined) {
value = conversions["boolean"](value, { context: context + " has member composed that" });
ret[key] = value;
} else {
ret[key] = false;
}
}
},
convert(obj, { context = "The provided value" } = {}) {

View File

@@ -8,162 +8,148 @@ const convertEventListenerOptions = require("./EventListenerOptions.js").convert
const convertEvent = require("./Event.js").convert;
const impl = utils.implSymbol;
function EventTarget() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'EventTarget'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class EventTarget {
constructor() {
return iface.setup(Object.create(new.target.prototype));
}
iface.setup(this);
addEventListener(type, callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = utils.tryImplForWrapper(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
if (curArg === null || curArg === undefined) {
curArg = convertAddEventListenerOptions(curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3"
});
} else if (utils.isObject(curArg)) {
curArg = convertAddEventListenerOptions(curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3" + " dictionary"
});
} else if (typeof curArg === "boolean") {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3"
});
} else {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3"
});
}
}
args.push(curArg);
}
return this[impl].addEventListener(...args);
}
removeEventListener(type, callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = utils.tryImplForWrapper(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
if (curArg === null || curArg === undefined) {
curArg = convertEventListenerOptions(curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3"
});
} else if (utils.isObject(curArg)) {
curArg = convertEventListenerOptions(curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3" + " dictionary"
});
} else if (typeof curArg === "boolean") {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3"
});
} else {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3"
});
}
}
args.push(curArg);
}
return this[impl].removeEventListener(...args);
}
dispatchEvent(event) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'dispatchEvent' on 'EventTarget': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertEvent(curArg, { context: "Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1" });
args.push(curArg);
}
return this[impl].dispatchEvent(...args);
}
}
Object.defineProperty(EventTarget, "prototype", {
value: EventTarget.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(EventTarget.prototype, {
addEventListener: { enumerable: true },
removeEventListener: { enumerable: true },
dispatchEvent: { enumerable: true },
[Symbol.toStringTag]: { value: "EventTarget", configurable: true }
});
EventTarget.prototype.addEventListener = function addEventListener(type, callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = utils.tryImplForWrapper(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
if (curArg === null || curArg === undefined) {
curArg = convertAddEventListenerOptions(curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3"
});
} else if (utils.isObject(curArg)) {
curArg = convertAddEventListenerOptions(curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3" + " dictionary"
});
} else if (typeof curArg === "boolean") {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3"
});
} else {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'addEventListener' on 'EventTarget': parameter 3"
});
}
}
args.push(curArg);
}
return this[impl].addEventListener(...args);
};
EventTarget.prototype.removeEventListener = function removeEventListener(type, callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg === null || curArg === undefined) {
curArg = null;
} else {
curArg = utils.tryImplForWrapper(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
if (curArg === null || curArg === undefined) {
curArg = convertEventListenerOptions(curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3"
});
} else if (utils.isObject(curArg)) {
curArg = convertEventListenerOptions(curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3" + " dictionary"
});
} else if (typeof curArg === "boolean") {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3"
});
} else {
curArg = conversions["boolean"](curArg, {
context: "Failed to execute 'removeEventListener' on 'EventTarget': parameter 3"
});
}
}
args.push(curArg);
}
return this[impl].removeEventListener(...args);
};
EventTarget.prototype.dispatchEvent = function dispatchEvent(event) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'dispatchEvent' on 'EventTarget': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertEvent(curArg, { context: "Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1" });
args.push(curArg);
}
return this[impl].dispatchEvent(...args);
};
Object.defineProperty(EventTarget.prototype, Symbol.toStringTag, {
value: "EventTarget",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -223,8 +209,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,40 +5,32 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function External() {
throw new TypeError("Illegal constructor");
class External {
constructor() {
throw new TypeError("Illegal constructor");
}
AddSearchProvider() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].AddSearchProvider();
}
IsSearchProviderInstalled() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].IsSearchProviderInstalled();
}
}
Object.defineProperty(External, "prototype", {
value: External.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(External.prototype, {
AddSearchProvider: { enumerable: true },
IsSearchProviderInstalled: { enumerable: true },
[Symbol.toStringTag]: { value: "External", configurable: true }
});
External.prototype.AddSearchProvider = function AddSearchProvider() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].AddSearchProvider();
};
External.prototype.IsSearchProviderInstalled = function IsSearchProviderInstalled() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].IsSearchProviderInstalled();
};
Object.defineProperty(External.prototype, Symbol.toStringTag, {
value: "External",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -98,8 +90,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -8,97 +8,71 @@ const convertFilePropertyBag = require("./FilePropertyBag.js").convert;
const impl = utils.implSymbol;
const Blob = require("./Blob.js");
function File(fileBits, fileName) {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'File'. Please use the 'new' operator; this constructor " + "cannot be called as a function."
);
}
if (arguments.length < 2) {
throw new TypeError("Failed to construct 'File': 2 arguments required, but only " + arguments.length + " present.");
}
const args = [];
{
let curArg = arguments[0];
if (!utils.isObject(curArg)) {
throw new TypeError("Failed to construct 'File': parameter 1" + " is not an iterable object.");
} else {
const V = [];
const tmp = curArg;
for (let nextItem of tmp) {
if (isBlob(nextItem)) {
nextItem = utils.implForWrapper(nextItem);
} else if (nextItem instanceof ArrayBuffer) {
} else if (ArrayBuffer.isView(nextItem)) {
} else {
nextItem = conversions["USVString"](nextItem, {
context: "Failed to construct 'File': parameter 1" + "'s element"
});
}
V.push(nextItem);
}
curArg = V;
class File extends Blob.interface {
constructor(fileBits, fileName) {
if (arguments.length < 2) {
throw new TypeError(
"Failed to construct 'File': 2 arguments required, but only " + arguments.length + " present."
);
}
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["USVString"](curArg, { context: "Failed to construct 'File': parameter 2" });
args.push(curArg);
}
{
let curArg = arguments[2];
curArg = convertFilePropertyBag(curArg, { context: "Failed to construct 'File': parameter 3" });
args.push(curArg);
const args = [];
{
let curArg = arguments[0];
if (!utils.isObject(curArg)) {
throw new TypeError("Failed to construct 'File': parameter 1" + " is not an iterable object.");
} else {
const V = [];
const tmp = curArg;
for (let nextItem of tmp) {
if (isBlob(nextItem)) {
nextItem = utils.implForWrapper(nextItem);
} else if (nextItem instanceof ArrayBuffer) {
} else if (ArrayBuffer.isView(nextItem)) {
} else {
nextItem = conversions["USVString"](nextItem, {
context: "Failed to construct 'File': parameter 1" + "'s element"
});
}
V.push(nextItem);
}
curArg = V;
}
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = conversions["USVString"](curArg, { context: "Failed to construct 'File': parameter 2" });
args.push(curArg);
}
{
let curArg = arguments[2];
curArg = convertFilePropertyBag(curArg, { context: "Failed to construct 'File': parameter 3" });
args.push(curArg);
}
return iface.setup(Object.create(new.target.prototype), args);
}
iface.setup(this, args);
}
Object.setPrototypeOf(File.prototype, Blob.interface.prototype);
Object.setPrototypeOf(File, Blob.interface);
Object.defineProperty(File, "prototype", {
value: File.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(File.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["name"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(File.prototype, "lastModified", {
get() {
get lastModified() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["lastModified"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(File.prototype, {
name: { enumerable: true },
lastModified: { enumerable: true },
[Symbol.toStringTag]: { value: "File", configurable: true }
});
Object.defineProperty(File.prototype, Symbol.toStringTag, {
value: "File",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -160,8 +134,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,63 +5,44 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function FileList() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(FileList, "prototype", {
value: FileList.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(FileList.prototype, Symbol.iterator, {
writable: true,
enumerable: false,
configurable: true,
value: Array.prototype[Symbol.iterator]
});
FileList.prototype.item = function item(index) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class FileList {
constructor() {
throw new TypeError("Illegal constructor");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'item' on 'FileList': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, { context: "Failed to execute 'item' on 'FileList': parameter 1" });
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].item(...args));
};
item(index) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(FileList.prototype, "length", {
get() {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'item' on 'FileList': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, { context: "Failed to execute 'item' on 'FileList': parameter 1" });
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].item(...args));
}
get length() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["length"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(FileList.prototype, {
item: { enumerable: true },
length: { enumerable: true },
[Symbol.toStringTag]: { value: "FileList", configurable: true },
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }
});
Object.defineProperty(FileList.prototype, Symbol.toStringTag, {
value: "FileList",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -121,8 +102,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -9,179 +9,149 @@ const EventTarget = require("./EventTarget.js");
module.exports = {
createInterface: function(defaultPrivateData = {}) {
function FileReader() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'FileReader'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class FileReader extends EventTarget.interface {
constructor() {
return iface.setup(Object.create(new.target.prototype));
}
iface.setup(this);
}
Object.setPrototypeOf(FileReader.prototype, EventTarget.interface.prototype);
Object.setPrototypeOf(FileReader, EventTarget.interface);
Object.defineProperty(FileReader, "prototype", {
value: FileReader.prototype,
writable: false,
enumerable: false,
configurable: false
});
FileReader.prototype.readAsArrayBuffer = function readAsArrayBuffer(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsArrayBuffer' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, { context: "Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1" });
args.push(curArg);
}
return this[impl].readAsArrayBuffer(...args);
};
FileReader.prototype.readAsBinaryString = function readAsBinaryString(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsBinaryString' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, {
context: "Failed to execute 'readAsBinaryString' on 'FileReader': parameter 1"
});
args.push(curArg);
}
return this[impl].readAsBinaryString(...args);
};
FileReader.prototype.readAsText = function readAsText(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsText' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, { context: "Failed to execute 'readAsText' on 'FileReader': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'readAsText' on 'FileReader': parameter 2"
});
readAsArrayBuffer(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
return this[impl].readAsText(...args);
};
FileReader.prototype.readAsDataURL = function readAsDataURL(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsArrayBuffer' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, {
context: "Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1"
});
args.push(curArg);
}
return this[impl].readAsArrayBuffer(...args);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsDataURL' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, { context: "Failed to execute 'readAsDataURL' on 'FileReader': parameter 1" });
args.push(curArg);
}
return this[impl].readAsDataURL(...args);
};
readAsBinaryString(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
FileReader.prototype.abort = function abort() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsBinaryString' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, {
context: "Failed to execute 'readAsBinaryString' on 'FileReader': parameter 1"
});
args.push(curArg);
}
return this[impl].readAsBinaryString(...args);
}
return this[impl].abort();
};
readAsText(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(FileReader.prototype, "readyState", {
get() {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsText' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, { context: "Failed to execute 'readAsText' on 'FileReader': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'readAsText' on 'FileReader': parameter 2"
});
}
args.push(curArg);
}
return this[impl].readAsText(...args);
}
readAsDataURL(blob) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'readAsDataURL' on 'FileReader': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertBlob(curArg, { context: "Failed to execute 'readAsDataURL' on 'FileReader': parameter 1" });
args.push(curArg);
}
return this[impl].readAsDataURL(...args);
}
abort() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].abort();
}
get readyState() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["readyState"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "result", {
get() {
get result() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["result"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "error", {
get() {
get error() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["error"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "onloadstart", {
get() {
get onloadstart() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onloadstart"]);
},
}
set(V) {
set onloadstart(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -189,22 +159,17 @@ module.exports = {
V = utils.tryImplForWrapper(V);
this[impl]["onloadstart"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "onprogress", {
get() {
get onprogress() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onprogress"]);
},
}
set(V) {
set onprogress(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -212,22 +177,17 @@ module.exports = {
V = utils.tryImplForWrapper(V);
this[impl]["onprogress"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "onload", {
get() {
get onload() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onload"]);
},
}
set(V) {
set onload(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -235,22 +195,17 @@ module.exports = {
V = utils.tryImplForWrapper(V);
this[impl]["onload"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "onabort", {
get() {
get onabort() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onabort"]);
},
}
set(V) {
set onabort(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -258,22 +213,17 @@ module.exports = {
V = utils.tryImplForWrapper(V);
this[impl]["onabort"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "onerror", {
get() {
get onerror() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onerror"]);
},
}
set(V) {
set onerror(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -281,22 +231,17 @@ module.exports = {
V = utils.tryImplForWrapper(V);
this[impl]["onerror"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(FileReader.prototype, "onloadend", {
get() {
get onloadend() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onloadend"]);
},
}
set(V) {
set onloadend(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -304,46 +249,33 @@ module.exports = {
V = utils.tryImplForWrapper(V);
this[impl]["onloadend"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(FileReader.prototype, {
readAsArrayBuffer: { enumerable: true },
readAsBinaryString: { enumerable: true },
readAsText: { enumerable: true },
readAsDataURL: { enumerable: true },
abort: { enumerable: true },
readyState: { enumerable: true },
result: { enumerable: true },
error: { enumerable: true },
onloadstart: { enumerable: true },
onprogress: { enumerable: true },
onload: { enumerable: true },
onabort: { enumerable: true },
onerror: { enumerable: true },
onloadend: { enumerable: true },
[Symbol.toStringTag]: { value: "FileReader", configurable: true },
EMPTY: { value: 0, enumerable: true },
LOADING: { value: 1, enumerable: true },
DONE: { value: 2, enumerable: true }
});
Object.defineProperty(FileReader, "EMPTY", {
value: 0,
enumerable: true
Object.defineProperties(FileReader, {
EMPTY: { value: 0, enumerable: true },
LOADING: { value: 1, enumerable: true },
DONE: { value: 2, enumerable: true }
});
Object.defineProperty(FileReader.prototype, "EMPTY", {
value: 0,
enumerable: true
});
Object.defineProperty(FileReader, "LOADING", {
value: 1,
enumerable: true
});
Object.defineProperty(FileReader.prototype, "LOADING", {
value: 1,
enumerable: true
});
Object.defineProperty(FileReader, "DONE", {
value: 2,
enumerable: true
});
Object.defineProperty(FileReader.prototype, "DONE", {
value: 2,
enumerable: true
});
Object.defineProperty(FileReader.prototype, Symbol.toStringTag, {
value: "FileReader",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
create(constructorArgs, privateData) {
let obj = Object.create(FileReader.prototype);
@@ -372,8 +304,6 @@ module.exports = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,64 +7,39 @@ const convertFocusEventInit = require("./FocusEventInit.js").convert;
const impl = utils.implSymbol;
const UIEvent = require("./UIEvent.js");
function FocusEvent(type) {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'FocusEvent'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
class FocusEvent extends UIEvent.interface {
constructor(type) {
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'FocusEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'FocusEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertFocusEventInit(curArg, { context: "Failed to construct 'FocusEvent': parameter 2" });
args.push(curArg);
}
return iface.setup(Object.create(new.target.prototype), args);
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to construct 'FocusEvent': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, { context: "Failed to construct 'FocusEvent': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertFocusEventInit(curArg, { context: "Failed to construct 'FocusEvent': parameter 2" });
args.push(curArg);
}
iface.setup(this, args);
}
Object.setPrototypeOf(FocusEvent.prototype, UIEvent.interface.prototype);
Object.setPrototypeOf(FocusEvent, UIEvent.interface);
Object.defineProperty(FocusEvent, "prototype", {
value: FocusEvent.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(FocusEvent.prototype, "relatedTarget", {
get() {
get relatedTarget() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["relatedTarget"]);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(FocusEvent.prototype, {
relatedTarget: { enumerable: true },
[Symbol.toStringTag]: { value: "FocusEvent", configurable: true }
});
Object.defineProperty(FocusEvent.prototype, Symbol.toStringTag, {
value: "FocusEvent",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -126,8 +101,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -42,291 +42,283 @@ const IteratorPrototype = Object.create(utils.IteratorPrototype, {
configurable: true
},
[Symbol.toStringTag]: {
value: "FormDataIterator",
writable: false,
enumerable: false,
value: "FormData Iterator",
configurable: true
}
});
function FormData() {
if (new.target === undefined) {
throw new TypeError(
"Failed to construct 'FormData'. Please use the 'new' operator; this constructor " +
"cannot be called as a function."
);
}
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = convertHTMLFormElement(curArg, { context: "Failed to construct 'FormData': parameter 1" });
class FormData {
constructor() {
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = convertHTMLFormElement(curArg, { context: "Failed to construct 'FormData': parameter 1" });
}
args.push(curArg);
}
args.push(curArg);
return iface.setup(Object.create(new.target.prototype), args);
}
iface.setup(this, args);
}
append(name, value) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(FormData, "prototype", {
value: FormData.prototype,
writable: false,
enumerable: false,
configurable: false
});
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'append' on 'FormData': 2 arguments required, but only " + arguments.length + " present."
);
}
const args = [];
switch (arguments.length) {
case 2:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'append' on 'FormData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (isBlob(curArg)) {
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'append' on 'FormData': parameter 2" });
args.push(curArg);
}
} else {
{
let curArg = arguments[1];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'append' on 'FormData': parameter 2"
});
args.push(curArg);
}
}
}
break;
default:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'append' on 'FormData': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'append' on 'FormData': parameter 2" });
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'append' on 'FormData': parameter 3"
});
}
args.push(curArg);
}
}
return this[impl].append(...args);
}
Object.defineProperty(FormData.prototype, Symbol.iterator, {
writable: true,
enumerable: false,
configurable: true,
value: function entries() {
delete(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'delete' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'delete' on 'FormData': parameter 1" });
args.push(curArg);
}
return this[impl].delete(...args);
}
get(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'get' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'get' on 'FormData': parameter 1" });
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].get(...args));
}
getAll(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'getAll' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'getAll' on 'FormData': parameter 1" });
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].getAll(...args));
}
has(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'has' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'has' on 'FormData': parameter 1" });
args.push(curArg);
}
return this[impl].has(...args);
}
set(name, value) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'set' on 'FormData': 2 arguments required, but only " + arguments.length + " present."
);
}
const args = [];
switch (arguments.length) {
case 2:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'set' on 'FormData': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (isBlob(curArg)) {
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'set' on 'FormData': parameter 2" });
args.push(curArg);
}
} else {
{
let curArg = arguments[1];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'set' on 'FormData': parameter 2"
});
args.push(curArg);
}
}
}
break;
default:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'set' on 'FormData': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'set' on 'FormData': parameter 2" });
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'set' on 'FormData': parameter 3"
});
}
args.push(curArg);
}
}
return this[impl].set(...args);
}
keys() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return module.exports.createDefaultIterator(this, "key");
}
values() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return module.exports.createDefaultIterator(this, "value");
}
entries() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return module.exports.createDefaultIterator(this, "key+value");
}
forEach(callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, " + "but only 0 present.");
}
if (typeof callback !== "function") {
throw new TypeError(
"Failed to execute 'forEach' on 'iterable': The callback provided " + "as parameter 1 is not a function."
);
}
const thisArg = arguments[1];
let pairs = Array.from(this[impl]);
let i = 0;
while (i < pairs.length) {
const [key, value] = pairs[i].map(utils.tryWrapperForImpl);
callback.call(thisArg, value, key, this);
pairs = Array.from(this[impl]);
i++;
}
}
}
Object.defineProperties(FormData.prototype, {
append: { enumerable: true },
delete: { enumerable: true },
get: { enumerable: true },
getAll: { enumerable: true },
has: { enumerable: true },
set: { enumerable: true },
keys: { enumerable: true },
values: { enumerable: true },
entries: { enumerable: true },
forEach: { enumerable: true },
[Symbol.toStringTag]: { value: "FormData", configurable: true },
[Symbol.iterator]: { value: FormData.prototype.entries, configurable: true, writable: true }
});
FormData.prototype.forEach = function forEach(callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError("Failed to execute 'forEach' on 'FormData': 1 argument required, " + "but only 0 present.");
}
if (typeof callback !== "function") {
throw new TypeError(
"Failed to execute 'forEach' on 'FormData': The callback provided " + "as parameter 1 is not a function."
);
}
const thisArg = arguments[1];
let pairs = Array.from(this[impl]);
let i = 0;
while (i < pairs.length) {
const [key, value] = pairs[i].map(utils.tryWrapperForImpl);
callback.call(thisArg, value, key, this);
pairs = Array.from(this[impl]);
i++;
}
};
FormData.prototype.append = function append(name, value) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'append' on 'FormData': 2 arguments required, but only " + arguments.length + " present."
);
}
const args = [];
switch (arguments.length) {
case 2:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'append' on 'FormData': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (isBlob(curArg)) {
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'append' on 'FormData': parameter 2" });
args.push(curArg);
}
} else {
{
let curArg = arguments[1];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'append' on 'FormData': parameter 2"
});
args.push(curArg);
}
}
}
break;
default:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'append' on 'FormData': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'append' on 'FormData': parameter 2" });
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'append' on 'FormData': parameter 3"
});
}
args.push(curArg);
}
}
return this[impl].append(...args);
};
FormData.prototype.delete = function _delete(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'delete' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'delete' on 'FormData': parameter 1" });
args.push(curArg);
}
return this[impl].delete(...args);
};
FormData.prototype.get = function get(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'get' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'get' on 'FormData': parameter 1" });
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].get(...args));
};
FormData.prototype.getAll = function getAll(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'getAll' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'getAll' on 'FormData': parameter 1" });
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].getAll(...args));
};
FormData.prototype.has = function has(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'has' on 'FormData': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'has' on 'FormData': parameter 1" });
args.push(curArg);
}
return this[impl].has(...args);
};
FormData.prototype.set = function set(name, value) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 2) {
throw new TypeError(
"Failed to execute 'set' on 'FormData': 2 arguments required, but only " + arguments.length + " present."
);
}
const args = [];
switch (arguments.length) {
case 2:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'set' on 'FormData': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
if (isBlob(curArg)) {
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'set' on 'FormData': parameter 2" });
args.push(curArg);
}
} else {
{
let curArg = arguments[1];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'set' on 'FormData': parameter 2"
});
args.push(curArg);
}
}
}
break;
default:
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'set' on 'FormData': parameter 1" });
args.push(curArg);
}
{
let curArg = arguments[1];
curArg = convertBlob(curArg, { context: "Failed to execute 'set' on 'FormData': parameter 2" });
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["USVString"](curArg, { context: "Failed to execute 'set' on 'FormData': parameter 3" });
}
args.push(curArg);
}
}
return this[impl].set(...args);
};
FormData.prototype.entries = FormData.prototype[Symbol.iterator];
FormData.prototype.keys = function keys() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return module.exports.createDefaultIterator(this, "key");
};
FormData.prototype.values = function values() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return module.exports.createDefaultIterator(this, "value");
};
Object.defineProperty(FormData.prototype, Symbol.toStringTag, {
value: "FormData",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -371,8 +363,6 @@ const iface = {
const iterator = Object.create(IteratorPrototype);
Object.defineProperty(iterator, utils.iterInternalSymbol, {
value: { target, kind, index: 0 },
writable: false,
enumerable: false,
configurable: true
});
return iterator;
@@ -397,8 +387,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

File diff suppressed because it is too large Load Diff

View File

@@ -7,31 +7,21 @@ const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
const HTMLHyperlinkElementUtils = require("./HTMLHyperlinkElementUtils.js");
function HTMLAnchorElement() {
throw new TypeError("Illegal constructor");
}
class HTMLAnchorElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLAnchorElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLAnchorElement, HTMLElement.interface);
Object.defineProperty(HTMLAnchorElement, "prototype", {
value: HTMLAnchorElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLAnchorElement.prototype, "target", {
get() {
get target() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("target");
return value === null ? "" : value;
},
}
set(V) {
set target(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -41,23 +31,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "target", {
});
this.setAttribute("target", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "download", {
get() {
get download() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("download");
return value === null ? "" : value;
},
}
set(V) {
set download(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -67,23 +52,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "download", {
});
this.setAttribute("download", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "rel", {
get() {
get rel() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("rel");
return value === null ? "" : value;
},
}
set(V) {
set rel(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -93,23 +73,36 @@ Object.defineProperty(HTMLAnchorElement.prototype, "rel", {
});
this.setAttribute("rel", V);
},
}
enumerable: true,
configurable: true
});
get relList() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLAnchorElement.prototype, "hreflang", {
get() {
return utils.getSameObject(this, "relList", () => {
return utils.tryWrapperForImpl(this[impl]["relList"]);
});
}
set relList(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
this.relList.value = V;
}
get hreflang() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("hreflang");
return value === null ? "" : value;
},
}
set(V) {
set hreflang(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -119,23 +112,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "hreflang", {
});
this.setAttribute("hreflang", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "type", {
get() {
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("type");
return value === null ? "" : value;
},
}
set(V) {
set type(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -145,22 +133,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "type", {
});
this.setAttribute("type", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "text", {
get() {
get text() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["text"];
},
}
set(V) {
set text(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -170,23 +153,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "text", {
});
this[impl]["text"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "coords", {
get() {
get coords() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("coords");
return value === null ? "" : value;
},
}
set(V) {
set coords(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -196,23 +174,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "coords", {
});
this.setAttribute("coords", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "charset", {
get() {
get charset() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("charset");
return value === null ? "" : value;
},
}
set(V) {
set charset(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -222,23 +195,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "charset", {
});
this.setAttribute("charset", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -248,23 +216,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "rev", {
get() {
get rev() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("rev");
return value === null ? "" : value;
},
}
set(V) {
set rev(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -274,23 +237,18 @@ Object.defineProperty(HTMLAnchorElement.prototype, "rev", {
});
this.setAttribute("rev", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "shape", {
get() {
get shape() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("shape");
return value === null ? "" : value;
},
}
set(V) {
set shape(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -300,22 +258,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "shape", {
});
this.setAttribute("shape", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "href", {
get() {
get href() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
},
}
set(V) {
set href(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -325,42 +278,32 @@ Object.defineProperty(HTMLAnchorElement.prototype, "href", {
});
this[impl]["href"] = V;
},
enumerable: true,
configurable: true
});
HTMLAnchorElement.prototype.toString = function toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
};
Object.defineProperty(HTMLAnchorElement.prototype, "origin", {
get() {
toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
}
get origin() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["origin"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "protocol", {
get() {
get protocol() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["protocol"];
},
}
set(V) {
set protocol(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -370,22 +313,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "protocol", {
});
this[impl]["protocol"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "username", {
get() {
get username() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["username"];
},
}
set(V) {
set username(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -395,22 +333,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "username", {
});
this[impl]["username"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "password", {
get() {
get password() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["password"];
},
}
set(V) {
set password(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -420,22 +353,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "password", {
});
this[impl]["password"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "host", {
get() {
get host() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["host"];
},
}
set(V) {
set host(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -445,22 +373,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "host", {
});
this[impl]["host"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "hostname", {
get() {
get hostname() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["hostname"];
},
}
set(V) {
set hostname(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -470,22 +393,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "hostname", {
});
this[impl]["hostname"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "port", {
get() {
get port() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["port"];
},
}
set(V) {
set port(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -495,22 +413,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "port", {
});
this[impl]["port"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "pathname", {
get() {
get pathname() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["pathname"];
},
}
set(V) {
set pathname(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -520,22 +433,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "pathname", {
});
this[impl]["pathname"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "search", {
get() {
get search() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["search"];
},
}
set(V) {
set search(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -545,22 +453,17 @@ Object.defineProperty(HTMLAnchorElement.prototype, "search", {
});
this[impl]["search"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAnchorElement.prototype, "hash", {
get() {
get hash() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["hash"];
},
}
set(V) {
set hash(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -570,19 +473,35 @@ Object.defineProperty(HTMLAnchorElement.prototype, "hash", {
});
this[impl]["hash"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLAnchorElement.prototype, {
target: { enumerable: true },
download: { enumerable: true },
rel: { enumerable: true },
relList: { enumerable: true },
hreflang: { enumerable: true },
type: { enumerable: true },
text: { enumerable: true },
coords: { enumerable: true },
charset: { enumerable: true },
name: { enumerable: true },
rev: { enumerable: true },
shape: { enumerable: true },
href: { enumerable: true },
toString: { enumerable: true },
origin: { enumerable: true },
protocol: { enumerable: true },
username: { enumerable: true },
password: { enumerable: true },
host: { enumerable: true },
hostname: { enumerable: true },
port: { enumerable: true },
pathname: { enumerable: true },
search: { enumerable: true },
hash: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLAnchorElement", configurable: true }
});
Object.defineProperty(HTMLAnchorElement.prototype, Symbol.toStringTag, {
value: "HTMLAnchorElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -644,8 +563,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,31 +7,21 @@ const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
const HTMLHyperlinkElementUtils = require("./HTMLHyperlinkElementUtils.js");
function HTMLAreaElement() {
throw new TypeError("Illegal constructor");
}
class HTMLAreaElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLAreaElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLAreaElement, HTMLElement.interface);
Object.defineProperty(HTMLAreaElement, "prototype", {
value: HTMLAreaElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLAreaElement.prototype, "alt", {
get() {
get alt() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("alt");
return value === null ? "" : value;
},
}
set(V) {
set alt(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -41,23 +31,18 @@ Object.defineProperty(HTMLAreaElement.prototype, "alt", {
});
this.setAttribute("alt", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "coords", {
get() {
get coords() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("coords");
return value === null ? "" : value;
},
}
set(V) {
set coords(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -67,23 +52,18 @@ Object.defineProperty(HTMLAreaElement.prototype, "coords", {
});
this.setAttribute("coords", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "shape", {
get() {
get shape() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("shape");
return value === null ? "" : value;
},
}
set(V) {
set shape(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -93,23 +73,18 @@ Object.defineProperty(HTMLAreaElement.prototype, "shape", {
});
this.setAttribute("shape", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "target", {
get() {
get target() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("target");
return value === null ? "" : value;
},
}
set(V) {
set target(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -119,23 +94,18 @@ Object.defineProperty(HTMLAreaElement.prototype, "target", {
});
this.setAttribute("target", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "rel", {
get() {
get rel() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("rel");
return value === null ? "" : value;
},
}
set(V) {
set rel(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -145,22 +115,35 @@ Object.defineProperty(HTMLAreaElement.prototype, "rel", {
});
this.setAttribute("rel", V);
},
}
enumerable: true,
configurable: true
});
get relList() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLAreaElement.prototype, "noHref", {
get() {
return utils.getSameObject(this, "relList", () => {
return utils.tryWrapperForImpl(this[impl]["relList"]);
});
}
set relList(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
this.relList.value = V;
}
get noHref() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("noHref");
},
}
set(V) {
set noHref(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -174,22 +157,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "noHref", {
} else {
this.removeAttribute("noHref");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "href", {
get() {
get href() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
},
}
set(V) {
set href(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -199,42 +177,32 @@ Object.defineProperty(HTMLAreaElement.prototype, "href", {
});
this[impl]["href"] = V;
},
enumerable: true,
configurable: true
});
HTMLAreaElement.prototype.toString = function toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
};
Object.defineProperty(HTMLAreaElement.prototype, "origin", {
get() {
toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
}
get origin() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["origin"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "protocol", {
get() {
get protocol() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["protocol"];
},
}
set(V) {
set protocol(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -244,22 +212,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "protocol", {
});
this[impl]["protocol"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "username", {
get() {
get username() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["username"];
},
}
set(V) {
set username(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -269,22 +232,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "username", {
});
this[impl]["username"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "password", {
get() {
get password() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["password"];
},
}
set(V) {
set password(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -294,22 +252,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "password", {
});
this[impl]["password"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "host", {
get() {
get host() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["host"];
},
}
set(V) {
set host(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -319,22 +272,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "host", {
});
this[impl]["host"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "hostname", {
get() {
get hostname() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["hostname"];
},
}
set(V) {
set hostname(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -344,22 +292,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "hostname", {
});
this[impl]["hostname"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "port", {
get() {
get port() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["port"];
},
}
set(V) {
set port(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -369,22 +312,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "port", {
});
this[impl]["port"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "pathname", {
get() {
get pathname() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["pathname"];
},
}
set(V) {
set pathname(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -394,22 +332,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "pathname", {
});
this[impl]["pathname"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "search", {
get() {
get search() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["search"];
},
}
set(V) {
set search(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -419,22 +352,17 @@ Object.defineProperty(HTMLAreaElement.prototype, "search", {
});
this[impl]["search"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLAreaElement.prototype, "hash", {
get() {
get hash() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["hash"];
},
}
set(V) {
set hash(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -444,19 +372,30 @@ Object.defineProperty(HTMLAreaElement.prototype, "hash", {
});
this[impl]["hash"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLAreaElement.prototype, {
alt: { enumerable: true },
coords: { enumerable: true },
shape: { enumerable: true },
target: { enumerable: true },
rel: { enumerable: true },
relList: { enumerable: true },
noHref: { enumerable: true },
href: { enumerable: true },
toString: { enumerable: true },
origin: { enumerable: true },
protocol: { enumerable: true },
username: { enumerable: true },
password: { enumerable: true },
host: { enumerable: true },
hostname: { enumerable: true },
port: { enumerable: true },
pathname: { enumerable: true },
search: { enumerable: true },
hash: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLAreaElement", configurable: true }
});
Object.defineProperty(HTMLAreaElement.prototype, Symbol.toStringTag, {
value: "HTMLAreaElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -518,8 +457,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,27 +6,14 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLMediaElement = require("./HTMLMediaElement.js");
function HTMLAudioElement() {
throw new TypeError("Illegal constructor");
class HTMLAudioElement extends HTMLMediaElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
}
Object.setPrototypeOf(HTMLAudioElement.prototype, HTMLMediaElement.interface.prototype);
Object.setPrototypeOf(HTMLAudioElement, HTMLMediaElement.interface);
Object.defineProperty(HTMLAudioElement, "prototype", {
value: HTMLAudioElement.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(HTMLAudioElement.prototype, {
[Symbol.toStringTag]: { value: "HTMLAudioElement", configurable: true }
});
Object.defineProperty(HTMLAudioElement.prototype, Symbol.toStringTag, {
value: "HTMLAudioElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -88,8 +75,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLBRElement() {
throw new TypeError("Illegal constructor");
}
class HTMLBRElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLBRElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLBRElement, HTMLElement.interface);
Object.defineProperty(HTMLBRElement, "prototype", {
value: HTMLBRElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLBRElement.prototype, "clear", {
get() {
get clear() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("clear");
return value === null ? "" : value;
},
}
set(V) {
set clear(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,19 +30,12 @@ Object.defineProperty(HTMLBRElement.prototype, "clear", {
});
this.setAttribute("clear", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLBRElement.prototype, {
clear: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLBRElement", configurable: true }
});
Object.defineProperty(HTMLBRElement.prototype, Symbol.toStringTag, {
value: "HTMLBRElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -114,8 +97,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,30 +6,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLBaseElement() {
throw new TypeError("Illegal constructor");
}
class HTMLBaseElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLBaseElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLBaseElement, HTMLElement.interface);
Object.defineProperty(HTMLBaseElement, "prototype", {
value: HTMLBaseElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLBaseElement.prototype, "href", {
get() {
get href() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
},
}
set(V) {
set href(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -39,23 +29,18 @@ Object.defineProperty(HTMLBaseElement.prototype, "href", {
});
this[impl]["href"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBaseElement.prototype, "target", {
get() {
get target() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("target");
return value === null ? "" : value;
},
}
set(V) {
set target(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -65,19 +50,13 @@ Object.defineProperty(HTMLBaseElement.prototype, "target", {
});
this.setAttribute("target", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLBaseElement.prototype, {
href: { enumerable: true },
target: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLBaseElement", configurable: true }
});
Object.defineProperty(HTMLBaseElement.prototype, Symbol.toStringTag, {
value: "HTMLBaseElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -139,8 +118,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,31 +7,21 @@ const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
const WindowEventHandlers = require("./WindowEventHandlers.js");
function HTMLBodyElement() {
throw new TypeError("Illegal constructor");
}
class HTMLBodyElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLBodyElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLBodyElement, HTMLElement.interface);
Object.defineProperty(HTMLBodyElement, "prototype", {
value: HTMLBodyElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLBodyElement.prototype, "text", {
get() {
get text() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("text");
return value === null ? "" : value;
},
}
set(V) {
set text(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -42,23 +32,18 @@ Object.defineProperty(HTMLBodyElement.prototype, "text", {
});
this.setAttribute("text", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "link", {
get() {
get link() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("link");
return value === null ? "" : value;
},
}
set(V) {
set link(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -69,23 +54,18 @@ Object.defineProperty(HTMLBodyElement.prototype, "link", {
});
this.setAttribute("link", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "vLink", {
get() {
get vLink() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("vLink");
return value === null ? "" : value;
},
}
set(V) {
set vLink(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -96,23 +76,18 @@ Object.defineProperty(HTMLBodyElement.prototype, "vLink", {
});
this.setAttribute("vLink", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "aLink", {
get() {
get aLink() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("aLink");
return value === null ? "" : value;
},
}
set(V) {
set aLink(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -123,23 +98,18 @@ Object.defineProperty(HTMLBodyElement.prototype, "aLink", {
});
this.setAttribute("aLink", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "bgColor", {
get() {
get bgColor() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("bgColor");
return value === null ? "" : value;
},
}
set(V) {
set bgColor(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -150,23 +120,18 @@ Object.defineProperty(HTMLBodyElement.prototype, "bgColor", {
});
this.setAttribute("bgColor", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "background", {
get() {
get background() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("background");
return value === null ? "" : value;
},
}
set(V) {
set background(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -176,22 +141,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "background", {
});
this.setAttribute("background", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onafterprint", {
get() {
get onafterprint() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onafterprint"]);
},
}
set(V) {
set onafterprint(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -199,22 +159,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onafterprint", {
V = utils.tryImplForWrapper(V);
this[impl]["onafterprint"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onbeforeprint", {
get() {
get onbeforeprint() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onbeforeprint"]);
},
}
set(V) {
set onbeforeprint(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -222,22 +177,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onbeforeprint", {
V = utils.tryImplForWrapper(V);
this[impl]["onbeforeprint"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onbeforeunload", {
get() {
get onbeforeunload() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onbeforeunload"]);
},
}
set(V) {
set onbeforeunload(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -245,22 +195,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onbeforeunload", {
V = utils.tryImplForWrapper(V);
this[impl]["onbeforeunload"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onhashchange", {
get() {
get onhashchange() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onhashchange"]);
},
}
set(V) {
set onhashchange(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -268,22 +213,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onhashchange", {
V = utils.tryImplForWrapper(V);
this[impl]["onhashchange"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onlanguagechange", {
get() {
get onlanguagechange() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onlanguagechange"]);
},
}
set(V) {
set onlanguagechange(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -291,22 +231,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onlanguagechange", {
V = utils.tryImplForWrapper(V);
this[impl]["onlanguagechange"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onmessage", {
get() {
get onmessage() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onmessage"]);
},
}
set(V) {
set onmessage(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -314,22 +249,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onmessage", {
V = utils.tryImplForWrapper(V);
this[impl]["onmessage"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onmessageerror", {
get() {
get onmessageerror() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onmessageerror"]);
},
}
set(V) {
set onmessageerror(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -337,22 +267,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onmessageerror", {
V = utils.tryImplForWrapper(V);
this[impl]["onmessageerror"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onoffline", {
get() {
get onoffline() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onoffline"]);
},
}
set(V) {
set onoffline(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -360,22 +285,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onoffline", {
V = utils.tryImplForWrapper(V);
this[impl]["onoffline"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "ononline", {
get() {
get ononline() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["ononline"]);
},
}
set(V) {
set ononline(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -383,22 +303,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "ononline", {
V = utils.tryImplForWrapper(V);
this[impl]["ononline"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onpagehide", {
get() {
get onpagehide() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onpagehide"]);
},
}
set(V) {
set onpagehide(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -406,22 +321,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onpagehide", {
V = utils.tryImplForWrapper(V);
this[impl]["onpagehide"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onpageshow", {
get() {
get onpageshow() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onpageshow"]);
},
}
set(V) {
set onpageshow(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -429,22 +339,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onpageshow", {
V = utils.tryImplForWrapper(V);
this[impl]["onpageshow"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onpopstate", {
get() {
get onpopstate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onpopstate"]);
},
}
set(V) {
set onpopstate(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -452,22 +357,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onpopstate", {
V = utils.tryImplForWrapper(V);
this[impl]["onpopstate"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onrejectionhandled", {
get() {
get onrejectionhandled() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onrejectionhandled"]);
},
}
set(V) {
set onrejectionhandled(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -475,22 +375,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onrejectionhandled", {
V = utils.tryImplForWrapper(V);
this[impl]["onrejectionhandled"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onstorage", {
get() {
get onstorage() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onstorage"]);
},
}
set(V) {
set onstorage(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -498,22 +393,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onstorage", {
V = utils.tryImplForWrapper(V);
this[impl]["onstorage"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onunhandledrejection", {
get() {
get onunhandledrejection() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onunhandledrejection"]);
},
}
set(V) {
set onunhandledrejection(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -521,22 +411,17 @@ Object.defineProperty(HTMLBodyElement.prototype, "onunhandledrejection", {
V = utils.tryImplForWrapper(V);
this[impl]["onunhandledrejection"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLBodyElement.prototype, "onunload", {
get() {
get onunload() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onunload"]);
},
}
set(V) {
set onunload(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -544,19 +429,33 @@ Object.defineProperty(HTMLBodyElement.prototype, "onunload", {
V = utils.tryImplForWrapper(V);
this[impl]["onunload"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLBodyElement.prototype, {
text: { enumerable: true },
link: { enumerable: true },
vLink: { enumerable: true },
aLink: { enumerable: true },
bgColor: { enumerable: true },
background: { enumerable: true },
onafterprint: { enumerable: true },
onbeforeprint: { enumerable: true },
onbeforeunload: { enumerable: true },
onhashchange: { enumerable: true },
onlanguagechange: { enumerable: true },
onmessage: { enumerable: true },
onmessageerror: { enumerable: true },
onoffline: { enumerable: true },
ononline: { enumerable: true },
onpagehide: { enumerable: true },
onpageshow: { enumerable: true },
onpopstate: { enumerable: true },
onrejectionhandled: { enumerable: true },
onstorage: { enumerable: true },
onunhandledrejection: { enumerable: true },
onunload: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLBodyElement", configurable: true }
});
Object.defineProperty(HTMLBodyElement.prototype, Symbol.toStringTag, {
value: "HTMLBodyElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -618,8 +517,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,69 +6,59 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLButtonElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLButtonElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLButtonElement, HTMLElement.interface);
Object.defineProperty(HTMLButtonElement, "prototype", {
value: HTMLButtonElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
HTMLButtonElement.prototype.checkValidity = function checkValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class HTMLButtonElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
return this[impl].checkValidity();
};
checkValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLButtonElement.prototype.reportValidity = function reportValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].checkValidity();
}
return this[impl].reportValidity();
};
reportValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLButtonElement.prototype.setCustomValidity = function setCustomValidity(error) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].reportValidity();
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'setCustomValidity' on 'HTMLButtonElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'setCustomValidity' on 'HTMLButtonElement': parameter 1"
});
args.push(curArg);
}
return this[impl].setCustomValidity(...args);
};
setCustomValidity(error) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLButtonElement.prototype, "autofocus", {
get() {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'setCustomValidity' on 'HTMLButtonElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'setCustomValidity' on 'HTMLButtonElement': parameter 1"
});
args.push(curArg);
}
return this[impl].setCustomValidity(...args);
}
get autofocus() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("autofocus");
},
}
set(V) {
set autofocus(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -82,22 +72,17 @@ Object.defineProperty(HTMLButtonElement.prototype, "autofocus", {
} else {
this.removeAttribute("autofocus");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "disabled", {
get() {
get disabled() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("disabled");
},
}
set(V) {
set disabled(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -111,35 +96,25 @@ Object.defineProperty(HTMLButtonElement.prototype, "disabled", {
} else {
this.removeAttribute("disabled");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "form", {
get() {
get form() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["form"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "formNoValidate", {
get() {
get formNoValidate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("formNoValidate");
},
}
set(V) {
set formNoValidate(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -153,23 +128,18 @@ Object.defineProperty(HTMLButtonElement.prototype, "formNoValidate", {
} else {
this.removeAttribute("formNoValidate");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "formTarget", {
get() {
get formTarget() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("formTarget");
return value === null ? "" : value;
},
}
set(V) {
set formTarget(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -179,23 +149,18 @@ Object.defineProperty(HTMLButtonElement.prototype, "formTarget", {
});
this.setAttribute("formTarget", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -205,22 +170,17 @@ Object.defineProperty(HTMLButtonElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "type", {
get() {
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["type"];
},
}
set(V) {
set type(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -230,23 +190,18 @@ Object.defineProperty(HTMLButtonElement.prototype, "type", {
});
this[impl]["type"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "value", {
get() {
get value() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("value");
return value === null ? "" : value;
},
}
set(V) {
set value(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -256,58 +211,58 @@ Object.defineProperty(HTMLButtonElement.prototype, "value", {
});
this.setAttribute("value", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "willValidate", {
get() {
get willValidate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["willValidate"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "validity", {
get() {
get validity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["validity"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "validationMessage", {
get() {
get validationMessage() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["validationMessage"];
},
}
enumerable: true,
configurable: true
get labels() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["labels"]);
}
}
Object.defineProperties(HTMLButtonElement.prototype, {
checkValidity: { enumerable: true },
reportValidity: { enumerable: true },
setCustomValidity: { enumerable: true },
autofocus: { enumerable: true },
disabled: { enumerable: true },
form: { enumerable: true },
formNoValidate: { enumerable: true },
formTarget: { enumerable: true },
name: { enumerable: true },
type: { enumerable: true },
value: { enumerable: true },
willValidate: { enumerable: true },
validity: { enumerable: true },
validationMessage: { enumerable: true },
labels: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLButtonElement", configurable: true }
});
Object.defineProperty(HTMLButtonElement.prototype, Symbol.toStringTag, {
value: "HTMLButtonElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -369,8 +324,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,125 +6,115 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLCanvasElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLCanvasElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLCanvasElement, HTMLElement.interface);
Object.defineProperty(HTMLCanvasElement, "prototype", {
value: HTMLCanvasElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
HTMLCanvasElement.prototype.getContext = function getContext(contextId) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class HTMLCanvasElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'getContext' on 'HTMLCanvasElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'getContext' on 'HTMLCanvasElement': parameter 1"
});
args.push(curArg);
}
for (let i = 1; i < arguments.length; i++) {
let curArg = arguments[i];
curArg = conversions["any"](curArg, {
context: "Failed to execute 'getContext' on 'HTMLCanvasElement': parameter " + (i + 1)
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].getContext(...args));
};
getContext(contextId) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLCanvasElement.prototype.toDataURL = function toDataURL() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'getContext' on 'HTMLCanvasElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'toDataURL' on 'HTMLCanvasElement': parameter 1"
context: "Failed to execute 'getContext' on 'HTMLCanvasElement': parameter 1"
});
args.push(curArg);
}
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
for (let i = 1; i < arguments.length; i++) {
let curArg = arguments[i];
curArg = conversions["any"](curArg, {
context: "Failed to execute 'toDataURL' on 'HTMLCanvasElement': parameter 2"
context: "Failed to execute 'getContext' on 'HTMLCanvasElement': parameter " + (i + 1)
});
args.push(curArg);
}
args.push(curArg);
}
return this[impl].toDataURL(...args);
};
HTMLCanvasElement.prototype.toBlob = function toBlob(callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return utils.tryWrapperForImpl(this[impl].getContext(...args));
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'toBlob' on 'HTMLCanvasElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = utils.tryImplForWrapper(curArg);
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'toBlob' on 'HTMLCanvasElement': parameter 2"
});
toDataURL() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["any"](curArg, {
context: "Failed to execute 'toBlob' on 'HTMLCanvasElement': parameter 3"
});
const args = [];
{
let curArg = arguments[0];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'toDataURL' on 'HTMLCanvasElement': parameter 1"
});
}
args.push(curArg);
}
args.push(curArg);
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["any"](curArg, {
context: "Failed to execute 'toDataURL' on 'HTMLCanvasElement': parameter 2"
});
}
args.push(curArg);
}
return this[impl].toDataURL(...args);
}
return this[impl].toBlob(...args);
};
Object.defineProperty(HTMLCanvasElement.prototype, "width", {
get() {
toBlob(callback) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'toBlob' on 'HTMLCanvasElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = utils.tryImplForWrapper(curArg);
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'toBlob' on 'HTMLCanvasElement': parameter 2"
});
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["any"](curArg, {
context: "Failed to execute 'toBlob' on 'HTMLCanvasElement': parameter 3"
});
}
args.push(curArg);
}
return this[impl].toBlob(...args);
}
get width() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["width"];
},
}
set(V) {
set width(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -134,22 +124,17 @@ Object.defineProperty(HTMLCanvasElement.prototype, "width", {
});
this[impl]["width"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLCanvasElement.prototype, "height", {
get() {
get height() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["height"];
},
}
set(V) {
set height(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -159,19 +144,16 @@ Object.defineProperty(HTMLCanvasElement.prototype, "height", {
});
this[impl]["height"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLCanvasElement.prototype, {
getContext: { enumerable: true },
toDataURL: { enumerable: true },
toBlob: { enumerable: true },
width: { enumerable: true },
height: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLCanvasElement", configurable: true }
});
Object.defineProperty(HTMLCanvasElement.prototype, Symbol.toStringTag, {
value: "HTMLCanvasElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -233,8 +215,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,88 +5,70 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function HTMLCollection() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(HTMLCollection, "prototype", {
value: HTMLCollection.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLCollection.prototype, Symbol.iterator, {
writable: true,
enumerable: false,
configurable: true,
value: Array.prototype[Symbol.iterator]
});
HTMLCollection.prototype.item = function item(index) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class HTMLCollection {
constructor() {
throw new TypeError("Illegal constructor");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'item' on 'HTMLCollection': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'item' on 'HTMLCollection': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].item(...args));
};
item(index) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLCollection.prototype.namedItem = function namedItem(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'item' on 'HTMLCollection': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["unsigned long"](curArg, {
context: "Failed to execute 'item' on 'HTMLCollection': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].item(...args));
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'namedItem' on 'HTMLCollection': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'namedItem' on 'HTMLCollection': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].namedItem(...args));
};
namedItem(name) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLCollection.prototype, "length", {
get() {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'namedItem' on 'HTMLCollection': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'namedItem' on 'HTMLCollection': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].namedItem(...args));
}
get length() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["length"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLCollection.prototype, {
item: { enumerable: true },
namedItem: { enumerable: true },
length: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLCollection", configurable: true },
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }
});
Object.defineProperty(HTMLCollection.prototype, Symbol.toStringTag, {
value: "HTMLCollection",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -146,8 +128,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,30 +6,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLDListElement() {
throw new TypeError("Illegal constructor");
}
class HTMLDListElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLDListElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLDListElement, HTMLElement.interface);
Object.defineProperty(HTMLDListElement, "prototype", {
value: HTMLDListElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLDListElement.prototype, "compact", {
get() {
get compact() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("compact");
},
}
set(V) {
set compact(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -43,19 +33,12 @@ Object.defineProperty(HTMLDListElement.prototype, "compact", {
} else {
this.removeAttribute("compact");
}
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLDListElement.prototype, {
compact: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLDListElement", configurable: true }
});
Object.defineProperty(HTMLDListElement.prototype, Symbol.toStringTag, {
value: "HTMLDListElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -117,8 +100,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLDataElement() {
throw new TypeError("Illegal constructor");
}
class HTMLDataElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLDataElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLDataElement, HTMLElement.interface);
Object.defineProperty(HTMLDataElement, "prototype", {
value: HTMLDataElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLDataElement.prototype, "value", {
get() {
get value() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("value");
return value === null ? "" : value;
},
}
set(V) {
set value(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,19 +30,12 @@ Object.defineProperty(HTMLDataElement.prototype, "value", {
});
this.setAttribute("value", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLDataElement.prototype, {
value: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLDataElement", configurable: true }
});
Object.defineProperty(HTMLDataElement.prototype, Symbol.toStringTag, {
value: "HTMLDataElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -114,8 +97,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,27 +6,14 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLDataListElement() {
throw new TypeError("Illegal constructor");
class HTMLDataListElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
}
Object.setPrototypeOf(HTMLDataListElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLDataListElement, HTMLElement.interface);
Object.defineProperty(HTMLDataListElement, "prototype", {
value: HTMLDataListElement.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(HTMLDataListElement.prototype, {
[Symbol.toStringTag]: { value: "HTMLDataListElement", configurable: true }
});
Object.defineProperty(HTMLDataListElement.prototype, Symbol.toStringTag, {
value: "HTMLDataListElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -88,8 +75,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,30 +6,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLDetailsElement() {
throw new TypeError("Illegal constructor");
}
class HTMLDetailsElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLDetailsElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLDetailsElement, HTMLElement.interface);
Object.defineProperty(HTMLDetailsElement, "prototype", {
value: HTMLDetailsElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLDetailsElement.prototype, "open", {
get() {
get open() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("open");
},
}
set(V) {
set open(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -43,19 +33,12 @@ Object.defineProperty(HTMLDetailsElement.prototype, "open", {
} else {
this.removeAttribute("open");
}
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLDetailsElement.prototype, {
open: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLDetailsElement", configurable: true }
});
Object.defineProperty(HTMLDetailsElement.prototype, Symbol.toStringTag, {
value: "HTMLDetailsElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -117,8 +100,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,30 +6,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLDialogElement() {
throw new TypeError("Illegal constructor");
}
class HTMLDialogElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLDialogElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLDialogElement, HTMLElement.interface);
Object.defineProperty(HTMLDialogElement, "prototype", {
value: HTMLDialogElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLDialogElement.prototype, "open", {
get() {
get open() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("open");
},
}
set(V) {
set open(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -43,19 +33,12 @@ Object.defineProperty(HTMLDialogElement.prototype, "open", {
} else {
this.removeAttribute("open");
}
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLDialogElement.prototype, {
open: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLDialogElement", configurable: true }
});
Object.defineProperty(HTMLDialogElement.prototype, Symbol.toStringTag, {
value: "HTMLDialogElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -117,8 +100,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,30 +6,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLDirectoryElement() {
throw new TypeError("Illegal constructor");
}
class HTMLDirectoryElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLDirectoryElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLDirectoryElement, HTMLElement.interface);
Object.defineProperty(HTMLDirectoryElement, "prototype", {
value: HTMLDirectoryElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLDirectoryElement.prototype, "compact", {
get() {
get compact() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("compact");
},
}
set(V) {
set compact(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -43,19 +33,12 @@ Object.defineProperty(HTMLDirectoryElement.prototype, "compact", {
} else {
this.removeAttribute("compact");
}
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLDirectoryElement.prototype, {
compact: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLDirectoryElement", configurable: true }
});
Object.defineProperty(HTMLDirectoryElement.prototype, Symbol.toStringTag, {
value: "HTMLDirectoryElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -117,8 +100,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLDivElement() {
throw new TypeError("Illegal constructor");
}
class HTMLDivElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLDivElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLDivElement, HTMLElement.interface);
Object.defineProperty(HTMLDivElement, "prototype", {
value: HTMLDivElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLDivElement.prototype, "align", {
get() {
get align() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("align");
return value === null ? "" : value;
},
}
set(V) {
set align(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,19 +30,12 @@ Object.defineProperty(HTMLDivElement.prototype, "align", {
});
this.setAttribute("align", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLDivElement.prototype, {
align: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLDivElement", configurable: true }
});
Object.defineProperty(HTMLDivElement.prototype, Symbol.toStringTag, {
value: "HTMLDivElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -114,8 +97,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

File diff suppressed because it is too large Load Diff

View File

@@ -6,30 +6,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLEmbedElement() {
throw new TypeError("Illegal constructor");
}
class HTMLEmbedElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLEmbedElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLEmbedElement, HTMLElement.interface);
Object.defineProperty(HTMLEmbedElement, "prototype", {
value: HTMLEmbedElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLEmbedElement.prototype, "src", {
get() {
get src() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["src"];
},
}
set(V) {
set src(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -39,23 +29,18 @@ Object.defineProperty(HTMLEmbedElement.prototype, "src", {
});
this[impl]["src"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLEmbedElement.prototype, "type", {
get() {
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("type");
return value === null ? "" : value;
},
}
set(V) {
set type(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -65,23 +50,18 @@ Object.defineProperty(HTMLEmbedElement.prototype, "type", {
});
this.setAttribute("type", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLEmbedElement.prototype, "width", {
get() {
get width() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("width");
return value === null ? "" : value;
},
}
set(V) {
set width(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -91,23 +71,18 @@ Object.defineProperty(HTMLEmbedElement.prototype, "width", {
});
this.setAttribute("width", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLEmbedElement.prototype, "height", {
get() {
get height() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("height");
return value === null ? "" : value;
},
}
set(V) {
set height(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -117,23 +92,18 @@ Object.defineProperty(HTMLEmbedElement.prototype, "height", {
});
this.setAttribute("height", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLEmbedElement.prototype, "align", {
get() {
get align() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("align");
return value === null ? "" : value;
},
}
set(V) {
set align(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -143,23 +113,18 @@ Object.defineProperty(HTMLEmbedElement.prototype, "align", {
});
this.setAttribute("align", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLEmbedElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -169,19 +134,17 @@ Object.defineProperty(HTMLEmbedElement.prototype, "name", {
});
this.setAttribute("name", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLEmbedElement.prototype, {
src: { enumerable: true },
type: { enumerable: true },
width: { enumerable: true },
height: { enumerable: true },
align: { enumerable: true },
name: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLEmbedElement", configurable: true }
});
Object.defineProperty(HTMLEmbedElement.prototype, Symbol.toStringTag, {
value: "HTMLEmbedElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -243,8 +206,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,69 +6,59 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLFieldSetElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLFieldSetElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLFieldSetElement, HTMLElement.interface);
Object.defineProperty(HTMLFieldSetElement, "prototype", {
value: HTMLFieldSetElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
HTMLFieldSetElement.prototype.checkValidity = function checkValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class HTMLFieldSetElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
return this[impl].checkValidity();
};
checkValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLFieldSetElement.prototype.reportValidity = function reportValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].checkValidity();
}
return this[impl].reportValidity();
};
reportValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLFieldSetElement.prototype.setCustomValidity = function setCustomValidity(error) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].reportValidity();
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'setCustomValidity' on 'HTMLFieldSetElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'setCustomValidity' on 'HTMLFieldSetElement': parameter 1"
});
args.push(curArg);
}
return this[impl].setCustomValidity(...args);
};
setCustomValidity(error) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLFieldSetElement.prototype, "disabled", {
get() {
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'setCustomValidity' on 'HTMLFieldSetElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'setCustomValidity' on 'HTMLFieldSetElement': parameter 1"
});
args.push(curArg);
}
return this[impl].setCustomValidity(...args);
}
get disabled() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("disabled");
},
}
set(V) {
set disabled(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -82,36 +72,26 @@ Object.defineProperty(HTMLFieldSetElement.prototype, "disabled", {
} else {
this.removeAttribute("disabled");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFieldSetElement.prototype, "form", {
get() {
get form() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["form"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFieldSetElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -121,27 +101,35 @@ Object.defineProperty(HTMLFieldSetElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLFieldSetElement.prototype, "willValidate", {
get() {
return this[impl]["type"];
}
get elements() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.getSameObject(this, "elements", () => {
return utils.tryWrapperForImpl(this[impl]["elements"]);
});
}
get willValidate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["willValidate"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFieldSetElement.prototype, "validity", {
get() {
get validity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -149,32 +137,30 @@ Object.defineProperty(HTMLFieldSetElement.prototype, "validity", {
return utils.getSameObject(this, "validity", () => {
return utils.tryWrapperForImpl(this[impl]["validity"]);
});
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFieldSetElement.prototype, "validationMessage", {
get() {
get validationMessage() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["validationMessage"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLFieldSetElement.prototype, {
checkValidity: { enumerable: true },
reportValidity: { enumerable: true },
setCustomValidity: { enumerable: true },
disabled: { enumerable: true },
form: { enumerable: true },
name: { enumerable: true },
type: { enumerable: true },
elements: { enumerable: true },
willValidate: { enumerable: true },
validity: { enumerable: true },
validationMessage: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLFieldSetElement", configurable: true }
});
Object.defineProperty(HTMLFieldSetElement.prototype, Symbol.toStringTag, {
value: "HTMLFieldSetElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -236,8 +222,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLFontElement() {
throw new TypeError("Illegal constructor");
}
class HTMLFontElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLFontElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLFontElement, HTMLElement.interface);
Object.defineProperty(HTMLFontElement, "prototype", {
value: HTMLFontElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLFontElement.prototype, "color", {
get() {
get color() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("color");
return value === null ? "" : value;
},
}
set(V) {
set color(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -41,23 +31,18 @@ Object.defineProperty(HTMLFontElement.prototype, "color", {
});
this.setAttribute("color", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFontElement.prototype, "face", {
get() {
get face() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("face");
return value === null ? "" : value;
},
}
set(V) {
set face(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -67,23 +52,18 @@ Object.defineProperty(HTMLFontElement.prototype, "face", {
});
this.setAttribute("face", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFontElement.prototype, "size", {
get() {
get size() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("size");
return value === null ? "" : value;
},
}
set(V) {
set size(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -93,19 +73,14 @@ Object.defineProperty(HTMLFontElement.prototype, "size", {
});
this.setAttribute("size", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLFontElement.prototype, {
color: { enumerable: true },
face: { enumerable: true },
size: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLFontElement", configurable: true }
});
Object.defineProperty(HTMLFontElement.prototype, Symbol.toStringTag, {
value: "HTMLFontElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -167,8 +142,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,63 +6,53 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLFormElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLFormElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLFormElement, HTMLElement.interface);
Object.defineProperty(HTMLFormElement, "prototype", {
value: HTMLFormElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
HTMLFormElement.prototype.submit = function submit() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class HTMLFormElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
return this[impl].submit();
};
submit() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLFormElement.prototype.reset = function reset() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].submit();
}
return this[impl].reset();
};
reset() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLFormElement.prototype.checkValidity = function checkValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].reset();
}
return this[impl].checkValidity();
};
checkValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
HTMLFormElement.prototype.reportValidity = function reportValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
return this[impl].checkValidity();
}
return this[impl].reportValidity();
};
reportValidity() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLFormElement.prototype, "acceptCharset", {
get() {
return this[impl].reportValidity();
}
get acceptCharset() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("accept-charset");
return value === null ? "" : value;
},
}
set(V) {
set acceptCharset(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -72,22 +62,17 @@ Object.defineProperty(HTMLFormElement.prototype, "acceptCharset", {
});
this.setAttribute("accept-charset", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "action", {
get() {
get action() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["action"];
},
}
set(V) {
set action(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -97,22 +82,17 @@ Object.defineProperty(HTMLFormElement.prototype, "action", {
});
this[impl]["action"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "enctype", {
get() {
get enctype() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["enctype"];
},
}
set(V) {
set enctype(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -122,22 +102,17 @@ Object.defineProperty(HTMLFormElement.prototype, "enctype", {
});
this[impl]["enctype"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "method", {
get() {
get method() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["method"];
},
}
set(V) {
set method(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -147,23 +122,18 @@ Object.defineProperty(HTMLFormElement.prototype, "method", {
});
this[impl]["method"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -173,22 +143,17 @@ Object.defineProperty(HTMLFormElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "noValidate", {
get() {
get noValidate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("noValidate");
},
}
set(V) {
set noValidate(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -202,23 +167,18 @@ Object.defineProperty(HTMLFormElement.prototype, "noValidate", {
} else {
this.removeAttribute("noValidate");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "target", {
get() {
get target() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("target");
return value === null ? "" : value;
},
}
set(V) {
set target(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -228,14 +188,9 @@ Object.defineProperty(HTMLFormElement.prototype, "target", {
});
this.setAttribute("target", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "elements", {
get() {
get elements() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -243,32 +198,32 @@ Object.defineProperty(HTMLFormElement.prototype, "elements", {
return utils.getSameObject(this, "elements", () => {
return utils.tryWrapperForImpl(this[impl]["elements"]);
});
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFormElement.prototype, "length", {
get() {
get length() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["length"];
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLFormElement.prototype, {
submit: { enumerable: true },
reset: { enumerable: true },
checkValidity: { enumerable: true },
reportValidity: { enumerable: true },
acceptCharset: { enumerable: true },
action: { enumerable: true },
enctype: { enumerable: true },
method: { enumerable: true },
name: { enumerable: true },
noValidate: { enumerable: true },
target: { enumerable: true },
elements: { enumerable: true },
length: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLFormElement", configurable: true }
});
Object.defineProperty(HTMLFormElement.prototype, Symbol.toStringTag, {
value: "HTMLFormElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -330,8 +285,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLFrameElement() {
throw new TypeError("Illegal constructor");
}
class HTMLFrameElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLFrameElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLFrameElement, HTMLElement.interface);
Object.defineProperty(HTMLFrameElement, "prototype", {
value: HTMLFrameElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLFrameElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,23 +30,18 @@ Object.defineProperty(HTMLFrameElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "scrolling", {
get() {
get scrolling() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("scrolling");
return value === null ? "" : value;
},
}
set(V) {
set scrolling(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -66,22 +51,17 @@ Object.defineProperty(HTMLFrameElement.prototype, "scrolling", {
});
this.setAttribute("scrolling", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "src", {
get() {
get src() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["src"];
},
}
set(V) {
set src(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -91,23 +71,18 @@ Object.defineProperty(HTMLFrameElement.prototype, "src", {
});
this[impl]["src"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "frameBorder", {
get() {
get frameBorder() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("frameBorder");
return value === null ? "" : value;
},
}
set(V) {
set frameBorder(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -117,22 +92,17 @@ Object.defineProperty(HTMLFrameElement.prototype, "frameBorder", {
});
this.setAttribute("frameBorder", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "longDesc", {
get() {
get longDesc() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["longDesc"];
},
}
set(V) {
set longDesc(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -142,22 +112,17 @@ Object.defineProperty(HTMLFrameElement.prototype, "longDesc", {
});
this[impl]["longDesc"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "noResize", {
get() {
get noResize() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("noResize");
},
}
set(V) {
set noResize(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -171,49 +136,34 @@ Object.defineProperty(HTMLFrameElement.prototype, "noResize", {
} else {
this.removeAttribute("noResize");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "contentDocument", {
get() {
get contentDocument() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["contentDocument"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "contentWindow", {
get() {
get contentWindow() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["contentWindow"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "marginHeight", {
get() {
get marginHeight() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("marginHeight");
return value === null ? "" : value;
},
}
set(V) {
set marginHeight(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -224,23 +174,18 @@ Object.defineProperty(HTMLFrameElement.prototype, "marginHeight", {
});
this.setAttribute("marginHeight", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameElement.prototype, "marginWidth", {
get() {
get marginWidth() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("marginWidth");
return value === null ? "" : value;
},
}
set(V) {
set marginWidth(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -251,19 +196,21 @@ Object.defineProperty(HTMLFrameElement.prototype, "marginWidth", {
});
this.setAttribute("marginWidth", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLFrameElement.prototype, {
name: { enumerable: true },
scrolling: { enumerable: true },
src: { enumerable: true },
frameBorder: { enumerable: true },
longDesc: { enumerable: true },
noResize: { enumerable: true },
contentDocument: { enumerable: true },
contentWindow: { enumerable: true },
marginHeight: { enumerable: true },
marginWidth: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLFrameElement", configurable: true }
});
Object.defineProperty(HTMLFrameElement.prototype, Symbol.toStringTag, {
value: "HTMLFrameElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -325,8 +272,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,31 +7,21 @@ const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
const WindowEventHandlers = require("./WindowEventHandlers.js");
function HTMLFrameSetElement() {
throw new TypeError("Illegal constructor");
}
class HTMLFrameSetElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLFrameSetElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLFrameSetElement, HTMLElement.interface);
Object.defineProperty(HTMLFrameSetElement, "prototype", {
value: HTMLFrameSetElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLFrameSetElement.prototype, "cols", {
get() {
get cols() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("cols");
return value === null ? "" : value;
},
}
set(V) {
set cols(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -41,23 +31,18 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "cols", {
});
this.setAttribute("cols", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "rows", {
get() {
get rows() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("rows");
return value === null ? "" : value;
},
}
set(V) {
set rows(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -67,22 +52,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "rows", {
});
this.setAttribute("rows", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onafterprint", {
get() {
get onafterprint() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onafterprint"]);
},
}
set(V) {
set onafterprint(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -90,22 +70,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onafterprint", {
V = utils.tryImplForWrapper(V);
this[impl]["onafterprint"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onbeforeprint", {
get() {
get onbeforeprint() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onbeforeprint"]);
},
}
set(V) {
set onbeforeprint(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -113,22 +88,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onbeforeprint", {
V = utils.tryImplForWrapper(V);
this[impl]["onbeforeprint"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onbeforeunload", {
get() {
get onbeforeunload() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onbeforeunload"]);
},
}
set(V) {
set onbeforeunload(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -136,22 +106,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onbeforeunload", {
V = utils.tryImplForWrapper(V);
this[impl]["onbeforeunload"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onhashchange", {
get() {
get onhashchange() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onhashchange"]);
},
}
set(V) {
set onhashchange(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -159,22 +124,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onhashchange", {
V = utils.tryImplForWrapper(V);
this[impl]["onhashchange"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onlanguagechange", {
get() {
get onlanguagechange() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onlanguagechange"]);
},
}
set(V) {
set onlanguagechange(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -182,22 +142,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onlanguagechange", {
V = utils.tryImplForWrapper(V);
this[impl]["onlanguagechange"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onmessage", {
get() {
get onmessage() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onmessage"]);
},
}
set(V) {
set onmessage(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -205,22 +160,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onmessage", {
V = utils.tryImplForWrapper(V);
this[impl]["onmessage"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onmessageerror", {
get() {
get onmessageerror() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onmessageerror"]);
},
}
set(V) {
set onmessageerror(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -228,22 +178,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onmessageerror", {
V = utils.tryImplForWrapper(V);
this[impl]["onmessageerror"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onoffline", {
get() {
get onoffline() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onoffline"]);
},
}
set(V) {
set onoffline(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -251,22 +196,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onoffline", {
V = utils.tryImplForWrapper(V);
this[impl]["onoffline"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "ononline", {
get() {
get ononline() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["ononline"]);
},
}
set(V) {
set ononline(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -274,22 +214,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "ononline", {
V = utils.tryImplForWrapper(V);
this[impl]["ononline"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onpagehide", {
get() {
get onpagehide() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onpagehide"]);
},
}
set(V) {
set onpagehide(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -297,22 +232,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onpagehide", {
V = utils.tryImplForWrapper(V);
this[impl]["onpagehide"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onpageshow", {
get() {
get onpageshow() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onpageshow"]);
},
}
set(V) {
set onpageshow(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -320,22 +250,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onpageshow", {
V = utils.tryImplForWrapper(V);
this[impl]["onpageshow"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onpopstate", {
get() {
get onpopstate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onpopstate"]);
},
}
set(V) {
set onpopstate(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -343,22 +268,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onpopstate", {
V = utils.tryImplForWrapper(V);
this[impl]["onpopstate"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onrejectionhandled", {
get() {
get onrejectionhandled() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onrejectionhandled"]);
},
}
set(V) {
set onrejectionhandled(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -366,22 +286,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onrejectionhandled", {
V = utils.tryImplForWrapper(V);
this[impl]["onrejectionhandled"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onstorage", {
get() {
get onstorage() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onstorage"]);
},
}
set(V) {
set onstorage(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -389,22 +304,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onstorage", {
V = utils.tryImplForWrapper(V);
this[impl]["onstorage"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onunhandledrejection", {
get() {
get onunhandledrejection() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onunhandledrejection"]);
},
}
set(V) {
set onunhandledrejection(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -412,22 +322,17 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onunhandledrejection", {
V = utils.tryImplForWrapper(V);
this[impl]["onunhandledrejection"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLFrameSetElement.prototype, "onunload", {
get() {
get onunload() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["onunload"]);
},
}
set(V) {
set onunload(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -435,19 +340,29 @@ Object.defineProperty(HTMLFrameSetElement.prototype, "onunload", {
V = utils.tryImplForWrapper(V);
this[impl]["onunload"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLFrameSetElement.prototype, {
cols: { enumerable: true },
rows: { enumerable: true },
onafterprint: { enumerable: true },
onbeforeprint: { enumerable: true },
onbeforeunload: { enumerable: true },
onhashchange: { enumerable: true },
onlanguagechange: { enumerable: true },
onmessage: { enumerable: true },
onmessageerror: { enumerable: true },
onoffline: { enumerable: true },
ononline: { enumerable: true },
onpagehide: { enumerable: true },
onpageshow: { enumerable: true },
onpopstate: { enumerable: true },
onrejectionhandled: { enumerable: true },
onstorage: { enumerable: true },
onunhandledrejection: { enumerable: true },
onunload: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLFrameSetElement", configurable: true }
});
Object.defineProperty(HTMLFrameSetElement.prototype, Symbol.toStringTag, {
value: "HTMLFrameSetElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -509,8 +424,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLHRElement() {
throw new TypeError("Illegal constructor");
}
class HTMLHRElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLHRElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLHRElement, HTMLElement.interface);
Object.defineProperty(HTMLHRElement, "prototype", {
value: HTMLHRElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLHRElement.prototype, "align", {
get() {
get align() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("align");
return value === null ? "" : value;
},
}
set(V) {
set align(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,23 +30,18 @@ Object.defineProperty(HTMLHRElement.prototype, "align", {
});
this.setAttribute("align", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHRElement.prototype, "color", {
get() {
get color() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("color");
return value === null ? "" : value;
},
}
set(V) {
set color(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -66,22 +51,17 @@ Object.defineProperty(HTMLHRElement.prototype, "color", {
});
this.setAttribute("color", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHRElement.prototype, "noShade", {
get() {
get noShade() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("noShade");
},
}
set(V) {
set noShade(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -95,23 +75,18 @@ Object.defineProperty(HTMLHRElement.prototype, "noShade", {
} else {
this.removeAttribute("noShade");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHRElement.prototype, "size", {
get() {
get size() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("size");
return value === null ? "" : value;
},
}
set(V) {
set size(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -121,23 +96,18 @@ Object.defineProperty(HTMLHRElement.prototype, "size", {
});
this.setAttribute("size", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHRElement.prototype, "width", {
get() {
get width() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("width");
return value === null ? "" : value;
},
}
set(V) {
set width(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -147,19 +117,16 @@ Object.defineProperty(HTMLHRElement.prototype, "width", {
});
this.setAttribute("width", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLHRElement.prototype, {
align: { enumerable: true },
color: { enumerable: true },
noShade: { enumerable: true },
size: { enumerable: true },
width: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLHRElement", configurable: true }
});
Object.defineProperty(HTMLHRElement.prototype, Symbol.toStringTag, {
value: "HTMLHRElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -221,8 +188,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,27 +6,14 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLHeadElement() {
throw new TypeError("Illegal constructor");
class HTMLHeadElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
}
Object.setPrototypeOf(HTMLHeadElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLHeadElement, HTMLElement.interface);
Object.defineProperty(HTMLHeadElement, "prototype", {
value: HTMLHeadElement.prototype,
writable: false,
enumerable: false,
configurable: false
Object.defineProperties(HTMLHeadElement.prototype, {
[Symbol.toStringTag]: { value: "HTMLHeadElement", configurable: true }
});
Object.defineProperty(HTMLHeadElement.prototype, Symbol.toStringTag, {
value: "HTMLHeadElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -88,8 +75,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLHeadingElement() {
throw new TypeError("Illegal constructor");
}
class HTMLHeadingElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLHeadingElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLHeadingElement, HTMLElement.interface);
Object.defineProperty(HTMLHeadingElement, "prototype", {
value: HTMLHeadingElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLHeadingElement.prototype, "align", {
get() {
get align() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("align");
return value === null ? "" : value;
},
}
set(V) {
set align(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,19 +30,12 @@ Object.defineProperty(HTMLHeadingElement.prototype, "align", {
});
this.setAttribute("align", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLHeadingElement.prototype, {
align: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLHeadingElement", configurable: true }
});
Object.defineProperty(HTMLHeadingElement.prototype, Symbol.toStringTag, {
value: "HTMLHeadingElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -114,8 +97,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLHtmlElement() {
throw new TypeError("Illegal constructor");
}
class HTMLHtmlElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLHtmlElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLHtmlElement, HTMLElement.interface);
Object.defineProperty(HTMLHtmlElement, "prototype", {
value: HTMLHtmlElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLHtmlElement.prototype, "version", {
get() {
get version() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("version");
return value === null ? "" : value;
},
}
set(V) {
set version(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,19 +30,12 @@ Object.defineProperty(HTMLHtmlElement.prototype, "version", {
});
this.setAttribute("version", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLHtmlElement.prototype, {
version: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLHtmlElement", configurable: true }
});
Object.defineProperty(HTMLHtmlElement.prototype, Symbol.toStringTag, {
value: "HTMLHtmlElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -114,8 +97,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -5,27 +5,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
function HTMLHyperlinkElementUtils() {
throw new TypeError("Illegal constructor");
}
class HTMLHyperlinkElementUtils {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.defineProperty(HTMLHyperlinkElementUtils, "prototype", {
value: HTMLHyperlinkElementUtils.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "href", {
get() {
get href() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
},
}
set(V) {
set href(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -35,42 +28,32 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "href", {
});
this[impl]["href"] = V;
},
enumerable: true,
configurable: true
});
HTMLHyperlinkElementUtils.prototype.toString = function toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
};
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "origin", {
get() {
toString() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
}
get origin() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["origin"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "protocol", {
get() {
get protocol() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["protocol"];
},
}
set(V) {
set protocol(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -80,22 +63,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "protocol", {
});
this[impl]["protocol"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "username", {
get() {
get username() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["username"];
},
}
set(V) {
set username(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -105,22 +83,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "username", {
});
this[impl]["username"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "password", {
get() {
get password() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["password"];
},
}
set(V) {
set password(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -130,22 +103,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "password", {
});
this[impl]["password"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "host", {
get() {
get host() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["host"];
},
}
set(V) {
set host(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -155,22 +123,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "host", {
});
this[impl]["host"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "hostname", {
get() {
get hostname() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["hostname"];
},
}
set(V) {
set hostname(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -180,22 +143,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "hostname", {
});
this[impl]["hostname"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "port", {
get() {
get port() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["port"];
},
}
set(V) {
set port(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -205,22 +163,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "port", {
});
this[impl]["port"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "pathname", {
get() {
get pathname() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["pathname"];
},
}
set(V) {
set pathname(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -230,22 +183,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "pathname", {
});
this[impl]["pathname"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "search", {
get() {
get search() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["search"];
},
}
set(V) {
set search(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -255,22 +203,17 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "search", {
});
this[impl]["search"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "hash", {
get() {
get hash() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["hash"];
},
}
set(V) {
set hash(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -280,19 +223,23 @@ Object.defineProperty(HTMLHyperlinkElementUtils.prototype, "hash", {
});
this[impl]["hash"] = V;
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLHyperlinkElementUtils.prototype, {
href: { enumerable: true },
toString: { enumerable: true },
origin: { enumerable: true },
protocol: { enumerable: true },
username: { enumerable: true },
password: { enumerable: true },
host: { enumerable: true },
hostname: { enumerable: true },
port: { enumerable: true },
pathname: { enumerable: true },
search: { enumerable: true },
hash: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLHyperlinkElementUtils", configurable: true }
});
Object.defineProperty(HTMLHyperlinkElementUtils.prototype, Symbol.toStringTag, {
value: "HTMLHyperlinkElementUtils",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -352,8 +299,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,38 +6,28 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLIFrameElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLIFrameElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLIFrameElement, HTMLElement.interface);
Object.defineProperty(HTMLIFrameElement, "prototype", {
value: HTMLIFrameElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
HTMLIFrameElement.prototype.getSVGDocument = function getSVGDocument() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class HTMLIFrameElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
return utils.tryWrapperForImpl(this[impl].getSVGDocument());
};
getSVGDocument() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLIFrameElement.prototype, "src", {
get() {
return utils.tryWrapperForImpl(this[impl].getSVGDocument());
}
get src() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["src"];
},
}
set(V) {
set src(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -47,23 +37,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "src", {
});
this[impl]["src"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "srcdoc", {
get() {
get srcdoc() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("srcdoc");
return value === null ? "" : value;
},
}
set(V) {
set srcdoc(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -73,23 +58,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "srcdoc", {
});
this.setAttribute("srcdoc", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -99,22 +79,17 @@ Object.defineProperty(HTMLIFrameElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "allowFullscreen", {
get() {
get allowFullscreen() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("allowFullscreen");
},
}
set(V) {
set allowFullscreen(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -128,23 +103,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "allowFullscreen", {
} else {
this.removeAttribute("allowFullscreen");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "width", {
get() {
get width() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("width");
return value === null ? "" : value;
},
}
set(V) {
set width(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -154,23 +124,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "width", {
});
this.setAttribute("width", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "height", {
get() {
get height() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("height");
return value === null ? "" : value;
},
}
set(V) {
set height(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -180,49 +145,34 @@ Object.defineProperty(HTMLIFrameElement.prototype, "height", {
});
this.setAttribute("height", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "contentDocument", {
get() {
get contentDocument() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["contentDocument"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "contentWindow", {
get() {
get contentWindow() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["contentWindow"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "align", {
get() {
get align() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("align");
return value === null ? "" : value;
},
}
set(V) {
set align(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -232,23 +182,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "align", {
});
this.setAttribute("align", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "scrolling", {
get() {
get scrolling() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("scrolling");
return value === null ? "" : value;
},
}
set(V) {
set scrolling(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -258,23 +203,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "scrolling", {
});
this.setAttribute("scrolling", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "frameBorder", {
get() {
get frameBorder() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("frameBorder");
return value === null ? "" : value;
},
}
set(V) {
set frameBorder(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -284,22 +224,17 @@ Object.defineProperty(HTMLIFrameElement.prototype, "frameBorder", {
});
this.setAttribute("frameBorder", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "longDesc", {
get() {
get longDesc() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["longDesc"];
},
}
set(V) {
set longDesc(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -309,23 +244,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "longDesc", {
});
this[impl]["longDesc"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "marginHeight", {
get() {
get marginHeight() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("marginHeight");
return value === null ? "" : value;
},
}
set(V) {
set marginHeight(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -336,23 +266,18 @@ Object.defineProperty(HTMLIFrameElement.prototype, "marginHeight", {
});
this.setAttribute("marginHeight", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLIFrameElement.prototype, "marginWidth", {
get() {
get marginWidth() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("marginWidth");
return value === null ? "" : value;
},
}
set(V) {
set marginWidth(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -363,19 +288,26 @@ Object.defineProperty(HTMLIFrameElement.prototype, "marginWidth", {
});
this.setAttribute("marginWidth", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLIFrameElement.prototype, {
getSVGDocument: { enumerable: true },
src: { enumerable: true },
srcdoc: { enumerable: true },
name: { enumerable: true },
allowFullscreen: { enumerable: true },
width: { enumerable: true },
height: { enumerable: true },
contentDocument: { enumerable: true },
contentWindow: { enumerable: true },
align: { enumerable: true },
scrolling: { enumerable: true },
frameBorder: { enumerable: true },
longDesc: { enumerable: true },
marginHeight: { enumerable: true },
marginWidth: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLIFrameElement", configurable: true }
});
Object.defineProperty(HTMLIFrameElement.prototype, Symbol.toStringTag, {
value: "HTMLIFrameElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -437,8 +369,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLImageElement() {
throw new TypeError("Illegal constructor");
}
class HTMLImageElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLImageElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLImageElement, HTMLElement.interface);
Object.defineProperty(HTMLImageElement, "prototype", {
value: HTMLImageElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLImageElement.prototype, "alt", {
get() {
get alt() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("alt");
return value === null ? "" : value;
},
}
set(V) {
set alt(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,22 +30,17 @@ Object.defineProperty(HTMLImageElement.prototype, "alt", {
});
this.setAttribute("alt", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "src", {
get() {
get src() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["src"];
},
}
set(V) {
set src(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -65,22 +50,17 @@ Object.defineProperty(HTMLImageElement.prototype, "src", {
});
this[impl]["src"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "srcset", {
get() {
get srcset() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["srcset"];
},
}
set(V) {
set srcset(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -90,23 +70,18 @@ Object.defineProperty(HTMLImageElement.prototype, "srcset", {
});
this[impl]["srcset"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "sizes", {
get() {
get sizes() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("sizes");
return value === null ? "" : value;
},
}
set(V) {
set sizes(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -116,23 +91,18 @@ Object.defineProperty(HTMLImageElement.prototype, "sizes", {
});
this.setAttribute("sizes", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "crossOrigin", {
get() {
get crossOrigin() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("crossOrigin");
return value === null ? "" : value;
},
}
set(V) {
set crossOrigin(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -145,23 +115,18 @@ Object.defineProperty(HTMLImageElement.prototype, "crossOrigin", {
});
}
this.setAttribute("crossOrigin", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "useMap", {
get() {
get useMap() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("useMap");
return value === null ? "" : value;
},
}
set(V) {
set useMap(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -171,22 +136,17 @@ Object.defineProperty(HTMLImageElement.prototype, "useMap", {
});
this.setAttribute("useMap", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "isMap", {
get() {
get isMap() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("isMap");
},
}
set(V) {
set isMap(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -200,22 +160,17 @@ Object.defineProperty(HTMLImageElement.prototype, "isMap", {
} else {
this.removeAttribute("isMap");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "width", {
get() {
get width() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["width"];
},
}
set(V) {
set width(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -225,22 +180,17 @@ Object.defineProperty(HTMLImageElement.prototype, "width", {
});
this[impl]["width"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "height", {
get() {
get height() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["height"];
},
}
set(V) {
set height(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -250,75 +200,50 @@ Object.defineProperty(HTMLImageElement.prototype, "height", {
});
this[impl]["height"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "naturalWidth", {
get() {
get naturalWidth() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["naturalWidth"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "naturalHeight", {
get() {
get naturalHeight() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["naturalHeight"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "complete", {
get() {
get complete() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["complete"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "currentSrc", {
get() {
get currentSrc() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["currentSrc"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -328,22 +253,17 @@ Object.defineProperty(HTMLImageElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "lowsrc", {
get() {
get lowsrc() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["lowsrc"];
},
}
set(V) {
set lowsrc(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -353,23 +273,18 @@ Object.defineProperty(HTMLImageElement.prototype, "lowsrc", {
});
this[impl]["lowsrc"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "align", {
get() {
get align() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("align");
return value === null ? "" : value;
},
}
set(V) {
set align(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -379,23 +294,18 @@ Object.defineProperty(HTMLImageElement.prototype, "align", {
});
this.setAttribute("align", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "hspace", {
get() {
get hspace() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = parseInt(this.getAttribute("hspace"));
return isNaN(value) || value < 0 || value > 2147483647 ? 0 : value;
},
}
set(V) {
set hspace(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -405,23 +315,18 @@ Object.defineProperty(HTMLImageElement.prototype, "hspace", {
});
this.setAttribute("hspace", String(V > 2147483647 ? 0 : V));
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "vspace", {
get() {
get vspace() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = parseInt(this.getAttribute("vspace"));
return isNaN(value) || value < 0 || value > 2147483647 ? 0 : value;
},
}
set(V) {
set vspace(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -431,22 +336,17 @@ Object.defineProperty(HTMLImageElement.prototype, "vspace", {
});
this.setAttribute("vspace", String(V > 2147483647 ? 0 : V));
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "longDesc", {
get() {
get longDesc() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["longDesc"];
},
}
set(V) {
set longDesc(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -456,23 +356,18 @@ Object.defineProperty(HTMLImageElement.prototype, "longDesc", {
});
this[impl]["longDesc"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLImageElement.prototype, "border", {
get() {
get border() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("border");
return value === null ? "" : value;
},
}
set(V) {
set border(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -483,19 +378,31 @@ Object.defineProperty(HTMLImageElement.prototype, "border", {
});
this.setAttribute("border", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLImageElement.prototype, {
alt: { enumerable: true },
src: { enumerable: true },
srcset: { enumerable: true },
sizes: { enumerable: true },
crossOrigin: { enumerable: true },
useMap: { enumerable: true },
isMap: { enumerable: true },
width: { enumerable: true },
height: { enumerable: true },
naturalWidth: { enumerable: true },
naturalHeight: { enumerable: true },
complete: { enumerable: true },
currentSrc: { enumerable: true },
name: { enumerable: true },
lowsrc: { enumerable: true },
align: { enumerable: true },
hspace: { enumerable: true },
vspace: { enumerable: true },
longDesc: { enumerable: true },
border: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLImageElement", configurable: true }
});
Object.defineProperty(HTMLImageElement.prototype, Symbol.toStringTag, {
value: "HTMLImageElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -557,8 +464,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

File diff suppressed because it is too large Load Diff

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLLIElement() {
throw new TypeError("Illegal constructor");
}
class HTMLLIElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLLIElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLLIElement, HTMLElement.interface);
Object.defineProperty(HTMLLIElement, "prototype", {
value: HTMLLIElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLLIElement.prototype, "value", {
get() {
get value() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = parseInt(this.getAttribute("value"));
return isNaN(value) || value < -2147483648 || value > 2147483647 ? 0 : value;
},
}
set(V) {
set value(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,23 +30,18 @@ Object.defineProperty(HTMLLIElement.prototype, "value", {
});
this.setAttribute("value", String(V));
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLIElement.prototype, "type", {
get() {
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("type");
return value === null ? "" : value;
},
}
set(V) {
set type(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -66,19 +51,13 @@ Object.defineProperty(HTMLLIElement.prototype, "type", {
});
this.setAttribute("type", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLLIElement.prototype, {
value: { enumerable: true },
type: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLLIElement", configurable: true }
});
Object.defineProperty(HTMLLIElement.prototype, Symbol.toStringTag, {
value: "HTMLLIElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -140,8 +119,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,44 +6,29 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLLabelElement() {
throw new TypeError("Illegal constructor");
}
class HTMLLabelElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLLabelElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLLabelElement, HTMLElement.interface);
Object.defineProperty(HTMLLabelElement, "prototype", {
value: HTMLLabelElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLLabelElement.prototype, "form", {
get() {
get form() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["form"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLabelElement.prototype, "htmlFor", {
get() {
get htmlFor() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("for");
return value === null ? "" : value;
},
}
set(V) {
set htmlFor(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -53,19 +38,22 @@ Object.defineProperty(HTMLLabelElement.prototype, "htmlFor", {
});
this.setAttribute("for", V);
},
}
enumerable: true,
configurable: true
get control() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["control"]);
}
}
Object.defineProperties(HTMLLabelElement.prototype, {
form: { enumerable: true },
htmlFor: { enumerable: true },
control: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLLabelElement", configurable: true }
});
Object.defineProperty(HTMLLabelElement.prototype, Symbol.toStringTag, {
value: "HTMLLabelElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -127,8 +115,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,44 +6,29 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLLegendElement() {
throw new TypeError("Illegal constructor");
}
class HTMLLegendElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLLegendElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLLegendElement, HTMLElement.interface);
Object.defineProperty(HTMLLegendElement, "prototype", {
value: HTMLLegendElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLLegendElement.prototype, "form", {
get() {
get form() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["form"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLegendElement.prototype, "align", {
get() {
get align() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("align");
return value === null ? "" : value;
},
}
set(V) {
set align(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -53,19 +38,13 @@ Object.defineProperty(HTMLLegendElement.prototype, "align", {
});
this.setAttribute("align", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLLegendElement.prototype, {
form: { enumerable: true },
align: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLLegendElement", configurable: true }
});
Object.defineProperty(HTMLLegendElement.prototype, Symbol.toStringTag, {
value: "HTMLLegendElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -127,8 +106,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,30 +7,20 @@ const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
const LinkStyle = require("./LinkStyle.js");
function HTMLLinkElement() {
throw new TypeError("Illegal constructor");
}
class HTMLLinkElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLLinkElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLLinkElement, HTMLElement.interface);
Object.defineProperty(HTMLLinkElement, "prototype", {
value: HTMLLinkElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLLinkElement.prototype, "href", {
get() {
get href() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["href"];
},
}
set(V) {
set href(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,23 +30,18 @@ Object.defineProperty(HTMLLinkElement.prototype, "href", {
});
this[impl]["href"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "crossOrigin", {
get() {
get crossOrigin() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("crossOrigin");
return value === null ? "" : value;
},
}
set(V) {
set crossOrigin(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -69,23 +54,18 @@ Object.defineProperty(HTMLLinkElement.prototype, "crossOrigin", {
});
}
this.setAttribute("crossOrigin", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "rel", {
get() {
get rel() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("rel");
return value === null ? "" : value;
},
}
set(V) {
set rel(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -95,23 +75,36 @@ Object.defineProperty(HTMLLinkElement.prototype, "rel", {
});
this.setAttribute("rel", V);
},
}
enumerable: true,
configurable: true
});
get relList() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
Object.defineProperty(HTMLLinkElement.prototype, "media", {
get() {
return utils.getSameObject(this, "relList", () => {
return utils.tryWrapperForImpl(this[impl]["relList"]);
});
}
set relList(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
this.relList.value = V;
}
get media() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("media");
return value === null ? "" : value;
},
}
set(V) {
set media(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -121,23 +114,18 @@ Object.defineProperty(HTMLLinkElement.prototype, "media", {
});
this.setAttribute("media", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "hreflang", {
get() {
get hreflang() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("hreflang");
return value === null ? "" : value;
},
}
set(V) {
set hreflang(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -147,23 +135,18 @@ Object.defineProperty(HTMLLinkElement.prototype, "hreflang", {
});
this.setAttribute("hreflang", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "type", {
get() {
get type() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("type");
return value === null ? "" : value;
},
}
set(V) {
set type(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -173,23 +156,18 @@ Object.defineProperty(HTMLLinkElement.prototype, "type", {
});
this.setAttribute("type", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "charset", {
get() {
get charset() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("charset");
return value === null ? "" : value;
},
}
set(V) {
set charset(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -199,23 +177,18 @@ Object.defineProperty(HTMLLinkElement.prototype, "charset", {
});
this.setAttribute("charset", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "rev", {
get() {
get rev() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("rev");
return value === null ? "" : value;
},
}
set(V) {
set rev(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -225,23 +198,18 @@ Object.defineProperty(HTMLLinkElement.prototype, "rev", {
});
this.setAttribute("rev", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "target", {
get() {
get target() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("target");
return value === null ? "" : value;
},
}
set(V) {
set target(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -251,32 +219,30 @@ Object.defineProperty(HTMLLinkElement.prototype, "target", {
});
this.setAttribute("target", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLLinkElement.prototype, "sheet", {
get() {
get sheet() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["sheet"]);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLLinkElement.prototype, {
href: { enumerable: true },
crossOrigin: { enumerable: true },
rel: { enumerable: true },
relList: { enumerable: true },
media: { enumerable: true },
hreflang: { enumerable: true },
type: { enumerable: true },
charset: { enumerable: true },
rev: { enumerable: true },
target: { enumerable: true },
sheet: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLLinkElement", configurable: true }
});
Object.defineProperty(HTMLLinkElement.prototype, Symbol.toStringTag, {
value: "HTMLLinkElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -338,8 +304,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLMapElement() {
throw new TypeError("Illegal constructor");
}
class HTMLMapElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLMapElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLMapElement, HTMLElement.interface);
Object.defineProperty(HTMLMapElement, "prototype", {
value: HTMLMapElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLMapElement.prototype, "name", {
get() {
get name() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("name");
return value === null ? "" : value;
},
}
set(V) {
set name(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,14 +30,9 @@ Object.defineProperty(HTMLMapElement.prototype, "name", {
});
this.setAttribute("name", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMapElement.prototype, "areas", {
get() {
get areas() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -55,19 +40,13 @@ Object.defineProperty(HTMLMapElement.prototype, "areas", {
return utils.getSameObject(this, "areas", () => {
return utils.tryWrapperForImpl(this[impl]["areas"]);
});
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLMapElement.prototype, {
name: { enumerable: true },
areas: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLMapElement", configurable: true }
});
Object.defineProperty(HTMLMapElement.prototype, Symbol.toStringTag, {
value: "HTMLMapElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -129,8 +108,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,31 +6,21 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLMarqueeElement() {
throw new TypeError("Illegal constructor");
}
class HTMLMarqueeElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLMarqueeElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLMarqueeElement, HTMLElement.interface);
Object.defineProperty(HTMLMarqueeElement, "prototype", {
value: HTMLMarqueeElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLMarqueeElement.prototype, "behavior", {
get() {
get behavior() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("behavior");
return value === null ? "" : value;
},
}
set(V) {
set behavior(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -40,23 +30,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "behavior", {
});
this.setAttribute("behavior", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "bgColor", {
get() {
get bgColor() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("bgcolor");
return value === null ? "" : value;
},
}
set(V) {
set bgColor(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -66,23 +51,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "bgColor", {
});
this.setAttribute("bgcolor", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "direction", {
get() {
get direction() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("direction");
return value === null ? "" : value;
},
}
set(V) {
set direction(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -92,23 +72,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "direction", {
});
this.setAttribute("direction", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "height", {
get() {
get height() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("height");
return value === null ? "" : value;
},
}
set(V) {
set height(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -118,23 +93,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "height", {
});
this.setAttribute("height", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "hspace", {
get() {
get hspace() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = parseInt(this.getAttribute("hspace"));
return isNaN(value) || value < 0 || value > 2147483647 ? 0 : value;
},
}
set(V) {
set hspace(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -144,23 +114,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "hspace", {
});
this.setAttribute("hspace", String(V > 2147483647 ? 0 : V));
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "scrollAmount", {
get() {
get scrollAmount() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = parseInt(this.getAttribute("scrollamount"));
return isNaN(value) || value < 0 || value > 2147483647 ? 0 : value;
},
}
set(V) {
set scrollAmount(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -170,23 +135,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "scrollAmount", {
});
this.setAttribute("scrollamount", String(V > 2147483647 ? 0 : V));
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "scrollDelay", {
get() {
get scrollDelay() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = parseInt(this.getAttribute("scrolldelay"));
return isNaN(value) || value < 0 || value > 2147483647 ? 0 : value;
},
}
set(V) {
set scrollDelay(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -196,22 +156,17 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "scrollDelay", {
});
this.setAttribute("scrolldelay", String(V > 2147483647 ? 0 : V));
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "trueSpeed", {
get() {
get trueSpeed() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("truespeed");
},
}
set(V) {
set trueSpeed(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -225,23 +180,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "trueSpeed", {
} else {
this.removeAttribute("truespeed");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "vspace", {
get() {
get vspace() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = parseInt(this.getAttribute("vspace"));
return isNaN(value) || value < 0 || value > 2147483647 ? 0 : value;
},
}
set(V) {
set vspace(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -251,23 +201,18 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "vspace", {
});
this.setAttribute("vspace", String(V > 2147483647 ? 0 : V));
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMarqueeElement.prototype, "width", {
get() {
get width() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("width");
return value === null ? "" : value;
},
}
set(V) {
set width(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -277,19 +222,21 @@ Object.defineProperty(HTMLMarqueeElement.prototype, "width", {
});
this.setAttribute("width", V);
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLMarqueeElement.prototype, {
behavior: { enumerable: true },
bgColor: { enumerable: true },
direction: { enumerable: true },
height: { enumerable: true },
hspace: { enumerable: true },
scrollAmount: { enumerable: true },
scrollDelay: { enumerable: true },
trueSpeed: { enumerable: true },
vspace: { enumerable: true },
width: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLMarqueeElement", configurable: true }
});
Object.defineProperty(HTMLMarqueeElement.prototype, Symbol.toStringTag, {
value: "HTMLMarqueeElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -351,8 +298,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -7,122 +7,112 @@ const convertTextTrackKind = require("./TextTrackKind.js").convert;
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLMediaElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLMediaElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLMediaElement, HTMLElement.interface);
Object.defineProperty(HTMLMediaElement, "prototype", {
value: HTMLMediaElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
HTMLMediaElement.prototype.load = function load() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
class HTMLMediaElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
return this[impl].load();
};
HTMLMediaElement.prototype.canPlayType = function canPlayType(type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'canPlayType' on 'HTMLMediaElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'canPlayType' on 'HTMLMediaElement': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].canPlayType(...args));
};
HTMLMediaElement.prototype.play = function play() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl].play());
};
HTMLMediaElement.prototype.pause = function pause() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].pause();
};
HTMLMediaElement.prototype.addTextTrack = function addTextTrack(kind) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'addTextTrack' on 'HTMLMediaElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertTextTrackKind(curArg, {
context: "Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 2"
});
} else {
curArg = "";
load() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 3"
});
} else {
curArg = "";
}
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].addTextTrack(...args));
};
Object.defineProperty(HTMLMediaElement.prototype, "src", {
get() {
return this[impl].load();
}
canPlayType(type) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'canPlayType' on 'HTMLMediaElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'canPlayType' on 'HTMLMediaElement': parameter 1"
});
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].canPlayType(...args));
}
play() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl].play());
}
pause() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl].pause();
}
addTextTrack(kind) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'addTextTrack' on 'HTMLMediaElement': 1 argument required, but only " +
arguments.length +
" present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = convertTextTrackKind(curArg, {
context: "Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 1"
});
args.push(curArg);
}
{
let curArg = arguments[1];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 2"
});
} else {
curArg = "";
}
args.push(curArg);
}
{
let curArg = arguments[2];
if (curArg !== undefined) {
curArg = conversions["DOMString"](curArg, {
context: "Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 3"
});
} else {
curArg = "";
}
args.push(curArg);
}
return utils.tryWrapperForImpl(this[impl].addTextTrack(...args));
}
get src() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["src"];
},
}
set(V) {
set src(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -132,36 +122,26 @@ Object.defineProperty(HTMLMediaElement.prototype, "src", {
});
this[impl]["src"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "currentSrc", {
get() {
get currentSrc() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["currentSrc"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "crossOrigin", {
get() {
get crossOrigin() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("crossOrigin");
return value === null ? "" : value;
},
}
set(V) {
set crossOrigin(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -174,36 +154,26 @@ Object.defineProperty(HTMLMediaElement.prototype, "crossOrigin", {
});
}
this.setAttribute("crossOrigin", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "networkState", {
get() {
get networkState() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["networkState"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "preload", {
get() {
get preload() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const value = this.getAttribute("preload");
return value === null ? "" : value;
},
}
set(V) {
set preload(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -213,61 +183,41 @@ Object.defineProperty(HTMLMediaElement.prototype, "preload", {
});
this.setAttribute("preload", V);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "buffered", {
get() {
get buffered() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["buffered"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "readyState", {
get() {
get readyState() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["readyState"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "seeking", {
get() {
get seeking() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["seeking"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "currentTime", {
get() {
get currentTime() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["currentTime"];
},
}
set(V) {
set currentTime(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -277,48 +227,33 @@ Object.defineProperty(HTMLMediaElement.prototype, "currentTime", {
});
this[impl]["currentTime"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "duration", {
get() {
get duration() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["duration"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "paused", {
get() {
get paused() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["paused"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "defaultPlaybackRate", {
get() {
get defaultPlaybackRate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["defaultPlaybackRate"];
},
}
set(V) {
set defaultPlaybackRate(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -328,22 +263,17 @@ Object.defineProperty(HTMLMediaElement.prototype, "defaultPlaybackRate", {
});
this[impl]["defaultPlaybackRate"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "playbackRate", {
get() {
get playbackRate() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["playbackRate"];
},
}
set(V) {
set playbackRate(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -353,61 +283,41 @@ Object.defineProperty(HTMLMediaElement.prototype, "playbackRate", {
});
this[impl]["playbackRate"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "played", {
get() {
get played() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["played"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "seekable", {
get() {
get seekable() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return utils.tryWrapperForImpl(this[impl]["seekable"]);
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "ended", {
get() {
get ended() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["ended"];
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "autoplay", {
get() {
get autoplay() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("autoplay");
},
}
set(V) {
set autoplay(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -421,22 +331,17 @@ Object.defineProperty(HTMLMediaElement.prototype, "autoplay", {
} else {
this.removeAttribute("autoplay");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "loop", {
get() {
get loop() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("loop");
},
}
set(V) {
set loop(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -450,22 +355,17 @@ Object.defineProperty(HTMLMediaElement.prototype, "loop", {
} else {
this.removeAttribute("loop");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "controls", {
get() {
get controls() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("controls");
},
}
set(V) {
set controls(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -479,22 +379,17 @@ Object.defineProperty(HTMLMediaElement.prototype, "controls", {
} else {
this.removeAttribute("controls");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "volume", {
get() {
get volume() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["volume"];
},
}
set(V) {
set volume(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -504,22 +399,17 @@ Object.defineProperty(HTMLMediaElement.prototype, "volume", {
});
this[impl]["volume"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "muted", {
get() {
get muted() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this[impl]["muted"];
},
}
set(V) {
set muted(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -529,22 +419,17 @@ Object.defineProperty(HTMLMediaElement.prototype, "muted", {
});
this[impl]["muted"] = V;
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "defaultMuted", {
get() {
get defaultMuted() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("muted");
},
}
set(V) {
set defaultMuted(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -558,14 +443,9 @@ Object.defineProperty(HTMLMediaElement.prototype, "defaultMuted", {
} else {
this.removeAttribute("muted");
}
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "audioTracks", {
get() {
get audioTracks() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -573,14 +453,9 @@ Object.defineProperty(HTMLMediaElement.prototype, "audioTracks", {
return utils.getSameObject(this, "audioTracks", () => {
return utils.tryWrapperForImpl(this[impl]["audioTracks"]);
});
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "videoTracks", {
get() {
get videoTracks() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -588,14 +463,9 @@ Object.defineProperty(HTMLMediaElement.prototype, "videoTracks", {
return utils.getSameObject(this, "videoTracks", () => {
return utils.tryWrapperForImpl(this[impl]["videoTracks"]);
});
},
}
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "textTracks", {
get() {
get textTracks() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -603,100 +473,61 @@ Object.defineProperty(HTMLMediaElement.prototype, "textTracks", {
return utils.getSameObject(this, "textTracks", () => {
return utils.tryWrapperForImpl(this[impl]["textTracks"]);
});
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLMediaElement.prototype, {
load: { enumerable: true },
canPlayType: { enumerable: true },
play: { enumerable: true },
pause: { enumerable: true },
addTextTrack: { enumerable: true },
src: { enumerable: true },
currentSrc: { enumerable: true },
crossOrigin: { enumerable: true },
networkState: { enumerable: true },
preload: { enumerable: true },
buffered: { enumerable: true },
readyState: { enumerable: true },
seeking: { enumerable: true },
currentTime: { enumerable: true },
duration: { enumerable: true },
paused: { enumerable: true },
defaultPlaybackRate: { enumerable: true },
playbackRate: { enumerable: true },
played: { enumerable: true },
seekable: { enumerable: true },
ended: { enumerable: true },
autoplay: { enumerable: true },
loop: { enumerable: true },
controls: { enumerable: true },
volume: { enumerable: true },
muted: { enumerable: true },
defaultMuted: { enumerable: true },
audioTracks: { enumerable: true },
videoTracks: { enumerable: true },
textTracks: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLMediaElement", configurable: true },
NETWORK_EMPTY: { value: 0, enumerable: true },
NETWORK_IDLE: { value: 1, enumerable: true },
NETWORK_LOADING: { value: 2, enumerable: true },
NETWORK_NO_SOURCE: { value: 3, enumerable: true },
HAVE_NOTHING: { value: 0, enumerable: true },
HAVE_METADATA: { value: 1, enumerable: true },
HAVE_CURRENT_DATA: { value: 2, enumerable: true },
HAVE_FUTURE_DATA: { value: 3, enumerable: true },
HAVE_ENOUGH_DATA: { value: 4, enumerable: true }
});
Object.defineProperty(HTMLMediaElement, "NETWORK_EMPTY", {
value: 0,
enumerable: true
Object.defineProperties(HTMLMediaElement, {
NETWORK_EMPTY: { value: 0, enumerable: true },
NETWORK_IDLE: { value: 1, enumerable: true },
NETWORK_LOADING: { value: 2, enumerable: true },
NETWORK_NO_SOURCE: { value: 3, enumerable: true },
HAVE_NOTHING: { value: 0, enumerable: true },
HAVE_METADATA: { value: 1, enumerable: true },
HAVE_CURRENT_DATA: { value: 2, enumerable: true },
HAVE_FUTURE_DATA: { value: 3, enumerable: true },
HAVE_ENOUGH_DATA: { value: 4, enumerable: true }
});
Object.defineProperty(HTMLMediaElement.prototype, "NETWORK_EMPTY", {
value: 0,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "NETWORK_IDLE", {
value: 1,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "NETWORK_IDLE", {
value: 1,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "NETWORK_LOADING", {
value: 2,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "NETWORK_LOADING", {
value: 2,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "NETWORK_NO_SOURCE", {
value: 3,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "NETWORK_NO_SOURCE", {
value: 3,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "HAVE_NOTHING", {
value: 0,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "HAVE_NOTHING", {
value: 0,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "HAVE_METADATA", {
value: 1,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "HAVE_METADATA", {
value: 1,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "HAVE_CURRENT_DATA", {
value: 2,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "HAVE_CURRENT_DATA", {
value: 2,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "HAVE_FUTURE_DATA", {
value: 3,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "HAVE_FUTURE_DATA", {
value: 3,
enumerable: true
});
Object.defineProperty(HTMLMediaElement, "HAVE_ENOUGH_DATA", {
value: 4,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, "HAVE_ENOUGH_DATA", {
value: 4,
enumerable: true
});
Object.defineProperty(HTMLMediaElement.prototype, Symbol.toStringTag, {
value: "HTMLMediaElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -758,8 +589,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

View File

@@ -6,30 +6,20 @@ const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLMenuElement() {
throw new TypeError("Illegal constructor");
}
class HTMLMenuElement extends HTMLElement.interface {
constructor() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLMenuElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLMenuElement, HTMLElement.interface);
Object.defineProperty(HTMLMenuElement, "prototype", {
value: HTMLMenuElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLMenuElement.prototype, "compact", {
get() {
get compact() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.hasAttribute("compact");
},
}
set(V) {
set compact(V) {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
@@ -43,19 +33,12 @@ Object.defineProperty(HTMLMenuElement.prototype, "compact", {
} else {
this.removeAttribute("compact");
}
},
enumerable: true,
configurable: true
}
}
Object.defineProperties(HTMLMenuElement.prototype, {
compact: { enumerable: true },
[Symbol.toStringTag]: { value: "HTMLMenuElement", configurable: true }
});
Object.defineProperty(HTMLMenuElement.prototype, Symbol.toStringTag, {
value: "HTMLMenuElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
@@ -117,8 +100,6 @@ const iface = {
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});

Some files were not shown because too many files have changed in this diff Show More