diff --git a/lib/jsdom/living/nodes/HTMLElement-impl.js b/lib/jsdom/living/nodes/HTMLElement-impl.js index 7e6000dd4f..98189846b9 100644 --- a/lib/jsdom/living/nodes/HTMLElement-impl.js +++ b/lib/jsdom/living/nodes/HTMLElement-impl.js @@ -4,7 +4,7 @@ const ElementImpl = require("./Element-impl").implementation; const MouseEvent = require("../generated/MouseEvent"); const ElementCSSInlineStyleImpl = require("./ElementCSSInlineStyle-impl").implementation; const GlobalEventHandlersImpl = require("./GlobalEventHandlers-impl").implementation; -const HTMLAndSVGElementSharedImpl = require("./HTMLAndSVGElementShared-impl").implementation; +const HTMLOrSVGElementImpl = require("./HTMLOrSVGElement-impl").implementation; const { firstChildWithLocalName } = require("../helpers/traversal"); const { isDisabled } = require("../helpers/form-controls"); const { fireAnEvent } = require("../helpers/events"); @@ -12,7 +12,7 @@ const { fireAnEvent } = require("../helpers/events"); class HTMLElementImpl extends ElementImpl { constructor(args, privateData) { super(args, privateData); - this._initHTMLAndSVGElement(); + this._initHTMLOrSVGElement(); this._initElementCSSInlineStyle(); this._initGlobalEvents(); @@ -151,7 +151,7 @@ class HTMLElementImpl extends ElementImpl { mixin(HTMLElementImpl.prototype, ElementCSSInlineStyleImpl.prototype); mixin(HTMLElementImpl.prototype, GlobalEventHandlersImpl.prototype); -mixin(HTMLElementImpl.prototype, HTMLAndSVGElementSharedImpl.prototype); +mixin(HTMLElementImpl.prototype, HTMLOrSVGElementImpl.prototype); module.exports = { implementation: HTMLElementImpl diff --git a/lib/jsdom/living/nodes/HTMLElement.webidl b/lib/jsdom/living/nodes/HTMLElement.webidl index e1fc40ddb0..27d7104467 100644 --- a/lib/jsdom/living/nodes/HTMLElement.webidl +++ b/lib/jsdom/living/nodes/HTMLElement.webidl @@ -7,28 +7,25 @@ interface HTMLElement : Element { [CEReactions, Reflect] attribute DOMString lang; [CEReactions] attribute boolean translate; [CEReactions] attribute DOMString dir; - [SameObject] readonly attribute DOMStringMap dataset; // user interaction [CEReactions, Reflect] attribute boolean hidden; void click(); - [CEReactions] attribute long tabIndex; -// We don't support FocusOptions yet -// void focus(optional FocusOptions options); - void focus(); - void blur(); [CEReactions, Reflect] attribute DOMString accessKey; // readonly attribute DOMString accessKeyLabel; [CEReactions] attribute boolean draggable; // [CEReactions] attribute boolean spellcheck; +// [CEReactions] attribute DOMString autocapitalize; // [CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerText; + +// ElementInternals attachInternals(); }; HTMLElement includes GlobalEventHandlers; // HTMLElement includes DocumentAndElementEventHandlers; HTMLElement includes ElementContentEditable; -// HTMLElement includes HTMLOrSVGElement; +HTMLElement includes HTMLOrSVGElement; // https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface partial interface HTMLElement { diff --git a/lib/jsdom/living/nodes/HTMLLinkElement.webidl b/lib/jsdom/living/nodes/HTMLLinkElement.webidl index c5284f0b83..cea86bd6af 100644 --- a/lib/jsdom/living/nodes/HTMLLinkElement.webidl +++ b/lib/jsdom/living/nodes/HTMLLinkElement.webidl @@ -8,7 +8,6 @@ interface HTMLLinkElement : HTMLElement { // [CEReactions] attribute DOMString as; // (default "") [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; [CEReactions, Reflect] attribute DOMString media; -// [CEReactions] attribute DOMString nonce; // [CEReactions] attribute DOMString integrity; [CEReactions, Reflect] attribute DOMString hreflang; [CEReactions, Reflect] attribute DOMString type; diff --git a/lib/jsdom/living/nodes/HTMLAndSVGElementShared-impl.js b/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js similarity index 92% rename from lib/jsdom/living/nodes/HTMLAndSVGElementShared-impl.js rename to lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js index 03bd0c33f1..d33da48f67 100644 --- a/lib/jsdom/living/nodes/HTMLAndSVGElementShared-impl.js +++ b/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js @@ -4,8 +4,8 @@ const conversions = require("webidl-conversions"); const focusing = require("../helpers/focusing"); const DOMStringMap = require("../generated/DOMStringMap"); -class HTMLAndSVGElementSharedImpl { - _initHTMLAndSVGElement() { +class HTMLOrSVGElementImpl { + _initHTMLOrSVGElement() { this._tabIndex = 0; this._dataset = DOMStringMap.createImpl([], { element: this }); } @@ -53,4 +53,4 @@ class HTMLAndSVGElementSharedImpl { } } -exports.implementation = HTMLAndSVGElementSharedImpl; +exports.implementation = HTMLOrSVGElementImpl; diff --git a/lib/jsdom/living/nodes/HTMLOrSVGElement.webidl b/lib/jsdom/living/nodes/HTMLOrSVGElement.webidl new file mode 100644 index 0000000000..25563447f8 --- /dev/null +++ b/lib/jsdom/living/nodes/HTMLOrSVGElement.webidl @@ -0,0 +1,11 @@ +interface mixin HTMLOrSVGElement { + [SameObject] readonly attribute DOMStringMap dataset; +// TODO: Shouldn't be directly [Reflect]ed + [Reflect] attribute DOMString nonce; // intentionally no [CEReactions] + + [CEReactions] attribute long tabIndex; +// We don't support FocusOptions yet +// void focus(optional FocusOptions options); + void focus(); + void blur(); +}; diff --git a/lib/jsdom/living/nodes/HTMLScriptElement.webidl b/lib/jsdom/living/nodes/HTMLScriptElement.webidl index ffafbefa15..4560d561b8 100644 --- a/lib/jsdom/living/nodes/HTMLScriptElement.webidl +++ b/lib/jsdom/living/nodes/HTMLScriptElement.webidl @@ -8,7 +8,6 @@ interface HTMLScriptElement : HTMLElement { [CEReactions, Reflect] attribute boolean defer; [CEReactions, Reflect] attribute DOMString? crossOrigin; [CEReactions] attribute DOMString text; - [CEReactions, Reflect] attribute DOMString nonce; // [CEReactions, Reflect] attribute DOMString integrity; diff --git a/lib/jsdom/living/nodes/HTMLStyleElement.webidl b/lib/jsdom/living/nodes/HTMLStyleElement.webidl index 58d725748f..3d7a3ae2ed 100644 --- a/lib/jsdom/living/nodes/HTMLStyleElement.webidl +++ b/lib/jsdom/living/nodes/HTMLStyleElement.webidl @@ -3,7 +3,6 @@ HTMLConstructor] interface HTMLStyleElement : HTMLElement { [CEReactions, Reflect] attribute DOMString media; - [CEReactions, Reflect] attribute DOMString nonce; // also has obsolete members }; diff --git a/lib/jsdom/living/nodes/SVGElement-impl.js b/lib/jsdom/living/nodes/SVGElement-impl.js index faceda7c2f..479b2344a6 100644 --- a/lib/jsdom/living/nodes/SVGElement-impl.js +++ b/lib/jsdom/living/nodes/SVGElement-impl.js @@ -7,12 +7,12 @@ const SVGAnimatedString = require("../generated/SVGAnimatedString"); const ElementImpl = require("./Element-impl").implementation; const ElementCSSInlineStyleImpl = require("./ElementCSSInlineStyle-impl").implementation; const GlobalEventHandlersImpl = require("./GlobalEventHandlers-impl").implementation; -const HTMLAndSVGElementSharedImpl = require("./HTMLAndSVGElementShared-impl").implementation; +const HTMLOrSVGElementImpl = require("./HTMLOrSVGElement-impl").implementation; class SVGElementImpl extends ElementImpl { constructor(args, privateData) { super(args, privateData); - this._initHTMLAndSVGElement(); + this._initHTMLOrSVGElement(); this._initElementCSSInlineStyle(); this._initGlobalEvents(); } @@ -46,6 +46,6 @@ SVGElementImpl.attributeRegistry = new Map(); mixin(SVGElementImpl.prototype, ElementCSSInlineStyleImpl.prototype); mixin(SVGElementImpl.prototype, GlobalEventHandlersImpl.prototype); -mixin(SVGElementImpl.prototype, HTMLAndSVGElementSharedImpl.prototype); +mixin(SVGElementImpl.prototype, HTMLOrSVGElementImpl.prototype); exports.implementation = SVGElementImpl; diff --git a/lib/jsdom/living/nodes/SVGElement.webidl b/lib/jsdom/living/nodes/SVGElement.webidl index 972aacd234..ceaff38d97 100644 --- a/lib/jsdom/living/nodes/SVGElement.webidl +++ b/lib/jsdom/living/nodes/SVGElement.webidl @@ -4,15 +4,11 @@ interface SVGElement : Element { // TODO: implement reflection in webidl2js [SameObject] readonly attribute SVGAnimatedString className; - [SameObject] readonly attribute DOMStringMap dataset; - readonly attribute SVGSVGElement? ownerSVGElement; readonly attribute SVGElement? viewportElement; - - attribute long tabIndex; - void focus(); - void blur(); }; SVGElement includes GlobalEventHandlers; +// SVGElement includes DocumentAndElementEventHandlers; // SVGElement includes SVGElementInstance; +SVGElement includes HTMLOrSVGElement;