1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:37:45 +00:00

LibWeb: Add Exposed attribute and IDL spec links where missing

The intent is to use these to autogenerate prototype declarations for
Window and WorkerGlobalScope classes.

And the spec links are just nice to have :^)
This commit is contained in:
Andrew Kaster 2022-10-07 16:45:09 -06:00 committed by Andreas Kling
parent 0265041d44
commit 67ceba2e6a
123 changed files with 236 additions and 14 deletions

View file

@ -1,6 +1,6 @@
#import <DOM/Event.idl>
[]
[Exposed=*]
interface CloseEvent : Event {
constructor(DOMString type, optional CloseEventInit eventInitDict = {});

View file

@ -8,6 +8,8 @@ enum DOMParserSupportedType {
"image/svg+xml"
};
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparser
[Exposed=Window]
interface DOMParser {
constructor();

View file

@ -2,6 +2,7 @@
#import <HTML/HTMLHyperlinkElementUtils.idl>
// https://html.spec.whatwg.org/multipage/text-level-semantics.html#htmlanchorelement
[Exposed=Window]
interface HTMLAnchorElement : HTMLElement {
// FIXME: [HTMLConstructor] constructor();

View file

@ -2,6 +2,7 @@
#import <HTML/HTMLHyperlinkElementUtils.idl>
// https://html.spec.whatwg.org/multipage/image-maps.html#htmlareaelement
[Exposed=Window]
interface HTMLAreaElement : HTMLElement {
// FIXME: [HTMLConstructor] constructor();

View file

@ -1,7 +1,6 @@
#import <HTML/HTMLMediaElement.idl>
[Exposed=Window, LegacyFactoryFunction=Audio(optional DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {
// FIXME: [HTMLConstructor] constructor();
};

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlbrelement
[Exposed=Window]
interface HTMLBRElement : HTMLElement {
[Reflect] attribute DOMString clear;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlbaseelement
[Exposed=Window]
interface HTMLBaseElement : HTMLElement {
[CEReactions] attribute USVString href;

View file

@ -1,6 +1,8 @@
#import <DOM/EventHandler.idl>
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/sections.html#htmlbodyelement
[Exposed=Window]
interface HTMLBodyElement : HTMLElement {
[LegacyNullToEmptyString, Reflect] attribute DOMString text;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlbuttonelement
[Exposed=Window]
interface HTMLButtonElement : HTMLElement {
[Reflect=formnovalidate] attribute boolean formNoValidate;

View file

@ -4,6 +4,8 @@
typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
// https://html.spec.whatwg.org/multipage/semantics.html#htmlcanvaselement
[Exposed=Window]
interface HTMLCanvasElement : HTMLElement {
RenderingContext? getContext(DOMString contextId, optional any options = null);

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmldlistelement
[Exposed=Window]
interface HTMLDListElement : HTMLElement {
[Reflect] attribute boolean compact;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmldataelement
[Exposed=Window]
interface HTMLDataElement : HTMLElement {
[Reflect] attribute DOMString value;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmldatalistelement
[Exposed=Window]
interface HTMLDataListElement : HTMLElement {

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmldetailselement
[Exposed=Window]
interface HTMLDetailsElement : HTMLElement {
[Reflect] attribute boolean open;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmldialogelement
[Exposed=Window]
interface HTMLDialogElement : HTMLElement {
[Reflect] attribute boolean open;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmldirectoryelement
[Exposed=Window]
interface HTMLDirectoryElement : HTMLElement {
[Reflect] attribute boolean compact;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmldivelement
[Exposed=Window]
interface HTMLDivElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -1,6 +1,8 @@
#import <HTML/DOMStringMap.idl>
#import <DOM/EventHandler.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlelement
[Exposed=Window]
interface HTMLElement : Element {
[Reflect] attribute DOMString title;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlembedelement
[Exposed=Window]
interface HTMLEmbedElement : HTMLElement {
[Reflect] attribute DOMString src;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlfieldsetelement
[Exposed=Window]
interface HTMLFieldSetElement : HTMLElement {
readonly attribute DOMString type;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlfontelement
[Exposed=Window]
interface HTMLFontElement : HTMLElement {
[LegacyNullToEmptyString, Reflect] attribute DOMString color;

View file

@ -1,6 +1,8 @@
#import <DOM/HTMLCollection.idl>
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlformelement
[Exposed=Window]
interface HTMLFormElement : HTMLElement {
[Reflect] attribute DOMString name;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlframeelement
[Exposed=Window]
interface HTMLFrameElement : HTMLElement {
[Reflect] attribute DOMString name;

View file

@ -1,6 +1,8 @@
#import <DOM/EventHandler.idl>
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlframesetelement
[Exposed=Window]
interface HTMLFrameSetElement : HTMLElement {
[Reflect] attribute DOMString cols;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/grouping-content.html#htmlhrelement
[Exposed=Window]
interface HTMLHRElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlheadelement
[Exposed=Window]
interface HTMLHeadElement : HTMLElement {

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlheadingelement
[Exposed=Window]
interface HTMLHeadingElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlhtmlelement
[Exposed=Window]
interface HTMLHtmlElement : HTMLElement {
[Reflect] attribute DOMString version;

View file

@ -1,6 +1,8 @@
#import <HTML/HTMLElement.idl>
#import <DOM/Document.idl>
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#htmliframeelement
[Exposed=Window]
interface HTMLIFrameElement : HTMLElement {
[Reflect] attribute DOMString src;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement
[Exposed=Window, LegacyFactoryFunction=Image(optional unsigned long width, optional unsigned long height)]
interface HTMLImageElement : HTMLElement {
[Reflect] attribute DOMString src;

View file

@ -2,6 +2,8 @@
#import <HTML/HTMLFormElement.idl>
#import <FileAPI/FileList.idl>
// https://html.spec.whatwg.org/multipage/input.html#htmlinputelement
[Exposed=Window]
interface HTMLInputElement : HTMLElement {
readonly attribute HTMLFormElement? form;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/grouping-content.html#htmllielement
[Exposed=Window]
interface HTMLLIElement : HTMLElement {
[Reflect] attribute DOMString type;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/forms.html#htmllabelelement
[Exposed=Window]
interface HTMLLabelElement : HTMLElement {
[Reflect=for] attribute DOMString htmlFor;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmllegendelement
[Exposed=Window]
interface HTMLLegendElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmllinkelement
[Exposed=Window]
interface HTMLLinkElement : HTMLElement {
[Reflect] attribute DOMString href;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/image-maps.html#htmlmapelement
[Exposed=Window]
interface HTMLMapElement : HTMLElement {
[Reflect] attribute DOMString name;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/obsolete.html#htmlmarqueeelement
[Exposed=Window]
interface HTMLMarqueeElement : HTMLElement {
[Reflect] attribute DOMString behavior;

View file

@ -6,6 +6,8 @@ enum CanPlayTypeResult {
"probably"
};
// https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement
[Exposed=Window]
interface HTMLMediaElement : HTMLElement {
[Reflect] attribute DOMString src;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/grouping-content.html#htmlmenuelement
[Exposed=Window]
interface HTMLMenuElement : HTMLElement {
[Reflect] attribute boolean compact;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlmetaelement
[Exposed=Window]
interface HTMLMetaElement : HTMLElement {
[Reflect] attribute DOMString name;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmlmeterelement
[Exposed=Window]
interface HTMLMeterElement : HTMLElement {

View file

@ -1,8 +1,10 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/edits.html#htmlmodelement
[Exposed=Window]
interface HTMLModElement : HTMLElement {
[Reflect] attribute DOMString cite;
[Reflect] attribute USVString cite;
[Reflect=datetime] attribute DOMString dateTime;
};

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/grouping-content.html#htmlolistelement
[Exposed=Window]
interface HTMLOListElement : HTMLElement {
[Reflect] attribute boolean reversed;

View file

@ -1,6 +1,8 @@
#import <DOM/Document.idl>
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#htmlobjectelement
[Exposed=Window]
interface HTMLObjectElement : HTMLElement {
[CEReactions] attribute DOMString data;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmloptgroupelement
[Exposed=Window]
interface HTMLOptGroupElement : HTMLElement {
[Reflect] attribute boolean disabled;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmloptionelement
[Exposed=Window, LegacyFactoryFunction=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false)]
interface HTMLOptionElement : HTMLElement {
[Reflect] attribute boolean disabled;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmloutputelement
[Exposed=Window]
interface HTMLOutputElement : HTMLElement {
readonly attribute DOMString type;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlparagraphelement
[Exposed=Window]
interface HTMLParagraphElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/obsolete.html#htmlparamelement
[Exposed=Window]
interface HTMLParamElement : HTMLElement {
[Reflect] attribute DOMString name;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/embedded-content.html#htmlpictureelement
[Exposed=Window]
interface HTMLPictureElement : HTMLElement {

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/grouping-content.html#htmlpreelement
[Exposed=Window]
interface HTMLPreElement : HTMLElement {

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmlprogresselement
[Exposed=Window]
interface HTMLProgressElement : HTMLElement {
[CEReactions] attribute double value;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/grouping-content.html#htmlquoteelement
[Exposed=Window]
interface HTMLQuoteElement : HTMLElement {
[Reflect] attribute DOMString cite;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/scripting.html#htmlscriptelement
[Exposed=Window]
interface HTMLScriptElement : HTMLElement {
[Reflect] attribute DOMString src;

View file

@ -1,6 +1,8 @@
#import <HTML/HTMLElement.idl>
#import <HTML/HTMLOptionsCollection.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmlselectelement
[Exposed=Window]
interface HTMLSelectElement : HTMLElement {
[Reflect] attribute boolean disabled;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/scripting.html#htmlslotelement
[Exposed=Window]
interface HTMLSlotElement : HTMLElement {
[Reflect] attribute DOMString name;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/embedded-content.html#htmlsourceelement
[Exposed=Window]
interface HTMLSourceElement : HTMLElement {
[Reflect] attribute DOMString src;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/text-level-semantics.html#htmlspanelement
[Exposed=Window]
interface HTMLSpanElement : HTMLElement {

View file

@ -3,6 +3,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmlstyleelement
[Exposed=Window]
interface HTMLStyleElement : HTMLElement {
// FIXME: [HTMLConstructor] constructor();

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/tables.html#htmltablecaptionelement
[Exposed=Window]
interface HTMLTableCaptionElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/tables.html#htmltablecellelement
[Exposed=Window]
interface HTMLTableCellElement : HTMLElement {
attribute unsigned long colSpan;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/tables.html#htmltablecolelement
[Exposed=Window]
interface HTMLTableColElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -4,6 +4,8 @@
#import <HTML/HTMLTableSectionElement.idl>
#import <DOM/HTMLCollection.idl>
// https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
[Exposed=Window]
interface HTMLTableElement : HTMLElement {
attribute HTMLTableCaptionElement? caption;

View file

@ -1,6 +1,8 @@
#import <DOM/HTMLCollection.idl>
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/tables.html#htmltablerowelement
[Exposed=Window]
interface HTMLTableRowElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -2,6 +2,8 @@
#import <HTML/HTMLElement.idl>
#import <HTML/HTMLTableRowElement.idl>
// https://html.spec.whatwg.org/multipage/tables.html#htmltablesectionelement
[Exposed=Window]
interface HTMLTableSectionElement : HTMLElement {
[Reflect] attribute DOMString align;

View file

@ -1,6 +1,8 @@
#import <DOM/DocumentFragment.idl>
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/scripting.html#htmltemplateelement
[Exposed=Window]
interface HTMLTemplateElement : HTMLElement {
readonly attribute DocumentFragment content;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/form-elements.html#htmltextareaelement
[Exposed=Window]
interface HTMLTextAreaElement : HTMLElement {
[Reflect] attribute DOMString placeholder;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/text-level-semantics.html#htmltimeelement
[Exposed=Window]
interface HTMLTimeElement : HTMLElement {
[Reflect=datetime] attribute DOMString dateTime;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/semantics.html#htmltitleelement
[Exposed=Window]
interface HTMLTitleElement : HTMLElement {

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/media.html#htmltrackelement
[Exposed=Window]
interface HTMLTrackElement : HTMLElement {
[Reflect] attribute DOMString src;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/grouping-content.html#htmlulistelement
[Exposed=Window]
interface HTMLUListElement : HTMLElement {
[Reflect] attribute boolean compact;

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLElement.idl>
// https://html.spec.whatwg.org/multipage/dom.html#htmlunknownelement
[Exposed=Window]
interface HTMLUnknownElement : HTMLElement {

View file

@ -1,5 +1,7 @@
#import <HTML/HTMLMediaElement.idl>
// https://html.spec.whatwg.org/multipage/media.html#htmlvideoelement
[Exposed=Window]
interface HTMLVideoElement : HTMLMediaElement {
[Reflect] attribute DOMString poster;

View file

@ -1,3 +1,5 @@
// https://html.spec.whatwg.org/multipage/canvas.html#imagedata
[Exposed=(Window,Worker), Serializable]
interface ImageData {
readonly attribute unsigned long width;

View file

@ -1,5 +1,7 @@
#import <HTML/MessagePort.idl>
// https://html.spec.whatwg.org/multipage/web-messaging.html#messagechannel
[Exposed=(Window,Worker)]
interface MessageChannel {
constructor();

View file

@ -1,6 +1,7 @@
#import <DOM/Event.idl>
[]
// https://html.spec.whatwg.org/multipage/comms.html#messageevent
[Exposed=(Window,Worker)]
interface MessageEvent : Event {
constructor(DOMString type, optional MessageEventInit eventInitDict = {});

View file

@ -1,6 +1,8 @@
#import <DOM/EventTarget.idl>
#import <DOM/EventHandler.idl>
// https://html.spec.whatwg.org/multipage/web-messaging.html#messageport
[Exposed=(Window,Worker,AudioWorklet), Transferable]
interface MessagePort : EventTarget {
undefined postMessage(any message);

View file

@ -1,5 +1,7 @@
#import <DOM/Event.idl>
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#pagetransitionevent
[Exposed=Window]
interface PageTransitionEvent : Event {
constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {});

View file

@ -1,7 +1,8 @@
#import <DOM/Event.idl>
#import <HTML/HTMLElement.idl>
[]
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submitevent
[Exposed=Window]
interface SubmitEvent : Event {
constructor(DOMString type, optional SubmitEventInit eventInitDict = {});

View file

@ -1,3 +1,5 @@
// https://html.spec.whatwg.org/multipage/canvas.html#textmetrics
[Exposed=Window]
interface TextMetrics {
// x-direction
readonly attribute double width; // advance width