diff options
Diffstat (limited to 'components')
22 files changed, 117 insertions, 8 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index e44e17d39de..247de62b23f 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -334,5 +334,6 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration { rval } + // https://drafts.csswg.org/cssom/#cssstyledeclaration css_properties_accessors!(css_properties); } diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index bc179a82133..d4a3b216914 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -357,6 +357,7 @@ impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope { Ok(()) } + // https://html.spec.whatwg.org/multipage/#handler-dedicatedworkerglobalscope-onmessage event_handler!(message, GetOnmessage, SetOnmessage); } diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 0ff28055e9d..196ea7af438 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -1842,7 +1842,10 @@ impl DocumentMethods for Document { // This method intentionally does nothing } + // https://html.spec.whatwg.org/multipage/#globaleventhandlers global_event_handlers!(); + + // https://html.spec.whatwg.org/multipage/#handler-onreadystatechange event_handler!(readystatechange, GetOnreadystatechange, SetOnreadystatechange); } diff --git a/components/script/dom/filereader.rs b/components/script/dom/filereader.rs index 384ab976be3..ffd74806c04 100644 --- a/components/script/dom/filereader.rs +++ b/components/script/dom/filereader.rs @@ -253,11 +253,22 @@ impl FileReader { } impl FileReaderMethods for FileReader { + // https://w3c.github.io/FileAPI/#dfn-onloadstart event_handler!(loadstart, GetOnloadstart, SetOnloadstart); + + // https://w3c.github.io/FileAPI/#dfn-onprogress event_handler!(progress, GetOnprogress, SetOnprogress); + + // https://w3c.github.io/FileAPI/#dfn-onload event_handler!(load, GetOnload, SetOnload); + + // https://w3c.github.io/FileAPI/#dfn-onabort event_handler!(abort, GetOnabort, SetOnabort); + + // https://w3c.github.io/FileAPI/#dfn-onerror event_handler!(error, GetOnerror, SetOnerror); + + // https://w3c.github.io/FileAPI/#dfn-onloadend event_handler!(loadend, GetOnloadend, SetOnloadend); //TODO https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer diff --git a/components/script/dom/htmlappletelement.rs b/components/script/dom/htmlappletelement.rs index a3cb281497b..988aa36e9ee 100644 --- a/components/script/dom/htmlappletelement.rs +++ b/components/script/dom/htmlappletelement.rs @@ -54,6 +54,8 @@ impl HTMLAppletElement { impl HTMLAppletElementMethods for HTMLAppletElement { // https://html.spec.whatwg.org/#the-applet-element:dom-applet-name make_getter!(Name); + + // https://html.spec.whatwg.org/#the-applet-element:dom-applet-name make_atomic_setter!(SetName, "name"); } diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index a38e385bc9c..3016966fc10 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -71,6 +71,8 @@ impl HTMLBodyElement { impl HTMLBodyElementMethods for HTMLBodyElement { // https://html.spec.whatwg.org/multipage#dom-body-bgcolor make_getter!(BgColor, "bgcolor"); + + // https://html.spec.whatwg.org/multipage#dom-body-bgcolor make_setter!(SetBgColor, "bgcolor"); // https://html.spec.whatwg.org/multipage/#the-body-element diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index a8c95eb6d3b..c7f3e71807e 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -98,22 +98,29 @@ impl HTMLButtonElementMethods for HTMLButtonElement { // https://html.spec.whatwg.org/multipage/#dom-button-type make_setter!(SetType, "type"); - // https://html.spec.whatwg.org/multipage/#htmlbuttonelement + // https://html.spec.whatwg.org/multipage/#dom-fs-formaction make_url_or_base_getter!(FormAction); + // https://html.spec.whatwg.org/multipage/#dom-fs-formaction make_setter!(SetFormAction, "formaction"); + // https://html.spec.whatwg.org/multipage/#dom-fs-formenctype make_enumerated_getter!( FormEnctype, "application/x-www-form-urlencoded", ("text/plain") | ("multipart/form-data")); + // https://html.spec.whatwg.org/multipage/#dom-fs-formenctype make_setter!(SetFormEnctype, "formenctype"); + // https://html.spec.whatwg.org/multipage/#dom-fs-formmethod make_enumerated_getter!(FormMethod, "get", ("post") | ("dialog")); + // https://html.spec.whatwg.org/multipage/#dom-fs-formmethod make_setter!(SetFormMethod, "formmethod"); + // https://html.spec.whatwg.org/multipage/#dom-fs-formtarget make_getter!(FormTarget); + // https://html.spec.whatwg.org/multipage/#dom-fs-formtarget make_setter!(SetFormTarget, "formtarget"); // https://html.spec.whatwg.org/multipage/#dom-fe-name diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 0b9ea1e6b8c..80e6f93d36e 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -130,16 +130,22 @@ impl HTMLElementMethods for HTMLElement { }) } + // https://html.spec.whatwg.org/multipage/#attr-title make_getter!(Title); + // https://html.spec.whatwg.org/multipage/#attr-title make_setter!(SetTitle, "title"); + // https://html.spec.whatwg.org/multipage/#attr-lang make_getter!(Lang); + // https://html.spec.whatwg.org/multipage/#attr-lang make_setter!(SetLang, "lang"); // https://html.spec.whatwg.org/multipage/#dom-hidden make_bool_getter!(Hidden); + // https://html.spec.whatwg.org/multipage/#dom-hidden make_bool_setter!(SetHidden, "hidden"); + // https://html.spec.whatwg.org/multipage/#globaleventhandlers global_event_handlers!(NoOnload); // https://html.spec.whatwg.org/multipage/#dom-dataset diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs index 03750d382b8..6b745617b94 100644 --- a/components/script/dom/htmlfontelement.rs +++ b/components/script/dom/htmlfontelement.rs @@ -50,7 +50,10 @@ impl HTMLFontElement { } impl HTMLFontElementMethods for HTMLFontElement { + // https://html.spec.whatwg.org/multipage/#dom-font-color make_getter!(Color, "color"); + + // https://html.spec.whatwg.org/multipage/#dom-font-color make_setter!(SetColor, "color"); } diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 11613d866b2..05f7442bbcc 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -122,6 +122,8 @@ impl HTMLFormElementMethods for HTMLFormElement { // https://html.spec.whatwg.org/multipage/#dom-form-name make_getter!(Name); + + // https://html.spec.whatwg.org/multipage/#dom-form-name make_atomic_setter!(SetName, "name"); // https://html.spec.whatwg.org/multipage/#dom-fs-novalidate diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 6abf4f7b877..e4665847468 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -339,12 +339,14 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { Err(NotSupported) } + // https://html.spec.whatwg.org/multipage/#dom-dim-width make_getter!(Width); - + // https://html.spec.whatwg.org/multipage/#dom-dim-width make_setter!(SetWidth, "width"); + // https://html.spec.whatwg.org/multipage/#dom-dim-height make_getter!(Height); - + // https://html.spec.whatwg.org/multipage/#dom-dim-height make_setter!(SetHeight, "height"); } diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index dcb69a44104..bfd6ca2fdd8 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -197,18 +197,22 @@ impl LayoutHTMLImageElementHelpers for LayoutJS<HTMLImageElement> { } impl HTMLImageElementMethods for HTMLImageElement { + // https://html.spec.whatwg.org/multipage/#dom-img-alt make_getter!(Alt); - + // https://html.spec.whatwg.org/multipage/#dom-img-alt make_setter!(SetAlt, "alt"); + // https://html.spec.whatwg.org/multipage/#dom-img-src make_url_getter!(Src); - + // https://html.spec.whatwg.org/multipage/#dom-img-src make_setter!(SetSrc, "src"); + // https://html.spec.whatwg.org/multipage/#dom-img-usemap make_getter!(UseMap); - + // https://html.spec.whatwg.org/multipage/#dom-img-usemap make_setter!(SetUseMap, "usemap"); + // https://html.spec.whatwg.org/multipage/#dom-img-ismap make_bool_getter!(IsMap); // https://html.spec.whatwg.org/multipage/#dom-img-ismap @@ -269,28 +273,40 @@ impl HTMLImageElementMethods for HTMLImageElement { image.is_some() } - // https://html.spec.whatwg.org/#dom-img-name + // https://html.spec.whatwg.org/multipage/#dom-img-name make_getter!(Name); + + // https://html.spec.whatwg.org/multipage/#dom-img-name make_atomic_setter!(SetName, "name"); + // https://html.spec.whatwg.org/multipage/#dom-img-align make_getter!(Align); + // https://html.spec.whatwg.org/multipage/#dom-img-align make_setter!(SetAlign, "align"); + // https://html.spec.whatwg.org/multipage/#dom-img-hspace make_uint_getter!(Hspace); + // https://html.spec.whatwg.org/multipage/#dom-img-hspace make_uint_setter!(SetHspace, "hspace"); + // https://html.spec.whatwg.org/multipage/#dom-img-vspace make_uint_getter!(Vspace); + // https://html.spec.whatwg.org/multipage/#dom-img-vspace make_uint_setter!(SetVspace, "vspace"); + // https://html.spec.whatwg.org/multipage/#dom-img-longdesc make_getter!(LongDesc); + // https://html.spec.whatwg.org/multipage/#dom-img-longdesc make_setter!(SetLongDesc, "longdesc"); + // https://html.spec.whatwg.org/multipage/#dom-img-border make_getter!(Border); + // https://html.spec.whatwg.org/multipage/#dom-img-border make_setter!(SetBorder, "border"); } diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index becbf7c4947..9204e20ab22 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -247,6 +247,8 @@ impl HTMLInputElementMethods for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#dom-input-size make_uint_getter!(Size, "size", DEFAULT_INPUT_SIZE); + + // https://html.spec.whatwg.org/multipage/#dom-input-size make_limited_uint_setter!(SetSize, "size", DEFAULT_INPUT_SIZE); // https://html.spec.whatwg.org/multipage/#dom-input-type diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index 072e14bab3b..b9e3d0e081b 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -209,19 +209,34 @@ impl HTMLLinkElement { } impl HTMLLinkElementMethods for HTMLLinkElement { + // https://html.spec.whatwg.org/multipage/#dom-link-href make_url_getter!(Href); + + // https://html.spec.whatwg.org/multipage/#dom-link-href make_setter!(SetHref, "href"); + // https://html.spec.whatwg.org/multipage/#dom-link-rel make_getter!(Rel); + + // https://html.spec.whatwg.org/multipage/#dom-link-rel make_setter!(SetRel, "rel"); + // https://html.spec.whatwg.org/multipage/#dom-link-media make_getter!(Media); + + // https://html.spec.whatwg.org/multipage/#dom-link-media make_setter!(SetMedia, "media"); + // https://html.spec.whatwg.org/multipage/#dom-link-hreflang make_getter!(Hreflang); + + // https://html.spec.whatwg.org/multipage/#dom-link-hreflang make_setter!(SetHreflang, "hreflang"); + // https://html.spec.whatwg.org/multipage/#dom-link-type make_getter!(Type); + + // https://html.spec.whatwg.org/multipage/#dom-link-type make_setter!(SetType, "type"); // https://html.spec.whatwg.org/multipage/#dom-link-rellist diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 82908e2d78f..97cd6573fda 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -571,8 +571,9 @@ impl VirtualMethods for HTMLScriptElement { } impl HTMLScriptElementMethods for HTMLScriptElement { + // https://html.spec.whatwg.org/multipage/#dom-script-src make_url_getter!(Src); - + // https://html.spec.whatwg.org/multipage/#dom-script-src make_setter!(SetSrc, "src"); // https://www.whatwg.org/html/#dom-script-text diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index 153593f5e58..db4a08a00c5 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -77,6 +77,8 @@ impl HTMLTableCellElement { impl HTMLTableCellElementMethods for HTMLTableCellElement { // https://html.spec.whatwg.org/multipage/#dom-tdth-colspan make_uint_getter!(ColSpan, "colspan", DEFAULT_COLSPAN); + + // https://html.spec.whatwg.org/multipage/#dom-tdth-colspan make_uint_setter!(SetColSpan, "colspan"); } diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 333e5259394..a0a0c12b705 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -121,6 +121,8 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement { // https://html.spec.whatwg.org/multipage/#dom-textarea-cols make_uint_getter!(Cols, "cols", DEFAULT_COLS); + + // https://html.spec.whatwg.org/multipage/#dom-textarea-cols make_limited_uint_setter!(SetCols, "cols", DEFAULT_COLS); // https://www.whatwg.org/html/#dom-fe-disabled @@ -155,6 +157,8 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement { // https://html.spec.whatwg.org/multipage/#dom-textarea-rows make_uint_getter!(Rows, "rows", DEFAULT_ROWS); + + // https://html.spec.whatwg.org/multipage/#dom-textarea-rows make_limited_uint_setter!(SetRows, "rows", DEFAULT_ROWS); // https://html.spec.whatwg.org/multipage/#dom-textarea-wrap diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 25b8d832fe4..4b614786efa 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -228,9 +228,16 @@ impl WebSocket { } impl WebSocketMethods for WebSocket { + // https://html.spec.whatwg.org/multipage/#handler-websocket-onopen event_handler!(open, GetOnopen, SetOnopen); + + // https://html.spec.whatwg.org/multipage/#handler-websocket-onclose event_handler!(close, GetOnclose, SetOnclose); + + // https://html.spec.whatwg.org/multipage/#handler-websocket-onerror event_handler!(error, GetOnerror, SetOnerror); + + // https://html.spec.whatwg.org/multipage/#handler-websocket-onmessage event_handler!(message, GetOnmessage, SetOnmessage); // https://html.spec.whatwg.org/multipage/#dom-websocket-url diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 6fd99de5b4d..c463efa9f69 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -503,8 +503,13 @@ impl WindowMethods for Window { }) } + // https://html.spec.whatwg.org/multipage/#globaleventhandlers global_event_handlers!(); + + // https://html.spec.whatwg.org/multipage/#handler-window-onunload event_handler!(unload, GetOnunload, SetOnunload); + + // https://html.spec.whatwg.org/multipage/#handler-onerror error_event_handler!(error, GetOnerror, SetOnerror); // https://developer.mozilla.org/en-US/docs/Web/API/Window/screen diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index d2b3982c805..2711e8502db 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -162,7 +162,10 @@ impl WorkerMethods for Worker { Ok(()) } + // https://html.spec.whatwg.org/multipage/#handler-dedicatedworkerglobalscope-onmessage event_handler!(message, GetOnmessage, SetOnmessage); + + // https://html.spec.whatwg.org/multipage/#handler-workerglobalscope-onerror event_handler!(error, GetOnerror, SetOnerror); } diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 0f08ef9ec11..5ab625c1d48 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -293,6 +293,7 @@ impl XMLHttpRequest { } impl XMLHttpRequestMethods for XMLHttpRequest { + // https://xhr.spec.whatwg.org/#handler-xhr-onreadystatechange event_handler!(readystatechange, GetOnreadystatechange, SetOnreadystatechange); // https://xhr.spec.whatwg.org/#dom-xmlhttprequest-readystate diff --git a/components/script/dom/xmlhttprequesteventtarget.rs b/components/script/dom/xmlhttprequesteventtarget.rs index 0e443d65041..627e4882dde 100644 --- a/components/script/dom/xmlhttprequesteventtarget.rs +++ b/components/script/dom/xmlhttprequesteventtarget.rs @@ -38,11 +38,24 @@ impl XMLHttpRequestEventTargetDerived for EventTarget { } impl XMLHttpRequestEventTargetMethods for XMLHttpRequestEventTarget { + // https://xhr.spec.whatwg.org/#handler-xhr-onloadstart event_handler!(loadstart, GetOnloadstart, SetOnloadstart); + + // https://xhr.spec.whatwg.org/#handler-xhr-onprogress event_handler!(progress, GetOnprogress, SetOnprogress); + + // https://xhr.spec.whatwg.org/#handler-xhr-onabort event_handler!(abort, GetOnabort, SetOnabort); + + // https://xhr.spec.whatwg.org/#handler-xhr-onerror event_handler!(error, GetOnerror, SetOnerror); + + // https://xhr.spec.whatwg.org/#handler-xhr-onload event_handler!(load, GetOnload, SetOnload); + + // https://xhr.spec.whatwg.org/#handler-xhr-ontimeout event_handler!(timeout, GetOntimeout, SetOntimeout); + + // https://xhr.spec.whatwg.org/#handler-xhr-onloadend event_handler!(loadend, GetOnloadend, SetOnloadend); } |