Skip to content

Add HTML text level semantics types #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 7 additions & 23 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5548,7 +5548,6 @@ declare var HTMLAllCollection: {
};

interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {
Methods: string;
/**
* Sets or retrieves the character set used to encode the object.
*/
Expand All @@ -5564,14 +5563,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.
*/
Expand All @@ -5596,7 +5594,6 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {
*/
text: string;
type: string;
urn: string;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -6610,12 +6607,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 {
Expand Down Expand Up @@ -6737,19 +6735,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.
*/
Expand All @@ -6763,6 +6748,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.
Expand All @@ -6784,7 +6770,7 @@ interface HTMLImageElement extends HTMLElement {
width: number;
readonly x: number;
readonly y: number;
msGetAsCastingSource(): any;
decode(): Promise<void>;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -8021,8 +8007,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.
Expand Down
80 changes: 72 additions & 8 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@
"override-type": "\"async\" | \"sync\" | \"auto\""
}
}
}
},
"element": [
{
"name": "img"
}
]
},
"BroadcastChannelEventMap": {
"name": "BroadcastChannelEventMap",
Expand Down Expand Up @@ -1861,6 +1866,13 @@
},
"no-interface-object": "1"
},
"HTMLAnchorElement": {
"element": [
{
"name": "a"
}
]
},
"HTMLAreaElement": {
"element": [
{
Expand All @@ -1875,6 +1887,20 @@
}
]
},
"HTMLBRElement": {
"element": [
{
"name": "br"
}
]
},
"HTMLDataElement": {
"element": [
{
"name": "data"
}
]
},
"HTMLDetailsElement": {
"element": [
{
Expand Down Expand Up @@ -1989,6 +2015,16 @@
}
]
},
"HTMLModElement": {
"element": [
{
"name": "del"
},
{
"name": "ins"
}
]
},
"HTMLOListElement": {
"element": [
{
Expand All @@ -2003,6 +2039,13 @@
}
]
},
"HTMLPictureElement": {
"element": [
{
"name": "picture"
}
]
},
"HTMLPreElement": {
"element": [
{
Expand Down Expand Up @@ -2042,6 +2085,20 @@
}
]
},
"HTMLSourceElement": {
"element": [
{
"name": "source"
}
]
},
"HTMLSpanElement": {
"element": [
{
"name": "span"
}
]
},
"HTMLStyleElement": {
"element": [
{
Expand Down Expand Up @@ -2113,13 +2170,6 @@
}
]
},
"HTMLTemplateElement": {
"element": [
{
"name": "template"
}
]
},
"HTMLTableRowElement": {
"element": [
{
Expand All @@ -2140,13 +2190,27 @@
}
]
},
"HTMLTimeElement": {
"element": [
{
"name": "time"
}
]
},
"HTMLTitleElement": {
"element": [
{
"name": "title"
}
]
},
"HTMLTemplateElement": {
"element": [
{
"name": "template"
}
]
},
"HTMLUListElement": {
"element": [
{
Expand Down
9 changes: 0 additions & 9 deletions inputfiles/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,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 */"
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions inputfiles/idl/HTML - Edits.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Exposed=Window,
HTMLConstructor]
interface HTMLModElement : HTMLElement {
[CEReactions] attribute USVString cite;
[CEReactions] attribute DOMString dateTime;
};
9 changes: 9 additions & 0 deletions inputfiles/idl/HTML - Embedded content.commentmap.json
Original file line number Diff line number Diff line change
@@ -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."
}
36 changes: 36 additions & 0 deletions inputfiles/idl/HTML - Embedded content.widl
Original file line number Diff line number Diff line change
@@ -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<void> decode();
};
13 changes: 13 additions & 0 deletions inputfiles/idl/HTML - Links.commentmap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"hyperlink-href": "Returns the hyperlink's URL.\nCan be set, to change the URL.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not see these comments showing up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what should be done there, it seems should be htmlhyperlinkelementutils-href instead of hyperlink-href to add it to the lib file. Should it be manually mapped?

"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 \"#\")."
}
13 changes: 13 additions & 0 deletions inputfiles/idl/HTML - Links.widl
Original file line number Diff line number Diff line change
@@ -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;
};
3 changes: 3 additions & 0 deletions inputfiles/idl/HTML - Text level semantics.commentmap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"a-text": "Same as textContent."
}
36 changes: 36 additions & 0 deletions inputfiles/idl/HTML - Text level semantics.widl
Original file line number Diff line number Diff line change
@@ -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 {};
Loading