Skip to content

Commit c77ea33

Browse files
authored
Merge pull request #494 from saschanaz/text-semantics
Add HTML text level semantics types
2 parents 1ae123b + 69103b5 commit c77ea33

11 files changed

+211
-40
lines changed

baselines/dom.generated.d.ts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5548,7 +5548,6 @@ declare var HTMLAllCollection: {
55485548
};
55495549

55505550
interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {
5551-
Methods: string;
55525551
/**
55535552
* Sets or retrieves the character set used to encode the object.
55545553
*/
@@ -5564,14 +5563,13 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {
55645563
* Sets or retrieves the language code of the object.
55655564
*/
55665565
hreflang: string;
5567-
readonly mimeType: string;
55685566
/**
55695567
* Sets or retrieves the shape of the object.
55705568
*/
55715569
/** @deprecated */
55725570
name: string;
5573-
readonly nameProp: string;
5574-
readonly protocolLong: string;
5571+
ping: string;
5572+
referrerPolicy: string;
55755573
/**
55765574
* Sets or retrieves the relationship between the object and the destination of the link.
55775575
*/
@@ -5596,7 +5594,6 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {
55965594
*/
55975595
text: string;
55985596
type: string;
5599-
urn: string;
56005597
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
56015598
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
56025599
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -6610,12 +6607,13 @@ interface HTMLHyperlinkElementUtils {
66106607
host: string;
66116608
hostname: string;
66126609
href: string;
6613-
origin: string;
6610+
readonly origin: string;
6611+
password: string;
66146612
pathname: string;
66156613
port: string;
66166614
protocol: string;
66176615
search: string;
6618-
toString(): string;
6616+
username: string;
66196617
}
66206618

66216619
interface HTMLIFrameElementEventMap extends HTMLElementEventMap {
@@ -6737,19 +6735,6 @@ interface HTMLImageElement extends HTMLElement {
67376735
longDesc: string;
67386736
/** @deprecated */
67396737
lowsrc: string;
6740-
/**
6741-
* Gets or sets whether the DLNA PlayTo device is available.
6742-
*/
6743-
msPlayToDisabled: boolean;
6744-
msPlayToPreferredSourceUri: string;
6745-
/**
6746-
* Gets or sets the primary DLNA PlayTo device.
6747-
*/
6748-
msPlayToPrimary: boolean;
6749-
/**
6750-
* Gets the source associated with the media element for use by the PlayToManager.
6751-
*/
6752-
readonly msPlayToSource: any;
67536738
/**
67546739
* Sets or retrieves the name of the object.
67556740
*/
@@ -6763,6 +6748,7 @@ interface HTMLImageElement extends HTMLElement {
67636748
* The original width of the image resource before sizing.
67646749
*/
67656750
readonly naturalWidth: number;
6751+
referrerPolicy: string;
67666752
sizes: string;
67676753
/**
67686754
* The address or URL of the a media resource that is to be considered.
@@ -6784,7 +6770,7 @@ interface HTMLImageElement extends HTMLElement {
67846770
width: number;
67856771
readonly x: number;
67866772
readonly y: number;
6787-
msGetAsCastingSource(): any;
6773+
decode(): Promise<void>;
67886774
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
67896775
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
67906776
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -8021,8 +8007,6 @@ interface HTMLSourceElement extends HTMLElement {
80218007
* Gets or sets the intended media type of the media source.
80228008
*/
80238009
media: string;
8024-
/** @deprecated */
8025-
msKeySystem: string;
80268010
sizes: string;
80278011
/**
80288012
* The address or URL of the a media resource that is to be considered.

inputfiles/addedTypes.json

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,12 @@
180180
"override-type": "\"async\" | \"sync\" | \"auto\""
181181
}
182182
}
183-
}
183+
},
184+
"element": [
185+
{
186+
"name": "img"
187+
}
188+
]
184189
},
185190
"BroadcastChannelEventMap": {
186191
"name": "BroadcastChannelEventMap",
@@ -1861,6 +1866,13 @@
18611866
},
18621867
"no-interface-object": "1"
18631868
},
1869+
"HTMLAnchorElement": {
1870+
"element": [
1871+
{
1872+
"name": "a"
1873+
}
1874+
]
1875+
},
18641876
"HTMLAreaElement": {
18651877
"element": [
18661878
{
@@ -1875,6 +1887,20 @@
18751887
}
18761888
]
18771889
},
1890+
"HTMLBRElement": {
1891+
"element": [
1892+
{
1893+
"name": "br"
1894+
}
1895+
]
1896+
},
1897+
"HTMLDataElement": {
1898+
"element": [
1899+
{
1900+
"name": "data"
1901+
}
1902+
]
1903+
},
18781904
"HTMLDetailsElement": {
18791905
"element": [
18801906
{
@@ -1989,6 +2015,16 @@
19892015
}
19902016
]
19912017
},
2018+
"HTMLModElement": {
2019+
"element": [
2020+
{
2021+
"name": "del"
2022+
},
2023+
{
2024+
"name": "ins"
2025+
}
2026+
]
2027+
},
19922028
"HTMLOListElement": {
19932029
"element": [
19942030
{
@@ -2003,6 +2039,13 @@
20032039
}
20042040
]
20052041
},
2042+
"HTMLPictureElement": {
2043+
"element": [
2044+
{
2045+
"name": "picture"
2046+
}
2047+
]
2048+
},
20062049
"HTMLPreElement": {
20072050
"element": [
20082051
{
@@ -2042,6 +2085,20 @@
20422085
}
20432086
]
20442087
},
2088+
"HTMLSourceElement": {
2089+
"element": [
2090+
{
2091+
"name": "source"
2092+
}
2093+
]
2094+
},
2095+
"HTMLSpanElement": {
2096+
"element": [
2097+
{
2098+
"name": "span"
2099+
}
2100+
]
2101+
},
20452102
"HTMLStyleElement": {
20462103
"element": [
20472104
{
@@ -2113,13 +2170,6 @@
21132170
}
21142171
]
21152172
},
2116-
"HTMLTemplateElement": {
2117-
"element": [
2118-
{
2119-
"name": "template"
2120-
}
2121-
]
2122-
},
21232173
"HTMLTableRowElement": {
21242174
"element": [
21252175
{
@@ -2140,13 +2190,27 @@
21402190
}
21412191
]
21422192
},
2193+
"HTMLTimeElement": {
2194+
"element": [
2195+
{
2196+
"name": "time"
2197+
}
2198+
]
2199+
},
21432200
"HTMLTitleElement": {
21442201
"element": [
21452202
{
21462203
"name": "title"
21472204
}
21482205
]
21492206
},
2207+
"HTMLTemplateElement": {
2208+
"element": [
2209+
{
2210+
"name": "template"
2211+
}
2212+
]
2213+
},
21502214
"HTMLUListElement": {
21512215
"element": [
21522216
{

inputfiles/comments.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -424,15 +424,6 @@
424424
},
425425
"complete": {
426426
"comment": "/**\r\n * Retrieves whether the object is fully loaded.\r\n */"
427-
},
428-
"msPlayToPrimary": {
429-
"comment": "/**\r\n * Gets or sets the primary DLNA PlayTo device.\r\n */"
430-
},
431-
"msPlayToDisabled": {
432-
"comment": "/**\r\n * Gets or sets whether the DLNA PlayTo device is available.\r\n */"
433-
},
434-
"msPlayToSource": {
435-
"comment": "/**\r\n * Gets the source associated with the media element for use by the PlayToManager.\r\n */"
436427
}
437428
}
438429
}

inputfiles/idl/HTML - Edits.widl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Exposed=Window,
2+
HTMLConstructor]
3+
interface HTMLModElement : HTMLElement {
4+
[CEReactions] attribute USVString cite;
5+
[CEReactions] attribute DOMString dateTime;
6+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"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.",
3+
"img-naturalheight": "These attributes return the intrinsic dimensions of the image,\nor zero if the dimensions are not known.",
4+
"img-complete": "Returns true if the image has been completely downloaded or if\nno image is specified; otherwise, returns false.",
5+
"img-currentsrc": "Returns the image's absolute URL.",
6+
"img-decoding": "Returns the image decoding hint set for this image.",
7+
"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.",
8+
"image": "Returns a new img element, with the width and height attributes set to the values\npassed in the relevant arguments, if applicable."
9+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[Exposed=Window,
2+
HTMLConstructor]
3+
interface HTMLPictureElement : HTMLElement {};
4+
5+
[Exposed=Window,
6+
HTMLConstructor]
7+
interface HTMLSourceElement : HTMLElement {
8+
[CEReactions] attribute USVString src;
9+
[CEReactions] attribute DOMString type;
10+
[CEReactions] attribute USVString srcset;
11+
[CEReactions] attribute DOMString sizes;
12+
[CEReactions] attribute DOMString media;
13+
};
14+
15+
[Exposed=Window,
16+
HTMLConstructor,
17+
NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
18+
interface HTMLImageElement : HTMLElement {
19+
[CEReactions] attribute DOMString alt;
20+
[CEReactions] attribute USVString src;
21+
[CEReactions] attribute USVString srcset;
22+
[CEReactions] attribute DOMString sizes;
23+
[CEReactions] attribute DOMString? crossOrigin;
24+
[CEReactions] attribute DOMString useMap;
25+
[CEReactions] attribute boolean isMap;
26+
[CEReactions] attribute unsigned long width;
27+
[CEReactions] attribute unsigned long height;
28+
readonly attribute unsigned long naturalWidth;
29+
readonly attribute unsigned long naturalHeight;
30+
readonly attribute boolean complete;
31+
readonly attribute USVString currentSrc;
32+
[CEReactions] attribute DOMString referrerPolicy;
33+
[CEReactions] attribute DOMString decoding;
34+
35+
Promise<void> decode();
36+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"hyperlink-href": "Returns the hyperlink's URL.\nCan be set, to change the URL.",
3+
"hyperlink-origin": "Returns the hyperlink's URL's origin.",
4+
"hyperlink-protocol": "Returns the hyperlink's URL's scheme.\nCan be set, to change the URL's scheme.",
5+
"hyperlink-username": "Returns the hyperlink's URL's username.\nCan be set, to change the URL's username.",
6+
"hyperlink-password": "Returns the hyperlink's URL's password.\nCan be set, to change the URL's password.",
7+
"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.",
8+
"hyperlink-hostname": "Returns the hyperlink's URL's host.\nCan be set, to change the URL's host.",
9+
"hyperlink-port": "Returns the hyperlink's URL's port.\nCan be set, to change the URL's port.",
10+
"hyperlink-pathname": "Returns the hyperlink's URL's path.\nCan be set, to change the URL's path.",
11+
"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 \"?\").",
12+
"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+
}

inputfiles/idl/HTML - Links.widl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
interface mixin HTMLHyperlinkElementUtils {
2+
[CEReactions] stringifier attribute USVString href;
3+
readonly attribute USVString origin;
4+
[CEReactions] attribute USVString protocol;
5+
[CEReactions] attribute USVString username;
6+
[CEReactions] attribute USVString password;
7+
[CEReactions] attribute USVString host;
8+
[CEReactions] attribute USVString hostname;
9+
[CEReactions] attribute USVString port;
10+
[CEReactions] attribute USVString pathname;
11+
[CEReactions] attribute USVString search;
12+
[CEReactions] attribute USVString hash;
13+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"a-text": "Same as textContent."
3+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[Exposed=Window,
2+
HTMLConstructor]
3+
interface HTMLAnchorElement : HTMLElement {
4+
[CEReactions] attribute DOMString target;
5+
[CEReactions] attribute DOMString download;
6+
[CEReactions] attribute USVString ping;
7+
[CEReactions] attribute DOMString rel;
8+
[SameObject, PutForwards=value] readonly attribute DOMTokenList relList;
9+
[CEReactions] attribute DOMString hreflang;
10+
[CEReactions] attribute DOMString type;
11+
12+
[CEReactions] attribute DOMString text;
13+
14+
[CEReactions] attribute DOMString referrerPolicy;
15+
};
16+
HTMLAnchorElement includes HTMLHyperlinkElementUtils;
17+
18+
[Exposed=Window,
19+
HTMLConstructor]
20+
interface HTMLDataElement : HTMLElement {
21+
[CEReactions] attribute DOMString value;
22+
};
23+
24+
[Exposed=Window,
25+
HTMLConstructor]
26+
interface HTMLTimeElement : HTMLElement {
27+
[CEReactions] attribute DOMString dateTime;
28+
};
29+
30+
[Exposed=Window,
31+
HTMLConstructor]
32+
interface HTMLSpanElement : HTMLElement {};
33+
34+
[Exposed=Window,
35+
HTMLConstructor]
36+
interface HTMLBRElement : HTMLElement {};

0 commit comments

Comments
 (0)