diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-20 21:26:41 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-20 21:26:41 -0700 |
commit | 5fc511a40e4f5710783cd76875fd119997307ad8 (patch) | |
tree | 4fe8370934941472653ec0bfa9714e161c8deb7a /components/script/dom/webidls | |
parent | c0c70ef0946da25ce31c44037f4a5ff2028b9aee (diff) | |
parent | d1af39c114d9b1b101826d541afb09105971084b (diff) | |
download | servo-5fc511a40e4f5710783cd76875fd119997307ad8.tar.gz servo-5fc511a40e4f5710783cd76875fd119997307ad8.zip |
Auto merge of #11255 - s-baldrick:11158, r=ConnorGBrewster
11158 - add event handlers
Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy --faster` does not report any errors
- [X] These changes fix #11158 (github issue number if applicable).
Either:
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ____
Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11255)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/webidls')
5 files changed, 73 insertions, 2 deletions
diff --git a/components/script/dom/webidls/BeforeUnloadEvent.webidl b/components/script/dom/webidls/BeforeUnloadEvent.webidl new file mode 100644 index 00000000000..5e4a099725a --- /dev/null +++ b/components/script/dom/webidls/BeforeUnloadEvent.webidl @@ -0,0 +1,11 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* + * For more information on this interface please see + * https://html.spec.whatwg.org/multipage/#beforeunloadevent + */ + +interface BeforeUnloadEvent : Event { + attribute DOMString returnValue; +}; diff --git a/components/script/dom/webidls/Document.webidl b/components/script/dom/webidls/Document.webidl index b211fe7be58..b73d563bac7 100644 --- a/components/script/dom/webidls/Document.webidl +++ b/components/script/dom/webidls/Document.webidl @@ -138,6 +138,7 @@ partial /*sealed*/ interface Document { // also has obsolete members }; Document implements GlobalEventHandlers; +Document implements DocumentAndElementEventHandlers; // https://html.spec.whatwg.org/multipage/#Document-partial partial interface Document { diff --git a/components/script/dom/webidls/EventHandler.webidl b/components/script/dom/webidls/EventHandler.webidl index fa42b757cab..957fc0bd4dd 100644 --- a/components/script/dom/webidls/EventHandler.webidl +++ b/components/script/dom/webidls/EventHandler.webidl @@ -20,42 +20,99 @@ callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional optional any error); typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; +[TreatNonObjectAsNull] +callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); +typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; + // https://html.spec.whatwg.org/multipage/#globaleventhandlers [NoInterfaceObject] interface GlobalEventHandlers { attribute EventHandler onabort; attribute EventHandler onblur; + attribute EventHandler oncancel; attribute EventHandler oncanplay; attribute EventHandler oncanplaythrough; attribute EventHandler onchange; attribute EventHandler onclick; + attribute EventHandler onclose; + attribute EventHandler oncontextmenu; + attribute EventHandler oncuechange; attribute EventHandler ondblclick; + attribute EventHandler ondrag; + attribute EventHandler ondragend; + attribute EventHandler ondragenter; + attribute EventHandler ondragexit; + attribute EventHandler ondragleave; + attribute EventHandler ondragover; + attribute EventHandler ondragstart; + attribute EventHandler ondrop; + attribute EventHandler ondurationchange; attribute EventHandler onemptied; + attribute EventHandler onended; attribute OnErrorEventHandler onerror; + attribute EventHandler onfocus; attribute EventHandler oninput; + attribute EventHandler oninvalid; attribute EventHandler onkeydown; attribute EventHandler onkeypress; attribute EventHandler onkeyup; attribute EventHandler onload; attribute EventHandler onloadeddata; attribute EventHandler onloadedmetadata; + attribute EventHandler onloadstart; + attribute EventHandler onmousedown; + [LenientThis] attribute EventHandler onmouseenter; + [LenientThis] attribute EventHandler onmouseleave; + attribute EventHandler onmousemove; + attribute EventHandler onmouseout; attribute EventHandler onmouseover; + attribute EventHandler onmouseup; + attribute EventHandler onwheel; attribute EventHandler onpause; attribute EventHandler onplay; attribute EventHandler onplaying; attribute EventHandler onprogress; + attribute EventHandler onratechange; attribute EventHandler onreset; attribute EventHandler onresize; + attribute EventHandler onscroll; + attribute EventHandler onseeked; + attribute EventHandler onseeking; + attribute EventHandler onselect; + attribute EventHandler onshow; + attribute EventHandler onstalled; attribute EventHandler onsubmit; attribute EventHandler onsuspend; attribute EventHandler ontimeupdate; attribute EventHandler ontoggle; + attribute EventHandler onvolumechange; attribute EventHandler onwaiting; }; // https://html.spec.whatwg.org/multipage/#windoweventhandlers [NoInterfaceObject] interface WindowEventHandlers { - attribute EventHandler onunload; + attribute EventHandler onafterprint; + attribute EventHandler onbeforeprint; + attribute OnBeforeUnloadEventHandler onbeforeunload; + attribute EventHandler onhashchange; + attribute EventHandler onlanguagechange; + attribute EventHandler onmessage; + attribute EventHandler onoffline; + attribute EventHandler ononline; + attribute EventHandler onpagehide; + attribute EventHandler onpageshow; + attribute EventHandler onpopstate; + attribute EventHandler onrejectionhandled; attribute EventHandler onstorage; + attribute EventHandler onunhandledrejection; + attribute EventHandler onunload; +}; + +// https://html.spec.whatwg.org/multipage/#documentandelementeventhandlers +[NoInterfaceObject] +interface DocumentAndElementEventHandlers { + attribute EventHandler oncopy; + attribute EventHandler oncut; + attribute EventHandler onpaste; }; diff --git a/components/script/dom/webidls/HTMLElement.webidl b/components/script/dom/webidls/HTMLElement.webidl index 9778985dd40..19222109d63 100644 --- a/components/script/dom/webidls/HTMLElement.webidl +++ b/components/script/dom/webidls/HTMLElement.webidl @@ -54,5 +54,6 @@ partial interface HTMLElement { }; HTMLElement implements GlobalEventHandlers; +HTMLElement implements DocumentAndElementEventHandlers; HTMLElement implements ElementContentEditable; HTMLElement implements ElementCSSInlineStyle; diff --git a/components/script/dom/webidls/HTMLFrameSetElement.webidl b/components/script/dom/webidls/HTMLFrameSetElement.webidl index f35de93e545..5addd41d253 100644 --- a/components/script/dom/webidls/HTMLFrameSetElement.webidl +++ b/components/script/dom/webidls/HTMLFrameSetElement.webidl @@ -7,4 +7,5 @@ interface HTMLFrameSetElement : HTMLElement { // attribute DOMString cols; // attribute DOMString rows; }; -//HTMLFrameSetElement implements WindowEventHandlers; + +HTMLFrameSetElement implements WindowEventHandlers; |