Skip to content

Add onbeforreprint and onafterprint events to Window #406

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 1 commit into from
Apr 4, 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
7 changes: 7 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4231,6 +4231,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
*/
queryCommandValue(commandId: string): string;
releaseEvents(): void;
updateSettings(): void;
webkitCancelFullScreen(): void;
webkitExitFullscreen(): void;
/**
Expand Down Expand Up @@ -14798,6 +14799,8 @@ declare var WheelEvent: {

interface WindowEventMap extends GlobalEventHandlersEventMap {
"abort": UIEvent;
"afterprint": Event;
"beforeprint": Event;
"beforeunload": BeforeUnloadEvent;
"blur": FocusEvent;
"canplay": Event;
Expand Down Expand Up @@ -14929,6 +14932,8 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
readonly navigator: Navigator;
offscreenBuffering: string | boolean;
onabort: ((this: Window, ev: UIEvent) => any) | null;
onafterprint: ((this: Window, ev: Event) => any) | null;
onbeforeprint: ((this: Window, ev: Event) => any) | null;
onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;
onblur: ((this: Window, ev: FocusEvent) => any) | null;
oncanplay: ((this: Window, ev: Event) => any) | null;
Expand Down Expand Up @@ -15739,6 +15744,8 @@ declare const name: never;
declare var navigator: Navigator;
declare var offscreenBuffering: string | boolean;
declare var onabort: ((this: Window, ev: UIEvent) => any) | null;
declare var onafterprint: ((this: Window, ev: Event) => any) | null;
declare var onbeforeprint: ((this: Window, ev: Event) => any) | null;
declare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;
declare var onblur: ((this: Window, ev: FocusEvent) => any) | null;
declare var oncanplay: ((this: Window, ev: Event) => any) | null;
Expand Down
6 changes: 0 additions & 6 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,6 @@
"additional-signatures": [
"scrollBy(options?: ScrollToOptions): void"
]
},
"print": {
"name": "print",
"override-signatures": [
"print(): void"
]
}
}
},
Expand Down
44 changes: 44 additions & 0 deletions inputfiles/browser.webidl.preprocessed.json
Original file line number Diff line number Diff line change
Expand Up @@ -26792,13 +26792,33 @@
"type": "ExtensionScriptApis",
"read-only": 1
},
"onafterprint": {
"specs": "html5",
"name": "onafterprint",
"tags": "Printing",
"type-original": "EventHandler",
"nullable": 1,
"exposed": "Window",
"type": "EventHandlerNonNull",
"event-handler": "afterprint"
},
"name": {
"specs": "html5",
"exposed": "Window",
"name": "name",
"type": "DOMString",
"type-original": "DOMString"
},
"onbeforeprint": {
"specs": "html5",
"name": "onbeforeprint",
"tags": "Printing",
"type-original": "EventHandler",
"nullable": 1,
"exposed": "Window",
"type": "EventHandlerNonNull",
"event-handler": "beforeprint"
},
"onvrdisplaydisconnect": {
"specs": "html5",
"name": "onvrdisplaydisconnect",
Expand Down Expand Up @@ -28336,6 +28356,18 @@
"exposed": "Window",
"name": "resizeTo"
},
"print": {
"signature": [
{
"type": "void",
"type-original": "void"
}
],
"specs": "html5",
"exposed": "Window",
"name": "print",
"tags": "Printing"
},
"scrollBy": {
"signature": [
{
Expand Down Expand Up @@ -32599,6 +32631,18 @@
],
"exposed": "Window"
},
"updateSettings": {
"signature": [
{
"type": "void",
"type-original": "void"
}
],
"specs": "dom4",
"exposed": "Window",
"name": "updateSettings",
"tags": "Printing"
},
"caretRangeFromPoint": {
"signature": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/preprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function preprocess() {
if (o.tags.indexOf("MSAppOnly") > -1) return false;
if (o.tags.indexOf("MSAppScheduler") > -1) return false;
if (o.tags.indexOf("Diagnostics") > -1) return false;
if (o.tags.indexOf("Printing") > -1) return false;
if (o.tags.indexOf("Printing") > -1 && typeof o.name === "string" && o.name.toLowerCase().startsWith("ms")) return false;
if (o.tags.indexOf("WinPhoneOnly") > -1) return false;
if (o.tags.indexOf("IEOnly") > -1) return false;
}
Expand Down