Skip to content

Add HTML semantics types #490

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 3 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
18 changes: 3 additions & 15 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6552,8 +6552,6 @@ declare var HTMLHRElement: {
};

interface HTMLHeadElement extends HTMLElement {
/** @deprecated */
profile: string;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHeadElement, 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: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -7048,6 +7046,7 @@ declare var HTMLLegendElement: {
};

interface HTMLLinkElement extends HTMLElement, LinkStyle {
as: string;
/**
* Sets or retrieves the character set used to encode the object.
*/
Expand All @@ -7063,12 +7062,12 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle {
* Sets or retrieves the language code of the object.
*/
hreflang: string;
import?: Document;
integrity: string;
/**
* Sets or retrieves the media type.
*/
media: string;
referrerPolicy: string;
/**
* Sets or retrieves the relationship between the object and the destination of the link.
*/
Expand All @@ -7079,6 +7078,7 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle {
*/
/** @deprecated */
rev: string;
readonly sizes: DOMTokenList;
/**
* Sets or retrieves the window or frame at which to target content.
*/
Expand Down Expand Up @@ -7392,11 +7392,6 @@ declare var HTMLMenuElement: {
};

interface HTMLMetaElement extends HTMLElement {
/**
* Sets or retrieves the character set used to encode the object.
*/
/** @deprecated */
charset: string;
/**
* Gets or sets meta-information to associate with httpEquiv or name.
*/
Expand All @@ -7414,11 +7409,6 @@ interface HTMLMetaElement extends HTMLElement {
*/
/** @deprecated */
scheme: string;
/**
* Sets or retrieves the URL property that will be loaded after the specified time has elapsed.
*/
/** @deprecated */
url: string;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMetaElement, 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: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -8048,8 +8038,6 @@ declare var HTMLSpanElement: {
};

interface HTMLStyleElement extends HTMLElement, LinkStyle {
/** @deprecated */
disabled: boolean;
/**
* Sets or retrieves the media type.
*/
Expand Down
69 changes: 57 additions & 12 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -713,18 +713,6 @@
}
}
},
"HTMLLinkElement": {
"name": "HTMLLinkElement",
"properties": {
"property": {
"import": {
"name": "import",
"override-type": "Document",
"required": 0
}
}
}
},
"HTMLCanvasElement": {
"name": "HTMLCanvasElement",
"methods": {
Expand Down Expand Up @@ -2123,6 +2111,13 @@
},
"no-interface-object": "1"
},
"HTMLBaseElement": {
"element": [
{
"name": "base"
}
]
},
"HTMLDivElement": {
"element": [
{
Expand All @@ -2137,13 +2132,42 @@
}
]
},
"HTMLHeadElement": {
"element": [
{
"name": "head"
}
]
},
"HTMLHRElement": {
"element": [
{
"name": "hr"
}
]
},
"HTMLHtmlElement": {
"element": [
{
"name": "html"
}
]
},
"HTMLLinkElement": {
"properties": {
"property": {
"disabled":{
"name": "disabled",
"type": "boolean"
}
}
},
"element": [
{
"name": "link"
}
]
},
"HTMLLIElement": {
"element": [
{
Expand All @@ -2158,6 +2182,13 @@
}
]
},
"HTMLMetaElement": {
"element": [
{
"name": "meta"
}
]
},
"HTMLOListElement": {
"element": [
{
Expand Down Expand Up @@ -2197,6 +2228,13 @@
}
]
},
"HTMLStyleElement": {
"element": [
{
"name": "style"
}
]
},
"HTMLTableDataCellElement": {
"name": "HTMLTableDataCellElement",
"extends": "HTMLTableCellElement",
Expand Down Expand Up @@ -2227,6 +2265,13 @@
}
]
},
"HTMLTitleElement": {
"element": [
{
"name": "title"
}
]
},
"HTMLUListElement": {
"element": [
{
Expand Down
6 changes: 0 additions & 6 deletions inputfiles/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,8 @@
"content": {
"comment": "/**\r\n * Gets or sets meta-information to associate with httpEquiv or name.\r\n */"
},
"url": {
"comment": "/**\r\n * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.\r\n */"
},
"scheme": {
"comment": "/**\r\n * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.\r\n */"
},
"charset": {
"comment": "/**\r\n * Sets or retrieves the character set used to encode the object.\r\n */"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions inputfiles/idl/HTML - Semantics.commentmap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title-text": "Returns the child text content of the element.\nCan be set, to replace the element's children with the given value."
}
52 changes: 52 additions & 0 deletions inputfiles/idl/HTML - Semantics.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[Exposed=Window,
HTMLConstructor]
interface HTMLHtmlElement : HTMLElement {};

[Exposed=Window,
HTMLConstructor]
interface HTMLHeadElement : HTMLElement {};

[Exposed=Window,
HTMLConstructor]
interface HTMLTitleElement : HTMLElement {
[CEReactions] attribute DOMString text;
};

[Exposed=Window,
HTMLConstructor]
interface HTMLBaseElement : HTMLElement {
[CEReactions] attribute USVString href;
[CEReactions] attribute DOMString target;
};

[Exposed=Window,
HTMLConstructor]
interface HTMLLinkElement : HTMLElement {
[CEReactions] attribute USVString href;
[CEReactions] attribute DOMString? crossOrigin;
[CEReactions] attribute DOMString rel;
[CEReactions] attribute DOMString as; // (default "")
[SameObject, PutForwards=value] readonly attribute DOMTokenList relList;
[CEReactions] attribute DOMString media;
[CEReactions] attribute DOMString integrity;
[CEReactions] attribute DOMString hreflang;
[CEReactions] attribute DOMString type;
[SameObject, PutForwards=value] readonly attribute DOMTokenList sizes;
[CEReactions] attribute DOMString referrerPolicy;
};
HTMLLinkElement includes LinkStyle;

[Exposed=Window,
HTMLConstructor]
interface HTMLMetaElement : HTMLElement {
[CEReactions] attribute DOMString name;
[CEReactions] attribute DOMString httpEquiv;
[CEReactions] attribute DOMString content;
};

[Exposed=Window,
HTMLConstructor]
interface HTMLStyleElement : HTMLElement {
[CEReactions] attribute DOMString media;
};
HTMLStyleElement includes LinkStyle;
4 changes: 4 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
"title": "HTML - Obsolete features",
"deprecated": true
},
{
"url": "https://html.spec.whatwg.org/multipage/semantics.html",
"title": "HTML - Semantics"
},
{
"url": "https://html.spec.whatwg.org/multipage/webstorage.html",
"title": "HTML - Web storage"
Expand Down
17 changes: 0 additions & 17 deletions inputfiles/overridingTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,23 +235,6 @@
}
}
},
"HTMLLinkElement": {
Copy link
Contributor

Choose a reason for hiding this comment

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

we have explicitly added these in #488 and #425 can we keep them for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

relList is in the spec so it's not really removed. disable is not, the spec does not mention it, even not as a deprecated attribute...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, it was once in the spec, has been removed not because it's needless but it's in inappropriate document. I'll add it again.

"name": "HTMLLinkElement",
"properties": {
"property": {
"disabled":{
"deprecated": 0,
"name": "disabled",
"type": "boolean"
},
"relList": {
"read-only": 1,
"name": "relList",
"type": "DOMTokenList"
}
}
}
},
"SourceBuffer": {
"specs": "media-source",
"name": "SourceBuffer",
Expand Down