From f0b912c02c080aa883a7b78287b47d8973c27481 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 10 Jun 2018 11:47:55 +0900 Subject: [PATCH 1/2] add HTML text level semantics types --- baselines/dom.generated.d.ts | 7 ++-- inputfiles/addedTypes.json | 35 ++++++++++++++++++ ...TML - Text level semantics.commentmap.json | 3 ++ .../idl/HTML - Text level semantics.widl | 36 +++++++++++++++++++ inputfiles/idlSources.json | 4 +++ 5 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 inputfiles/idl/HTML - Text level semantics.commentmap.json create mode 100644 inputfiles/idl/HTML - Text level semantics.widl diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index ab73ecca9..1d15fb981 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -5525,7 +5525,6 @@ declare var HTMLAllCollection: { }; interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { - Methods: string; /** * Sets or retrieves the character set used to encode the object. */ @@ -5541,14 +5540,13 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { * Sets or retrieves the language code of the object. */ hreflang: string; - readonly mimeType: string; /** * Sets or retrieves the shape of the object. */ /** @deprecated */ name: string; - readonly nameProp: string; - readonly protocolLong: string; + ping: string; + referrerPolicy: string; /** * Sets or retrieves the relationship between the object and the destination of the link. */ @@ -5573,7 +5571,6 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { */ text: string; type: string; - urn: string; addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index de0ba635c..6da58049a 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -2123,6 +2123,41 @@ }, "no-interface-object": "1" }, + "HTMLAnchorElement": { + "element": [ + { + "name": "a" + } + ] + }, + "HTMLBRElement": { + "element": [ + { + "name": "br" + } + ] + }, + "HTMLDataElement": { + "element": [ + { + "name": "data" + } + ] + }, + "HTMLSpanElement": { + "element": [ + { + "name": "span" + } + ] + }, + "HTMLTimeElement": { + "element": [ + { + "name": "time" + } + ] + }, "HTMLTableDataCellElement": { "name": "HTMLTableDataCellElement", "extends": "HTMLTableCellElement", diff --git a/inputfiles/idl/HTML - Text level semantics.commentmap.json b/inputfiles/idl/HTML - Text level semantics.commentmap.json new file mode 100644 index 000000000..c62d22abd --- /dev/null +++ b/inputfiles/idl/HTML - Text level semantics.commentmap.json @@ -0,0 +1,3 @@ +{ + "a-text": "Same as textContent." +} diff --git a/inputfiles/idl/HTML - Text level semantics.widl b/inputfiles/idl/HTML - Text level semantics.widl new file mode 100644 index 000000000..311aeb51d --- /dev/null +++ b/inputfiles/idl/HTML - Text level semantics.widl @@ -0,0 +1,36 @@ +[Exposed=Window, + HTMLConstructor] +interface HTMLAnchorElement : HTMLElement { + [CEReactions] attribute DOMString target; + [CEReactions] attribute DOMString download; + [CEReactions] attribute USVString ping; + [CEReactions] attribute DOMString rel; + [SameObject, PutForwards=value] readonly attribute DOMTokenList relList; + [CEReactions] attribute DOMString hreflang; + [CEReactions] attribute DOMString type; + + [CEReactions] attribute DOMString text; + + [CEReactions] attribute DOMString referrerPolicy; +}; +HTMLAnchorElement includes HTMLHyperlinkElementUtils; + +[Exposed=Window, + HTMLConstructor] +interface HTMLDataElement : HTMLElement { + [CEReactions] attribute DOMString value; +}; + +[Exposed=Window, + HTMLConstructor] +interface HTMLTimeElement : HTMLElement { + [CEReactions] attribute DOMString dateTime; +}; + +[Exposed=Window, + HTMLConstructor] +interface HTMLSpanElement : HTMLElement {}; + +[Exposed=Window, + HTMLConstructor] +interface HTMLBRElement : HTMLElement {}; diff --git a/inputfiles/idlSources.json b/inputfiles/idlSources.json index 5984c14fc..7e8901f2b 100644 --- a/inputfiles/idlSources.json +++ b/inputfiles/idlSources.json @@ -48,6 +48,10 @@ "title": "HTML - Obsolete features", "deprecated": true }, + { + "url": "https://html.spec.whatwg.org/multipage/text-level-semantics.html", + "title": "HTML - Text level semantics" + }, { "url": "https://html.spec.whatwg.org/multipage/webstorage.html", "title": "HTML - Web storage" From fcf40f1c17fd63825595f6954d6b6de56583e554 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 10 Jun 2018 12:17:44 +0900 Subject: [PATCH 2/2] adds edits/links/embedded content types --- baselines/dom.generated.d.ts | 25 +++---------- inputfiles/addedTypes.json | 31 +++++++++++++++- inputfiles/comments.json | 9 ----- inputfiles/idl/HTML - Edits.widl | 6 ++++ .../HTML - Embedded content.commentmap.json | 9 +++++ inputfiles/idl/HTML - Embedded content.widl | 36 +++++++++++++++++++ inputfiles/idl/HTML - Links.commentmap.json | 13 +++++++ inputfiles/idl/HTML - Links.widl | 13 +++++++ inputfiles/idlSources.json | 12 +++++++ 9 files changed, 124 insertions(+), 30 deletions(-) create mode 100644 inputfiles/idl/HTML - Edits.widl create mode 100644 inputfiles/idl/HTML - Embedded content.commentmap.json create mode 100644 inputfiles/idl/HTML - Embedded content.widl create mode 100644 inputfiles/idl/HTML - Links.commentmap.json create mode 100644 inputfiles/idl/HTML - Links.widl diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 1d15fb981..2128e27ed 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -6605,12 +6605,13 @@ interface HTMLHyperlinkElementUtils { host: string; hostname: string; href: string; - origin: string; + readonly origin: string; + password: string; pathname: string; port: string; protocol: string; search: string; - toString(): string; + username: string; } interface HTMLIFrameElementEventMap extends HTMLElementEventMap { @@ -6732,19 +6733,6 @@ interface HTMLImageElement extends HTMLElement { longDesc: string; /** @deprecated */ lowsrc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; /** * Sets or retrieves the name of the object. */ @@ -6758,6 +6746,7 @@ interface HTMLImageElement extends HTMLElement { * The original width of the image resource before sizing. */ readonly naturalWidth: number; + referrerPolicy: string; sizes: string; /** * The address or URL of the a media resource that is to be considered. @@ -6777,9 +6766,7 @@ interface HTMLImageElement extends HTMLElement { * Sets or retrieves the width of the object. */ width: number; - readonly x: number; - readonly y: number; - msGetAsCastingSource(): any; + decode(): Promise; addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -8014,8 +8001,6 @@ interface HTMLSourceElement extends HTMLElement { * Gets or sets the intended media type of the media source. */ media: string; - /** @deprecated */ - msKeySystem: string; sizes: string; /** * The address or URL of the a media resource that is to be considered. diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index 6da58049a..998451f70 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -180,7 +180,12 @@ "override-type": "\"async\" | \"sync\" | \"auto\"" } } - } + }, + "element": [ + { + "name": "img" + } + ] }, "BroadcastChannelEventMap": { "name": "BroadcastChannelEventMap", @@ -2144,6 +2149,30 @@ } ] }, + "HTMLModElement": { + "element": [ + { + "name": "del" + }, + { + "name": "ins" + } + ] + }, + "HTMLPictureElement": { + "element": [ + { + "name": "picture" + } + ] + }, + "HTMLSourceElement": { + "element": [ + { + "name": "source" + } + ] + }, "HTMLSpanElement": { "element": [ { diff --git a/inputfiles/comments.json b/inputfiles/comments.json index bf389a520..5bc298d45 100644 --- a/inputfiles/comments.json +++ b/inputfiles/comments.json @@ -430,15 +430,6 @@ }, "complete": { "comment": "/**\r\n * Retrieves whether the object is fully loaded.\r\n */" - }, - "msPlayToPrimary": { - "comment": "/**\r\n * Gets or sets the primary DLNA PlayTo device.\r\n */" - }, - "msPlayToDisabled": { - "comment": "/**\r\n * Gets or sets whether the DLNA PlayTo device is available.\r\n */" - }, - "msPlayToSource": { - "comment": "/**\r\n * Gets the source associated with the media element for use by the PlayToManager.\r\n */" } } } diff --git a/inputfiles/idl/HTML - Edits.widl b/inputfiles/idl/HTML - Edits.widl new file mode 100644 index 000000000..d51432947 --- /dev/null +++ b/inputfiles/idl/HTML - Edits.widl @@ -0,0 +1,6 @@ +[Exposed=Window, + HTMLConstructor] +interface HTMLModElement : HTMLElement { + [CEReactions] attribute USVString cite; + [CEReactions] attribute DOMString dateTime; +}; diff --git a/inputfiles/idl/HTML - Embedded content.commentmap.json b/inputfiles/idl/HTML - Embedded content.commentmap.json new file mode 100644 index 000000000..142ceab34 --- /dev/null +++ b/inputfiles/idl/HTML - Embedded content.commentmap.json @@ -0,0 +1,9 @@ +{ + "img-height": "These attributes return the actual rendered dimensions of the\nimage, or zero if the dimensions are not known.\nThey can be set, to change the corresponding content\nattributes.", + "img-naturalheight": "These attributes return the intrinsic dimensions of the image,\nor zero if the dimensions are not known.", + "img-complete": "Returns true if the image has been completely downloaded or if\nno image is specified; otherwise, returns false.", + "img-currentsrc": "Returns the image's absolute URL.", + "img-decoding": "Returns the image decoding hint set for this image.", + "img-decode": "This method causes the user agent to decode the\nimage in parallel, returning a promise that fulfills when decoding is complete.\nThe promise will be rejected with an \"EncodingError\"\nDOMException if the image cannot be decoded.", + "image": "Returns a new img element, with the width and height attributes set to the values\npassed in the relevant arguments, if applicable." +} diff --git a/inputfiles/idl/HTML - Embedded content.widl b/inputfiles/idl/HTML - Embedded content.widl new file mode 100644 index 000000000..62ed9463f --- /dev/null +++ b/inputfiles/idl/HTML - Embedded content.widl @@ -0,0 +1,36 @@ +[Exposed=Window, + HTMLConstructor] +interface HTMLPictureElement : HTMLElement {}; + +[Exposed=Window, + HTMLConstructor] +interface HTMLSourceElement : HTMLElement { + [CEReactions] attribute USVString src; + [CEReactions] attribute DOMString type; + [CEReactions] attribute USVString srcset; + [CEReactions] attribute DOMString sizes; + [CEReactions] attribute DOMString media; +}; + +[Exposed=Window, + HTMLConstructor, + NamedConstructor=Image(optional unsigned long width, optional unsigned long height)] +interface HTMLImageElement : HTMLElement { + [CEReactions] attribute DOMString alt; + [CEReactions] attribute USVString src; + [CEReactions] attribute USVString srcset; + [CEReactions] attribute DOMString sizes; + [CEReactions] attribute DOMString? crossOrigin; + [CEReactions] attribute DOMString useMap; + [CEReactions] attribute boolean isMap; + [CEReactions] attribute unsigned long width; + [CEReactions] attribute unsigned long height; + readonly attribute unsigned long naturalWidth; + readonly attribute unsigned long naturalHeight; + readonly attribute boolean complete; + readonly attribute USVString currentSrc; + [CEReactions] attribute DOMString referrerPolicy; + [CEReactions] attribute DOMString decoding; + + Promise decode(); +}; diff --git a/inputfiles/idl/HTML - Links.commentmap.json b/inputfiles/idl/HTML - Links.commentmap.json new file mode 100644 index 000000000..2ebb3883c --- /dev/null +++ b/inputfiles/idl/HTML - Links.commentmap.json @@ -0,0 +1,13 @@ +{ + "hyperlink-href": "Returns the hyperlink's URL.\nCan be set, to change the URL.", + "hyperlink-origin": "Returns the hyperlink's URL's origin.", + "hyperlink-protocol": "Returns the hyperlink's URL's scheme.\nCan be set, to change the URL's scheme.", + "hyperlink-username": "Returns the hyperlink's URL's username.\nCan be set, to change the URL's username.", + "hyperlink-password": "Returns the hyperlink's URL's password.\nCan be set, to change the URL's password.", + "hyperlink-host": "Returns the hyperlink's URL's host and port (if different from the default port for the\nscheme).\nCan be set, to change the URL's host and port.", + "hyperlink-hostname": "Returns the hyperlink's URL's host.\nCan be set, to change the URL's host.", + "hyperlink-port": "Returns the hyperlink's URL's port.\nCan be set, to change the URL's port.", + "hyperlink-pathname": "Returns the hyperlink's URL's path.\nCan be set, to change the URL's path.", + "hyperlink-search": "Returns the hyperlink's URL's query (includes leading \"?\" if\nnon-empty).\nCan be set, to change the URL's query (ignores leading \"?\").", + "hyperlink-hash": "Returns the hyperlink's URL's fragment (includes leading \"#\" if\nnon-empty).\nCan be set, to change the URL's fragment (ignores leading \"#\")." +} diff --git a/inputfiles/idl/HTML - Links.widl b/inputfiles/idl/HTML - Links.widl new file mode 100644 index 000000000..2dc0fe4d0 --- /dev/null +++ b/inputfiles/idl/HTML - Links.widl @@ -0,0 +1,13 @@ +interface mixin HTMLHyperlinkElementUtils { + [CEReactions] stringifier attribute USVString href; + readonly attribute USVString origin; + [CEReactions] attribute USVString protocol; + [CEReactions] attribute USVString username; + [CEReactions] attribute USVString password; + [CEReactions] attribute USVString host; + [CEReactions] attribute USVString hostname; + [CEReactions] attribute USVString port; + [CEReactions] attribute USVString pathname; + [CEReactions] attribute USVString search; + [CEReactions] attribute USVString hash; +}; diff --git a/inputfiles/idlSources.json b/inputfiles/idlSources.json index 7e8901f2b..40a862501 100644 --- a/inputfiles/idlSources.json +++ b/inputfiles/idlSources.json @@ -35,6 +35,14 @@ "url": "https://html.spec.whatwg.org/multipage/common-dom-interfaces.html", "title": "HTML - Common DOM interfaces" }, + { + "url": "https://html.spec.whatwg.org/multipage/edits.html", + "title": "HTML - Edits" + }, + { + "url": "https://html.spec.whatwg.org/multipage/embedded-content.html", + "title": "HTML - Embedded content" + }, { "url": "https://html.spec.whatwg.org/multipage/form-control-infrastructure.html", "title": "HTML - Form control infrastructure" @@ -43,6 +51,10 @@ "url": "https://html.spec.whatwg.org/multipage/form-elements.html", "title": "HTML - Form elements" }, + { + "url": "https://html.spec.whatwg.org/multipage/links.html", + "title": "HTML - Links" + }, { "url": "https://html.spec.whatwg.org/multipage/obsolete.html", "title": "HTML - Obsolete features",