Search completed in 3.01 seconds.
Event.cancelable - Web APIs
the
cancelable read-only property of the event interface indicates whether the event can be
canceled, and therefore prevented as if the event never happened.
... if the event is not
cancelable, then its
cancelable property will be false and the event listener cannot stop the event from occurring.
... event listeners that handle multiple kinds of events may want to check
cancelable before invoking their preventdefault() methods.
...And 11 more matches
AudioParam.cancelAndHoldAtTime() - Web APIs
the
cancelandholdattime() property of the audioparam interface
cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods.
... syntax var audioparam = audioparam.
cancelandholdattime(
canceltime) parameters
canceltime a double representing the time (in seconds) after the audiocontext was first created after which all scheduled changes will be
cancelled.
... specifications specification status comment web audio apithe definition of '
cancelandholdattime()' in that specification.
...And 7 more matches
GlobalEventHandlers.onanimationcancel - Web APIs
the onanimation
cancel property of the globaleventhandlers mixin is the eventhandler for processing animation
cancel events.
... an animation
cancel event is sent when a css animation unexpectedly aborts, that is, any time it stops running without sending an animationend event.
... syntax var anim
cancelhandler = target.onanimation
cancel; target.onanimation
cancel = function value a function to be called when an animation
cancel event occurs indicating that a css animation has begun on the target, where the target object is an html element (htmlelement), document (document), or window (window).
...And 6 more matches
ReadableStream.cancel() - Web APIs
the
cancel() method of the readablestream interface
cancels the associated stream.
...
cancel is used when you've completely finished with the stream and don't need any more data from it, even if there are chunks enqueued waiting to be read.
... that data is lost after
cancel is called, and the stream is not readable any more.
...And 6 more matches
HTMLElement: transitioncancel event - Web APIs
the transition
cancel event is fired when a css transition is
canceled.
... see globaleventhandlers.ontransition
cancel for more information.
... bubbles yes
cancelable no interface transitionevent event handler property globaleventhandlers.ontransition
cancel examples this code gets an element that has a transition defined and adds a listener to the transition
cancel event: const transition = document.queryselector('.transition'); transition.addeventlistener('transition
cancel', () => { console.log('transition
canceled'); }); the same, but using the ontransition
cancel property instead of addeventlistener(): const transition = document.queryselector('.transition'); transition.ontransition
cancel = () => { console.log('transition
canceled'); }; live example in the following example, we have a simple <div> element, styled with a transition that includes a delay: <div class="...
...And 5 more matches
ReadableStreamDefaultReader.cancel() - Web APIs
the
cancel() method of the readablestreamdefaultreader interface
cancels the stream, signaling a loss of interest in the stream by a consumer.
...
cancel is used when you've completely finished with the stream and don't need any more data from it, even if there are chunks enqueued waiting to be read.
... that data is lost after
cancel is called, and the stream is not readable any more.
...And 5 more matches
GlobalEventHandlers.onpointercancel - Web APIs
the onpointer
cancel property of the globaleventhandlers mixin is an eventhandler that processes pointer
cancel events.
... syntax targetelement.onpointer
cancel =
cancelhandler; var
cancelhandler = targetelement.onpointer
cancel; value
cancelhandler the pointer
cancel event handler for element targetelement.
... example this example shows two ways to use onpointer
cancel to handle an element's pointer
cancel events.
...And 4 more matches
GlobalEventHandlers.ontransitioncancel - Web APIs
the ontransition
cancel property of the globaleventhandlers mixin is an eventhandler that processes transition
cancel events.
... the transition
cancel event is sent when a css transition is
cancelled.
... the transition is
cancelled when: the value of the transition-property property that applies to the target is changed the display property is set to "none".
...And 4 more matches
Document: transitioncancel event - Web APIs
the transition
cancel event is fired when a css transition is
canceled.
... see globaleventhandlers.ontransition
cancel for more information.
... bubbles yes
cancelable no interface transitionevent event handler property globaleventhandlers.ontransition
cancel the original target for this event is the element that had the transition applied.
...And 3 more matches
HTMLElement: animationcancel event - Web APIs
the animation
cancel event is fired when a css animation unexpectedly aborts.
... an event handler for this event can be added by setting the onanimation
cancel property, or using addeventlistener().
... bubbles yes
cancelable no interface animationevent event handler property onanimation
cancel examples this code gets an element that's currently being animated and adds a listener to the animation
cancel event.
...And 3 more matches
MediaTrackSettings.echoCancellation - Web APIs
the mediatracksettings dictionary's echo
cancellation property is a boolean value whose value indicates whether or not echo
cancellation is enabled on an audio track.
... this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.echo
cancellation property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... echo
cancellation is a feature which attempts to prevent echo effects on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their input device.
...And 3 more matches
Window: transitioncancel event - Web APIs
the transition
cancel event is fired when a css transition is
canceled.
... see globaleventhandlers.ontransition
cancel for more information.
... bubbles yes
cancelable no interface transitionevent event handler property globaleventhandlers.ontransition
cancel the original target for this event is the element that had the transition applied.
...And 3 more matches
Animation.cancel() - Web APIs
the web animations api's
cancel() method of the animation interface clears all keyframeeffects caused by this animation and aborts its playback.
... when an animation is
cancelled, its starttime and currenttime are set to null.
... syntax animation.
cancel(); parameters none.
...And 2 more matches
Animation.oncancel - Web APIs
the on
cancel property of the web animations api's animation interface is the event handler for the
cancel event.
... the
cancel event can be triggered manually with animation.
cancel() when the animation enters the "idle" play state from another state, such as when the animation is removed from an element before it finishes playing creating a new animation that is initially idle does not trigger a
cancel event on the new animation.
... syntax var
cancelhandler = animation.on
cancel; animation.on
cancel =
cancelhandler; value a function to be executed when the animation is
cancelled, or null if there is no
cancel event handler.
...And 2 more matches
DataTransfer.mozUserCancelled - Web APIs
the datatransfer.mozuser
cancelled property is used in the dragend event handler to determine if the user
canceled the drag or not.
... if the user
canceled the event, the property returns true and returns false otherwise.
... syntax datatransfer.mozuser
cancelled; return value a boolean representing true if the user
canceled the drag event and returns false otherwise.
...And 2 more matches
Document: animationcancel event - Web APIs
the animation
cancel event is fired when a css animation unexpectedly aborts.
... bubbles yes
cancelable no interface animationevent event handler property onanimation
cancel the original target for this event is the element that had the animation applied.
...for full details on this event please see the page on htmlelement: animation
cancel.
...And 2 more matches
GlobalEventHandlers.oncancel - Web APIs
the on
cancel property of the globaleventhandlers mixin is an eventhandler for processing
cancel events sent to a <dialog> element.
... the
cancel event fires when the user indicates a wish to dismiss a <dialog>.
... syntax target.on
cancel = functionref; value functionref is a function name or a function expression.
...And 2 more matches
GlobalEventHandlers.ontouchcancel - Web APIs
the ontouch
cancel property of the globaleventhandlers mixin is an eventhandler that processes touch
cancel events.
... syntax var
cancelhandler = someelement.ontouch
cancel; return value
cancelhandler the touch
cancel event handler for element someelement.
... example this example shows two ways to use ontouch
cancel to set an element's touch
cancel event handler.
...And 2 more matches
MediaTrackConstraints.echoCancellation - Web APIs
the mediatrackconstraints dictionary's echo
cancellation property is a constrainboolean describing the requested or mandatory constraints placed upon the value of the echo
cancellation constrainable property.
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echo
cancellation as returned by a call to mediadevices.getsupportedconstraints().
... syntax var constraintsobject = { echo
cancellation: constraint }; constraintsobject.echo
cancellation = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with echo
cancellation enabled or disabled as specified, if possible, but will not fail if this can't be done.
...And 2 more matches
Window: animationcancel event - Web APIs
the animation
cancel event is fired when a css animation unexpectedly aborts.
... bubbles yes
cancelable no interface animationevent event handler property onanimation
cancel the original target for this event is the element that had the animation applied.
...for full details on this event please see the page on htmlelement: animation
cancel.
...And 2 more matches
FC_CancelFunction
name fc_
cancelfunction -
cancel a function running in parallel syntax ck_rv fc_
cancelfunction( ck_session_handle hsession ); parameters hsession [in] session handle.
...fc_
cancelfunction is a legacy function that simply returns ckr_function_not_parallel.
... return value fc_
cancelfunction always returns ckr_function_not_parallel.
... examples see also nsc_
cancelfunction ...
Document: pointercancel event - Web APIs
the pointer
cancel event is fired when the browser determines that there are unlikely to be any more pointer events, or if after the pointerdown event is fired, the pointer is then used to manipulate the viewport by panning, zooming, or scrolling.
... bubbles yes
cancelable no interface pointerevent event handler property onpointer
cancel some examples of situations that will trigger a pointer
cancel event: a hardware event occurs that
cancels the pointer activities.
... after the pointer
cancel event is fired, the browser will also send pointerout followed by pointerleave.
... examples using addeventlistener(): document.addeventlistener('pointer
cancel', (event) => { console.log('pointer event
cancelled') }); using the onpointer
cancel event handler property: document.onpointer
cancel = (event) => { console.log('pointer event
cancelled') }; specifications specification status pointer events obsolete ...
HTMLElement: pointercancel event - Web APIs
the pointer
cancel event is fired when the browser determines that there are unlikely to be any more pointer events, or if after the pointerdown event is fired, the pointer is then used to manipulate the viewport by panning, zooming, or scrolling.
... bubbles yes
cancelable no interface pointerevent event handler property onpointer
cancel some examples of situations that will trigger a pointer
cancel event: a hardware event occurs that
cancels the pointer activities.
... after the pointer
cancel event is fired, the browser will also send pointerout followed by pointerleave.
... examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointer
cancel', (event) => { console.log('pointer event
cancelled'); }); using the onpointer
cancel event handler property: const para = document.queryselector('p'); para.onpointer
cancel = (event) => { console.log('pointer event
cancelled'); }; specifications specification status pointer events obsolete ...
ReadableStreamBYOBReader.cancel() - Web APIs
the
cancel() method of the readablestreambyobreader interface
cancels the stream, signaling a loss of interest in the stream by a consumer.
... note: if the reader is active, the
cancel() method behaves the same as that for the associated stream (readablestream.
cancel()).
... syntax var promise = readablestreambyobreader.
cancel(reason); parameters reason a domstring providing a human-readable reason for the
cancellation.
... specifications specification status comment streamsthe definition of '
cancel()' in that specification.
window.cancelAnimationFrame() - Web APIs
the window.
cancelanimationframe() method
cancels an animation frame request previously scheduled through a call to window.requestanimationframe().
... syntax window.
cancelanimationframe(requestid); parameters requestid the id value returned by the call to window.requestanimationframe() that requested the callback.
... examples var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.msrequestanimationframe; var
cancelanimationframe = window.
cancelanimationframe || window.moz
cancelanimationframe; var start = window.mozanimationstarttime; // only supported in ff.
... var myreq; function step(timestamp) { var progress = timestamp - start; d.style.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's important to update the requestid each time you're calling requestanimationframe myreq = requestanimationframe(step); } } myreq = requestanimationframe(step); // the
cancelation uses the last requestid
cancelanimationframe(myreq); specifications specification status comment html living standardthe definition of '
cancelanimationframe()' in that specification.
XRSession.cancelAnimationFrame() - Web APIs
the
cancelanimationframe() method of the xrsession interface
cancels an animation frame which was previously requested by calling requestanimationframe.
... syntax xrsession.
cancelanimationframe(handle); parameters handle the unique value returned by the call to requestanimationframe() that previously scheduled the animation callback.
... the pausexr() function shown at the bottom can be called to suspend the webvr session, in essence, by
canceling any pending animation frame callback.
...nction framecallback(time, xrframe) { xrsession.requestanimationframe(framecallback); // update and render the frame } async function startxr() { xrsession = xr.requestsession("immersive-vr"); if (xrsession) { stopbutton.onclick = stopxr; requesthandle = xrsession.requestanimationframe(framecallback); } } function pausexr() { if (xrsession && requesthandle) { xrsession.
cancelanimationframe(requesthandle); requesthandle = null; } } specifications specification status comment webxr device apithe definition of 'xrsession.
cancelanimationframe' in that specification.
nsICancelable
netwerk/base/public/nsi
cancelable.idlscriptable this interface provides a means to
cancel an operation that is in progress.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void
cancel(in nsresult areason); methods
cancel() call this method to request that this object abort whatever operation it may be performing.
... void
cancel( in nsresult areason ); parameters areason a failure code indicating why the operation is being
canceled.
AudioParam.cancelScheduledValues() - Web APIs
the
cancelscheduledvalues() method of the audioparam interface
cancels all scheduled future changes to the audioparam.
... syntax var audioparam = audioparam.
cancelscheduledvalues(starttime) parameters starttime a double representing the time (in seconds) after the audiocontext was first created after which all scheduled changes will be
cancelled.
... examples var gainnode = audioctx.creategain(); gainnode.gain.setvaluecurveattime(wavearray, audioctx.currenttime, 2); //'gain' is the audioparam gainnode.gain.
cancelscheduledvalues(audioctx.currenttime); specifications specification status comment web audio apithe definition of '
cancelscheduledvalues' in that specification.
Event.cancelBubble - Web APIs
the
cancelbubble property of the event interface is a historical alias to event.stoppropagation().
... syntax event.
cancelbubble = bool; var bool = event.
cancelbubble; value a boolean.
... example elem.onclick = function(event) { // do cool things here event.
cancelbubble = true; } specifications specification status comment domthe definition of '
cancelbubble' in that specification.
HTMLDialogElement: cancel event - Web APIs
the
cancel event fires on a <dialog> when the user instructs the browser that they wish to dismiss the current open dialog.
... bubbles no
cancelable yes interface event event handler on
cancel examples live example html <dialog class="example-dialog"> <button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('
cancel', (event) => { result.textcontent = 'dialog was
canceled'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.add...
...ion') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status html living standardthe definition of '
cancel' in that specification.
MediaTrackSupportedConstraints.echoCancellation - Web APIs
the mediatracksupportedconstraints dictionary's echo
cancellation property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the echo
cancellation constraint.
... syntax echo
cancellationconstraintsupported = supportedconstraintsdictionary.echo
cancellation; value this property is present in the dictionary (and its value is always true) if the user agent supports the echo
cancellation constraint.
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().echo
cancellation) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'echo
cancellation' in that specification.
SpeechSynthesis.cancel() - Web APIs
the
cancel() method of the speechsynthesis interface removes all utterances from the utterance queue.
... syntax speechsynthesisinstance.
cancel(); returns void.
...this is quite a long sentence to say.'); var utterance2 = new speechsynthesisutterance('we should say another sentence too, just to be on the safe side.'); synth.speak(utterance1); synth.speak(utterance2); synth.
cancel(); // utterance1 stops being spoken immediately, and both are removed from the queue specifications specification status comment web speech apithe definition of '
cancel()' in that specification.
UIEvent.cancelBubble - Web APIs
the uievent.
cancelbubble property indicates if event bubbling for this event has been
canceled or not.
... syntax event.
cancelbubble = bool; var bool = event.
cancelbubble; specifications this property is not part of any specification.
... although the similar event.
cancelbubble property was included in an old working draft of w3c dom level 2.
window.cancelIdleCallback() - Web APIs
summary the window.
cancelidlecallback() method
cancels a callback previously scheduled with window.requestidlecallback().
... syntax window.
cancelidlecallback(handle); parameters handle the id value returned by window.requestidlecallback() when the callback was established.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet
cancelidlecallback experimentalchrome full support 47edge full support 79firefox full support 55 full support 55 full support 53disabled disabled from version 53: this feature is be...
cancelInstall - Archive of obsolete content
method of install object syntax void
cancelinstall() void
cancelinstall( int errorcode ) parameters none.
...err = getlasterror(); if (!err) performinstall(); else
cancelinstall(err); ...
cancel - Archive of obsolete content
« xul reference home
cancel() return type: no return value call this method to
cancel and close the wizard.
... the code in the onwizard
cancel attribute is called before the wizard is
cancelled.
PR_CancelJob
causes a previously queued job to be
canceled.
... syntax #include <prtpool.h> nspr_api(prstatus) pr_
canceljob(prjob *job); parameter the function has the following parameter: job a pointer to a prjob structure returned by a pr_queuejob function representing the job to be
cancelled.
Document: touchcancel event - Web APIs
the touch
cancel event is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created).
... bubbles yes
cancelable no interface touchevent event handler property ontouch
cancel examples code samples for those events are available on the dedicated page: touch events.
Element: touchcancel event - Web APIs
the touch
cancel event is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created).
... bubbles yes
cancelable no interface touchevent event handler property ontouch
cancel examples code samples for those events are available on the dedicated page: touch events.
::-webkit-search-cancel-button - CSS: Cascading Style Sheets
the ::-webkit-search-
cancel-button css pseudo-element represents a button (the "
cancel button") at the edge of an <input> of type="search" which clears away the current value of the <input> element.
... syntax selector::-webkit-search-
cancel-button specifications not part of any standard.
Index - Web APIs
64 animation.
cancel() api, animation, method, reference, web animations,
cancel, waapi, web animations api the web animations api's
cancel() method of the animation interface clears all keyframeeffects caused by this animation and aborts its playback.
... 70 animation.on
cancel api, animation, event handler, property, reference, web animations, events, on
cancel, web animations api the on
cancel property of the web animations api's animation interface is the event handler for the
cancel event.
...a new promise is created every time the animation enters the "pending" play state as well as when the animation is
canceled, since in both of those scenarios, the animation is ready to be started again.
...And 54 more matches
Download
method overview promise start(); promise launch(); promise showcontainingdirectory(); promise
cancel(); promise removepartialdata(); promise whensucceeded(); promise finalize([optional] boolean aremovepartialdata); properties attribute type description
canceled read only boolean indicates that the download has been
canceled.
... this property can become true, then it can be reset to false when a
canceled download is restarted.
... this property becomes true as soon as the
cancel() method is called, though the stopped property might remain false until the
cancellation request has been processed.
...And 24 more matches
nsIPromptService
button_pos_1 256 this is the button used to
cancel the prompt.
... it typically has the label "
cancel" or "no".
... button_pos_2 65536 this button can be used to give the user a choice of options, but still allowing the user to
cancel the prompt.
...And 20 more matches
WebRequest.jsm
the event listener receives detailed information about the request, and can modify or
cancel the request.
...this then enables the event listener to modify or
cancel the request.
... see modifying &
canceling requests.
...And 16 more matches
Drag Operations - Web APIs
you can use the value none to indicate that no drop is allowed at this location, although it is preferred not to
cancel the event in this case.
... if you want to allow a drop, you must prevent the default handling by
cancelling both the dragenter and dragover events.
... to do this, call a function which checks a condition and only
cancels the event when the condition is met.
...And 13 more matches
nsIDownloadManager
to get the service, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsi
cancelable a
cancelable, in boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void
canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gecko 1.9.1 void flush(); obsolete since gecko 1.8 nsidownload getdownload(in unsigned long aid); void onclose(); obsolete since gecko 1...
....9.1 void open(in nsidomwindow aparent, in nsidownload adownload); obsolete since gecko 1.9.1 void openprogressdialogfor(in nsidownload adownload, in nsidomwindow aparent, in boolean a
canceldownloadonclose); obsolete since gecko 1.9.1 void pausedownload(in unsigned long aid); void removedownload(in unsigned long aid); void removedownloadsbytimeframe(in long long abegintime, in long long aendtime); void removelistener(in nsidownloadprogresslistener alistener); void resumedownload(in unsigned long aid); void retrydownload(in unsigned long aid); void savestate(); obsolete since gecko 1.8 void startbatchupdate(); obsolete since gecko 1.9.1 attributes attribute type description ...
... cancleanup boolean whether or not there are downloads that can be cleaned up (removed) that is downloads that have completed, have failed or have been
canceled.
...And 11 more matches
Vue conditional rendering: editing existing todos - Learn web development
copy the following code into that file: <template> <form class="stack-small" @submit.prevent="onsubmit"> <div> <label class="edit-label">edit name for "{{label}}"</label> <input :id="id" type="text" autocomplete="off" v-model.lazy.trim="newlabel" /> </div> <div class="btn-group"> <button type="button" class="btn" @click="on
cancel">
cancel <span class="visually-hidden">editing {{label}}</span> </button> <button type="submit" class="btn btn__primary"> save <span class="visually-hidden">edit for {{label}}</span> </button> </div> </form> </template> <script> export default { props: { label: { type: string, required: true }, id: { type: str...
...ing, required: true } }, data() { return { newlabel: this.label }; }, methods: { onsubmit() { if (this.newlabel && this.newlabel !== this.label) { this.$emit("item-edited", this.newlabel); } }, on
cancel() { this.$emit("edit-
cancelled"); } } }; </script> <style scoped> .edit-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; margin-bottom: 5px; } input { display: inline-block; margin-top: 0.4rem; width: 100%; min-height: 4.4rem; padding: 0.4rem 0.8rem; border: 2px solid #565656; } form { display: flex; flex-direction: row; flex-wrap: wrap; } form > * { flex: 0 0 100%; } </style> note: walk throug...
... there is a "save" button and a "
cancel" button: when the "save" button is clicked, the component emits the new label via an item-edited event.
...And 10 more matches
Document - Web APIs
globaleventhandlers.onanimation
cancel an eventhandler called when an animation
cancel event is sent, indicating that a running css animation has been
canceled.
... globaleventhandlers.on
cancel is an eventhandler representing the code to be called when the
cancel event is raised.
... globaleventhandlers.onpointer
cancel is an eventhandler representing the code to be called when the pointer
cancel event is raised.
...And 10 more matches
Componentizing our Svelte app - Learn web development
when entering editing mode we'll show an <input> field to allow us to edit the current todo name, with two buttons to confirm or
cancel our changes.
...when the todo is in editing mode, the user can save or
cancel the changes.
... add the following set of functions below your previous function to handle these actions: function on
cancel() { name = todo.name // restores name to its initial value and editing = false // and exit editing mode } function onsave() { update({ name: name }) // updates todo name editing = false // and exit editing mode } function onremove() { dispatch('remove', todo) // emit remove event } function onedit() { editing = true // enter editing mode } function ontoggle() { update({ completed: !todo.completed}) // updates todo status } updati...
...And 8 more matches
IME handling guide
finally, this class guarantees that requesting to commit or
cancel current composition to ime is perefored synchronously.
... note that even if there are pending notifications, they are
canceled when notify_ime_of_focus is sent since querying content with following notifications immediately after getting focus does not make sense.
... if this notification is tried to sent before sending notify_ime_of_focus, all pending notifications and notify_ime_of_blur itself are
canceled.
...And 7 more matches
Window - Web APIs
window.
cancelanimationframe() enables you to
cancel a callback previously scheduled with window.requestanimationframe.
... window.
cancelidlecallback() enables you to
cancel a callback previously scheduled with window.requestidlecallback.
... window.clearimmediate()
cancels the repeated execution set using setimmediate.
...And 7 more matches
Dialogs and Prompts - Archive of obsolete content
add ok and
cancel buttons in an order that is consistent with os default (but the button set and layout is highly customizable, see below).
... simple dialog code the following xul code defines a simple dialog with two buttons, ok and
cancel (buttons="accept,
cancel" attribute on dialog).
... <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." title="..." buttons="accept,
cancel" ondialogaccept="return onaccept();" ondialog
cancel="return on
cancel();"> <script src="chrome://..."/> <!-- content --> </dialog> you need to implement onaccept and on
cancel functions in your script.
...And 6 more matches
jspage - Archive of obsolete content
tedtarget:l,target:g,code:b,key:m,shift:a.shiftkey,control:a.ctrlkey,alt:a.altkey,meta:a.metakey}); }});event.keys=new hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});event.implement({stop:function(){return this.stoppropagation().preventdefault(); },stoppropagation:function(){if(this.event.stoppropagation){this.event.stoppropagation();}else{this.event.
cancelbubble=true;}return this;},preventdefault:function(){if(this.event.preventdefault){this.event.preventdefault(); }else{this.event.returnvalue=false;}return this;}});function class(b){if(b instanceof function){b={initialize:b};}var a=function(){object.reset(this);if(a._prototyping){return this; }this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._curr...
...>'+__flash__argumentstoxml(arguments,2)+"</invoke>"); return eval(rs);};var fx=new class({implements:[chain,events,options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this; this.setoptions(a);this.options.duration=fx.durations[this.options.duration]||this.options.duration.toint();var b=this.options.wait;if(b===false){this.options.link="
cancel"; }},gettransition:function(){return function(a){return -(math.cos(math.pi*a)-1)/2;};},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration); this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return fx.compute(c,...
...b,a); },check:function(){if(!this.timer){return true;}switch(this.options.link){case"
cancel":this.
cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments)); return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.gettransition(); this.starttimer();this.onstart();return this;},complete:function(){if(this.stoptimer()){this.oncomplete();}return this;},
cancel:function(){if(this.stoptimer()){this.on
cancel(); }return this;},onstart:function(){this.fireevent("start",this.subject);},oncomplete:function(){this.fireevent("complete",this.subject);if(!this.callchain()){this.fireevent("chaincomplete",this.subject); }},on
cancel:function(){this.fireevent("
cancel",this.subject).clearchain();},pause:function(){t...
...And 6 more matches
dialog - Archive of obsolete content
attributes buttonaccesskeyaccept, buttonaccesskey
cancel, buttonaccesskeydisclosure, buttonaccesskeyextra1, buttonaccesskeyextra2, buttonaccesskeyhelp, buttonalign, buttondir, buttondisabledaccept, buttonlabelaccept, buttonlabel
cancel, buttonlabeldisclosure, buttonlabelextra1, buttonlabelextra2, buttonlabelhelp, buttonorient, buttonpack, buttons, defaultbutton, title properties buttons, defaultbutton methods acceptdialog,
canceldialog, center...
...windowonscreen, getbutton, movetoalertposition examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,
cancel" buttonlabel
cancel="
cancel" buttonlabelaccept="save"> <dialogheader title="options" description="my preferences"/> <groupbox> <caption label="colour"/> <radiogroup> <radio label="red"/> <radio label="green" selected="true"/> <radio label="blue"/> </radiogroup> <label value="nickname"/> <textbox/> </groupbox> </dialog> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground...
... buttonaccesskey
cancel type: string the access key to use for the "
cancel" button.
...And 6 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
and if you click on
cancel or save, the focus disappears again.
... put the following contents inside it: <script> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() let name = '' const addtodo = () => { dispatch('addtodo', name) name = '' } const on
cancel = () => name = '' </script> <form on:submit|preventdefault={addtodo} on:keydown={e => e.key === 'escape' && on
cancel()}> <h2 class="label-wrapper"> <label for="todo-0" class="label__lg">what needs to be done?</label> </h2> <input bind:value={name} type="text" id="todo-0" autocomplete="off" class="input input__lg" /> <button type="submit" disabled={!name} class="btn btn__primary btn_...
...we are also taking care of the escape key with on:keydown={e => e.key === 'escape' && on
cancel()}.
...And 6 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
table { border: 1px solid black; } th, td { border: 1px solid black; } result row and column spanning now, let's introduce another column that shows the date the user's membership ended, along with a super-heading above the "joined" and "
canceled" dates called "membership dates".
... result let's actually look at the output first this time: notice how the heading area here is actually two rows, one with "name", "id", "membership dates", and "balance" headings, and the other with "joined" and "
canceled", which are sub-headings below "membership dates".
... having a second row of <th> elements that contains only the "joined" and "
canceled" headings.
...And 6 more matches
InstallListener
method overview void onnewinstall(in addoninstall install) void ondownloadstarted(in addoninstall install) void ondownloadprogress(in addoninstall install) void ondownloadended(in addoninstall install) void ondownload
cancelled(in addoninstall install) void ondownloadfailed(in addoninstall install) void oninstallstarted(in addoninstall install) void oninstallended(in addoninstall install, in addon addon) void oninstall
cancelled(in addoninstall install) void oninstallfailed(in addoninstall install) void onexternalinstall(in addon install, in addon existingaddon, in...
...a listener may return false to
cancel the download.
...a listener may return false to
cancel the download.
...And 5 more matches
Pointer events - Web APIs
pointer
cancel onpointer
cancel a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactived).
... pointerout onpointerout fired for several reasons including: pointer is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointer
cancel event (see pointer
cancel); when a pen stylus leaves the hover range detectable by the digitizer.
... <html> <script> function over_handler(event) { } function enter_handler(event) { } function down_handler(event) { } function move_handler(event) { } function up_handler(event) { } function
cancel_handler(event) { } function out_handler(event) { } function leave_handler(event) { } function gotcapture_handler(event) { } function lostcapture_handler(event) { } function init() { var el=document.getelementbyid("target"); // register pointer event handlers el.onpointerover = over_handler; el.onpointerenter = enter_handler; el.onpointerdown = do...
...And 5 more matches
Event reference
animation
cancel a css animation has aborted.
... transition
cancel a css transition has been
cancelled.
... compositionend the composition of a passage of text has been completed or
canceled.
...And 5 more matches
prefwindow - Archive of obsolete content
attributes buttonalign, buttondir, buttonorient, buttonpack, buttons, defaultbutton, lastselected, onbeforeaccept, ondialogaccept, ondialog
cancel, ondialogdisclosure, ondialoghelp, onload, onunload, title, type properties buttons, currentpane, defaultbutton, lastselected, preferencepanes, type methods acceptdialog, addpane,
canceldialog, centerwindowonscreen, getbutton, opensubdialog, openwindow, showpane examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow xmlns="http://ww...
...
cancel: the
cancel button which will
cancel the operation.
...warning: if the accept and
cancel buttons are actually shown is system dependent and is mainly controlled by the value of the boolean preference browser.preferences.instantapply.
...And 4 more matches
Focus management with Vue refs - Learn web development
similarly, if you save or
cancel your edit, focus will disappear again as you move back to the non-edit view.
...we'll also want to put focus back on the "edit" button when a user
cancels or saves their edit.
... vue's $nexttick() method we want to set focus on the "edit" button when a user saves or
cancels their edit.
...And 4 more matches
imgIRequest
inherits from: nsirequest last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void
cancelandforgetobserver(in nsresult astatus); imgirequest clone(in imgidecoderobserver aobserver); void decrementanimationconsumers(); imgirequest getstaticrequest(); void incrementanimationconsumers(); void lockimage(); void requestdecode(); void unlockimage(); attributes attribute type description corsmode long the cors mode that this image was loaded with.
... status_load_partial 0x2 used internally by imgrequest to flag that a request is being
cancelled as a result of a failure of a proxy holder and not an internal failure.
... cors_anonymous 2 cors_use_credentials 3 methods
cancelandforgetobserver()
cancels this request as in nsirequest.
cancel(); further, also nulls out decoderobserver so it gets no further notifications from us.
...And 4 more matches
nsIAuthPrompt
methods prompt() this method puts up a text input dialog with ok and
cancel buttons.
... result the result of the dialog box, ok or
cancel buttons.
... return value true for ok, false for
cancel.
...And 4 more matches
nsIDOMEvent
nseventptr getinternalnsevent(); violates the xpcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean
cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidelines void settarget(in nsidomeventtarge...
...
cancelable boolean used to indicate whether or not an event can have its default action prevented.
... void initevent( in domstring eventtypearg, in boolean canbubblearg, in boolean
cancelablearg ); parameters eventtypearg specifies the event type.
...And 4 more matches
nsISHistoryListener
docshell/shistory/public/nsishistorylistener.idlscriptable an interface you can implement to receive notifications about activities that occur in session history, and optionally
cancel them.
... return value true to allow the go back operation to proceed or false to
cancel it.
... return value true to allow the go forward operation to proceed or false to
cancel it.
...And 4 more matches
nsIWebBrowserPersist
inherits from: nsi
cancelable last changed in gecko 36.0 (firefox 36.0 / thunderbird 36.0 / seamonkey 2.33) implemented by: @mozilla.org/embedding/browser/nswebbrowser;1 and @mozilla.org/embedding/browser/nswebbrowserpersist;1.
... to create an instance, use: var webbrowserpersist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void
cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, i...
... persist_flags_cleanup_on_failure 8192 automatically cleanup after a failed or
cancelled operation, deleting all created files and directories.
...And 4 more matches
Activity Manager examples
ed, initiator is omitted event.init(folder.prettiestname + " is processed", null, "no junk found", process.starttime, // start time date.now()); // completion time event.contexttype = process.contexttype; // optional event.contextobj = process.contextobj; // optional gactivitymanager.addactivity(event); showing a user-defined activity with
cancel capability (javascript) this sample improves the previous one by providing an nsiactivity
cancelhandler to allow the user to
cancel the process.
... // step 1: create a nsiactivity
cancelhandler implementation function
canceljunkprocess() { // user stuff here..
... }
canceljunkprocess.prototype = {
cancel: function(aactivity) { let initiator = aactivity.initiator; if (initiator) { let folder = aactivity.getsubjects({})[0]; ....
...And 4 more matches
HTMLElement - Web APIs
toucheventhandlers.ontouch
cancel returns the event handling code for the touch
cancel event.
... animation events animation
cancel fired when an animation unexpectedly aborts.
... also available via the onanimation
cancel property.
...And 4 more matches
Using readable streams - Web APIs
the generic syntax skeleton looks like this: const stream = new readablestream({ start(controller) { }, pull(controller) { },
cancel() { }, type, autoallocatechunksize }, { highwatermark, size() }); the constructor takes two objects as parameters.
...
cancel() — a method that, when included, will be called if the app signals that the stream is to be
cancelled (e.g.
... if readablestream.
cancel() is called).
...And 4 more matches
Intercepting Page Loads - Archive of obsolete content
you can't, however, easily
cancel the page load.
... asubject.setrequestheader("referer", "http://example.com", false); } else if (re_url_to_
cancel.test(url)) { // re_url_to_
cancel is a regular expression.
... asubject.
cancel(components.results.ns_binding_aborted); } } } this example shows how you can obtain the url for the request, analyze it using regular expressions, and perform actions on it such as modifying http headers, or even
canceling the request.
...And 3 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
most installation scripts, including the one discussed here, take the following basic form (in pseudo-code and with links to the sections in which these installation steps are documented): initinstall(); if (verify_space()) { err = add_dirs_and_files; register_files; if (err==success) { performinstall() }; else {
cancelinstall() }; } as you can see in the code listing, the verification process at the top is on lines 1 to 18; the file addition process, here part of the main installation block, is on lines 24 to 41; the registration part of the main installation block is on lines 42-58; and the execution at the end of the main block is on lines 59 to 71.
...recall that an install process takes the following general form: initinstall(); if (verify_space()) { err = add_dirs_and_files; register_files; if (err==success) { performinstall() }; else {
cancelinstall() }; } in this arrangement, the actual execution of the installation is checked against the errors returned from the addition of files to the installation, which may itself have been conditioned on some verification of version and necessary disk space.
... the actual install code used to execute the installation appears in theinstall.js file as follows: if (err==success) { err = performinstall(); logcomment("performinstall() returned: " + err); } else {
cancelinstall(err); logcomment("
cancelinstall() due to error: " + err); } } else
cancelinstall(insufficient_disk_space); performinstall is the function used to execute the install once it has been initialized and loaded, and it is the last step to installing the software.
...And 3 more matches
Index - Archive of obsolete content
34 buttonaccesskey
cancel xul attributes, xul reference no summary!
... 43 buttonlabel
cancel xul attributes, xul reference no summary!
... 224 ondialog
cancel xul attributes, xul reference no summary!
...And 3 more matches
Creating Dialogs - Archive of obsolete content
it provides the useful ability to construct up to four buttons along the bottom of the dialog forok,
cancel, and so on.
... example dialog source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,
cancel" ondialogaccept="return dook();" ondialog
cancel="return do
cancel();"> <script> function dook(){ alert("you pressed ok!"); return true; } function do
cancel(){ alert("you pressed
cancel!"); return true; } </script> <description value="select a button"/> </dialog> you may place any elements that you wish in a dialog.
...the following values may be used, seperated by commas: accept - an ok button
cancel - a
cancel button help - a help button disclosure - a disclosure button, which is used for showing more information you can set code to execute when the buttons are pressed using the ondialogaccept, ondialog
cancel, ondialoghelp and ondialogdisclosure attributes.
...And 3 more matches
Using Spacers - Archive of obsolete content
you'll notice that the
cancel button in the dialogs has always set its width so that it fits the text inside it.
...flex examples example 1: <button label="find" flex="1"/> <button label="
cancel" flex="1"/> example 2: <button label="find" flex="10"/> <button label="
cancel" flex="1"/> example 3: <button label="find" flex="2"/> <button label="replace"/> <button label="
cancel" flex="4"/> example 4: <button label="find" flex="2"/> <button label="replace" flex="2"/> <button label="
cancel" flex="3"/> example 5: <html:div> <button label="find" flex="2"/> <button la...
... example 2 here, both buttons will grow, but the find button will grow ten times as much as the
cancel button, because it has a flex value that is 10 times the flex value of the find button.
...And 3 more matches
Using IO Timeout And Interrupt On NT - Archive of obsolete content
canceling overlapped io by closing the file descriptor therefore, we need to
cancel the outstanding overlapped io request before the thread exits.
... nt's <tt>
cancelio()</tt> function would be ideal for this purpose.
... unfortunately, <tt>
cancelio()</tt> is not available on nt 3.51.
...And 3 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
universe'); clearing timeouts finally, if a timeout has been created, you can
cancel it before the specified time has elapsed by calling cleartimeout(), passing it the identifier of the settimeout() call as a parameter.
... so to
cancel our above timeout, you'd do this: cleartimeout(mygreeting); note: see greeter-app.html for a slightly more involved demo that allows you to set the name of the person to say hello to in a form, and
cancel the greeting using a separate button (see the source code also).
...(you can see the source code, also.) clearing a requestanimationframe() call clearing a requestanimationframe() call can be done by calling the corresponding
cancelanimationframe() method.
...And 3 more matches
DeferredTask.jsm
method overview bool ispending();obsolete since gecko 28 void start();obsolete since gecko 28 void flush();obsolete since gecko 28 void
cancel();obsolete since gecko 28 void arm(); void disarm(); promise finalize(); attributes isarmed boolean indicates whether the task is currently requested to start again later, regardless of whether it is currently running.
... void flush();
cancel obsolete since gecko 28
cancel any pending task.
... void
cancel(); arm request the execution of the task after the delay specified on construction.
...And 3 more matches
mozIStoragePendingStatement
the mozistoragependingstatement interface represents a pending asynchronous database statement, and offers the
cancel() method which allows you to
cancel the pending statement.
... last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void
cancel(); methods
cancel()
cancels the pending statement.
... fails only if you attempt to
cancel the operation more than once.
...And 3 more matches
nsITextInputProcessor
finally, when you commit the composition with the last composition string, just do this: tip.commitcomposition(); when you commit composition with specific string, specify commit string with its argument: tip.commitcompositionwith("foo-bar-buzz"); when you
cancel composition, just do this: tip.
cancelcomposition(); when you dispatch keydown event (and one or more keypress events), just do this: var keyevent = new keyboardevent("", // type attribute value should be empty.
...var dodefault = tip.keydown(keyevent); when you dispatch keyup event, just do this: var keyevent = new keyboardevent("", { key: "a", code: "keya", keycode: keyboardevent.dom_vk_a }); var dodefault = tip.keyup(keyevent); startcomposition(), flushpendingcomposition(), commitcomposition(), commitcompositionwith(), and
cancelcomposition() can take a keyboardevent which causes modifying the composition state.
... method overview void appendclausetopendingcomposition(in unsigned long alength, in unsigned long aattribute); boolean begininputtransaction(in nsidomwindow awindow, in nsitextinputprocessorcallback acallback); boolean begininputtransactionfortests(in nsidomwindow awindow, [optional] in nsitextinputprocessorcallback acallback); void
cancelcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean commitcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean commitcompositionwith(in domstring acommitstring, [optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean flushpendingcomposit...
...And 3 more matches
nsITimer
it is not necessary to
cancel the timer in that case.
... method overview void
cancel(); void init(in nsiobserver aobserver, in unsigned long adelay, in unsigned long atype); void initwithcallback(in nsitimercallback acallback, in unsigned long adelay, in unsigned long atype); void initwithfunccallback(in nstimercallbackfunc acallback, in voidptr aclosure, in unsigned long adelay, in unsigned long atype); native code only!
... methods
cancel()
cancels the timer.
...And 3 more matches
Element - Web APIs
eventtarget.dispatchevent() dispatches an event to this node in the dom and returns a boolean that indicates whether no handler
canceled the event.
...
cancel fires on a <dialog> when the user instructs the browser that they wish to dismiss the current open dialog.
... also available via the on
cancel property.
...And 3 more matches
HTMLElement: transitionend event - Web APIs
bubbles yes
cancelable yes interface transitionevent event handler property ontransitionend the transitionend event is fired in both directions - as it finishes transitioning to the transitioned state, and when it fully reverts to the default or non-transitioned state.
... if the transition
cancel event is fired, the transitionend event will not fire.
...over me</div> <div class="message"></div> .transition { width: 100px; height: 100px; background: rgba(255,0,0,1); transition-property: transform background; transition-duration: 2s; transition-delay: 1s; } .transition:hover { transform: rotate(90deg); background: rgba(255,0,0,0); } to this, we'll add some javascript to indicate that the transitionstart, transitionrun, transition
cancel and transitionend events fire.
...And 3 more matches
Panels - Archive of obsolete content
this is the normal way in which a user would
cancel the operation.
... you may wish to also place a
cancel or close button within the panel, especially if the panel is larger with a lot of controls within it.
... <panel id="search-panel" noautohide="true"> <textbox id="search"/> <button label="search" oncommand="dosearch();"/> <button label="
cancel" oncommand="this.parentnode.hidepopup();"/> </panel> because the panel can no longer be closed by clicking elsewhere, the panel should always provide a means to close the panel itself.
...And 2 more matches
Adding Event Handlers - Archive of obsolete content
we would want to add a script to handle the find button, the
cancel button and to handle each menu command.
... our find files example a command handler can be placed on the find and
cancel buttons in the find files dialog.
...however, pressing the
cancel button should close the window.
...And 2 more matches
Anatomy of a video game - Game development
note: in practice, it is more common to prevent the next requestanimationframe() with an if-statement, rather than calling
cancelanimationframe().
... for the second issue, stopping the main loop, you will need to
cancel the call to main() with window.
cancelanimationframe().
... you will need to pass
cancelanimationframe() the id token given by requestanimationframe() when it was last called.
...And 2 more matches
AddonInstall
this can be
canceled at any time with the
cancel() method.
... method overview void install() void
cancel() void addlistener(in installlistener listener) void removelistener(in installlistener listener) properties attribute type description name string the name of the add-on being installed.
...the process will continue in the background until it fails, completes, one of the registered installlisteners pauses it, or the process is
canceled by a call to the
cancel() method.
...And 2 more matches
Sqlite.jsm
if statements are in progress at the time this function is called, they will be
cancelled.
... along with a result row, onrow is passed a
cancel function as its second argument.
... consumers of this api can call the
cancel function should they want to immediately abort the execution of the statement.
...And 2 more matches
nsIAuthPrompt2
to create an instance, use: var authprompt2 = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt2); method overview nsi
cancelable asyncpromptauth(in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pruint32 level, in nsiauthinformation authinfo); boolean promptauth(in nsichannel achannel, in pruint32 level, in nsiauthinformation authinfo); constants constant value description level_none 0 the password will be sent unencrypted.
... if the user closes the dialog using a
cancel button or similar, the callback's nsiauthpromptcallback.onauth
cancelled() method must be called.
... calling nsi
cancelable.
cancel() on the returned object should close the dialog and must call nsiauthpromptcallback.onauth
cancelled() on the provided callback.
...And 2 more matches
nsIProtocolProxyService
to access the service use: var pps = components.classes["@mozilla.org/network/protocol-proxy-service;1"] .getservice(components.interfaces.nsiprotocolproxyservice); method overview deprecated since gecko 18 nsiproxyinfo resolve(in nsiuri auri, in unsigned long aflags); nsi
cancelable asyncresolve(in nsiuri auri, in unsigned long aflags,in nsiprotocolproxycallback acallback); nsiproxyinfo newproxyinfo(in acstring atype, in autf8string ahost,in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy); nsiproxyinfo getfailoverforproxy(in nsiproxyinfo aproxyinfo, in nsiuri auri, in nsresult areason); vo...
... nsi
cancelable asyncresolve( in nsiuri auri, in unsigned long aflags, in nsiprotocolproxycallback acallback ); parameters auri the uri to test.
... return value an nsi
cancelableobject that can be used to
cancel the asynchronous operation.
...And 2 more matches
nsIRequest
method overview void
cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this request.
... methods
cancel()
cancels the current request.
... requests that use nsistreamlistener must not call ondataavailable anymore after
cancel has been called.
...And 2 more matches
Working with windows in chrome code
ress; setprogress(window.arguments[0].progress); setstatus(window.arguments[0].status); } } function setprogress(value) { gprogressmeter.value = 100 * value / maxprogress; } function setstatus(text) { gstatus.value = "status: " + text + "..."; } ]]></script> <label id="status" value="(no status)" /> <hbox> <progressmeter id="progressmeter" mode="determined" /> <button label="
cancel" oncommand="close();" /> </hbox> </window> example 2: interacting with the opener sometimes an opened window needs to interact with its opener; for example, it might do so in order to give notice that the user has made changes in the window.
... let's add code to the previous example to notify the opener when the user presses
cancel on the progress dialog.
... if we're sure the window that opened the progress dialog declares the
canceloperation function, we can use window.opener.
canceloperation() to notify it, like this: <button label="
cancel" oncommand="opener.
canceloperation(); close();" /> using a callback function.
...And 2 more matches
Advanced animations - Web APIs
losepath(); ctx.fillstyle = this.color; ctx.fill(); } }; function draw() { ctx.clearrect(0,0, canvas.width, canvas.height); ball.draw(); ball.x += ball.vx; ball.y += ball.vy; raf = window.requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.
cancelanimationframe(raf); }); ball.draw(); boundaries without any boundary collision testing our ball runs out of the canvas quickly.
...ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } raf = window.requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.
cancelanimationframe(raf); }); ball.draw(); acceleration to make the motion more real, you can play with the velocity like this, for example: ball.vy *= .99; ball.vy += .25; this slows down the vertical velocity each frame, so that the ball will just bounce on the floor in the end.
...ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } raf = window.requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.
cancelanimationframe(raf); }); ball.draw(); trailing effect until now we have made use of the clearrect method when clearing prior frames.
...And 2 more matches
GlobalEventHandlers - Web APIs
globaleventhandlers.onanimation
cancel an eventhandler called when an animation
cancel event is sent, indicating that a running css animation has been
canceled.
... globaleventhandlers.on
cancel is an eventhandler representing the code to be called when the
cancel event is raised.
... globaleventhandlers.onpointer
cancel is an eventhandler representing the code to be called when the pointer
cancel event is raised.
...And 2 more matches
MSManipulationEvent.initMSManipulationEvent() - Web APIs
syntax msmanipulationevent.initmsmanipulationevent(typearg, canbubblearg,
cancelablearg, viewarg, detailarg, laststate, currentstate); parameters typearg [in] type: domstring the type of the event being created.
...
cancelablearg [in] type: boolean indicates whether the event’s default action can be prevented.
... when true, the default action can be
canceled.
...And 2 more matches
Multi-touch interaction - Web APIs
example this example demonstrates using pointer events' various event types (pointerdown, pointermove, pointerup pointer
cancel, etc.) for different multi-touch interactions.
...the handler for pointerup is used for the pointer
cancel, pointerout and pointerleave events, since these four events have the same semantics in this application.
... function set_handlers(name) { // install event handlers for the given element var el=document.getelementbyid(name); el.onpointerdown = pointerdown_handler; el.onpointermove = pointermove_handler; // use same handler for pointer{up,
cancel,out,leave} events since // the semantics for these events - in this app - are the same.
...And 2 more matches
ReadableStream.ReadableStream() - Web APIs
cancel(reason) optional this method, also defined by the developer, will be called if the app signals that the stream is to be
cancelled (e.g.
... if readablestream.
cancel() is called).
...the reason parameter contains a domstring describing why the stream was
cancelled.
...And 2 more matches
Adding windows and dialogs - Archive of obsolete content
you may be asking yourself what's the big deal about defining a simple xul window with an ok and maybe a
cancel button.
... <dialog id="xulschoolhello-hello-dialog" title="&xulschoolhello.hellodialog.title;" buttons="accept,
cancel" ondialogaccept="return xulschoolchrome.hellodialog.accept();" ondialog
cancel="return xulschoolchrome.hellodialog.
cancel();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> carefully read the specification of the dialog element.
...the only constant rule is that clicking on ok and
cancel will close the dialog unless your associated function returns false.
... you should avoid returning false, though, specially with the
cancel button.
Index - Archive of obsolete content
781 buttonaccesskey
cancel xul attributes, xul reference no summary!
... 790 buttonlabel
cancel xul attributes, xul reference no summary!
... 1187
cancel xul methods, xul reference no summary!
... 1188
canceldialog xul methods, xul reference no summary!
Install script template - Archive of obsolete content
condary install location var secondaryfolder; //special error values used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccurederror = -4711; var winregisnullerror = -4712; var invalidrootkeyerror = -4713; var registrykeynotwritableerror = -4714; //initinstall block //the installation is initialized here -- if we fail here,
cancel the installation // initinstall is quite an overloaded method, but i have invoked it here with three strings // which are globally defined err = initinstall(software_name, plid, version); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall(software_name, software_name, version); if (err != 0)
cancelinstall(err); } //addfiles to current brows...
...k space if(verifydiskspace(pluginsfolder, plugin_size+component_size)) { // start installing plugin shared library reseterror(); // install the plugin shared library to the current browser's plugin directory errblock1 = addfile (plid, version, plugin_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + plugin_file + " to " + pluginsfolder + ":" + errblock1);
cancelinstall(errblock1); } // start installing xpt file if this is a scriptable plugin // install to the plugins directory -- this works well in mozilla 1.0 clients // in mozilla 1.0 clients, the components directory can be avoided for xpt files errblock1 = addfile (plid, version, component_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + component_file + " to "...
... + pluginsfolder + ":" + errblock1);
cancelinstall(errblock1); } } else { logcomment("
cancelling current browser install due to lack of space...");
cancellinstall(); } // secondary install block, which sets up plugins and xpt in another location in addition to the current browser errblock2 = createsecondaryinstall(); // performinstall block, in which error conditions from previous blocks are checked.
... you can also simply call refreshplugins() } else
cancelinstall(errblock1); // plid solution -- write keys to the registry /** * function for secondary installation of plugin (firstinstall).
confirm - Archive of obsolete content
button position constants button_pos_0: the first logical button button_pos_1: the second logical button button_pos_2: the third logical button button title constants button_title_ok: an 'ok' button button_title_
cancel: a '
cancel' button button_title_yes: a 'yes' button button_title_no: a 'no' button button_title_save: a 'save' button button_title_dont_save: a 'don't save' button button_title_revert: a 'revert' button button_title_is_string: custom title specified by the corresponding abuttonxtitle parameter other constants button_pos_0_default: sp...
...note that this only applies to buttons 0 and 2, not button 1 (the "
cancel" button).
... std_ok_
cancel_buttons: use this instead of the constants above to have standard 'ok' and '
cancel' buttons.
... foobar 0.1?", "confirm", std_yes_no_buttons, null, null, null, "install fluxcompensator 0.4 as well", check); returns the return value is an integer indicating which button the user selected: value button 0 '
cancel' or button 1.
Adding Buttons - Archive of obsolete content
in this section, we will add two buttons, a find button and a
cancel button.
...buttons are commonly used for the ok and
cancel buttons in a dialog, for example.
...for example, ok or
cancel.
...the code to add is shown in red below: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button id="find-button" label="find"/> <button id="
cancel-button" label="
cancel"/> </window> you'll notice that the
cancel button was added also.
Introduction to XBL - Archive of obsolete content
xul (example.xul): <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://example/skin/example.css" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <box class="ok
cancelbuttons"/> </window> css (example.css): box.ok
cancelbuttons { -moz-binding: url('chrome://example/skin/example.xml#ok
cancel'); } xbl (example.xml): <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <binding id="ok
cancel"> <content> <xul:button label="ok"/> <xul:button label="c...
...the box has been declared to have a class of ok
cancelbuttons.
... the style sheet associated with the file says that boxes with the class ok
cancelbuttons have a specialized binding, defined in the xbl file.
...however, to summarize, it causes two buttons to be added automatically inside the box, one an ok button and the other a
cancel button.
XBL Attribute Inheritance - Archive of obsolete content
here is another example: xul: <box class="ok
cancel" oktitle="ok"
canceltitle="
cancel" image="happy.png"/> css: box.ok
cancel { -moz-binding: url('chrome://example/skin/example.xml#ok
cancel'); } xbl: <binding id="ok
cancel"> <content> <xul:button xbl:inherits="label=oktitle,image"/> <xul:button xbl:inherits="label=
canceltitle"/> </content> </binding> the value of the oktitle attribute is mapped to the label attribute of the firs...
...the
canceltitle attribute is mapped to the label attribute of the second button.
...the result is as follows: <box class="ok
cancel" oktitle="ok"
canceltitle="
cancel" image="happy.png"> <button label="ok" image="happy.png"/> <button label="
cancel"/> </box> note that the attributes are duplicated on the inner (anonymous) content.
... changing the attributes on the box with the ok
cancel class will automatically change the values on the buttons.
mozbrowserusernameandpasswordrequired
the embedder is supposed to retrieve the necessary credentials, usually using a dialog or a database of username/passwords, and then call authenticate() or
cancel() as appropriate.
... general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
...
cancel() a function that is called to
cancel the authentication.
Index
m interface reference possible values for input format (note that not all image formats support saving alpha channels): 189 imgiloader interfaces, interfaces:scriptable, needscontent, xpcom api reference, xpcom interface reference implemented by @mozilla.org/image/loader;1 as a service: 190 imgirequest interfaces, interfaces:scriptable, needscontent
cancels this request as in nsirequest.
cancel(); further, also nulls out decoderobserver so it gets no further notifications from us.
... 211 mozistoragependingstatement interfaces, interfaces:scriptable, storage the mozistoragependingstatement interface represents a pending asynchronous database statement, and offers the
cancel() method which allows you to
cancel the pending statement.
... 377 nsicachingchannel cache, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference this interface provides: 378 nsi
cancelable interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference call this method to request that this object abort whatever operation it may be performing.
... 467 nsidnsrequest interfaces, interfaces:scriptable, xpcom, xpcom interface reference called to
cancel a pending asynchronous dns request.
Observer Notifications
you can
cancel the shutdown from here by setting asubject.data to true (asubject is the first parameter to your observer, the data value is an nsisupportsprbool).
...the attempt to go offline can be
canceled.
... note: if your code chooses to
cancel the attempt to go offline, it must notify the user.
... em-action-requested item-
cancel-action a previous action has been
cancelled.
nsIAuthPromptCallback
method overview void onauthavailable(in nsisupports acontext, in nsiauthinformation aauthinfo); void onauth
cancelled(in nsisupports acontext, in boolean user
cancel); methods onauthavailable() authentication information is available.
... onauth
cancelled() notification that the prompt was
cancelled.
... void onauth
cancelled( in nsisupports acontext, in boolean user
cancel ); parameters acontext the context that was passed to nsiauthprompt2.asyncpromptauth().
... user
cancel if false, this prompt was
cancelled by calling the the
cancel method on the nsi
cancelable; otherwise, it was
cancelled by the user.
nsIDNSService
method overview nsi
cancelable asyncresolve(in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf...
...nsi
cancelable asyncresolve( in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget ); parameters ahostname the host name or ip-address-literal to resolve.
... return value an object that can be used to
cancel the host lookup.
...any pending asynchronous requests will be
canceled, and the local cache of dns records will be cleared.
nsITextInputProcessorNotification
"request-to-
cancel" this is required to be handled.
... when this is requested, the callback should
cancel composition synchronously, i.e., nsitextinputprocessor.
cancelcomposition() should be called.
... if the callback doesn't want to
cancel the composition synchronously, it's okay to
cancel it later (i.e., asynchronously).
... however, gecko will
cancel the composition with empty string internally.
nsIMsgCloudFileProvider
inherits from: nsisupports method overview void init(in string aaccountkey); void uploadfile(in nsilocalfile afile, in nsirequestobserver acallback); acstring urlforfile(in nsilocalfile afile); void
cancelfileupload(in nsilocalfile afile); void refreshuserinfo(in boolean awithui, in nsirequestobserver acallback); void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequ...
... upload
canceled 0x8055311d returned when uploading has stopped because it was
cancelled by the user.
...
cancelfileupload()
cancels an upload currently in progress for some nsilocalfile.
... void
cancelfileupload(in nsilocalfile afile); parameters afile the nsilocalfile that is currently being uploaded to
cancel.
CustomEvent - Web APIs
event.
cancelbubble a historical alias to event.stoppropagation().
... event.
cancelable read only a boolean indicating whether the event is
cancelable.
... event.defaultprevented read only indicates whether or not the call to event.preventdefault()
canceled the event.
... event.preventdefault()
cancels the event (if it is
cancelable).
Event.initEvent() - Web APIs
syntax event.initevent(type, bubbles,
cancelable); type is a domstring defining the type of event.
...
cancelable is a boolean defining whether the event can be
canceled.
... once set, the read-only property event.
cancelable will give its value.
...var event = document.createevent('event'); // create a click event that bubbles up and // cannot be
canceled event.initevent('click', true, false); // listen for the event.
Event.preventDefault() - Web APIs
as noted below, calling preventdefault() for a non-
cancelable event, such as one dispatched via eventtarget.dispatchevent(), without specifying
cancelable: true has no effect.
...box)) { window.cleartimeout(warningtimeout); } else { // insert warningbox after mytextbox mytextbox.parentnode.insertbefore(warningbox, mytextbox.nextsibling); } warningtimeout = window.settimeout(function() { warningbox.parentnode.removechild(warningbox); warningtimeout = -1; }, 2000); } result notes calling preventdefault() during any stage of event flow
cancels the event, meaning that any default action normally taken by the implementation as a result of the event will not occur.
... you can use event.
cancelable to check if the event is
cancelable.
... calling preventdefault() for a non-
cancelable event has no effect.
Event - Web APIs
event.
cancelbubble a historical alias to event.stoppropagation().
... event.
cancelable read only a boolean indicating whether the event is
cancelable.
... event.defaultprevented read only indicates whether or not the call to event.preventdefault()
canceled the event.
... event.preventdefault()
cancels the event (if it is
cancelable).
KeyboardEvent.initKeyEvent() - Web APIs
syntax event.initkeyevent (type, bubbles,
cancelable, viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event.
...
cancelable is a boolean i indicating whether the event can be
canceled (see
cancelable).
... example var event = document.createevent('keyboardevent'); // create a key event // define the event event.initkeyevent("keypress", // typearg, true, // canbubblearg, true, //
cancelablearg, null, // viewarg, specifies uievent.view.
... the initkeyevent is the current gecko equivalent of the dom level 3 events (initially drafted and also deprecated in favor of keyboardevent() keyboard.initkeyboardevent() method with the following arguments : typearg of type domstring canbubblearg of type boolean
cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type domstring keylocationarg of type unsigned long modifierslist of type domstring); ...
Key Values - Web APIs
vk_oem_attn (0xf0) gdk_key_3270_attn (0xfd0e) "
cancel" [1] the
cancel key.
... gdk_key_
cancel (0xff69) "contextmenu" [3] shows the context menu.
...typically used as an exit,
cancel, or "escape this operation" button.
... gdk_key_zoomout (0x1008ff8c) qt::key_zoomout (0x010000f7) keycode_zoom_out (169) [1] in google chrome 52, the
cancel key incorrectly returns the key code "pause".
MSSiteModeEvent - Web APIs
preventdefault
cancels the default action of an event.
...
cancelable gets a value that indicates whether you can
cancel an event's default action.
...
cancelbubble gets or sets a value that indicates whether an event should be stopped from propagating up from the current target.
... defaultprevented gets a value that indicates whether the default action should be
canceled.
Pinch zoom gestures - Web APIs
the handler for pointerup is used for the pointer
cancel, pointerout and pointerleave events since these four events have the same semantics in this application.
... function init() { // install event handlers for the pointer target var el=document.getelementbyid("target"); el.onpointerdown = pointerdown_handler; el.onpointermove = pointermove_handler; // use same handler for pointer{up,
cancel,out,leave} events since // the semantics for these events - in this app - are the same.
... el.onpointerup = pointerup_handler; el.onpointer
cancel = pointerup_handler; el.onpointerout = pointerup_handler; el.onpointerleave = pointerup_handler; } pointer down the pointerdown event is fired when a pointer (mouse, pen/stylus or touch point on a touchscreen) makes contact with the contact surface.
... in this application, this handler is also used for pointer
cancel, pointerleave and pointerout events.
ReadableStream.pipeThrough() - Web APIs
prevent
cancel: if this is set to true, errors in the destination writablestream will no longer
cancel the source readablestream.
... in this case the method will return a promise rejected with the source’s error, or with any error that occurs during
canceling the source.
... in addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be
canceled.
... in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during
canceling the source.
ReadableStream.pipeTo() - Web APIs
prevent
cancel: if this is set to true, errors in the destination writablestream will no longer
cancel the source readablestream.
... in this case the method will return a promise rejected with the source’s error, or with any error that occurs during
canceling the source.
... in addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be
canceled.
... in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during
canceling the source.
TouchEvent - Web APIs
touch
cancel sent when a touch point has been disrupted in some way.
... there are several possible reasons why this might happen (and the exact reasons will vary from device to device, as well as browser to browser): an event of some kind occurred that
canceled the touch; this might happen if a modal alert pops up during the interaction.
... the user has placed more touch points on the screen than can be supported, in which case the earliest touch in the touchlist gets
canceled.
... globaleventhandlers.ontouch
cancel a global event handler for the touch
cancel event.
Using Touch Events - Web APIs
touch
cancel - fired when a touch point has been disrupted in an implementation-specific manner (for example, too many touch points are created).
...the state changes are starting contact with a touch surface, moving a touch point while maintaining contact with the surface, releasing a touch point and
canceling a touch event.
... // register touch event handlers someelement.addeventlistener('touchstart', process_touchstart, false); someelement.addeventlistener('touchmove', process_touchmove, false); someelement.addeventlistener('touch
cancel', process_touch
cancel, false); someelement.addeventlistener('touchend', process_touchend, false); process an event in an event handler, implementing the application's gesture semantics.
... add touchmove, touchend and touch
cancel event handlers within the touchstart.
UIEvent.initUIEvent() - Web APIs
syntax event.inituievent(type, canbubble,
cancelable, view, detail) parameters type is a domstring defining the type of event.
...
cancelable is a boolean defining whether the event can be
canceled.
... once set, the read-only property event.
cancelable will give its value.
... example var e = document.createevent("uievent"); // creates a click event that bubbles, can be
cancelled, // and with its view and detail property initialized to window and 1, // respectively e.inituievent("click", true, true, window, 1); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'uievent.inituievent()' in that specification.
Window: beforeunload event - Web APIs
the document is still visible and the event is still
cancelable at this point.
... bubbles no
cancelable yes interface event event handler property onbeforeunload this event enables a web page to trigger a confirmation dialog asking the user if they really want to leave the page.
... if the user confirms, the browser navigates to the new page, otherwise it
cancels the navigation.
... window.addeventlistener('beforeunload', (event) => { //
cancel the event as stated by the standard.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
return value the returned timeoutid is a positive integer value which identifies the timer created by the call to settimeout(); this value can be passed to cleartimeout() to
cancel the timeout.
...you may optionally
cancel this timeout by pressing on the second button.
... html <p>live example</p> <button onclick="delayedalert();">show an alert box after two seconds</button> <p></p> <button onclick="clearalert();">
cancel alert before it happens</button> javascript var timeoutid; function delayedalert() { timeoutid = window.settimeout(window.alert, 2*1000, 'that was really slow!'); } function clearalert() { window.cleartimeout(timeoutid); } result see also cleartimeout() example.
...this[sproperty] : this); }).bind(myarray); myboundmethod(); // prints "zero,one,two" because 'this' is bound to myarray in the function myboundmethod(1); // prints "one" settimeout(myboundmethod, 1.0*1000); // still prints "zero,one,two" after 1 second because of the binding settimeout(myboundmethod, 1.5*1000, "1"); // prints "one" after 1.5 seconds notes timeouts are
cancelled using cleartimeout().
Monitoring downloads - Archive of obsolete content
ameter(2, adownload.starttime); statement.execute(); statement.reset(); dbconn.close(); break; // record the completion (whether failed or successful) of the download case components.interfaces.nsidownloadmanager.download_finished: case components.interfaces.nsidownloadmanager.download_failed: case components.interfaces.nsidownloadmanager.download_
canceled: this.logtransfercompleted(adownload); break; } }, we're interested in four states.
... if the download's state indicates that the download is finished,
canceled, or failed, we call our logtransfercompleted routine to update the log to indicate that state change.
...cument.createelement('listcell'); var statusstr; switch(status) { case 0: statusstr = "downloading"; break; case 1: statusstr = "complete"; style = "color:green"; break; case 2: statusstr = "failed"; style = "color:red"; break; case 3: statusstr = "
canceled"; style = "color:purple"; break; case 4: statusstr = "paused"; style = "color:blue"; break; case 5: statusstr = "queued"; style = "color:teal"; break; case 6: statusstr = "blocked"; style = "color:white background-color:red"; break; case 7:...
Supporting private browsing mode - Archive of obsolete content
} };
canceling shutting off private browsing mode extensions can prevent private browsing mode from being shut off.
... to do this, simply watch for the private browsing private-browsing-
cancel-vote notification with the subject "exit", and set its data field to true to
cancel the operation, like this: var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(function (asubject, atopic, adata) { asubject.queryinterface(components.interfaces.nsisupportsprbool); // if another extension has not already
canceled entering the private mode if (!asubject.data) { if (adata == "exit") { // if we are leaving the private mode ...
... /* you should display some user interface here */ asubject.data = true; //
cancel the operation } } }, "private-browsing-
cancel-vote", false); note: a well-mannered extension should display some sort of user interface to indicate that private browsing mode will be kept on, and possibly offer the option to
cancel whatever operation is preventing the extension from allowing private browsing to be shut off.
initInstall - Archive of obsolete content
after calling initinstall, your script must call performinstall or
cancelinstall before it finishes.
... if your script does not call performinstall or
cancelinstall, netscape 6 will not be able to clean up properly after your script finishes.
...err = getlasterror(); if (!err) performinstall(); else
cancelinstall(err); ...
buttons - Archive of obsolete content
cancel: the
cancel button which will
cancel the operation.
...warning: if the accept and
cancel buttons are actually shown is system dependent and is mainly controlled by the value of the boolean preference browser.preferences.instantapply.
...the
cancel button might be shown as an additional possibility to close the dialog in this situation (windows and linux) or might be hidden, too (mac os).
Accesskey display rules - Archive of obsolete content
e.g., when an accesskey of "ok" is 'o' and an accesskey of "キャンセル" (means "
cancel") is 'c', the labels will be "ok(o)" and "キャンセル(c)" on japanese localized build.
...because japanese localizers "&
cancel" need to localize to "キャンセル(&c)".
...for this issue, we recommend the following format if you use .properties: <command-name>.label=
cancel <command-name>.accesskey=c note that apis of nsipromptservice are using the bad way.
Creating a Wizard - Archive of obsolete content
there are also related onwizardback, onwizardnext and onwizard
cancel attributes, which are called when the back, next and
cancel buttons are pressed respectively.
...these methods will be called when the page is hidden or shown, regardless of which button was pressed (except when
cancel is pressed -- you need to use onwizard
cancel to check for this.) these three methods should provide enough flexibility to handle navigation as you need to.
...as soon as one returns false, the navigation will be
cancelled.
The Box Model - Archive of obsolete content
the example below shows a simple login prompt: example 2 : source view <vbox> <hbox> <label control="login" value="login:"/> <textbox id="login"/> </hbox> <hbox> <label control="pass" value="password:"/> <textbox id="pass"/> </hbox> <button id="ok" label="ok"/> <button id="
cancel" label="
cancel"/> </vbox> here four elements have been oriented vertically, two inner hbox tags and two button elements.
...example 3 : source view <vbox> <hbox> <vbox> <label control="login" value="login:"/> <label control="pass" value="password:"/> </vbox> <vbox> <textbox id="login"/> <textbox id="pass"/> </vbox> </hbox> <button id="ok" label="ok"/> <button id="
cancel" label="
cancel"/> </vbox> notice how the text boxes are now aligned with each other.
... </description> <hbox> <label value="search for:" control="find-text"/> <textbox id="find-text"/> </hbox> <hbox> <spacer flex="1"/> <button id="find-button" label="find"/> <button id="
cancel-button" label="
cancel"/> </hbox> </vbox> the vertical box causes the main text, the box with the textbox and the box with the buttons to orient vertically.
wizard - Archive of obsolete content
attributes firstpage, lastpage, pagestep, title, windowtype properties canadvance, canrewind, currentpage, onfirstpage, onlastpage, pagecount, pageindex, pagestep, title, wizardpages methods advance,
cancel, extra1, extra2, getbutton, getpagebyid, goto, rewind examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="thewizard" title="secret code wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function checkcode(){ document.getelementbyid('thewizard').canadvance = (document.getelementbyid('secretc...
... use the can
cancel property to indicate to the user (by disabling the
cancel button) that they cannot can pagestep type: integer the index of the current page.
...
cancel() return type: no return value call this method to
cancel and close the wizard.
Dialogs in XULRunner - Archive of obsolete content
here is an example xul dialog: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,
cancel" buttonlabelaccept="set favorite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabel
cancel="
cancel" buttonaccesskey
cancel="n" ondialog
cancel="return do
cancel();"> <script> function dosave(){ //dosomething() return true; } function do
cancel(){ return true; } </script> <dialogheader title="...
...in an effort to make things easier for developers and more consistent for users, xul has a mechanism to automatically create and position the core dialog buttons ("ok," "
cancel," and "help" for example).
... here is a short list of the button attributes on dialog; see also creating dialogs at mozillazine knowledge base: buttons a comma separated list of buttons to show on dialog (accept,
cancel, help, extra1, and extra2).
Video and Audio APIs - Learn web development
let's step through mediabackward() (the functionality for mediaforward() is exactly the same, but in reverse): we clear any classes and intervals that are set on the fast forward functionality — we do this because if we press the rwd button after pressing the fwd button, we want to
cancel any fast forward functionality and replace it with the rewind functionality.
... if active has been set on the rwd button, we remove it using classlist.remove(), clear the interval that has been set when the button was first pressed (see below for more explanation), and use htmlmediaelement.play() to
cancel the rewind and start the video playing normally.
...how can we fix it so that they
cancel the rwd/fwd button functionality and play/stop the video as you'd expect?
React interactivity: Editing, filtering, conditional rendering - Learn web development
sestate() hook but above the return statement: const editingtemplate = ( <form classname="stack-small"> <div classname="form-group"> <label classname="todo-label" htmlfor={props.id}> new name for {props.name} </label> <input id={props.id} classname="todo-text" type="text" /> </div> <div classname="btn-group"> <button type="button" classname="btn todo-
cancel">
cancel <span classname="visually-hidden">renaming {props.name}</span> </button> <button type="submit" classname="btn btn__primary todo-edit"> save <span classname="visually-hidden">new name for {props.name}</span> </button> </div> </form> ); const viewtemplate = ( <div classname="stack-small"> <div classname="c-cb"> <input ...
... update the "edit" button in the viewtemplate like so: <button type="button" classname="btn" onclick={() => setediting(true)}> edit <span classname="visually-hidden">{props.name}</span> </button> now we'll add the same onclick handler to the "
cancel" button in the editingtemplate, but this time we'll set isediting to false so that it switches us back to the view template.
... update the "
cancel" button in the edittemplate like so: <button type="button" classname="btn todo-
cancel" onclick={() => setediting(false)} >
cancel <span classname="visually-hidden">renaming {props.name}</span> </button> with this code in place, you should be able to press the "edit" and "
cancel" buttons in your todo items to toggle between templates.
Accessible Toolkit Checklist
general dialogs/windows/general escape key
cancels dialogs and refocuses the previously focused on the parent window.
... alt+f4 closes windows, similar to escape but even works on dialogs without
cancel button alt+space opens window menu with restore, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definable.
... lists and combo boxes when a list is tabbed to, select the first item if nothing else is already selected f4, alt+down or alt+up toggle a combo box open and closed escape closes combo box if it was open (be careful not to have it
cancel entire dialog) up/down arrow key navigation.
Addon
overview of required methods void iscompatiblewith(in string appversion, in string platformversion) void findupdates(in updatelistener listener, in integer reason, in string appversion, in string platformversion) overview of optional methods void uninstall() void
canceluninstall() boolean hasresource(in string path) nsiuri getresourceuri(in string path) void getdatadirectory(in datadirectorycallback callback) required properties attribute type description appdisabled read only boolean true if this add-on cannot be used in the application based on version compatibility, dependencies, and blocklist...
... void uninstall( )
canceluninstall()
cancels uninstalling an add-on if it is pending uninstall.
... void
canceluninstall( ) hasresource() checks whether a file resource is available for this add-on.
AddonListener
t) void onenabled(in addon addon) void ondisabling(in addon addon, in boolean needsrestart) void ondisabled(in addon addon) void oninstalling(in addon addon, in boolean needsrestart) void oninstalled(in addon addon) void onuninstalling(in addon addon, in boolean needsrestart) void onuninstalled(in addon addon) void onoperation
cancelled(in addon addon) void onpropertychanged(in addon addon, in string properties[]) methods onenabling() called when an add-on is about to be enabled.
... void onuninstalled( in addon addon, ) parameters addon the addon that has been uninstalled onoperation
cancelled() called when a pending operation for an add-on is
cancelled.
... void onoperation
cancelled( in addon addon, ) parameters addon the addon that has had a pending operation
cancelled onpropertychanged() called when one or more properties of addon has changed.
Add-on Repository
to import the add-on repository code module, use: components.utils.import("resource://gre/modules/addonrepository.jsm"); method overview string getrecommendedurl() string getsearchurl(in string searchterms) void
cancelsearch() void retrieverecommendedaddons(in integer maxresults, in searchcallback callback) void searchaddons(in string searchterms, in integer maxresults, in searchcallback callback) properties property type description homepageurl string the url of the repository site's home page.
...
cancelsearch()
cancels the search in progress.
... void
cancelsearch(); parameters none.
NSS functions
ickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later secmod_addnewmodule mxr 3.3 and later secmod_addnewmoduleex mxr 3.4 and later secmod_deletemoduleex mxr 3.12 and later secmod_
cancelwait mxr 3.9.3 and later secmod_candeleteinternalmodule mxr 3.5 and later secmod_createmodule mxr 3.4 and later secmod_deletemodule mxr 3.4 and later secmod_findmodule mxr 3.4 and later secmod_findslot mxr 3.4 and later secmod_freem...
....2 and later nss_cmscontentinfo_setcontent_digesteddata mxr 3.2 and later nss_cmscontentinfo_setcontent_encrypteddata mxr 3.2 and later nss_cmscontentinfo_setcontent_envelopeddata mxr 3.2 and later nss_cmscontentinfo_setcontent_signeddata mxr 3.2 and later nss_cmsdecoder_
cancel mxr 3.2 and later nss_cmsdecoder_finish mxr 3.2 and later nss_cmsdecoder_start mxr 3.2 and later nss_cmsdecoder_update mxr 3.2 and later nss_cmsdigestcontext_
cancel mxr 3.2 and later nss_cmsdigestcontext_finishmultiple mxr 3.2 and later ...
...ter nss_cmsdigestcontext_update mxr 3.2 and later nss_cmsdigesteddata_create mxr 3.2 and later nss_cmsdigesteddata_destroy mxr 3.2 and later nss_cmsdigesteddata_getcontentinfo mxr 3.2 and later nss_cmsderencode mxr 3.2 and later nss_cmsencoder_
cancel mxr 3.2 and later nss_cmsencoder_finish mxr 3.2 and later nss_cmsencoder_start mxr 3.2 and later nss_cmsencoder_update mxr 3.2 and later nss_cmsencrypteddata_create mxr 3.2 and later nss_cmsencrypteddata_destroy mxr 3.2 and later n...
imgILoader
this means that callers of loadimage should make sure to
cancel() the resulting request before the observer goes away.
...this means that callers of loadimagewithchannel should make sure to
cancel() the resulting request before the observer goes away.
...achannel will be
canceled for you in this case.
nsIChannelEventSink
by calling oldchannel->
cancel() there is a certain freedom in implementing this method: if the return-value indicates success, a callback on callback is required.
... exceptions thrown this method can throw any exception; if an exception occurs, the load will be
canceled, and no network requests will occur for the new channel.
... the redirect will be
canceled.
nsIClipboardDragDropHooks
if there are multiple hooks set for a window, any of them has an opportunity to
cancel the action so no further processing will occur.
...otherwise, false to show the drag is
canceled (does not go to operating system).
...otherwise, false to indicate that the copy/drag is
canceled, does not go to operating system.
nsIDOMMouseScrollEvent
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description ...
...void initmousescrollevent( in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis ); parameters typearg the type of event.
...
cancelablearg specifies whether or not the created event can be
canceled.
nsIDOMOrientationEvent
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean
cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis.
...void initprogressevent( in domstring eventtypearg, in boolean canbubblearg, in boolean
cancelablearg, in double x, in double y, in double z ); parameters eventtypearg the type of event.
...
cancelablearg specifies whether or not the created event can be
canceled.
nsIDOMProgressEvent
method overview void initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type description lengthcomputable boolean specifies whether or not the total size of the transfer is known.
... void initprogressevent( in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg ); parameters typearg the type of event.
...
cancelablearg specifies whether or not the created event can be
canceled.
nsIDOMSimpleGestureEvent
method overview void initsimplegestureevent(in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg); attributes attribute type ...
... void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg ); parameters type...
...arg canbubblearg
cancelablearg viewarg detailarg screenxarg screenyarg clientxarg clientyarg ctrlkeyarg altkeyarg shiftkeyarg metakeyarg buttonarg relatedtargetarg directionarg the value to assign to the direction attribute.
nsIDOMStorageEventObsolete
method overview void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain domstring the domain of the storage area which changed, or "#session" if the event represents a change to session storage.
... void initstorageevent( in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in domstring domainarg ); parameters typearg the type argument.
...
cancelablearg true if the event can be
canceled, otherwise false.
nsIProtocolProxyCallback
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onproxyavailable(in nsi
cancelable arequest, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus); methods onproxyavailable() this method is called when proxy info is available or when an error in the proxy resolution occurs.
... void onproxyavailable( in nsi
cancelable arequest, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus ); parameters arequest the value returned from asyncresolve.
... see also nsi
cancelable nsiuri nsiproxyinfo nsiprotocolproxyservice ...
nsIWorkerMessageEvent
1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean a
cancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data.
... void initmessageevent( in domstring atypearg, in boolean acanbubblearg, in boolean a
cancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg ); parameters atypearg the event type.
... a
cancelablearg whether or not the event can be
canceled.
XUL Overlays
for example, the buttons that appear at the bottom of common dialogs, the ok and
cancel buttons, may be used in dozens of places in the ui.
...the mechanism is the same, however.) any dialog that wants to overlay these buttons just declares the overlay at the top: <?xul-overlay href="chrome://global/content/dialogoverlay.xul"?> and includes an empty box with an id of ok
cancelbuttons in the ui.
... the following snippet shows a dialog with custom ui elements at the top and a reference to the overlay's ok and
cancel buttons at the bottom: <box align="horizontal" id="bx1" flex="100%" style="margin-bottom: 1em; width: 100%;"> <html:input type="checkbox" id="dialog.newwindow"/> <html:label for="dialog.newwindow">&openwin.label;</html:label> <spring flex="100%"/> </box> <box id="ok
cancelbuttons"/> for more detail, see the ok and
cancel button definitions being referenced here in the global component file platformdialogoverlay.xul.
Background Tasks API - Web APIs
the implementation of our shim for
cancelidlecallback() is much simpler: window.
cancelidlecallback = window.
cancelidlecallback || function(id) { cleartimeout(id); } if
cancelidlecallback() isn't defined, this creates one which simply passes the specified callback id through to cleartimeout().
... the window interface is also augmented by this api to offer the new requestidlecallback() and
cancelidlecallback() methods.
... window.requestidlecallback = window.requestidlecallback || function(handler) { let starttime = date.now(); return settimeout(function() { handler({ didtimeout: false, timeremaining: function() { return math.max(0, 50.0 - (date.now() - starttime)); } }); }, 1); }; window.
cancelidlecallback = window.
cancelidlecallback || function(id) { cleartimeout(id); }; managing the task queue next, let's look at the way we manage the tasks that need to be performed.
CloseEvent.initCloseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble,
cancelable, wasclean, reasoncode, reason); parameters type the string to set the event's type to.
...
cancelable whether or not the event's default action can be prevented.
... sets the value of event.
cancelable.
Element: cut event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncut the event's default action is to copy the current selection (if any) to the system clipboard and remove it from the document.
... a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and
cancelling the default action using event.preventdefault().
... note though that
cancelling the default action will also prevent the document from being updated.
HTMLDialogElement.close() - Web APIs
from there you can click the
cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="
cancel" type="reset">
cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var
cancelbutton = document.getelementbyid('
cancel'); var dialog = document.getelementbyid('favdialo...
...; dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form
cancel button closes the dialog box
cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement.open - Web APIs
from there you can click the
cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="
cancel" type="reset">
cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var
cancelbutton = document.getelementbyid('
cancel'); var dialog = document.getelementbyid('favdialo...
...; dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form
cancel button closes the dialog box
cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement.show() - Web APIs
from there you can click the
cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="
cancel" type="reset">
cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var
cancelbutton = document.getelementbyid('
cancel'); var dialog = document.getelementbyid('favdialo...
...; dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form
cancel button closes the dialog box
cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> specifications specification status comment html living standardthe definition of 'show()' in that specification.
HTMLDialogElement.showModal() - Web APIs
from there you can click the
cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="
cancel" type="reset">
cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var
cancelbutton = document.getelementbyid('
cancel'); var dialog = document.getelementbyid('favdialo...
...; dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form
cancel button closes the dialog box
cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement - Web APIs
from there you can click the
cancel button to close the dialog (via the htmldialogelement.close() function), or submit the form via the submit button.
... --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="
cancel" type="reset">
cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var
cancelbutton = document.getelementbyid('
cancel'); var dialog = document.getelementbyid('favdialo...
...; dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form
cancel button closes the dialog box
cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
Dragging and Dropping Multiple Items - Web APIs
to reject the items, either don't
cancel the dragover event, or set the effectallowed property to none.
... you may wish to do both in case another listener has already
cancelled the event.
...utput" style="min-height: 100px; white-space: pre; border: 1px solid black;" ondragenter="document.getelementbyid('output').textcontent = ''; event.stoppropagation(); event.preventdefault();" ondragover="event.stoppropagation(); event.preventdefault();" ondrop="event.stoppropagation(); event.preventdefault(); dodrop(event);"> <div> fix</div> </div> </body> </html> this example
cancels both the dragenter and dragover events by calling the preventdefault().
Basic concepts - Web APIs
success events don't bubble up and they can't be
canceled.
... error events, on the other hand, do bubble, and can be
cancelled.
... this is quite important, as error events abort whatever transactions they're running in, unless they are
cancelled.
MouseEvent.initMouseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble,
cancelable, view, detail, screenx, screeny, clientx, clienty, ctrlkey, altkey, shiftkey, metakey, button, relatedtarget); parameters type the string to set the event's type to.
...
cancelable whether or not the event's default action can be prevented.
... sets the value of event.
cancelable.
PointerEvent - Web APIs
pointer
cancel a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactived).
... pointerout this event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointer
cancel event (see pointer
cancel); when a pen stylus leaves the hover range detectable by the digitizer.
... globaleventhandlers.onpointer
cancel a global event handler for the pointer
cancel event.
Using Pointer Events - Web APIs
function startup() { var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("pointerdown", handlestart, false); el.addeventlistener("pointerup", handleend, false); el.addeventlistener("pointer
cancel", handle
cancel, false); el.addeventlistener("pointermove", handlemove, false); log("initialized."); } this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
... handling
canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be
canceled, the pointer
cancel event is sent, and we call the handle
cancel() function below.
... function handle
cancel(evt) { log("pointer
cancel: id = " + evt.pointerid); var idx = ongoingtouchindexbyid(evt.pointerid); ongoingtouches.splice(idx, 1); // remove it; we're done } since the idea is to immediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment.
ProgressEvent.initProgressEvent() - Web APIs
do not use it anymore, use the standard constructor, progressevent(), to create a synthetic progressevent syntax progress.initprogressevent(typearg, canbubblearg,
cancelablearg, lengthcomputable, loaded, total); parameters typearg is a domstring identifying the specific type of animation event that occurred.
... abort the operation was
cancelled and didn't complete.
...
cancelablearg is a boolean flag indicating if the event associated action can be avoided (true) or not (false).
ReadableStreamDefaultController.close() - Web APIs
if you want to completely get rid of the stream and discard any enqueued chunks, you'd use readablestream.
cancel() or readablestreamdefaultreader.
cancel().
...a
cancel() function is also provided to stop the generation if readablestream.
cancel() is called for any reason.
...e(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(controller) { // we don't really need a pull in this example },
cancel() { // this is called if the reader
cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamsthe definition of 'close()' in that specification.
SVGGraphicsElement: cut event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncut the eventʼs default action is to copy the current selection (if any) to the system clipboard and remove it from the document.
... a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and
cancelling the default action using event.preventdefault().
... note though that
cancelling the default action will also prevent the document from being updated.
SVGSVGElement - Web APIs
svgsvgelement.unsuspendredraw()
cancels a specified suspendredraw() by providing a unique suspend handle id that was returned by a previous suspendredraw() call.
... svgsvgelement.unsuspendredrawall()
cancels all currently active suspendredraw() method calls.
... this method is most useful at the very end of a set of svg dom calls to ensure that all pending suspendredraw() method calls have been
cancelled.
StorageEvent - Web APIs
="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">storageevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} method overview void initstorageevent( in domstring type, in boolean canbubble, in boolean
cancelable, in domstring key, in domstring oldvalue, in domstring newvalue, in usvstring url, in storage storagearea ); attributes attribute type description key domstring represents the key changed.
... syntax storageevent.initstorageevent(type[, canbubble[,
cancelable[, key[, oldvalue[, newvalue[, url[, storagearea]]]]]]]) parameters typearg the name of the event.
...
cancelable optional a boolean indicating whether the event is
cancelable.
Streams API concepts - Web APIs
there are two types of underlying source: push sources constantly push data at you when you’ve accessed them, and it is up to you to start, pause, or
cancel access to the stream.
... there is also a construct you’ll use called a controller — each reader has an associated controller that allows you to control the stream (for example, to
cancel it if wished).
...if you want another reader to start reading your stream, you typically need to
cancel the first reader before you do anything else (although you can tee streams, see the teeing section below) note that there are two different types of readable stream.
Multi-touch interaction - Web APIs
example this example demonstrates using the touchstart, touchmove, touch
cancel, and touchend) touch events for the following gestures: single touch, two (simultaneous) touches, more than two simultaneous touches, 1-finger swipe, and 2-finger move/pinch/swipe.
...the touchend and touch
cancel event types use the same handler.
... function set_handlers(name) { // install event handlers for the given element var el=document.getelementbyid(name); el.ontouchstart = start_handler; el.ontouchmove = move_handler; // use same handler for touch
cancel and touchend el.ontouch
cancel = end_handler; el.ontouchend = end_handler; } function init() { set_handlers("target1"); set_handlers("target2"); set_handlers("target3"); set_handlers("target4"); } move/pinch/zoom handler this function provides very basic support for 2-touch horizontal move/pinch/zoom handling.
Touch events - Web APIs
function startup() { var el = document.getelementbyid("canvas"); el.addeventlistener("touchstart", handlestart, false); el.addeventlistener("touchend", handleend, false); el.addeventlistener("touch
cancel", handle
cancel, false); el.addeventlistener("touchmove", handlemove, false); } document.addeventlistener("domcontentloaded", startup); this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
... handling
canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be
canceled, the touch
cancel event is sent, and we call the handle
cancel() function below.
... function handle
cancel(evt) { evt.preventdefault(); console.log("touch
cancel."); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var idx = ongoingtouchindexbyid(touches[i].identifier); ongoingtouches.splice(idx, 1); // remove it; we're done } } since the idea is to immediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment.
Movement, orientation, and motion: A WebXR example - Web APIs
we record the returned request id in case we need to
cancel the request later.
... function sessionended() { xrbutton.innertext = "enter webxr"; if (animationframerequestid) { xrsession.
cancelanimationframe(animationframerequestid); animationframerequestid = 0; } xrsession = null; } we can also call sessionended() directly if we wish to programmatically end the webxr session.
... in either case, the label of the button is updated to indicate that a click will start a session, and then, if there is a pending request for an animation frame, we
cancel it by calling
cancelanimationframe once that's done, the value of xrsession is changed to null to indicate that we're done with the session.
Using the Web Animations API - Web APIs
animation.
cancel() aborts the animation and removes its effects.
... on
cancel is the event handler for the
cancel event and can be triggers with
cancel().
... nommingcake.onfinish = endgame; drinking.onfinish = endgame; // ...or alice reaches the end of her animation alicechange.onfinish = endgame; better still, the web animations api also provides a finish promise that will resolve when the animation finishes, or reject if it is
canceled.
Window: unhandledrejection event - Web APIs
bubbles no
cancelable yes interface promiserejectionevent event handler property onunhandledrejection usage notes allowing the unhandledrejection event to bubble will eventually result in an error message being output to the console.
...you can prevent that from happening by adding a handler for unhandledrejection events that—in addition to any other tasks you wish to perform—calls preventdefault() to
cancel the event, preventing it from bubbling up to be handled by the runtime's logging code.
... this works because unhandledrejection is
cancelable.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
the cleartimeout() method of the windoworworkerglobalscope mixin
cancels a timeout previously established by calling settimeout().
... syntax scope.cleartimeout(timeoutid) parameters timeoutid the identifier of the timeout you want to
cancel.
... var alarm = { remind: function(amessage) { alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.
cancel(); } this.timeoutid = window.settimeout(function(msg) { this.remind(msg); }.bind(this), 1000, 'wake up!'); },
cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown.
Using XMLHttpRequest - Web APIs
load the transfer is complete; all data is now in the response var oreq = new xmlhttprequest(); oreq.addeventlistener("progress", updateprogress); oreq.addeventlistener("load", transfercomplete); oreq.addeventlistener("error", transferfailed); oreq.addeventlistener("abort", transfer
canceled); oreq.open(); // ...
... } else { // unable to compute progress information since the total size is unknown } } function transfercomplete(evt) { console.log("the transfer is complete."); } function transferfailed(evt) { console.log("an error occurred while transferring the file."); } function transfer
canceled(evt) { console.log("the transfer has been
canceled by the user."); } lines 3-6 add event listeners for the various events that are sent while performing a data transfer using xmlhttprequest.
...the upload events are fired on the xmlhttprequest.upload object, as shown below: var oreq = new xmlhttprequest(); oreq.upload.addeventlistener("progress", updateprogress); oreq.upload.addeventlistener("load", transfercomplete); oreq.upload.addeventlistener("error", transferfailed); oreq.upload.addeventlistener("abort", transfer
canceled); oreq.open(); note: progress events are not available for the file: protocol.
XRSession.onsqueezeend - Web APIs
if heldobject has an object reference, that object is passed to a function called
cancelobjectdrag(), which would be written to return the object to its original position.
... this takes care of the situation in which the drag is aborted or
canceled.
... xrsession.onsqueezeend = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace; if (user.heldobject) {
cancelobjectdrag(user.heldobject); } } }; this code presumes that if the user actually intentionally completed the drag, user.heldobject will be null here.
Creating a cross-browser video player - Developer guides
fullscreen the fullscreen api should be straight forward to use: the user clicks a button, if the video is in fullscreen mode:
cancel it, otherwise enter fullscreen mode.
...ke the other buttons, a click event handler is attached in which we call a user defined function handlefullscreen: fullscreen.addeventlistener('click', function(e) { handlefullscreen(); }); the handlefullscreen function is defined as follows: var handlefullscreen = function() { if (isfullscreen()) { if (document.exitfullscreen) document.exitfullscreen(); else if (document.moz
cancelfullscreen) document.moz
cancelfullscreen(); else if (document.webkit
cancelfullscreen) document.webkit
cancelfullscreen(); else if (document.msexitfullscreen) document.msexitfullscreen(); setfullscreendata(false); } else { if (videocontainer.requestfullscreen) videocontainer.requestfullscreen(); else if (videocontainer.mozrequestfullscreen) videocontainer.mozreque...
...interestingly document must be used for exiting/
cancelling fullscreen mode, whereas any html element can request fullscreen mode, here the videocontainer is used as it also contains the custom controls which should also appear with the video in fullscreen mode.
Creating and triggering events - Developer guides
function simulateclick() { const event = new mouseevent('click', { view: window, bubbles: true,
cancelable: true }); const cb = document.getelementbyid('checkbox'); const
cancelled = !cb.dispatchevent(event); if (
cancelled) { // a handler called preventdefault.
... alert("
cancelled"); } else { // none of the handlers called preventdefault.
... alert("not
cancelled"); } } ...
timers - Archive of obsolete content
example var { settimeout, cleartimeout } = require("sdk/timers"); var id = settimeout(function() { // do something in 1 sec }, 1000); // to stop/
cancel this timeout cleartimeout(id); setinterval(callback, ms) schedules callback to be called repeatedly every ms milliseconds.
... example var { setinterval, clearinterval } = require("sdk/timers"); var id = setinterval(function() { // do something every 1 sec // to stop/
cancel this interval clearinterval(id); }, 1000); ...
Adding Events and Commands - Archive of obsolete content
you can capture and
cancel events during any of these phases, provided that they aren't
canceled before they reach the point where you intended to capture them.
... in general, you should avoid adding event handlers in the capturing phase, or
canceling events.
Updating addons broken by private browsing changes - Archive of obsolete content
idownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityservice ff 20: nsiprivatebrowsingservice nsirecentbadcertservice furthermore, if your code uses any of these common chrome apis: ff 19: saveurl saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsingui finally, if your code watches for any of these observer notifications: private-browsing private-browsing-
cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will require updating to correctly support the new per-window private browser feature in firefox 20 (and will require updating to work correctly in releases of firefox since the ones listed).
... nsidownload now has retry,
cancel, remove, pause, and resume methods which should be used instead of deprecated similarly-named nsidownloadmanager methods.
MozBeforeResize - Archive of obsolete content
general info specification mozilla specific interface event bubbles no
cancelable no target window default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
cached - Archive of obsolete content
general info specification offline interface event bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
checking - Archive of obsolete content
general info specification offline interface event bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
downloading - Archive of obsolete content
general info specification offline interface event bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
error - Archive of obsolete content
general info specification offline interface event bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
noupdate - Archive of obsolete content
general info specification offline interface event bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
obsolete - Archive of obsolete content
general info specification offline interface event bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
progress - Archive of obsolete content
general info specification offline interface progressevent bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
updateready - Archive of obsolete content
general info specification offline interface event bubbles no
cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
...
cancelable boolean is it possible to
cancel the event?
Install.js - Archive of obsolete content
this.profileinstall = install.confirm('install ' + this.extfullname + ' ' + this.extversion + ' to your profile directory (ok) or your browser directory (
cancel)?'); } // init install var dispname = this.extfullname + ' ' + this.extversion; var regname = '/' + this.extauthor + '/' + this.extshortname; install.initinstall(dispname, regname, this.extversion); // find directory to install into var installpath; if (this.profileinstall) installpath = profiledir; else installpath = install.getfolder('chrome'); // add jar file ins...
...arguments; if (args == 'p=0') { this.profileinstall = false; this.silentinstall = true; } else if (args == 'p=1') { this.profileinstall = true; this.silentinstall = true; } }, handleerror: function(err) { if (!this.silentinstall) { install.alert('error: could not install ' + this.extfullname + ' ' + this.extversion + ' (error code: ' + err + ')'); } install.
cancelinstall(err); } }; xpiinstaller.install(); ...
Download Manager preferences - Archive of obsolete content
0 indicates that the downloads should be paused and resumed automatically the next time firefox is run; 1 indicates that the downloads should be paused but will not automatically resume when the application is restarted; and 2 indicates that the downloads will be
canceled on quit.
...0 indicates that the download should be removed upon completion; 1 indicates that completed and
canceled downloads should be removed on quit; 2 indicates that downloads should never be removed automatically.
generateCRMFRequest() - Archive of obsolete content
the dialog describes the key generation process and gives the user the opportunity to
cancel the operation.
... "error:user
cancel" the user has
canceled the key generation operation "error:internalerror" the software encountered some internal error, such as out of memory ...
Tamarin Build System Documentation - Archive of obsolete content
build when all build slaves are idle the next build begins before the build begins buildbot waits for 2 minutes of no checkin activity the build system prioritizes tamarin-redux checkins over sandbox builds when several tamarin-redux checkins occur the newest change is built including all checkins since the last build each sandbox build occurs in the order they were submitted, the submitter may
cancel a build.
... if buildbot is busy the queue is displayed http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm the submitter of a sandbox build may remove a build request by clicking on the
cancel button tamarin-redux builds are higher priority than sandbox builds, they cannot be removed but the most checkin including all new checkins are built how can i run buildbot scripts locally?
Using XPInstall to Install Plugins - Archive of obsolete content
here is an example: var plid = "myplugin.plug/version=6.5"; err = initinstall(software_name, plid, version); if (err != 0) { // install may have failed because of n6 and = // replace plid with a simple string err = initinstall(software_name, "mypluginstring", version); if (err != 0)
cancelinstall(err); } note that above, the plid contains an "=" and in case the xpi package is running on browsers that treat "=" as an illegal token, the workaround is to handle the error and invoke initinstall again.
... err = getlasterror(); if (!err) performinstall(); else
cancelinstall(err); installing plugin files to the current browser installing to the current browser is the task that is the most important for the xpi package to succeed in.
Windows Install - Archive of obsolete content
note the disk space verification, the editing of the windows registry, the writing to the installation log, and the error checking before either performinstall or
cancelinstall is called.
..., "bin", // dir name in jar to extract fprogram, // where to put this file // (returned from getfolder) "", // subdir name to create relative to fprogram true); // force flag logcomment("adddirectory() returned: " + err); // check return value if(err == success) { err = performinstall(); logcomment("performinstall() returned: " + err); } else
cancelinstall(err); } else
cancelinstall(insufficient_disk_space); // end main ...
Methods - Archive of obsolete content
cancelinstall aborts the installation of the software.
... confirm displays a confirm dialog box with the specified message and ok and
cancel buttons.
Return Codes - Archive of obsolete content
no_matching_certificate -206 extracted file was not signed by the certificate used to sign the installation script cant_read_archive -207 xpi package cannot be read invalid_arguments -208 bad parameters to a function illegal_relative_path -209 illegal relative path user_
cancelled -210 user clicked
cancel on install dialog install_not_started -211 a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 the silent installation privilege has not been granted.
... filename_already_used -226 same filename being used in install install_
cancelled -227 raised when installation is
cancelled in medias res.
accesskey - Archive of obsolete content
for example, when an the accesskey for an 'ok' button is 'o', and the accesskey for the button labeled 'キャンセル' (which means '
cancel') is 'c', the labels will be 'ok(o)' and 'キャンセル(c)'.
... example <vbox> <label value="enter name" accesskey="e" control="myname"/> <textbox id="myname"/> <button label="
cancel" accesskey="n"/> <button label="ok" accesskey="o"/> </vbox> see also label attribute acceltext attribute xul accesskey faq and policies ...
Attribute (XUL) - Archive of obsolete content
« xul reference home acceltext accessible accesskey activetitlebarcolor afterselected align allowevents allownegativeassertions alternatingbackground alwaysopenpopup attribute autocheck autocompleteenabled autocompletepopup autocompletesearch autocompletesearchparam autofill autofillaftermatch autoscroll beforeselected buttonaccesskeyaccept buttonaccesskey
cancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabel
cancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed colo...
...gth maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialog
cancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizard
cancel onwizard...
CheckboxStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean is it possible to
cancel the event?
DOMMenuItemActive - Archive of obsolete content
general info specification xul interface event bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
DOMMenuItemInactive - Archive of obsolete content
general info specification xul interface event bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
RadioStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean is it possible to
cancel the event?
ValueChange - Archive of obsolete content
general info specification xul interface event bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean is it possible to
cancel the event?
broadcast - Archive of obsolete content
general info specification xul interface event bubbles no
cancelable no target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
close - Archive of obsolete content
general info specification xul interface event bubbles no
cancelable no target window default action the window is closed.
...
cancelable read only boolean whether the event is
cancellable or not.
command - Archive of obsolete content
general info specification xul interface xulcommandevent bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... bubbles read only boolean whether the event normally bubbles or not
cancelable read only boolean whether the event is
cancellable or not?
commandupdate - Archive of obsolete content
general info specification xul interface event bubbles no
cancelable no target element default action none.
...
cancelable read only boolean whether the event is
cancellable or not.
popuphidden - Archive of obsolete content
general info specification xul interface popupevent bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
popuphiding - Archive of obsolete content
general info specification xul interface popupevent bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
popupshowing - Archive of obsolete content
general info specification xul interface popupevent bubbles yes
cancelable yes target element default action a popup is displayed properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
popupshown - Archive of obsolete content
general info specification xul interface popupevent bubbles yes
cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
ContextMenus - Archive of obsolete content
to
cancel a context menu event, you can use the preventdefault method of the event object.
... function checkcontextmenu(event) { if (event.target.localname == "textbox") event.preventdefault(); } function init() { var container = document.getelementbyid("container"); container.addeventlistener("contextmenu", checkcontextmenu, true); } the 'checkcontextmenu' function checks to see if the textbox was the target of the context menu and, if so,
cancels the event using the preventdefault method.
Menus - Archive of obsolete content
the user may select a command to invoke it, or may
cancel the operation by pressing escape or clicking outside the menu.
...when a menu command is selected or the menu is
cancelled, the menupopup disappears from the screen again.
OpenClose - Archive of obsolete content
the user may
cancel selecting a command from a menu by pressing the escape key.
...a user may also
cancel selecting from a menu by clicking outside the menu.
PopupEvents - Archive of obsolete content
the popuphiding event is fired regardless of how the popup was hidden, whether because the user selected an item from a menu, or if the user clicked outside the popup, or if the user pressed escape to
cancel the menu.
...you also cannot
cancel the hiding of a menupopup when a user has made a selection from a menu, as it is already too late to do so.
Localization - Archive of obsolete content
"&bytes.before;2520&bytes.after;"/> </treerow> </treeitem> </treechildren> </tree> <splitter id="splitbar" resizeafter="grow" style="display: none;"/> <spacer class="titlespace"/> <hbox> <progressmeter id="progmeter" value="50%" style="display: none;"/> <spacer flex="1"/> <button id="find-button" label="&button.find;" oncommand="dofind()"/> <button id="
cancel-button" label="&button.
cancel;" oncommand="window.close();"/> </hbox> </vbox> </window> each text string has been replaced by an entity reference.
..."size"> <!entity type.date "date modified"> <!entity mode.is "is"> <!entity mode.isnot "is not"> <!entity casesensitive "case sensitive search"> <!entity matchfilename "match entire filename"> <!entity results.filename "filename"> <!entity results.location "location"> <!entity results.size "size"> <!entity bytes.before ""> <!entity bytes.after "bytes"> <!entity button.find "find"> <!entity button.
cancel "
cancel"> now, to add text for a new language all you need to do is create another dtd file.
Open and Save Dialogs - Archive of obsolete content
return
cancel - the user pressed
cancel.
... var res = fp.show(); if (res != nsifilepicker.return
cancel){ var thefile = fp.file; // --- do something with the file here --- } next, we'll see how to create a wizard.
Using the Editor from XUL - Archive of obsolete content
in both cases, the editorcanclose() method is the javascript is called, which causes the nseditorshell to display a dialog asking the user if they want to save the document, throw away their changes, or
cancel.
... note that if they
cancel, the close operation is aborted.
XUL Questions and Answers - Archive of obsolete content
possible values include: accept,
cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network.
... this problem can be solved by capturing the focus events and giving the focus to another xul element or capturing and
canceling the keypress events.
button - Archive of obsolete content
cancel the
cancel button which will
cancel the operation.
...possible values include: accept,
cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network.
2006-09-29 - Archive of obsolete content
27 status meeting
cancelled most of the mozilla calendar participants were unavailable during sept.
... 27, the meeting was
cancelled and rescheduled for a later date.
Debug - Archive of obsolete content
2 debug.ms_async_callback_status_
cancel the synchronous work item was
canceled.
... 1 debug.ms_async_op_status_
canceled the asynchronous operation was
canceled.
Mobile touch controls - Game development
pure javascript approach we could implement touch events on our own — setting up event listeners and assigning relevant functions to them would be quite straightforward: var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("touchstart", handlestart); el.addeventlistener("touchmove", handlemove); el.addeventlistener("touchend", handleend); el.addeventlistener("touch
cancel", handle
cancel); this way, touching the game's <canvas> on the mobile screen would emit events, and thus we could manipulate the game in any way we want (for example, moving the space ship around).
... touchmove is fired when they move the finger on the screen while touching it touchend is fired when the user stops touching the screen touch
cancel is fired when a touch is
cancelled, for example when the user moves their finger outside of the screen.
JavaScript basics - Learn web development
when you run the example and get the dialog box that prompts you to enter your user name, try pressing the
cancel button.
...this happens because—when you
cancel the prompt—the value is set as null.
Drawing graphics - Learn web development
the loop ends when you stop calling requestanimationframe() or if you call window.
cancelanimationframe() after calling requestanimationframe() but before the frame is called.
... note: it's good practice to call
cancelanimationframe() from your main code when you're done using the animation, to ensure that no updates are still waiting to be run.
Accessibility in React - Learn web development
moving focus back to the edit button at first glance, getting react to move focus back to our "edit" button when the edit is saved or
cancelled appears deceptively easy.
... again try using the "edit" and "
cancel" buttons to toggle between the templates of your <todo /> component; you'll see the browser focus indicator move appropriately, without the problem we discussed at the start of this section.
Starting our Svelte Todo list app - Learn web development
<div class="stack-small"> <form class="stack-small"> <div class="form-group"> <label for="todo-1" class="todo-label"> new name for 'create a svelte starter app' </label> <input type="text" id="todo-1" autocomplete="off" class="todo-text" /> </div> <div class="btn-group"> <button class="btn todo-
cancel" type="button">
cancel <span class="visually-hidden">renaming create a svelte starter app</span> </button> <button class="btn btn__primary todo-edit" type="submit"> save <span class="visually-hidden">new name for create a svelte starter app</span> </button> </div> </form> </div> ...
... when the task is being edited, the list item has an input and two button to
cancel or save modifications.
Application cache implementation overview
on
canceled state loadcompleted invokes onerror event and 'finishes' the update (what transits the state to finished).
...
canceled can be set only by call to nsofflinecacheupdate::
cancel() public method that also
cancels all running items downloads immediately.
Eclipse CDT Manual Setup
(if an "indexing" item starts after the "refreshing the workspace" item has finished, click the little red box beside that item to
cancel it, since we want to configure the project before the indexer runs.) initial project properties so that the indexer will run faster and give better results, and so that eclipse doesn't give results for irrelevant files, you should add some resource filters to have eclipse ignore certain non-source files and directories.
...if indexing started automatically (see the progress tab),
cancel it, since there seems to be a bug that makes it give bad results when it starts automatically at this stage.
Frame script loading and lifetime
if you use allowdelayedload, you can
cancel it by using removedelayedframescript: var mm = window.messagemanager; mm.removedelayedframescript("chrome://my-e10s-extension/content/frame-script.js"); this means we will stop loading the script into new tabs.
...ner('unload', function(aevent) { if (aevent.target == gcontentframemessagemanager) { sendasyncmessage('my-addon-id', 'framescript-died'); // if you did not set third argument of `services.mm.addmessagelistener` to `true`, then this will fail to send a message } }, false); note about unload during uninstallation/upgrade when your add-on is uninstalled, or disabled, you should:
cancel it, if you have used allowdelayedload, by calling removedelayedframescript; ensuring the frame script is not loaded into any new tabs.
mozbrowseractivitydone
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserasyncscroll
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowseraudioplaybackchange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsercaretstatechanged
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserclose
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsercontextmenu
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserdocumentfirstpaint
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsererror
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserfindchange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserfirstpaint
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsericonchange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserloadend
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserloadstart
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserlocationchange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsermanifestchange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsermetachange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowseropensearch
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowseropentab
the mozbrowseropentab event is fired when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowseropenwindow
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserresize
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserscroll
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserscrollareachanged
this can occur on resize and when the page size changes (while loading for example.) general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserscrollviewchange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsersecuritychange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowserselectionstatechanged
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsershowmodalprompt
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowsertitlechange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
mozbrowservisibilitychange
general info specification non standard interface customevent bubbles yes
cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...
cancelable read only boolean whether the event is
cancellable or not.
MozScrolledAreaChanged
specification mozilla specific interface uievent bubbles yes
cancelable yes target defaultview, document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
...
cancelableread only boolean whether the event is
cancellable or not.
smartcard-insert
the smartcard-insert event is fired when the insertion of a smart card has been detected specification mozilla specific interface event bubbles no
cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
...
cancelableread only boolean whether the event is
cancellable or not.
smartcard-remove
specification mozilla specific interface event bubbles no
cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
...
cancelableread only boolean whether the event is
cancellable or not.
HTTP Cache
external
canceling of the loading channel) concurrent readers would not be able to reach the remaning unread content.
... this could be improved by keeping the network load running and being stored to the cache entry even after the writing channel has been
canceled.
Webapps.jsm
) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp)
canceldownload: function
canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: fun...
...ction(windowid) popcontentaction: function(windowid) action
cancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _getrequestchannel: function(afullpackagepath, aislocalfileinstall, aoldapp,) _senddownloadprogressevent: function(anewapp, aprogress) _getpackage: function(arequestchannel, aid, aoldapp, anewapp) _computefilehash: function(afilepath) _sendappliedevent: function(aap...
L20n HTML Bindings
consider the following source html: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-
cancel"></a> </p> assume the following malicious translation: <save """ <input value="save" type="text"> or <a href="http://myevilwebsite.com" onclick="alert('pwnd!')" title="back to the homepage">
cancel</a>.
... """> the result will be: <p data-l10n-id="back"> <input value="save" type="submit"> or <a href="/main" class="btn-
cancel" title="back to the homepage">
cancel</a>.
Index
return codes o 0 - no error o 1 - user
cancelled o 2 - usage error o 6 - nls init error o 8 - certificate db open error o 9 - key db open error o 10 - file initialization error o 11 - unicode conversion error o 12 - temporary file creation error o 13 - pkcs11 get slot error o 14 - pkcs12 decoder start error o 15 - error read from import file o 16 - pkcs12 decode error o ...
... 229 fc_
cancelfunction nss no summary!
sslerr.html
e with export regulations." ssl_error_protocol_version_alert -12190 "peer reports incompatible or unsupported protocol version." ssl_error_insufficient_security_alert -12189 "server requires ciphers more secure than those supported by client." ssl_error_internal_error_alert -12188 "peer reports it experienced an internal error." ssl_error_user_
canceled_alert -12187 "peer user
canceled handshake." ssl_error_no_renegotiation_alert -12186 "peer does not permit renegotiation of ssl security parameters." ssl_error_unsupported_extension_alert -12184 "ssl peer does not support requested tls hello extension." ssl_error_certificate_unobtainable_alert -12183 "ssl peer could not obtain your certificate ...
... sec_error_user_
cancelled -8105 the user clicked
cancel.
S/MIME functions
.2 and later nss_cmscontentinfo_setcontent_digesteddata mxr 3.2 and later nss_cmscontentinfo_setcontent_encrypteddata mxr 3.2 and later nss_cmscontentinfo_setcontent_envelopeddata mxr 3.2 and later nss_cmscontentinfo_setcontent_signeddata mxr 3.2 and later nss_cmsdecoder_
cancel mxr 3.2 and later nss_cmsdecoder_finish mxr 3.2 and later nss_cmsdecoder_start mxr 3.2 and later nss_cmsdecoder_update mxr 3.2 and later nss_cmsdigestcontext_
cancel mxr 3.2 and later nss_cmsdigestcontext_finishmultiple mxr 3.2 and later ...
...ter nss_cmsdigestcontext_update mxr 3.2 and later nss_cmsdigesteddata_create mxr 3.2 and later nss_cmsdigesteddata_destroy mxr 3.2 and later nss_cmsdigesteddata_getcontentinfo mxr 3.2 and later nss_cmsderencode mxr 3.2 and later nss_cmsencoder_
cancel mxr 3.2 and later nss_cmsencoder_finish mxr 3.2 and later nss_cmsencoder_start mxr 3.2 and later nss_cmsencoder_update mxr 3.2 and later nss_cmsencrypteddata_create mxr 3.2 and later nss_cmsencrypteddata_destroy mxr 3.2 and later n...
Necko Interfaces Overview
channel is used to download the resource once) download initiated via nsichannel::asyncopen method can be
canceled via nsirequest::
cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg.
...fies completion of async download, possibly w/ error nsiloadgroup : nsirequest attribute of a nsirequest channel impl adds itself to its load group during invocation of asyncopen channel impl removes itself from its load group when download completes load groups in gecko own all channels used to load a particular page (until the channels complete) all channels owned by a load group can be
canceled at once via the load group's nsirequest::
cancel method nsitransport represents a physical connection, such as a file descriptor or a socket used directly by protocol handler implementations (as well as by mailnews and chatzilla) synchronous i/o methods: openinputstream, openoutputstream asynchronous i/o methods: asyncread, asyncwrite nsitransport::asyncread takes a nsistreamlistener par...
How to embed the JavaScript engine
*/ ok = js_callfunctionname(cx, target, "onclick", argv, &rval); /* now test rval to see whether we should
cancel the event.
... */ if (rval.isboolean() && !rval.toboolean())
cancelevent(event); again, i've elided error checking (such as testing for !ok after the call), and i've faked up some c event management routines that emulate the dom's convention of
canceling an event if its handler returns false.
extIApplication
it is possible for the shutdown to be
canceled.
...it is possible for the restart to be
canceled.
nsIBadCertListener2
it can also be used to obtain the ssl handshake status of a connection that will be
canceled because of improper certificate status.
... return value the consumer shall return true if it wants to suppress the error message related to the bad cert (the connection will still get
canceled).
nsIDNSListener
inherits from: nsisupports last changed in gecko 1.7 method overview void onlookupcomplete(in nsi
cancelable arequest, in nsidnsrecord arecord, in nsresult astatus); methods onlookupcomplete() called when an asynchronous host lookup completes.
... void onlookupcomplete( in nsi
cancelable arequest, in nsidnsrecord arecord, in nsresult astatus ); parameters arequest the value returned from asyncresolve.
nsIDNSRequest
inherits from: nsisupports last changed in gecko 1.7 method overview void
cancel(); methods
cancel() called to
cancel a pending asynchronous dns request.
...void
cancel(); parameters none.
nsIDOMMozTouchEvent
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidommouseevent method overview void initmoztouchevent(in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolea...
...void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long streamidarg ); parameters streamidarg the value to assig...
nsIDOMWindowUtils
wheel_event_expected_overflow_delta_y_positive 0x0200 wheel_event_expected_overflow_delta_y_negative 0x0400 mousescroll_prefer_widget_at_point 1 mousescroll_scroll_lines 2 mousescroll_win_scroll_lparam_not_null 65536 touch_hover 1 touch_contact 2 touch_remove 4 touch_
cancel 8 ime_status_disabled 0 users cannot use ime at all.
...this must be one of "touchstart", "touchend", "touchmove", or "touch
cancel".
nsIDownload
completed states are nsidownloadmanager::download_finished, nsidownloadmanager::download_failed, and nsidownloadmanager::download_
canceled.
...
cancelable nsi
cancelable an object that can be used to
cancel the download.
nsILoginManagerCrypto
can throw if the user
cancels entry of their master password, or if the ciphertext value can not be successfully decrypted (for example, if it was encrypted with some other key).
...can throw if the user
cancels entry of their master password.
All keyboard shortcuts - Firefox Developer Tools
command windows macos linux select the element under the mouse and
cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane.
...+ e execute the current expression enter return enter add a new line, for entering multiline expressions shift + enter shift + return shift + enter autocomplete popup these shortcuts apply while the autocomplete popup is open: command windows macos linux choose the current autocomplete suggestion tab tab tab
cancel the autocomplete popup esc esc esc move to the previous autocomplete suggestion up arrow up arrow up arrow move to the next autocomplete suggestion down arrow down arrow down arrow page up through autocomplete suggestions page up page up page up page down through autocomplete suggestions page down page down page down...
Animation - Web APIs
event handlers animation.on
cancel gets and sets the event handler for the
cancel event.
... methods animation.
cancel() clears all keyframeeffects caused by this animation and aborts its playback.
AnimationEvent.initAnimationEvent() - Web APIs
syntax animationevent.initanimationevent(typearg, canbubblearg,
cancelablearg, animationnamearg, elapsedtimearg); parameters typearg a domstring identifying the specific type of animation event that occurred.
...
cancelablearg a boolean flag indicating if the event associated action can be avoided (true) or not (false).
AudioParam - Web APIs
audioparam.
cancelscheduledvalues()
cancels all scheduled future changes to the audioparam.
... audioparam.
cancelandholdattime()
cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods.
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg,
cancelablearg, viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
...
cancelablearg a boolean shether or not the event can be
canceled.
CustomEvent.initCustomEvent() - Web APIs
syntax event.initcustomevent(type, canbubble,
cancelable, detail); parameters type is a domstring containing the name of the event.
...
cancelable is a boolean indicating whether the event is
cancelable.
DataTransfer - Web APIs
datatransfer.mozuser
cancelled read only this property applies only to the dragend event, and is true if the user
canceled the drag operation by pressing escape.
... living standard mozcursor, mozitemcount, mozsourcenode, mozuser
cancelled, addelement(), mozcleardataat(), mozgetdataat(), mozsetdataat() and moztypesat are gecko specific.
DedicatedWorkerGlobalScope - Web APIs
windowtimers.clearinterval()
cancels the repeated execution set using windowtimers.setinterval().
... windowtimers.cleartimeout()
cancels the repeated execution set using windowtimers.settimeout().
Document: pointermove event - Web APIs
the pointermove event is fired when a pointer changes coordinates, and the pointer has not been
canceled by a browser touch-action.
... bubbles yes
cancelable yes interface pointerevent event handler property onpointermove examples using addeventlistener(): document.addeventlistener('pointermove', (event) => { console.log('pointer moved'); }); using the onpointermove event handler property: document.onpointermove = (event) => { console.log('pointer moved'); }; specifications specification status pointer events obsolete ...
Document: pointerout event - Web APIs
the pointerout event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointer
cancel event (see pointer
cancel); when a pen stylus leaves the hover range detectable by the digitizer.
... bubbles yes
cancelable yes interface pointerevent event handler property onpointerout examples using addeventlistener(): document.addeventlistener('pointerout', (event) => { console.log('pointer moved out'); }); using the onpointerout event handler property: document.onpointerout = (event) => { console.log('pointer moved out'); }; specifications specification status pointer events obsolete ...
Document: selectstart event - Web APIs
if the event is
canceled, the selection is not changed.
... bubbles yes
cancelable yes interface event event handler property onselectstart examples // addeventlistener version document.addeventlistener('selectstart', () => { console.log('selection started'); }); // onselectstart version document.onselectstart = () => { console.log('selection changed.'); }; specifications specification status comment selection apithe definition of 'selectstart' in that specification.
Document: transitionend event - Web APIs
bubbles yes
cancelable yes interface transitionevent event handler property ontransitionend the transitionend event is fired in both directions - as it finishes transitioning to the transitioned state, and when it fully reverts to the default or non-transitioned state.
...if the transition
cancel event is fired, the transitionend event will not fire.
EffectTiming.fill - Web APIs
elem.style.transform = 'translatey(100px)'; elem.animate({ transform: 'none', offset: 0 }, 200); for some complex effects where animations layer on top of one another, it may be necessary to use a fill mode temporarily to capture the final value of an animation before
canceling it.
... animation.commitstyles(); animation.
cancel(); }); specifications specification status comment web animationsthe definition of 'fill' in that specification.
Element: MSGestureHold event - Web APIs
bubbles unknown
cancelable unknown interface msgestureevent event handler property unknown the uievent.detail property of an msgesturehold event has 3 possible values: msgesture_flag_begin this value indicates that the user started contacting the touch surface.
... msgesture_flag_end & msgesture_flag_
cancel (bitwise and-ed together) this value indicates that the user has moved their finger, regardless of whether they also stopped touching the touch surface specifications not part of any specification.
Element: compositionend event - Web APIs
the compositionend event is fired when a text composition system such as an input method editor completes or
cancels the current composition session.
... bubbles yes
cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionend', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"><...
Element: copy event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncopy the event's default action is to copy the selection (if any) to the clipboard.
... a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and
cancelling the event's default action using event.preventdefault().
Element: fullscreenchange event - Web APIs
bubbles yes
cancelable no interface event event handler property onfullscreenchange this event is sent to the element which is transitioning into or out of full-screen mode.
...on the other hand, if document.fullscreenelement is null, full-screen mode has been
canceled.
Element: mouseenter event - Web APIs
bubbles no
cancelable no interface mouseevent event handler property onmouseenter usage notes though similar to mouseover, mouseenter differs in that it doesn't bubble and it isn't sent to any descendants when the pointer is moved from one of its descendants' physical space to its own physical space.
... a single mouseover event is sent to the deepest element of the dom tree, then it bubbles up the hierarchy until it is
canceled by a handler or reaches the root.
Element: mouseleave event - Web APIs
bubbles no
cancelable no interface mouseevent event handler property onmouseleave mouseleave and mouseout are similar but differ in that mouseleave does not bubble and mouseout does.
... one single mouseout event is sent to the deepest element of the dom tree, then it bubbles up the hierarchy until it is
canceled by a handler or reaches the root.
Element: paste event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property onpaste if the cursor is in an editable context (for example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position.
... to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must
cancel the default action using event.preventdefault(), and then insert its desired data manually.
Event() - Web APIs
cancelable optional a boolean indicating whether the event can be
cancelled.
... example // create a look event that bubbles up and cannot be
canceled const evt = new event("look", {"bubbles":true, "
cancelable":false}); document.dispatchevent(evt); // event can be dispatched from any element, not only the document mydiv.dispatchevent(evt); specifications specification status comment domthe definition of 'event()' in that specification.
EventTarget.addEventListener() - Web APIs
(function() { if (!event.prototype.preventdefault) { event.prototype.preventdefault=function() { this.returnvalue=false; }; } if (!event.prototype.stoppropagation) { event.prototype.stoppropagation=function() { this.
cancelbubble=true; }; } if (!element.prototype.addeventlistener) { var eventlisteners=[]; var addeventlistener=function(type,listener /*, usecapture (will be ignored) */) { var self=this; var wrapper=function(e) { e.target=e.srcelement; e.currenttarget=self; if (typeof listener.handleevent != 'undefined') { listener.handleevent(e); }...
...since it can't be
canceled, event listeners can't block page rendering anyway.
EventTarget.dispatchEvent() - Web APIs
syntax
cancelled = !target.dispatchevent(event) parameter event is the event object to be dispatched.
... return value the return value is false if event is
cancelable and at least one of the event handlers which received event called event.preventdefault().
Fullscreen API - Web APIs
no support 9 — 65alternate name alternate name uses the non-standard name: moz
cancelfullscreenie full support 11alternate name full support 11alternate name alternate name uses the non-standard name: msexitfullscreenopera full support 15prefixed full support 15prefixed prefixed implemented with the ve...
... no support 9 — 65alternate name alternate name uses the non-standard name: moz
cancelfullscreenopera android full support yessafari ios no support nosamsung internet android full support 5.0 full support 5.0 full support yesprefixed prefixed implemented with t...
Using the Gamepad API - Web APIs
to start with, we declare some variables: the gamepadinfo paragraph that the connection info is written into, the ball that we want to move, the start variable that acts as the id for requestanimation frame, the a and b variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the requestanimationframe() and
cancelanimationframe() cross browser forks.
... window.addeventlistener("gamepaddisconnected", function(e) { gamepadinfo.innerhtml = "waiting for gamepad.";
cancelrequestanimationframe(start); }); chrome does things differently here.
HTMLDialogElement.returnValue - Web APIs
<!-- simple pop-up dialog box containing a form --> <dialog id="favdialog"> <form method="dialog"> <p><label>favorite animal: <select name="favanimal" required> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button>
cancel</button> <button>confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if (di...
...alog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } function handleuserinput(returnvalue) { if (returnvalue === '
cancel' || returnvalue == null) { // user
canceled the dialog, do nothing } else if (returnvalue === 'confirm') { // user chose a favorite animal, do something with it } } // “update details” button opens the <dialog> modally updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); handleuserinput(dialog.returnvalue); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLElement: animationend event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationend examples this example gets an element that's being animated and listens for the animationend event: const animated = document.queryselector('.animated'); animated.addeventlistener('animationend', () => { console.log('animation ended'); }); the same, but using the onanimationend event handler property: const animated = document.queryselector('.animated'); animated.onanimationend = () => { console.l...
...ncount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animation
cancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation
canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.classlist.contains('active'); if (active) { applyanimation.textcontent = "
cancel animation"; } else { applya...
HTMLElement: animationiteration event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationiteration examples this code uses animationiteration to keep track of the number of iterations an animation has completed: const animated = document.queryselector('.animated'); let iterationcount = 0; animated.addeventlistener('animationiteration', () => { iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }); the same, but using the onanimationiteration event han...
...ncount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animation
cancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation
canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.classlist.contains('active'); if (active) { applyanimation.textcontent = "
cancel animation"; } else { applya...
HTMLElement: animationstart event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationstart examples this listens for the animationstart event and logs a message when it is fired: const animated = document.queryselector('.animated'); animated.addeventlistener('animationstart', () => { console.log('animation started'); }); the same, but using onanimationstart: const animated = docum...
...ncount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animation
cancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation
canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.classlist.contains('active'); if (active) { applyanimation.textcontent = "
cancel animation"; } else { applya...
HTMLElement: pointermove event - Web APIs
the pointermove event is fired when a pointer changes coordinates, and the pointer has not been
canceled by a browser touch-action.
... bubbles yes
cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more.
HTMLElement: pointerout event - Web APIs
the pointerout event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointer
cancel event (see pointer
cancel); when a pen stylus leaves the hover range detectable by the digitizer.
... bubbles yes
cancelable yes interface pointerevent event handler property onpointerout examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerout', (event) => { console.log('pointer moved out'); }); using the onpointerout event handler property: const para = document.queryselector('p'); para.onpointerout = (event) => { console.log('pointer moved out'); }; specifications specification status pointer events obsolete ...
HTMLElement: transitionrun event - Web APIs
bubbles yes
cancelable no interface transitionevent event handler property ontransitionrun examples this code adds a listener to the transitionrun event: el.addeventlistener('transitionrun', () => { console.log('transition is running but hasn\'t necessarily started transitioning yet'); }); the same, but using the ontransitionrun property instead of addeventlistener(): el.ontransitionrun = () => { console.log('transition started running, and will start transitioning when the transition delay has expired'); }; live example in the following example, we have a simple <div> element, styled with a transition t...
... the transitionrun will occur even if the transition is
canceled before the delay expires.
HTMLFormElement - Web APIs
fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not
canceled.
...when false is returned,
cancelable invalid events are fired for each invalid child and validation problems are reported to the user.
HTMLSelectElement - Web APIs
if the element fails its constraints, the browser fires a
cancelable invalid event at the element (and returns false).
...if there are problems, it fires a
cancelable invalid event at the element, and returns false; if there are no problems, it returns true.
HTMLTextAreaElement - Web APIs
in this case, it also fires a
cancelable invalid event at the control.
...if there are problems, it fires a
cancelable invalid event at the element, and returns false; if there are no problems, it returns true.
KeyboardEvent.initKeyboardEvent() - Web APIs
syntax kbdevent.initkeyboardevent(typearg, canbubblearg,
cancelablearg, viewarg, chararg, keyarg, locationarg, modifierslistarg, repeat) parameters typearg the type of keyboard event; this will be one of keydown, keypress, or keyup.
...
cancelablearg whether or not the event can be
canceled.
LockedFile.abort() - Web APIs
summary the abort method is used to release the lock on the lockedfile object, making it inactive: its active property is set to false and all ongoing operations are
canceled.
... note: when an ongoing operation is
canceled, there is no rollback (it is not a database transaction), therefore the file can be corrupted if the
canceled operation was performing some writing.
PaymentRequest.show() - Web APIs
the promise is also rejected with aborterror if the user
cancels the payment request.
... payrequest = new paymentrequest(methoddata, details, options); payrequest.onshippingaddresschange = ev => ev.updatewith(checkaddress(payrequest)); payrequest.onshippingoptionchange = ev => ev.updatewith(checkshipping(payrequest)); const repsonse = await payrequest.show(); await validateresponse(response); } catch(err) { /* handle the error; aborterror usually means a user
cancellation */ } } in this code, the methods checkaddress() and checkshipping(), respectively, check the shipping address and the shipping option changes and supply in response either a paymentdetailsupdate object or a promise to return one; this object contains the fields in the paymentresponse which have been or need to be changed.
Using the Payment Request API - Web APIs
const checkoutbutton = document.getelementbyid('checkout-button'); if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); checkoutbutton.addeventlistener('click', function() { request.show().then(function(paymentresponse) { // handle successful payment }).catch(function(error) { // handle
cancelled or failed payment.
... paymentresponse.complete('success') .then(function() { // for demo purposes: intropanel.style.display = 'none'; successpanel.style.display = 'block'; }); }).catch(function(error) { if (error.code == domexception.not_supported_err) { window.location.href = 'https://bobpay.xyz/#download'; } else { // other kinds of errors;
cancelled or failed payment.
PerformanceEventTiming - Web APIs
auxclick beforeinput click compositionend compositionstart compositionupdate contextmenu dblclick dragend dragenter dragleave dragover dragstart drop input keydown keypress keyup mousedown mouseenter mouseleave mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointer
cancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touch
cancel properties performanceeventtiming.processingstart returns the time at which event dispatch started.
... performanceeventtiming.
cancelable returns the associated event's
cancelable attribute.
ReadableStreamDefaultController.enqueue() - Web APIs
a
cancel() function is also provided to stop the generation if readablestream.
cancel() is called for any reason.
...e(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(controller) { // we don't really need a pull in this example },
cancel() { // this is called if the reader
cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamsthe definition of 'enqueue()' in that specification.
ReadableStreamDefaultController - Web APIs
a
cancel() function is also provided to stop the generation if readablestream.
cancel() is called for any reason.
...e(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(controller) { // we don't really need a pull in this example },
cancel() { // this is called if the reader
cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamsthe definition of 'readablestreamdefaultcontroller' in that specification.
SVGGraphicsElement: copy event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncopy the event's default action is to copy the selection (if any) to the clipboard.
... a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and
cancelling the event's default action using event.preventdefault().
SVGGraphicsElement: paste event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property onpaste if the cursor is in an editable context (for example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position.
... to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must
cancel the default action using event.preventdefault(), and then insert its desired data manually.
SharedWorkerGlobalScope - Web APIs
windowtimers.clearinterval()
cancels the repeated execution set using windowtimers.setinterval().
... windowtimers.cleartimeout()
cancels the repeated execution set using windowtimers.settimeout().
SpeechSynthesisErrorEvent.error - Web APIs
possible codes are:
canceled a speechsynthesis.
cancel method call caused the speechsynthesisutterance to be removed from the queue before it had begun being spoken.
... interrupted a speechsynthesis.
cancel method call caused the speechsynthesisutterance to be interrupted after it had begun being spoken and before it completed.
Streams API - Web APIs
there are more advantages too — you can detect when streams start or end, chain streams together, handle errors and
cancel streams as required, and react to the speed of the stream is being read at.
...for example, the response body returned by a successful fetch request can be exposed as a readablestream, and you can then read it using a reader created with readablestream.getreader(),
cancel it with readablestream.
cancel(), etc.
TransitionEvent.initTransitionEvent() - Web APIs
do not use it anymore, use the standard constructor, transitionevent(), to create a synthetic transitionevent syntax transitionevent.inittransitionevent(typearg, canbubblearg,
cancelablearg, transitionnamearg, elapsedtimearg); parameters typearg is a domstring identifying the specific type of transition event that occurred.
...
cancelablearg is a boolean flag indicating if the event associated action can be avoided (true) or not (false).
WebGLRenderingContext.makeXRCompatible() - Web APIs
ne = "scene1"; let glstartbutton; let xrstartbutton; window.addeventlistener("load", (event) => { loadsceneresources(currentscene); glstartbutton.addeventlistener("click", handlestartbuttonclick); xrstartbutton.addeventlistener("click", handlestartbuttonclick); }); outputcanvas.addeventlistener("webglcontextlost", (event) => { /* the context has been lost but can be restored */ event.
canceled = true; }); /* when the gl context is reconnected, reload the resources for the current scene.
... */ outputcanvas.addeventlistener("webglcontextrestored", (event) => { loadsceneresources(currentscene); }); async function onstartedxrsession(xrsession) { try { await gl.makexrcompatible(); } catch(err) { switch(err) { case aborterror: showsimplemessagebox("unable to transfer the game to your xr headset.", "
cancel"); break; case invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "
cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.classlist.contains("use-webxr") && navigator.xr) { try { xrsession = await navigator.xr.requestsession("immersive-vr"); ...
Signaling and video calling - Web APIs
function handlegetusermediaerror(e) { switch(e.name) { case "notfounderror": alert("unable to open your call because no camera and/or microphone" + "were found."); break; case "securityerror": case "permissiondeniederror": // do nothing; this is the same as the user
canceling the call.
...in this example, we ignore "securityerror" and "permissiondeniederror" results, treating refusal to grant permission to use the media hardware the same as the user
canceling the call.
Inputs and input sources - Web APIs
pickupobject() also records the original position of the object so it can be returned to that spot if the squeeze is
canceled or aborted.
...
canceling the squeeze in the squeezeend handler the squeezeend event is received after the squeeze is complete, even if it fails.
Window.confirm() - Web APIs
the window.confirm() method displays a modal dialog with an optional message and two buttons: ok and
cancel.
... return value a boolean indicating whether ok (true) or
cancel (false) was selected.
Window.prompt() - Web APIs
if the user clicks the
cancel button, this function returns null.
... the above prompt appears as follows (in chrome on os x): notes a prompt dialog contains a single-line textbox, a
cancel button, and an ok button, and returns the (possibly empty) text the user entered into that textbox.
Window: transitionend event - Web APIs
bubbles yes
cancelable yes interface transitionevent event handler property ontransitionend the transitionend event is fired in both directions - as it finishes transitioning to the transitioned state, and when it fully reverts to the default or non-transitioned state.
...if the transition
cancel event is fired, the transitionend event will not fire.
WindowEventHandlers.onbeforeunload - Web APIs
at this point, the document is still visible and the event is still
cancelable.
... window.addeventlistener('beforeunload', function (e) { //
cancel the event e.preventdefault(); // if you prevent default behavior in mozilla firefox prompt will always be shown // chrome requires returnvalue to be set e.returnvalue = ''; }); guarantee the browser unload by removing the returnvalue property of the event window.addeventlistener('beforeunload', function (e) { // the absence of a returnvalue property on the event will guarantee the brow...
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
the clearinterval() method of the windoworworkerglobalscope mixin
cancels a timed, repeating action which was previously established by a call to setinterval().
... syntax scope.clearinterval(intervalid) parameters intervalid the identifier of the repeated action you want to
cancel.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
return value the returned intervalid is a numeric, non-zero value which identifies the timer created by the call to setinterval(); this value can be passed to windoworworkerglobalscope.clearinterval() to
cancel the timeout.
...you can
cancel the interval using windoworworkerglobalscope.clearinterval().
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.clearinterval()
cancels the repeated execution set using windoworworkerglobalscope.setinterval().
... windoworworkerglobalscope.cleartimeout()
cancels the delayed execution set using windoworworkerglobalscope.settimeout().
WorkerGlobalScope - Web APIs
windoworworkerglobalscope.clearinterval()
cancels the repeated execution set using windoworworkerglobalscope.setinterval().
... windoworworkerglobalscope.cleartimeout()
cancels the delayed execution set using windoworworkerglobalscope.settimeout().
XRSession.requestAnimationFrame() - Web APIs
you can
cancel a previously scheduled animation by calling
cancelanimationframe().
... return value an integer value which serves as a unique, non-zero id or handle you may pass to
cancelanimationframe() if you need to remove the pending animation frame request.
XRSession - Web APIs
cancelanimationframe() removes a callback from the animation frame painting callback from xrsession's set of animation frame rendering callbacks, given the identifying handle returned by a previous call to requestanimationframe().
...returns an integer value which can be used to identify the request for the purposes of
canceling the callback using
cancelanimationframe().
Operable - Accessibility
understanding pointer gestures 2.5.2 pointer
cancellation (a) added in 2.1 for functionality that can be operated using a single-pointer at least one of the following is true: no down-event, abort/undo, up reversal or essential.
... understanding pointer
cancellation 2.5.3 label in name (a) added in 2.1 for each user interface component that includes a visible text label, make sure the accessible name matches (or includes) the visible text in the label.
Codecs used by WebRTC - Web media technologies
these two rfcs also lay out options that must be supported for each codec, as well as specific user comfort features such as echo
cancelation.
... it's useful to note that rfc 7874 defines more than a list of audio codecs that a webrtc-compliant browser must support; it also provides recommendations and requirements for special audio features such as echo
cancelation, noise reduction, and audio leveling.
Window: deviceproximity event - Archive of obsolete content
bubbles no
cancelable no interface deviceproximityevent target defaultview (window) default action none event handler property window.ondeviceproximity specification proximity sensor other properties property type description value read only double (float) the measured proximity of the distant device (distance in centimetres).
Window: userproximity event - Archive of obsolete content
bubbles no
cancelable no interface userproximityevent target defaultview (window) default action none event handler property window.onuserroximity specification proximity sensor note: this event has been disabled by default in firefox 62, behind the device.sensors.proximity.enabled preference (bug 1462308).
platform/xpcom - Archive of obsolete content
r { class } = require('sdk/core/heritage'); var { unknown } = require('sdk/platform/xpcom'); var request = class({ extends: unknown, interfaces: [ 'nsirequest' ], initialize: function initialize() { this.pending = false; }, ispending: function() { return this.pending; }, resume: function() { console.log('resuming...'); }, suspend: function() { console.log('suspending...'); },
cancel: function() { console.log('
canceling...'); } }); this component definition: specifies that we support nsirequest using the interfaces property.
Miscellaneous - Archive of obsolete content
however, if you are not going to
cancel the request, you need to "rewind" it by calling: postdata.queryinterface(ci.nsiseekablestream).seek(ci.nsiseekablestream.ns_seek_set, 0); adding custom certificates to a xulrunner application you need to ship a xulrunner application with your own ssl certificates?
Displaying web content in an extension without security issues - Archive of obsolete content
ing the event handler on the frame tag (meaning that it is outside the restricted document and can execute without restrictions): <iframe type="content" onclick="handleclick(event);"/> and the event handler would look like that: function handlebrowserclick(event) { // only react to left mouse clicks if (event.button != 0) return; // default action on link clicks is to go to this link,
cancel it event.preventdefault(); if (event.target instanceof htmlanchorelement && event.target.href) openlinkinbrowser(event.target.href); } safe html manipulation functions when it comes to displaying the data, it is tempting to generate some html code and to insert it into the document via innerhtml.
Tabbed browser - Archive of obsolete content
httpchannel, requesturl; if (topic == "http-on-modify-request") { httpchannel = subject.queryinterface(ci.nsihttpchannel); requesturl = httpchannel.uri.spec; var newrequesturl, i; if (/someurl/.test(requesturl)) { var goodies = loadcontextgoodies(httpchannel); if (goodies) { httpchannel.
cancel(cr.ns_binding_aborted); goodies.contentwindow.location = self.data.url('pages/test.html'); } else { //dont do anything as there is no contentwindow associated with the httpchannel, liekly a google ad is loading or some ajax call or something, so this is not an error } } return; } } }; serv...
chargingchange - Archive of obsolete content
general info specification battery interface event bubbles no
cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
chargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no
cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
dischargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no
cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
levelchange - Archive of obsolete content
general info specification battery interface event bubbles no
cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
nto the tinderstatus-installer directory: initinstall( "mozilla tinderstatus extension", "/mozdev/tinderstatus", "0.1"); var installdir = getfolder("chrome","tinderstatus"); setpackagefolder(installdir); adddirectory("tinderstatus"); registerchrome( content | delayed_chrome, getfolder(installdir, "content")); var result = performinstall(); if ( result != success )
cancelinstall(result); once all the files are in place, use your zip utility from within the tinderstatus-installer directory to create a zip archive called tinderstatus.xpi with install.js and the entire contents of the tinderstatus/ directory.
importUserCertificates - Archive of obsolete content
if it fails, one of the following error strings will be returned: error string description "error:user
cancel" the user
canceled the import operation "error:invalidcertificate" one of the certificate packages was incorrectly formatted "error:internalerror" the software encountered some internal error, such as out of memory "error:invalidrequestid" the request id in the response message does not match any outstanding request ...
JavaScript crypto - Archive of obsolete content
example of cryptomechanismflags and cipherflags pkcs11mechanismflags = pkcs11_mech_dsa_flag | pkcs11_mech_skipjack_flag | pkcs11_mech_random_flag; pkcs11cipherflags = 0; return values js_ok_add_module = 3 // successfully added a module js_err_other = -1 // errors other than the following js_err_user_
cancel_action = -2 // user aborted an action js_err_incorrect_num_of_arguments = -3 // calling a method w/ incorrect # of // arguments js_err_add_module = -5 // error adding a module js_err_bad_module_name = -6 // the module name is invalid js_err_add_module_duplicate = -10 // the module being installed has the ...
Mozilla Application Framework in Detail - Archive of obsolete content
registerchrome(package | delayed_chrome, getfolder("chrome","xmlterm.jar"), "content/xmlterm/"); registerchrome(skin | delayed_chrome, getfolder("chrome","xmlterm.jar"), "skin/modern/xmlterm/"); registerchrome(locale | delayed_chrome, getfolder("chrome","xmlterm.jar"), "locale/xmlterm/"); if (getlasterror() == success) performinstall(); else { alert("error detected: "+getlasterror());
cancelinstall(); } other features a resource description framework (rdf) parser with support for creating rdf graphs programmatically or by parsing files, compositing multiple sources into a single rdf graph, querying and manipulating graphs, and populating xul widgets (trees, menus, etc.) with graph data; an xslt/xpath processor; scalable vector graphics (svg) rendering with support for a usable su...
Supporting per-window private browsing - Archive of obsolete content
var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(function (asubject, atopic, adata) { asubject.queryinterface(components.interfaces.nsisupportsprbool); // if another extension has not already
canceled entering the private mode if (!asubject.data) { /* you should display some user interface here */ asubject.data = true; //
cancel the operation } }, "last-pb-context-exiting", false); forcing a channel into private mode usually, network channels inherit the privacy status of the document that created them, which means that they work correctly most of the time.
Creating XPI Installer Modules - Archive of obsolete content
itinstall: " + err); addfile("barley grain", // displayname from contents.rdf "barley.jar", // jar source getfolder("chrome"), // target folder ""); // target subdir // registerchrome(type, location, source) registerchrome(package | delayed_chrome, getfolder("chrome","barley.jar"), "content/"); if (err==success) performinstall(); else
cancelinstall(err); note that there is no version number on barley, and so the name + version parameter has a "v" and then nothing else.
File.macAlias - Archive of obsolete content
xpisrc = "miscellaneous program"; var vi = "1.1.1.1"; initinstall( "macintosh alias", "misc", vi, 0); f = getfolder("program"); g = getfolder("mac desktop"); addfile( "filemacalias", "2.2.2.2", xpisrc, f, xpisrc, true); err = file.macalias(f, xpisrc, g, xpisrc + " alias"); logcomment("file.macalias returns: " + err); if (0 == getlasterror()) performinstall(); else
cancelinstall(); ...
File.windowsShortcut - Archive of obsolete content
f = getfolder("windows"); g = getfolder("temporary"); addfile( "miscshortcut", "2.2.2.2", xpisrc, f, xpisrc, true); target = getfolder(f, xpisrc); shortcutpath = getfolder("program"); err = file.windowsshortcut( target, shortcutpath, "misc shortcut", g, "", target, 0); logcomment("file.windowsshortcut returns: " + err); if (0 == getlasterror()) performinstall(); else
cancelinstall(); ...
Install.addDirectory - Archive of obsolete content
var vi = "10.10.10.10"; var xpisrc = "adddir1"; initinstall("addfilenovers1", "adddir_1", vi, 1); f = getfolder("program"); setpackagefolder(f); err = adddirectory(xpisrc); logcomment("the error = " + err); if (0 == getlasterror()) performinstall(); else
cancelinstall(); ...
Install.addFile - Archive of obsolete content
var xpisrc = "file.txt"; initinstall( "adding a file", "testfile", "1.0.1.7", 1); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); if (0 == getlasterror()) performinstall(); else
cancelinstall(); ...
addFile - Archive of obsolete content
example var xpisrc = "file.txt"; initinstall("adding a file", "addfile", "1.0.1.7", 1); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); if (0 == getlasterror()) performinstall(); else
cancelinstall(); ...
refreshPlugins - Archive of obsolete content
; var xpisrc2 = "nsic3dpscriptablepeer.xpt"; initinstall( "cult3d plugin file", "@cycore.com/cult3d;version=1.0.0", "1.0.0"); setpackagefolder(getfolder("plugins")); addfile(xpisrc); addfile("",xpisrc2,getfolder("components"),""); var err = getlasterror(); if (err == success) { err = performinstall(); if (err == success) refreshplugins(); } else
cancelinstall(err); ...
Install Object - Archive of obsolete content
perform installation check that the files have been added successfully (e.g., by checking the error return codes from many of the main installation methods, and go ahead with the install if everything is in order: performor
cancel(); function performor
cancel() { if (0 == getlasterror()) performinstall(); else
cancelinstall(); } for complete script examples, see script examples.
XPInstall API reference - Archive of obsolete content
objects install properties methods adddirectory addfile alert
cancelinstall confirm deleteregisteredfile execute gestalt getcomponentfolder getfolder getlasterror getwinprofile getwinregistry initinstall loadresources logcomment patch performinstall refreshplugins registerchrome reseterror setpackagefolder installtri...
icon - Archive of obsolete content
possible values include: accept,
cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network.
Methods - Archive of obsolete content
« xul reference home acceptdialog additemtoselection addpane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur
cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirstv...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
working directory, create a plain text file named: install.js copy the following content, and paste it into the new file: const title = "custom toolbar button" const name = "custombutton" const version = "1.0" r = initinstall(title, name, version) || adddirectory(null, "content", getfolder("chrome"), name) || registerchrome(content + delayed_chrome, getfolder("chrome", name), "") if (r)
cancelinstall(r) else performinstall(), alert("now restart seamonkey") customize the title, name and (optionally) version definitions, changing the text between double-quote characters on those three lines.
Additional Install Features - Archive of obsolete content
for example, you might put the following as the last section of your script: if (getlasterror() == success) { performinstall(); } else {
cancelinstall(); } error codes that could be returned by getlasterror() are listed in the mozilla source file nsinstall.h.
Creating a Skin - Archive of obsolete content
#find-button { list-style-image: url("chrome://global/skin/checkbox/images/cbox-check.jpg"); font-weight: bold; } #
cancel-button { list-style-image: url("chrome://global/skin/icons/images/close-button.jpg"); } button:hover { color: #000066; } we add some images to the buttons and make the find button have bold text to indicate that it is the default button.
Keyboard Shortcuts - Archive of obsolete content
vk_
cancel vk_back vk_tab vk_clear vk_return vk_enter vk_shift vk_control vk_alt vk_pause vk_caps_lock vk_escape vk_space vk_page_up vk_page_down vk_end vk_home vk_left vk_up vk_right vk_down vk_printscreen vk_insert vk_delete vk_0 vk_1 vk_2 vk_3 vk_4 vk_5 vk_6 vk_7 ...
XUL Changes for Firefox 1.5 - Archive of obsolete content
this is used typically on gnome systems where possible values are: accept,
cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network.
NPP_URLNotify - Archive of obsolete content
npres_user_break: user
canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
the possible values for relationtype include: debug.ms_async_callback_status_assign_delegate debug.ms_async_callback_status_join debug.ms_async_callback_status_chooseany debug.ms_async_callback_status_
cancel debug.ms_async_callback_status_error for more information, see debug constants.
Client-side form validation - Learn web development
reset the visual state of the message } else { // if there is still an error, show the correct error showerror(); } }); form.addeventlistener('submit', function (event) { // if the email field is valid, we let the form submit if(!email.validity.valid) { // if it isn't, we display an appropriate error message showerror(); // then we prevent the form from being sent by
canceling the event event.preventdefault(); } }); function showerror() { if(email.validity.valuemissing) { // if the field is empty // display the following error message.
Adding a new event
if your new event shouldn't be created with event constructor such as: var event = new fooevent("bar", { bubbles: true,
cancelable: true, detail: 5 }); you shouldn't define construnctor in it.
Chrome registration
for example, the order of the "ok" and "
cancel" buttons in a dialog is different, as well as the names of some items.
Using the Browser API
it was originally used in firefox os to implement browser applications before that project was
cancelled; since firefox 47 it is available to desktop chrome code and used in places like the firefox devtools.
AddonManager
state_
cancelled an install that has been
canceled.
Code Samples
var beinguninstalled; let listener = { onuninstalling: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = true; } }, onoperation
cancelled: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = (addon.pendingoperations & addonmanager.pending_uninstall) != 0; } } } try { components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.addaddonlistener(listener); } catch (ex) {} ...
DownloadList
removefinished() removes downloads from the list that have finished, have failed, or have been
canceled without keeping partial data.
DownloadTarget
methods refresh() updates the state of a finished, failed, or
canceled download based on the current state as indicated by the file system.
Downloads.jsm
this download method does not provide user interface or the ability to
cancel or restart the download programmatically.
JavaScript code modules
the event listener receives detailed information about the request, and can modify or
cancel the request.
PR_ClearInterrupt
in this case, the request for interrupt is still pending with the thread and must be explicitly
canceled.
PR_Interrupt
the interrupt request remains in the thread's state until it is delivered exactly once or explicitly
canceled.
PR_JoinJob
syntax #include <prtpool.h> nspr_api(prstatus) pr_joinjob(prjob *job); parameter the function has the following parameter: job a pointer to a prjob structure returned by a pr_queuejob function representing the job to be
cancelled.
Thread Pools
thread pool types thread pool functions thread pool types prjobiodesc prjobfn prthreadpool prjob thread pool functions pr_createthreadpool pr_queuejob pr_queuejob_read pr_queuejob_write pr_queuejob_accept pr_queuejob_connect pr_queuejob_timer pr_
canceljob pr_joinjob pr_shutdownthreadpool pr_jointhreadpool ...
NSS_3.12_release_notes.html
bug 132485: built-in root certs slot description is empty bug 177184: nss_cmsdecoder_
cancel might have a leak bug 232392: erroneous root ca tests in nss libraries bug 286642: util should be in a shared library bug 287052: function to get crl entry reason code has incorrect prototype and implementation bug 299308: need additional apis in the crl cache for libpkix bug 335039: nssckfwcryptooperation_updatecombo is not declared bug 340917: crlutil should init nss read-only for some options ...
NSS tools : pk12util
return codes o 0 - no error o 1 - user
cancelled o 2 - usage error o 6 - nls init error o 8 - certificate db open error o 9 - key db open error o 10 - file initialization error o 11 - unicode conversion error o 12 - temporary file creation error o 13 - pkcs11 get slot error o 14 - pkcs12 decoder start error o 15 - error read from import file o 16 - pkcs12 decode error o 17 - pkcs12 decoder verify error o 18 - pkcs12 decoder vali...
Utility functions
ickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later secmod_addnewmodule mxr 3.3 and later secmod_addnewmoduleex mxr 3.4 and later secmod_deletemoduleex mxr 3.12 and later secmod_
cancelwait mxr 3.9.3 and later secmod_candeleteinternalmodule mxr 3.5 and later secmod_createmodule mxr 3.4 and later secmod_deletemodule mxr 3.4 and later secmod_findmodule mxr 3.4 and later secmod_findslot mxr 3.4 and later secmod_freem...
NSS Tools pk12util
error codes pk12util can return the following values: 0 - no error 1 - user
cancelled 2 - usage error 6 - nls init error 8 - certificate db open error 9 - key db open error 10 - file initialization error 11 - unicode conversion error 12 - temporary file creation error 13 - pkcs11 get slot error 14 - pkcs12 decoder start error 15 - error read from import file 16 - pkcs12 decode error 17 - pkcs12 decoder verify error 18 - pkcs12 decoder validate bags error 19 - pkcs12 decoder imp...
NSS tools : pk12util
return codes o 0 - no error o 1 - user
cancelled o 2 - usage error o 6 - nls init error o 8 - certificate db open error o 9 - key db open error o 10 - file initialization error o 11 - unicode conversion error o 12 - temporary file creation error o 13 - pkcs11 get slot error o 14 - pkcs12 decoder start error o 15 - error read from import file o 16 - pkcs12 decode error o ...
Index
202 js_clearpendingexception jsapi reference, spidermonkey js_clearpendingexception
cancels the currently pending exception in cx, if any.
Component Internals
in order to support something like an "are you sure you want to quit" dialog, the application needs to provide a higher-level event (e.g., startshutdown()) which allows for
cancellation.
Packaging WebLock
// register the new ui with the mozilla chrome registry registerchrome(content, getfolder(cf,"weblock.xpi"),"weblock"); registerchrome(skin, getfolder(cf, "weblock.xpi"),"weblock"); // perform the installation if there are no errors if (err==success) performinstall(); else
cancelinstall(err); the weblock trigger script the trigger script is the script placed on a web page that actually initiates an xpinstall installation and calls the installation script that appears in the xpi.
mozIStorageConnection
return value a mozistoragependingstatement object that can be used to
cancel the statements' execution.
mozIStorageStatement
return value a mozistoragependingstatement object that can be used to
cancel the execution of the statement.
nsIDocShell
suspendrefreshuris()
cancel the xpcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively.
nsIDroppedLinkHandler
exceptions thrown ns_error_dom_security_err error will be thrown and the event
canceled if the receiving target should not load the uri for security reasons.
nsIFilePicker
constant value description returnok 0 the file picker dialog was closed by the user hitting 'ok' return
cancel 1 the file picker dialog was closed by the user hitting '
cancel' returnreplace 2 the user chose an existing file and acknowledged that they want to overwrite the file filter constants these constants are used to create filters for commonly-used file types.
nsIFrameScriptLoader
this
cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new frames.
nsIHttpChannelInternal
method overview void getrequestversion(out unsigned long major, out unsigned long minor); void getresponseversion(out unsigned long major, out unsigned long minor); void httpupgrade(in acstring aprotocolname, in nsihttpupgradelistener alistener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description
canceled boolean returns true if and only if the channel has been
canceled.
nsIHttpHeaderVisitor
s.interfaces.nsirequest; }; myhttprequestobserver.prototype.observe = function ( subject, topic, data ) { var uri, avisitor; if ( subject instanceof this.nsihttpchannel ) { avisitor = new mynsihttpheadervisitor( ); subject.visitresponseheaders( avisitor ); if ( avisitor.isflash( ) ) { uri = subject.uri; subject.
cancel( this.aborted ); alert( "found flash!" ); //handle flash file here } } }; myhttprequestobserver.prototype.register = function ( ) { var observerservice = components.classes[ "@mozilla.org/observer-service;1" ].getservice( components.interfaces.nsiobserverservice ); observerservice.addobserver(this, "http-on-examine-response", false); ...
nsIProcessScriptLoader
this
cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new child processes.
nsIProgressEventSink
notifications will cease once the channel calls its listener's onstoprequest method or once the channel is
canceled (via nsirequest.
cancel()).
nsIRequestObserver
note: an exception thrown from onstartrequest has the side-effect of causing the request to be
canceled.
nsISSLErrorListener
return value the consumer shall return true if it wants to suppress the error message related to the error (the connection will still get
canceled).
nsITextInputProcessorCallback
example of simple js-ime: var simpleime = { _hasfocus: false, _hasrightstocompose: false, _tip: null, _callback: function simpleime_callback(atip, anotification) { try { switch (anotification.type) { case "request-to-commit": atip.commitcomposition(); break; case "request-to-
cancel": atip.
cancelcomposition(); break; case "notify-focus": this._hasfocus = true; break; case "notify-blur": this._hasfocus = false; break; case "notify-detached": this._hasfocus = false; this._hasrightstocompose = false; break; } return true; } catch (e) { return f...
nsIUserCertPicker
inherits from: nsisupports last changed in gecko 1.7 method overview nsix509cert pickbyusage(in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean
canceled); methods pickbyusage() nsix509cert pickbyusage( in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean
canceled ); parameters ctx selectednickname certusage allowinvalid allowduplicatenicknames
canceled return value ...
nsIXMLHttpRequestEventTarget
1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) attributes attribute type description onabort nsidomeventlistener a javascript function object that gets invoked if the operation is
canceled by the user.
XPCOM Interface Reference
ultnsiautocompletesearchnsibadcertlistener2nsibidikeyboardnsibinaryinputstreamnsibinaryoutputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsi
cancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicomposi...
XPCOM Interface Reference by grouping
nsicontentpolicy credentials nsilogininfo nsiloginmanager using nsiloginmanager nsiloginmanagerstorage nsiloginmetainfo history nsiglobalhistory nsiglobalhistory2 nsiglobalhistory3 ssl nsibadcertlistener2 system action nsi
cancelable application application nsiapplicationupdateservice nsiappshell nsiappshellservice nsiappstartup xul nsixulappinfo nsixulruntime nsixultemplatebuilder nsixultemplatequeryprocessor nsixultemplateresult ...
Storage
tset) { for (let row = aresultset.getnextrow(); row; row = aresultset.getnextrow()) { let value = row.getresultbyname("column_name"); } }, handleerror: function(aerror) { print("error: " + aerror.message); }, handlecompletion: function(areason) { if (areason != components.interfaces.mozistoragestatementcallback.reason_finished) print("query
canceled or aborted!"); } }); the call to executeasync takes an object that implements mozistoragestatementcallback.
Xray vision
for example: window.confirm() is a dom api that's supposed to ask the user to confirm an action, and return a boolean depending on whether they clicked "ok" or "
cancel".
WebIDL bindings
andler" macro: impl_event_handler(onthingchange); the "onthingchange" needs to be added to the staticatoms.py file: atom("onthingchange", "onthingchange") the actual implementation (.cpp) for firing the event would then look something like: nsresult myinterface::dispatchthingchangeevent() { ns_named_literal_string(type, "thingchange"); eventinit init; init.mbubbles = false; init.m
cancelable = false; refptr<event> event = event::constructor(this, type, init); event->settrusted(true); errorresult rv; dispatchevent(*event, rv); return rv.stealnsresult(); // assuming the caller cares about the return code.
Constants - Plugins
npres_user_break 2 user
canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
Initialization and Destruction - Plugins
the browser calls the plug-in's np_shutdown function, which informs the plug-in that its library is about to be unloaded, and gives it a chance to
cancel any outstanding i/o requests, delete threads it created, free any memory it allocated, and perform any other closing tasks.
Streams - Plugins
npres_user_break: the user
canceled the stream directly by clicking the stop button or indirectly by some action, such as by deleting the instance or initiating higher-priority network operations.
Accessibility Inspector - Firefox Developer Tools
note, however, that if you hold the shift key down when "performing a pick", you can "preview" the accessibility object in the tree (and its properties in the right-hand pane), but then continue picking as many times as you like (the picker does not get
cancelled) until you release the shift key.
Page inspector keyboard shortcuts - Firefox Developer Tools
command windows macos linux select the element under the mouse and
cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane.
Web console keyboard shortcuts - Firefox Developer Tools
+ e execute the current expression enter return enter add a new line, for entering multiline expressions shift + enter shift + return shift + enter autocomplete popup these shortcuts apply while the autocomplete popup is open: command windows macos linux choose the current autocomplete suggestion tab tab tab
cancel the autocomplete popup esc esc esc move to the previous autocomplete suggestion up arrow up arrow up arrow move to the next autocomplete suggestion down arrow down arrow down arrow page up through autocomplete suggestions page up page up page up page down through autocomplete suggestions page down page down page down...
AbortSignal: abort event - Web APIs
bubbles no
cancelable no interface event event handler onabort examples in the following snippets, we create a new abortcontroller object, and get its abortsignal (available in the signal property).
Animation.ready - Web APIs
a new promise is created every time the animation enters the "pending" play state as well as when the animation is
canceled, since in both of those scenarios, the animation is ready to be started again.
AudioContext.getOutputTimestamp() - Web APIs
play.addeventlistener('click', () => { if(!audioctx) { audioctx = new window.audiocontext(); } getdata(); source.start(0); play.setattribute('disabled', 'disabled'); raf = requestanimationframe(outputtimestamps); }); stop.addeventlistener('click', () => { source.stop(0); play.removeattribute('disabled');
cancelanimationframe(raf); }); // function to output timestamps function outputtimestamps() { let ts = audioctx.getoutputtimestamp() console.log('context time: ' + ts.contexttime + ' | performance time: ' + ts.performancetime); raf = requestanimationframe(outputtimestamps); } specifications specification status comment web audio apithe definition of 'getoutputtimestamp(...
AudioScheduledSourceNode: ended event - Web APIs
bubbles no
cancelable no interface event event handler property audioscheduledsourcenode.onended usage notes this event occurs when a audioscheduledsourcenode has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been performed, or because the entire buffer has been played.
AudioTrackList: addtrack event - Web APIs
bubbles no
cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addeventlistener('addtrack', (event) => { console.log(`audio track: ${event.track.label} added`); }); using the onaddtrack event handler property: const videoelement = document.queryselector('video'); videoelement.audiotracks.onaddtrack = (event) => { console.log(`audio track: ${event.track.label} added`); }; specifications specification status html living standardthe definition of 'addtrack' in that specification.
AudioTrackList: change event - Web APIs
bubbles no
cancelable no interface event event handler property onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.audiotracks[0]; track.enabled = !track.enabled; }); using the onchange event handler property: const videoelement = documen...
AudioTrackList: removetrack event - Web APIs
bubbles no
cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addeventlistener('removetrack', (event) => { console.log(`audio track: ${event.track.label} removed`); }); using the onremovetrack event handler property: const videoelement = document.queryselector('video'); videoelement.audiotracks.onremovetrack = (event) => { console.log(`audio track: ${event.track.label} removed`); }; specifications specification status html living standardthe definition of 'removetrack' in that specification.
BeforeUnloadEvent - Web APIs
arget="_top"><rect x="116" y="1" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">beforeunloadevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} bubbles no
cancelable yes target objects defaultview interface event examples window.addeventlistener("beforeunload", function( event ) { event.returnvalue = "\o/"; }); // is equivalent to window.addeventlistener("beforeunload", function( event ) { event.preventdefault(); }); webkit-derived browsers don't follow the spec for the dialog box.
BroadcastChannel: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessage examples live example in this example there's a "sender" <iframe> that broadcasts the contents of a <textarea> when the user clicks a button.
BroadcastChannel: messageerror event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessageerror examples this code uses addeventlistener to listen for messages and errors: const channel = new broadcastchannel('example-channel'); channel.addeventlistener('message', (event) => { received.textcontent = event.data; }); channel.addeventlistener('messageerror', (event) => { console.error(event); }); the same, but using the onmessage and onmessageerror event handler properties: const channel = new broadcastchannel('example-channel'); channel.onmessage = (event) => { received.textcontent = event.data; }; channel.onmess...
ByteLengthQueuingStrategy.size() - Web APIs
},
cancel(err) { console.log("stream error:", err); } }, queuingstrategy); var size = queueingstrategy.size(chunk); specifications specification status comment streamsthe definition of 'size' in that specification.
ByteLengthQueuingStrategy - Web APIs
},
cancel(err) { console.log("stream error:", err); } }, queueingstrategy); var size = queueingstrategy.size(chunk); specifications specification status comment streamsthe definition of 'bytelengthqueuingstrategy' in that specification.
DataTransfer.clearData() - Web APIs
event.datatransfer.cleardata(); // set the drag's format and data (use event target's id for data) event.datatransfer.setdata('text/plain', event.target.id); data.innerhtml = event.datatransfer.getdata('text/plain'); } function dragendhandler (event) { if (!dropped) { status.innerhtml = 'drag
canceled'; } data.innerhtml = event.datatransfer.getdata('text/plain') || 'empty'; // change border to signify drag is no longer in process event.currenttarget.style.border = '1px solid black'; if (dropped) { // remove all event listeners draggable.removeeventlistener('dragstart', dragstarthandler); draggable.removeeventlistener('dragend', dragendhandler); ...
DedicatedWorkerGlobalScope: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and sends it a message using worker.postmessage(): const worker = new worker("static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); the worker can listen for this message using addeventlistener(): // inside static/scripts/worker.js self.addeventlistener('message', (event) => { console.log(`received message from parent: ${event.data}`); }); ...
DedicatedWorkerGlobalScope: messageerror event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessageerror examples listen for messageerror using addeventlistener(): // inside worker.js self.addeventlistener('messageerror', (event) => { self.postmessage('error receiving message'); console.error(event); }); the same, but using the onmessageerror event handler property: // inside worker.js self.onmessageerror = (event) => { self.postmessage('error receiving message'); console.error(event); }; specifications specification status html living standard living standard ...
Document: DOMContentLoaded event - Web APIs
bubbles yes
cancelable yes (although specified as a simple event that isn't
cancelable) interface event event handler property none a different event, load, should be used only to detect a fully-loaded page.
Document: animationend event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationend the original target for this event is the element that had the animation applied.
Document: animationstart event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied.
Document: copy event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action.
Document: cut event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action.
Document: paste event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action.
Document: pointerdown event - Web APIs
bubbles yes
cancelable yes interface pointerevent event handler property onpointerdown examples using addeventlistener(): document.addeventlistener('pointerdown', (event) => { console.log('pointer down event'); }); using the onpointerdown event handler property: document.onpointerdown = (event) => { console.log('pointer down event'); }; specifications specification status pointer event...
Document: pointerenter event - Web APIs
bubbles no
cancelable no interface pointerevent event handler property onpointerenter examples using addeventlistener(): document.addeventlistener('pointerenter', (event) => { console.log('pointer entered element'); }); using the onpointerenter event handler property: document.onpointerenter = (event) => { console.log('pointer entered element'); }; specifications specification status pointer events obsolete ...
Document: pointerleave event - Web APIs
bubbles no
cancelable no interface pointerevent event handler property onpointerleave examples using addeventlistener(): document.addeventlistener('pointerleave', (event) => { console.log('pointer left element'); }); using the onpointerleave event handler property: document.onpointerleave = (event) => { console.log('pointer left element'); }; specifications specification status pointer events obsolete ...
Document: pointerlockchange event - Web APIs
bubbles yes
cancelable no interface event event handler property onpointerlockchange examples using addeventlistener(): document.addeventlistener('pointerlockchange', (event) => { console.log('pointer lock changed'); }); using the onpointerlockchange event handler property: document.onpointerlockchange = (event) => { console.log('pointer lock changed'); }; specifications specification status pointer lock candidate recommendation ...
Document: pointerlockerror event - Web APIs
bubbles yes
cancelable no interface event event handler property onpointerlockerror examples using addeventlistener(): const para = document.queryselector('p'); document.addeventlistener('pointerlockerror', (event) => { console.log('error locking pointer'); }); using the onpointerlockerror event handler property: document.onpointerlockerror = (event) => { console.log('error locking pointer'); }; specifications specification status pointer lock candidate recommendation ...
Document: pointerover event - Web APIs
bubbles yes
cancelable yes interface pointerevent event handler property onpointerover examples using addeventlistener(): document.addeventlistener('pointerover', (event) => { console.log('pointer moved in'); }); using the onpointerover event handler property: document.onpointerover = (event) => { console.log('pointer moved in'); }; specifications specification status pointer events obsolete ...
Document: pointerup event - Web APIs
bubbles yes
cancelable yes interface pointerevent event handler property onpointerup examples using addeventlistener(): document.addeventlistener('pointerup', (event) => { console.log('pointer up'); }); using the onpointerup event handler property: document.onpointerup = (event) => { console.log('pointer up'); }; specifications specification status pointer events obsolete ...
Document: readystatechange event - Web APIs
bubbles no
cancelable no interface event event handler property onreadystatechange examples live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } j...
Document: scroll event - Web APIs
bubbles yes
cancelable no interface event event handler property onscroll note: in ios uiwebviews, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed.
Document: selectionchange event - Web APIs
bubbles no
cancelable no interface event event handler property onselectionchange examples // addeventlistener version document.addeventlistener('selectionchange', () => { console.log(document.getselection()); }); // onselectionchange version document.onselectionchange = () => { console.log(document.getselection()); }; specifications specification status comment selection apithe definition of 'selectionchange' in that specification.
Document: touchend event - Web APIs
bubbles yes
cancelable yes interface touchevent event handler property ontouchend examples code samples for those events are available on the dedicated page: touch events.
Document: touchmove event - Web APIs
bubbles yes
cancelable yes interface touchevent event handler property ontouchmove examples code samples for those events are available on the dedicated page: touch events.
Document: touchstart event - Web APIs
bubbles yes
cancelable yes interface touchevent event handler property ontouchstart examples code samples for those events are available on the dedicated page: touch events.
Document: transitionrun event - Web APIs
bubbles yes
cancelable no interface transitionevent event handler property ontransitionrun the original target for this event is the element that had the transition applied.
Document: transitionstart event - Web APIs
bubbles yes
cancelable no interface transitionevent event handler property globaleventhandlers.ontransitionstart the original target for this event is the element that had the transition applied.
Document: visibilitychange event - Web APIs
bubbles yes
cancelable no interface event event handler property onvisibilitychange usage notes the event doesn't include the document's updated visibility status, but you can get that information from the document's visibilitystate property.
Document: wheel event - Web APIs
bubbles yes
cancelable yes interface wheelevent event handler property globaleventhandlers.onwheel this event replaces the non-standard deprecated mousewheel event.
Element: DOMActivate event - Web APIs
bubbles yes
cancelable yes interface mouseevent examples <svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseprofile="tiny" xmlns:ev="http://www.w3.org/2001/xml-events" width="6cm" height="5cm" viewbox="0 0 600 500"> <desc>example: invoke an ecmascript function from a domactivate event</desc> <!-- ecmascript to change the radius --> <script type="application/ecmascript"><![cdata[ function change(evt) { var circle = evt.target; var currentradius = circle.getfloattrait("r"); if (currentradius == 100) circle.setfloattrait("r", currentradius * 2)...
Element: DOMMouseScroll event - Web APIs
bubbles yes
cancelable yes interface mousescrollevent if you want to prevent the default action of mouse wheel events, it's not enough to handle only this event on gecko because if scroll amount by a native mouse wheel event is less than 1 line (or less than 1 page when the system setting is by page scroll), other mouse wheel events may be fired without this event.
Element: MozMousePixelScroll event - Web APIs
bubbles yes
cancelable yes interface mousescrollevent getting the distance scrolled the event's detail property indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either toward the bottom or toward the right, and positive values indicating scrolling to the top or left.
Element: auxclick event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property onauxclick preventing default actions for the vast majority of browsers that map middle click to opening a link in a new tab, including firefox, it is possible to
cancel this behavior by calling preventdefault() from within an auxclick event handler.
Element: blur event - Web APIs
bubbles no
cancelable no interface focusevent event handler property onblur sync / async sync composed yes examples simple example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result event ...
Element: click event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property onclick if the button is pressed on one element and the pointer is moved outside the element before the button is released, the event is fired on the most specific ancestor element that contained both elements.
Element: compositionstart event - Web APIs
bubbles yes
cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionstart', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="exampl...
Element: compositionupdate event - Web APIs
bubbles yes
cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionupdate', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label>...
Element: contextmenu event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property oncontextmenu examples in this example, the default action of the contextmenu event is
canceled using preventdefault() when the contextmenu event is fired at the first paragraph.
Element: dblclick event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property ondblclick examples this example toggles the size of a card when you double click on it.
Element: error event - Web APIs
bubbles no
cancelable no interface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise.
Element: focus event - Web APIs
bubbles no
cancelable no interface focusevent event handler property onfocus sync / async sync composed yes examples simple example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result e...
Element: focusin event - Web APIs
bubbles yes
cancelable no interface focusevent event handler property onfocusin sync / async sync composed yes examples live example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specificat...
Element: focusout event - Web APIs
bubbles yes
cancelable no interface focusevent event handler property onfocusout sync / async sync composed yes examples live example html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; }); form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specificatio...
Element: fullscreenerror event - Web APIs
bubbles yes
cancelable no interface event event handler property onfullscreenerror as with the fullscreenchange event, two fullscreenerror events are fired; the first is sent to the element which failed to change modes, and the second is sent to the document which contains that element.
Element: keydown event - Web APIs
bubbles yes
cancelable yes interface keyboardevent event handler property onkeydown the keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered.
Element: keypress event - Web APIs
interface keyboardevent bubbles yes
cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <input> element.
Element: keyup event - Web APIs
bubbles yes
cancelable yes interface keyboardevent event handler property onkeyup the keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered.
Element: mousedown event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property onmousedown examples the following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an html5 canvas.
Element: mousemove event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property onmousemove examples the following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an html5 canvas.
Element: mouseout event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property onmouseout examples the following examples show the use of the mouseout event.
Element: mouseover event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property onmouseover examples the following example illustrates the difference between mouseover and mouseenter events.
Element: mouseup event - Web APIs
bubbles yes
cancelable yes interface mouseevent event handler property onmouseup examples the following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an html5 canvas.
Element: mousewheel event - Web APIs
bubbles yes
cancelable yes interface mousewheelevent event handler property onmousewheel the detail property the value of the detail property is always zero, except in opera, which uses detail similarly to the firefox-only dommousescroll event's detail value, which indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either t...
Element: msContentZoom event - Web APIs
bubbles unknown
cancelable unknown interface unknown event handler property unknown example contentzoom.addeventlistener("mscontentzoom", function(e) { zoomfactor.value = contentzoom.mscontentzoomfactor.tofixed(2); }); specifications not part of any specification.
Element: overflow event - Web APIs
bubbles yes
cancelable yes interface uievent event handler property unknown examples <div id="wrapper"> <div id="child"></div> </div> <br/> <label><input type="checkbox" id="toggle" checked/> overflow</label> <style> #wrapper { width: 20px; height: 20px; background: #000; padding: 5px; overflow: hidden; } #child { width: 40px; height: 40px; border: 2px solid grey; background: #ccc; } </style> <script> var wrapper = document.getelementbyid("w...
Element: scroll event - Web APIs
bubbles no
cancelable no interface event event handler property onscroll note: in ios uiwebviews, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed.
Element: select event - Web APIs
bubbles yes
cancelable no interface uievent if generated from a user interface, event otherwise event handler property onselect the event is not available for all elements in all languages.
Element: show event - Web APIs
bubbles no
cancelable no interface event event handler property onshow examples <div contextmenu="test"></div> <menu type="context" id="test"> <menuitem label="alert" onclick="alert('the alert label has been clicked')" /> </menu> <script> document.getelementbyid("test").addeventlistener("show", function(e){ alert("the context menu will be displayed"); }, false); </script> specifications specification status html5the definition of 'show event' in that specification.
Element: touchend event - Web APIs
bubbles yes
cancelable yes interface touchevent event handler property ontouchend examples code samples for those events are available on the dedicated page: touch events.
Element: touchmove event - Web APIs
bubbles yes
cancelable yes interface touchevent event handler property ontouchmove examples code samples for those events are available on the dedicated page: touch events.
Element: touchstart event - Web APIs
bubbles yes
cancelable yes interface touchevent event handler property ontouchstart examples code samples for those events are available on the dedicated page: touch events.
Element: underflow event - Web APIs
bubbles yes
cancelable yes interface uievent event handler property unknown examples <div id="wrapper"> <div id="child"></div> </div> <br/> <label><input type="checkbox" id="toggle" checked/> overflow</label> <style> #wrapper { width: 20px; height: 20px; background: #000; padding: 5px; overflow: hidden; } #child { width: 40px; height: 40px; border: 2px solid grey; background: #ccc; } </style> <script> var wrapper = document.ge...
Element: wheel event - Web APIs
bubbles yes
cancelable yes interface wheelevent event handler property onwheel note: don't confuse the wheel event with the scroll event.
Event.defaultPrevented - Web APIs
the defaultprevented read-only property of the event interface returns a boolean indicating whether or not the call to event.preventdefault()
canceled the event.
Event.returnValue - Web APIs
syntax event.returnvalue = bool; var bool = event.returnvalue; value a boolean value which is true if the event has not been
canceled; otherwise, if the event has been
canceled or the default has been prevented, the value is false.
EventSource: error event - Web APIs
bubbles no
cancelable no interface event or errorevent event handler property eventsource.onerror examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('error', (e) => { console.log("an error occurred while attempting to connect."); }); // onerror version evtsource.onerror = (e) => { console.log("an error occurred while attempting to connect."); }; specifications specification status html living standardthe definition of 'error event' in that specification.
EventSource: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property eventsource.onmessage examples in this basic example, an eventsource is created to receive events from the server; a page with the name sse.php is responsible for generating the events.
EventSource: open event - Web APIs
bubbles no
cancelable no interface event event handler property eventsource.onopen examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('open', (e) => { console.log("the connection has been established."); }); // onopen version evtsource.onopen = (e) => { console.log("the connection has been established."); }; specifications specification status html living standardthe definition of 'open event' in that specification.
FileReader: abort event - Web APIs
bubbles no
cancelable no interface progressevent event handler property filereader.onabort examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log...
FileReader: error event - Web APIs
bubbles no
cancelable no interface progressevent event handler property filereader.onerror examples const fileinput = document.queryselector('input[type="file"]'); const reader = new filereader(); function handleselected(e) { const selectedfile = fileinput.files[0]; if (selectedfile) { reader.addeventlistener('error', () => { console.error(`error occurred reading file: ${selectedfile.name}`); }); reader.addeventlistener('load', () => { console.error(`file: ${selectedfile.name} read successfully`); }); reader.readasdataurl(selectedfile); ...
FileReader: load event - Web APIs
bubbles no
cancelable no interface progressevent event handler property filereader.onload examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border...
FileReader: loadend event - Web APIs
bubbles no
cancelable no interface progressevent event handler property filereader.onloadend examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; hei...
FileReader: loadstart event - Web APIs
bubbles no
cancelable no interface progressevent event handler property filereader.onloadstart examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; ...
FileReader: progress event - Web APIs
bubbles no
cancelable no interface progressevent event handler property filereader.onprogress examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5re...
FileReader.readyState - Web APIs
this could mean that: the entire file or blob has been read into memory, a file read error occurred, or abort() was called and the read was
cancelled.
Guide to the Fullscreen API - Web APIs
mentorshadowroot.fullscreenelement webkitfullscreenelement mozfullscreenelement msfullscreenelement document.onfullscreenchange onwebkitfullscreenchange onmozfullscreenchange onmsfullscreenchange document.onfullscreenerror onwebkitfullscreenerror onmozfullscreenerror onmsfullscreenerror document.exitfullscreen() webkitexitfullscreen() moz
cancelfullscreen() msexitfullscreen() element.requestfullscreen() webkitrequestfullscreen() mozrequestfullscreen() msrequestfullscreen() specifications specification status comment fullscreen api living standard initial version.
HTMLCanvasElement: webglcontextcreationerror event - Web APIs
bubbles yes
cancelable yes interface webglcontextevent event handler property none example var canvas = document.getelementbyid('canvas'); canvas.addeventlistener('webglcontextcreationerror', function(e) { console.log(e.statusmessage || 'unknown error'); }, false); var gl = canvas.getcontext('webgl'); // logs statusmessage or "unknown error" if unable to create webgl context specifications specification status comment webgl 1.0the ...
HTMLCanvasElement: webglcontextlost event - Web APIs
bubbles yes
cancelable yes interface webglcontextevent event handler property none example with the help of the webgl_lose_context extension, you can simulate the webglcontextlost event: const canvas = document.getelementbyid('canvas'); const gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextlost', (event) => { console.log(event); }); gl.getextension('webgl_lose_context').losecontext(); // "webglcontextlost" event is logged.
HTMLCanvasElement: webglcontextrestored event - Web APIs
bubbles yes
cancelable yes interface webglcontextevent event handler property none example with the help of the webgl_lose_context extension, you can simulate the webglcontextrestored event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextrestored', function(e) { console.log(e); }, false); gl.getextensi...
HTMLDialogElement: close event - Web APIs
bubbles no
cancelable no interface event event handler property onclose examples live example html <dialog class="example-dialog"> <button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('close', (event) => { result.textcontent = 'dialog was closed'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeo...
HTMLElement: beforeinput event - Web APIs
bubbles yes
cancelable yes interface inputevent event handler property none sync / async sync composed yes default action update the dom element examples this example logs current value of the element immediately before replacing that value with the new one applied to the <input> element.
HTMLElement: change event - Web APIs
bubbles yes
cancelable no interface event event handler property onchange depending on the kind of element being changed and the way the user interacts with the element, the change event fires at a different moment: when the element is :checked (by clicking or using the keyboard) for <input type="radio"> and <input type="checkbox">; when the user commits the change explicitly (e.g., by selecting a value from a <select>'s dropdown with a mouse click, by selecting a date from a date picker fo...
HTMLElement: input event - Web APIs
bubbles yes
cancelable no interface inputevent event handler property globaleventhandlers.oninput the event also applies to elements with contenteditable enabled, and to any element when designmode is turned on.
HTMLElement: lostpointercapture event - Web APIs
bubbles yes
cancelable no interface pointerevent event handler property onlostpointercapture examples this example listens for the lostpointercapture event for an element, and captures the pointer for the element on pointerdown.
HTMLElement: pointerdown event - Web APIs
bubbles yes
cancelable yes interface pointerevent event handler property onpointerdown examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerdown', (event) => { console.log('pointer down event'); }); using the onpointerdown event handler property: const para = document.queryselector('p'); para.onpointerdown = (event) => { console.log('pointer down event'); }...
HTMLElement: pointerenter event - Web APIs
bubbles no
cancelable no interface pointerevent event handler property onpointerenter examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerenter', (event) => { console.log('pointer entered element'); }); using the onpointerenter event handler property: const para = document.queryselector('p'); para.onpointerenter = (event) => { console.log('pointer entered element'); }; specifications specification status pointer events ...
HTMLElement: pointerleave event - Web APIs
bubbles no
cancelable no interface pointerevent event handler property onpointerleave examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerleave', (event) => { console.log('pointer left element'); }); using the onpointerleave event handler property: const para = document.queryselector('p'); para.onpointerleave = (event) => { console.log('pointer left element'); }; specifications specification status pointer events obsolete ...
HTMLElement: pointerover event - Web APIs
bubbles yes
cancelable yes interface pointerevent event handler property onpointerover examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerover', (event) => { console.log('pointer moved in'); }); using the onpointerover event handler property: const para = document.queryselector('p'); para.onpointerover = (event) => { console.log('pointer moved in'); }; specifications specification status pointer events obsolete ...
HTMLElement: pointerup event - Web APIs
bubbles yes
cancelable yes interface pointerevent event handler property onpointerup examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerup', (event) => { console.log('pointer up'); }); using the onpointerup event handler property: const para = document.queryselector('p'); para.onpointerup = (event) => { console.log('pointer up'); }; specifications specification status pointer events obsolete ...
HTMLElement: transitionstart event - Web APIs
bubbles yes
cancelable no interface transitionevent event handler property ontransitionstart examples this code adds a listener to the transitionstart event: element.addeventlistener('transitionstart', () => { console.log('started transitioning'); }); the same, but using the ontransitionstart property instead of addeventlistener(): element.ontransitionrun = () => { console.log('started transitioning'); }; live example in the following example, we have a simple <div> element, styled with a transition that includes a delay: <div class="transition">hover over me</div> <div class="message"></div> .tra...
HTMLFormElement: formdata event - Web APIs
general info bubbles no
cancelable no interface formdataevent event handler property globaleventhandlers.onformdata examples // grab reference to form const formelem = document.queryselector('form'); // submit handler formelem.addeventlistener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired')...
HTMLFormElement: reset event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble)
cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for form resets, and logs the current event.timestamp whenever that occurs.
HTMLFormElement: submit event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble)
cancelable yes interface submitevent event handler property globaleventhandlers.onsubmit note that the submit event fires on the <form> element itself, and not on any <button> or <input type="submit"> inside it.
HTMLInputElement: invalid event - Web APIs
bubbles no
cancelable yes interface event event handler property globaleventhandlers.oninvalid this event can be useful for displaying a summary of the problems with a form on submission.
HTMLInputElement: search event - Web APIs
bubbles yes
cancelable no interface event event handler property onsearch there are several ways a search can be initiated, such as by pressing enter while the <input> is focused, or, if the incremental attribute is present, after a ua-defined timeout elapses since the most recent keystroke (with new keystrokes resetting the timeout so the firing of the event is debounced).
HTMLMediaElement: abort event - Web APIs
bubbles no
cancelable no interface event event handler property onabort examples const video = document.queryselector('video'); const videosrc = 'https://path/to/video.webm'; video.addeventlistener('abort', () => { console.log(`abort loading: ${videosrc}`); }); const source = document.createelement('source'); source.setattribute('src', videosrc); source.setattribute('type', 'video/webm'); video.appendchild(source); specifications specification status html living standard living standard html5 recommendation ...
HTMLMediaElement: canplay event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.oncanplay specification html5 media examples these examples add an event listener for the htmlmediaelement's canplay event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: canplaythrough event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.oncanplaythrough specification html5 media examples these examples add an event listener for the htmlmediaelement's canplaythrough event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: durationchange event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.ondurationchange specification html5 media examples these examples add an event listener for the htmlmediaelement's durationchange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: emptied event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onemptied specification html5 media examples these examples add an event listener for the htmlmediaelement's emptied event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: ended event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onended specification html5 media this event is also defined in media capture and streams and web audio api examples these examples add an event listener for the htmlmediaelement's ended event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: error event - Web APIs
bubbles no
cancelable no interface event event handler property onerror examples const video = document.queryselector('video'); const videosrc = 'https://path/to/video.webm'; video.addeventlistener('error', () => { console.error(`error loading: ${videosrc}`); }); video.setattribute('src', videosrc); specifications specification status html living standard living standard html5 recommendation ...
HTMLMediaElement: loadeddata event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onloadeddata specification html5 media note that this event will not fire in mobile/tablet devices if data-saver is on in browser settings.
HTMLMediaElement: loadedmetadata event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onloadedmetadata specification html5 media additional properties property type description mozchannels read only int the number of channels.
HTMLMediaElement: loadstart event - Web APIs
bubbles no
cancelable no interface event event handler property onloadstart examples live example html <div class="example"> <button type="button">load video</button> <video controls width="250"></video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } vide...
HTMLMediaElement: pause event - Web APIs
general info bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onpause specification html5 media examples these examples add an event listener for the htmlmediaelement's pause event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: play event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onplay specification html5 media examples these examples add an event listener for the htmlmediaelement's play event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: playing event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onplaying specification html5 media examples these examples add an event listener for the htmlmediaelement's playing event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: progress event - Web APIs
bubbles no
cancelable no interface event event handler property onprogress examples live example html <div class="example"> <button type="button">load video</button> <video controls width="250"></video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } video { ...
HTMLMediaElement: ratechange event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onratechange specification html5 media examples these examples add an event listener for the htmlmediaelement's ratechange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: seeked event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onseeked specification html5 media examples these examples add an event listener for the htmlmediaelement's seeked event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: seeking event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onseeking specification html5 media examples these examples add an event listener for the htmlmediaelement's seeking event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: stalled event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onstalled specification html5 media examples these examples add an event listener for the htmlmediaelement's stalled event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: suspend event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onsuspend specification html5 media examples these examples add an event listener for the htmlmediaelement's suspend event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: timeupdate event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.ontimeupdate specification html5 media examples these examples add an event listener for the htmlmediaelement's timeupdate event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: volumechange event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onvolumechange specification html5 media examples these examples add an event listener for the htmlmediaelement's volumechange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: waiting event - Web APIs
bubbles no
cancelable no interface event target element default action none event handler property globaleventhandlers.onwaiting specification html5 media examples these examples add an event listener for the htmlmediaelement's waiting event, then post a message when that event handler has reacted to the event firing.
HTMLTrackElement: cuechange event - Web APIs
bubbles no
cancelable no interface event event handler oncuechange examples on the texttrack you can set up a listener for the cuechange event on a texttrack using the addeventlistener() method: track.addeventlistener('cuechange', function () { let cues = track.activecues; // array of current cues }); or you can just set the oncuechange event handler property: track.oncuechange = function () { let cues = track.activecues; // array of current cues } on the track element the underlying texttrack, indicated by the track property, receives...
onMSVideoOptimalLayoutChanged - Web APIs
syntax value description event property object.onmsvideooptimallayoutchanged = handler; attachevent method object.attachevent("onmsvideooptimallayoutchanged", handler) addeventlistener method object.addeventlistener("", handler, usecapture) synchronous no bubbles no
cancelable no see also msislayoutoptimalforplayback htmlvideoelement microsoft api extensions ...
IDBDatabase: abort event - Web APIs
bubbles yes
cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event.
IDBDatabase: close event - Web APIs
bubbles no
cancelable no interface event event handler property onerror examples this example opens a database and listens for the close event: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keyp...
IDBDatabase: error event - Web APIs
bubbles yes
cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain...
IDBDatabase: versionchange event - Web APIs
bubbles no
cancelable no interface event event handler property onversionchange examples this example opens a database and, on success, adds a listener to versionchange: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.c...
IDBOpenDBRequest: blocked event - Web APIs
bubbles no
cancelable no interface idbversionchangeevent event handler property onblocked examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); object...
IDBOpenDBRequest: upgradeneeded event - Web APIs
bubbles no
cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store.
IDBRequest: error event - Web APIs
bubbles yes
cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data it...
IDBRequest: success event - Web APIs
bubbles no
cancelable no interface event event handler property onsuccess examples this example tries to open a database and listens for the success event using addeventlistener(): // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minut...
IDBTransaction: abort event - Web APIs
bubbles yes
cancelable no interface event event handler property onabort this can happen for any of the following reasons: bad requests, (for example, trying to add the same key twice, or put the same index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded.
IDBTransaction: complete event - Web APIs
bubbles no
cancelable no interface event event handler property oncomplete examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore...
IDBTransaction: error event - Web APIs
bubbles yes
cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will con...
IDBTransactionSync - Web APIs
methods abort() call this method to signal a need to
cancel the effects of the operations performed by this transaction.
InputEvent() - Web APIs
ranges: (optional) an array of static ranges that will be affected by a change to the dom if the input event is not
canceled.
InputEvent.getTargetRanges() - Web APIs
the gettargetranges() property of the inputevent interface returns an array of static ranges that will be affected by a change to the dom if the input event is not
canceled.
InputEvent - Web APIs
inputevent.gettargetranges() returns an array of static ranges that will be affected by a change to the dom if the input event is not
canceled.
KeyboardEvent: code values - Web APIs
0x007f "pause" "pause" 0x0080 "unidentified" "" 0x0081 "numpadcomma" "" 0x0082 "lang1" "hangulmode" 0x0083 "lang2" "hanja" 0x0084 "intlyen" "intlyen" 0x0085 "osleft" "osleft" 0x0086 "osright" "osright" 0x0087 "contextmenu" "contextmenu" 0x0088 "browserstop" "
cancel" 0x0089 "again" "" 0x008a "props" "" 0x008b "undo" "undo" 0x008c "select" "" 0x008d "copy" "copy" 0x008e "open" "" 0x008f "paste" "paste" 0x0090 "find" "" 0x0091 "cut" "cut" 0x0092 "help" "help" 0x0093 "unidentified" "" 0x009...
KeyboardEvent.key - Web APIs
} //
cancel the default action to avoid it being handled twice event.preventdefault(); }, true); specification specification status comment ui eventsthe definition of 'keyboardevent.key' in that specification.
KeyboardEvent.keyCode - Web APIs
example window.addeventlistener("keydown", function (event) { if (event.defaultprevented) { return; // should do nothing if the default action has been
cancelled } var handled = false; if (event.key !== undefined) { // handle the event with keyboardevent.key and set handled true.
LockedFile - Web APIs
lockedfile.abort() makes the lockedfile inactive and
cancels all ongoing operations.
MSCandidateWindowHide - Web APIs
general info synchronous no bubbles no
cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event.
MSCandidateWindowShow - Web APIs
general info synchronous no bubbles no
cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event.
MSCandidateWindowUpdate - Web APIs
general info synchronous no bubbles no
cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event.
MSManipulationEvent - Web APIs
example interface msmanipulationevent extends uievent { readonly currentstate: number; readonly inertiadestinationx: number; readonly inertiadestinationy: number; readonly laststate: number; initmsmanipulationevent(typearg: string, canbubblearg: boolean,
cancelablearg: boolean, viewarg: window, detailarg: number, laststate: number, currentstate: number): void; readonly ms_manipulation_state_active: number; readonly ms_manipulation_state_
cancelled: number; readonly ms_manipulation_state_committed: number; readonly ms_manipulation_state_dragging: number; readonly ms_manipulation_state_inertia: number; readonly ms_manipulation_state...
MediaDevices: devicechange event - Web APIs
bubbles no
cancelable no interface event event handler ondevicechange example you can use the devicechange event in an addeventlistener method: navigator.mediadevices.addeventlistener('devicechange', function(event) { updatedevicelist(); }); or use the ondevicechange event handler property: navigator.mediadevices.ondevicechange = function(event) { updatedevicelist(); } specifications specification status media capture and streamsthe definition of 'devicechange' in that specification.
MediaError.message - Web APIs
the error handler looks like this: audioelement.onerror = function() { let s = ""; let err = audioelement.error; switch(err.code) { case mediaerror.media_err_aborted: s += "the user
canceled the audio."; break; case mediaerror.media_err_network: s+= "a network error occurred while fetching the audio."; break; case mediaerror.media_err_decode: s+= "an error occurred while decoding the audio."; break; case mediaerror.media_err_src_not_supported: s+= "the audio is missing or is in a format not supported by your browser.
MediaRecorder: dataavailable event - Web APIs
bubbles no
cancelable no interface blobevent event handler property ondataavailable for details of the all the possible reasons this event may raise, see the documentation for the event handler property: ondataavailable.
MediaRecorder: error event - Web APIs
bubbles no
cancelable no interface mediarecordererrorevent event handler property onerror for details of the all the possible errors see the documentation for the event handler property: onerror.
MediaStream: addtrack event - Web APIs
bubbles no
cancelable no interface mediastreamtrackevent event handler property onaddtrack examples using addeventlistener(): let stream = new mediastream(); stream.addeventlistener('addtrack', (event) => { console.log(`new ${event.track.kind} track added`); }); using the onaddtrack event handler property: let stream = new mediastream(); stream.onaddtrack = (event) => { console.log(`new ${event.track.kind} track added`); }; specifications specification status media capture and streamsthe definition of 'addtrack' in that specification.
MediaStream: removetrack event - Web APIs
bubbles no
cancelable no interface mediastreamtrackevent event handler property onremovetrack examples using addeventlistener(): let stream = new mediastream(); stream.addeventlistener('removetrack', (event) => { console.log(`${event.track.kind} track removed`); }); using the onremovetrack event handler property: let stream = new mediastream(); stream.onremovetrack = (event) => { console.log(`${event.track.kind} track removed`); }; specifications specification status media capture and streamsthe definition of 'removetrack' in that specification.
MediaStreamConstraints.audio - Web APIs
color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ audio: { samplesize: 8, echo
cancellation: true } }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which calls getusermedia(), specifying a set of audio constraints requesting that echo
cancellation be enabled and that, if possible, the sample rate be 8 bits per sample instead of the more common 16 bits (possibl...
MediaStreamEvent() - Web APIs
"
cancelable", optional and defaulting to false, inherited from eventinit, and indicating if the event can be
canceled or not.
MediaStreamTrack.applyConstraints() - Web APIs
the applyconstraints() method of the mediastreamtrack interface applies a set of constraints to the track; these constraints let the web site or app establish ideal values and acceptable ranges of values for the constrainable properties of the track, such as frame rate, dimensions, echo
cancelation, and so forth.
MediaStreamTrack: ended event - Web APIs
bubbles no
cancelable no interface event event handler property mediastreamtrack.onended usage notes ended events fire when the media stream track's source permanently stops sending data on the stream.
MediaStreamTrack: mute event - Web APIs
bubbles no
cancelable no interface event event handler property onmute examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack referenced by musictrack.
MediaStreamTrack: unmute event - Web APIs
bubbles no
cancelable no interface event event handler property onunmute note: the condition that most people think of as "muted" (that is, a user-controllable way to silence a track) is actually managed using the mediastreamtrack.enabled property, for which there are no events.
MediaTrackSettings - Web APIs
echo
cancellation a boolean indicating the current value of the echo
cancellation property, specifying true if echo
cancellation is enabled, otherwise false.
Capabilities, constraints, and settings - Web APIs
let videodefaultconstraintstring = '{\n "width": 320,\n "height": 240,\n "framerate": 30\n}'; let audiodefaultconstraintstring = '{\n "samplesize": 16,\n "channelcount": 2,\n "echo
cancellation": false\n}'; these defaults ask for a pretty common camera configuration, but don't insist on any property being of special importance.
MessagePort: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessage examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage...
MessagePort: messageerror event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessageerror examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); })...
MouseEvent - Web APIs
html <p><label><input type="checkbox" id="checkbox"> checked</label> <p><button id="button">click me</button> javascript function simulateclick() { var evt = new mouseevent("click", { bubbles: true,
cancelable: true, view: window }); var cb = document.getelementbyid("checkbox"); //element to click on var
canceled = !cb.dispatchevent(evt); if(
canceled) { // a handler called preventdefault alert("
canceled"); } else { // none of the handlers called preventdefault alert("not
canceled"); } } document.getelementbyid("button").addeventlistener('click', simulateclick); resu...
MouseScrollEvent - Web APIs
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean
cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description axis read only ...
Navigator.share() - Web APIs
it will reject immediately if the data parameter is not correctly specified, and will also reject if the user
cancels sharing.
Navigator.vibrate() - Web APIs
passing a value of 0, an empty array, or an array containing all zeros will
cancel any currently ongoing vibration pattern.
OfflineAudioContext: complete event - Web APIs
bubbles no
cancelable no default action none interface offlineaudiocompletionevent event handler property offlineaudiocontext.oncomplete examples when processing is complete, you might want to use the oncomplete handler the prompt the user that the audio can now be played, and enable the play button: let offlineaudioctx = new offlineaudiocontext(); offlineaudioctx.addeventlistener('complete', () => { console.log('offline audio processing now complete'); showmodaldialog('song processed and ready to play'); playbtn.disabled = false; }) you can also set up the event handler using the offlineaudioco...
PaymentRequest: shippingaddresschange event - Web APIs
bubbles no
cancelable no interface paymentrequestupdateevent event handler property onshippingaddresschange usage notes depending on the browser, the shipping address information may be redacted for privacy reasons.
PaymentResponse: payerdetailchange event - Web APIs
bubbles no
cancelable no interface paymentrequestupdateevent event handler property onpayerdetailchange examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping addr...
PointerEvent.PointerEvent() - Web APIs
example var moveevent = new pointerevent("pointermove"); var downevent = new pointerevent("pointerdown", {pointerid: 1, bubbles: true,
cancelable: true, pointertype: "touch", width: 100, height: 100, isprimary: true }); ...
RTCDTMFSender: tonechange event - Web APIs
bubbles no
cancelable no interface rtcdtmftonechangeevent event handler property ontonechange to determine what tone started playing, or if a tone stopped playing, check the value of the event's tone property.
RTCDataChannel: bufferedamountlow event - Web APIs
bubbles no
cancelable no interface event event handler property onbufferedamountlow examples this example sets up a handler for bufferedamountlow to request more data any time the data channel's buffer falls below the number of bytes specified by bufferedamountlowthreshold, which we have set to 65536.
RTCDataChannel: close event - Web APIs
bubbles no
cancelable no interface event event handler property rtcdatachannel.onclose examples this example sets up a handler for the close event for the rtcdatachannel named dc; its responsibility in this example is to update user interface elements to reflect that there is no longer an ongoing call, and to allow a new call to be started.
RTCDataChannel: error event - Web APIs
bubbles yes
cancelable no interface rtcerrorevent event handler property onerror the rtcerrorevent object provides details about the error that occurred; see that article for details.
RTCDataChannel: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessage note: the message event uses as its event object type the messageevent interface defined by the html specification.
RTCDataChannel: open event - Web APIs
bubbles no
cancelable no interface rtcdatachannelevent event handler property onopen examples this example adds to the rtcdatachannel dc a handler for the open event that adjusts the user interface to indicate that a chat window is ready to be used after a connection has been established.
RTCIceTransport: gatheringstatechange event - Web APIs
bubbles no
cancelable no interface event event handler property ongatheringstatechange the key difference between gatheringstatechange and icegatheringstatechange is that the latter represents the overall state of the connection including every rtcicetransport used by every rtcrtpsender and every rtcrtpreceiver on the entire connection.
RTCIceTransport: selectedcandidatepairchange event - Web APIs
bubbles no
cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user information about the progress of the ice negotiation for an rtcpeerconnection called pc.
RTCIceTransport.state - Web APIs
the transport may revert from the "connected" state to the "checking" state if either peer decides to
cancel consent to use the selected candidate pair, and may revert to "disconnected" if there are no candidates left to check but one or both clients are still gathering candidates.
RTCIceTransport: statechange event - Web APIs
bubbles no
cancelable no interface event event handler property rtcicetransport.onstatechange examples given an rtcpeerconnection, pc, the following code creates an event handler that calls a function named handlefailure() if the ice transport enters a failure state.
RTCIceTransportState - Web APIs
the transport may revert from the "connected" state to the "checking" state if either peer decides to
cancel consent to use the selected candidate pair, and may revert to "disconnected" if there are no candidates left to check but one or both clients are still gathering candidates.
RTCPeerConnection: addstream event - Web APIs
bubbles no
cancelable no interface mediastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event.
RTCPeerConnection: connectionstatechange event - Web APIs
bubbles no
cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session.
RTCPeerConnection: datachannel event - Web APIs
bubbles no
cancelable no interface rtcdatachannelevent event handler property ondatachannel examples this example sets up a function that handles datachannel events by gathering the information needed to communicate with the newly added rtcdatachannel and by adding event handlers for the events that occur on that channel.
RTCPeerConnection: icegatheringstatechange event - Web APIs
bubbles no
cancelable no interface event event handler onicegatheringstatechange note: while you can determine that ice candidate gathering is complete by watching for icegatheringstatechange events and checking for the value of icegatheringstate to become complete, you can also simply have your handler for the icecandidate event look to see if its candidate property is null.
RTCPeerConnection: icecandidate event - Web APIs
bubbles no
cancelable no interface rtcpeerconnectioniceevent event handler property rtcpeerconnection.onicecandidate description there are three reasons why the icecandidate event is fired on an rtcpeerconnection.
RTCPeerConnection: icecandidateerror event - Web APIs
bubbles no
cancelable no interface rtcpeerconnectioniceerrorevent event handler property rtcpeerconnection.onicecandidateerror description the error object's errorcode property is one of the numeric stun error codes.
RTCPeerConnection: identityresult event - Web APIs
bubbles no
cancelable no interface rtcidentityevent event handler property onidentityresult specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'identityresult' in that specification.
RTCPeerConnection: idpassertionerror event - Web APIs
bubbles no
cancelable no interface rtcidentityerrorevent event handler property onidpassertionerror warning: this event is no longer used; instead, you can detect an assertion error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected.
RTCPeerConnection: idpvalidationerror event - Web APIs
bubbles no
cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror warning: this event is no longer used; instead, you can detect a validation error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected.
RTCPeerConnection: negotiationneeded event - Web APIs
bubbles no
cancelable no interface event event handler property rtcpeerconnection.onnegotiationneeded the negotiationneeded event is first dispatched to the rtcpeerconnection when media is first added to the connection.
RTCPeerConnection: peeridentity event - Web APIs
bubbles no
cancelable no interface event event handler property onpeeridentity important: this event and its event handler have been removed from the specification and are no longer available.
RTCPeerConnection: removestream event - Web APIs
bubbles no
cancelable no interface mediastreamevent event handler property rtcpeerconnection.onremovestream important: this event has been removed from the webrtc specification in favor of the existing removetrack event on the remote mediastream and the corresponding mediastream.onremovetrack event handler property of the remote mediastream.
RTCPeerConnection: signalingstatechange event - Web APIs
bubbles no
cancelable no interface event event handler property rtcpeerconnection.onsignalingstatechange examples given an rtcpeerconnection, pc, and an updatestatus() function that presents status information to the user, this code sets up an event handler to let the user know when the ice negotiation process finishes up.
RTCPeerConnection: track event - Web APIs
bubbles yes
cancelable no interface rtctrackevent event handler property ontrack by the time this event is delivered, the new track has been fully added to the peer connection.
ReadableStream - Web APIs
methods readablestream.
cancel()
cancels the stream, signaling a loss of interest in the stream by a consumer.
Request.cache - Web APIs
now() - 86400000)) { // if older than 24 hours controller.abort() controller = new abortcontroller(); return fetch("some.json", {cache: "reload", mode: "same-origin", signal: controller.signal}) } // other possible conditions if (dt < (date.now() - 300000)) // if it's older than 5 minutes fetch("some.json", {cache: "no-cache", mode: "same-origin"}) // no
cancellation or return value.
SVGAnimationElement: beginEvent event - Web APIs
bubbles no
cancelable no interface timeevent event handler property onbegin examples animated circle <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px"> <title>svg smil animate with path</title> <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indefinite" /...
SVGAnimationElement: endEvent event - Web APIs
bubbles no
cancelable no interface timeevent event handler property onend examples animated circle <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px"> <title>svg smil animate with path</title> <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indefinite" /> ...
SVGAnimationElement: repeatEvent event - Web APIs
bubbles no
cancelable no interface timeevent event handler property onrepeat examples animated circle <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px"> <title>svg smil animate with path</title> <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indefinite" ...
SVGElement: abort event - Web APIs
bubbles no
cancelable no interface svgevent event handler property onabort examples svgelem.addeventlistener('abort', () => { console.log('load aborted.'); }) specifications not really described anywhere specifically, but mentioned in the svg 2 spec.
SVGElement: error event - Web APIs
bubbles yes
cancelable no interface svgevent event handler property onerror examples svgelem.addeventlistener('error', () => { console.log('svg not loaded properly.'); }) specifications specification status comment scalable vector graphics (svg) 2the definition of 'error' in that specification.
SVGElement: load event - Web APIs
bubbles no
cancelable no interface svgevent event handler property onload examples svgelem.addeventlistener('load', () => { console.log('svg loaded.'); }) specifications specification status comment scalable vector graphics (svg) 2the definition of 'load' in that specification.
SVGElement: resize event - Web APIs
bubbles no
cancelable no interface svgevent event handler property onresize examples svgelem.addeventlistener('resize', () => { console.log('svg resized.'); }) specifications specification status comment scalable vector graphics (svg) 2the definition of 'event changes in svg2' in that specification.
SVGElement: scroll event - Web APIs
bubbles no
cancelable no interface svgevent event handler property onscroll examples svgelem.addeventlistener('scroll', () => { console.log('svg scrolled.'); }) specifications specification status comment scalable vector graphics (svg) 2the definition of 'event changes in svg2' in that specification.
SVGElement: unload event - Web APIs
bubbles no
cancelable no interface svgevent event handler property onunload examples svgelem.addeventlistener('unload', () => { console.log('svg unloaded.'); }) specifications specification status comment scalable vector graphics (svg) 2the definition of 'unload' in that specification.
SVGElement: zoom event - Web APIs
bubbles yes
cancelable no interface svgevent event handler property onzoom examples svgelem.addeventlistener('zoom', () => { console.log('svg zoomed.'); }) ...
Using the Screen Capture API - Web APIs
this could be refined further by specifying additional information for each of audio and video: const gdmoptions = { video: { cursor: "always" }, audio: { echo
cancellation: true, noisesuppression: true, samplerate: 44100 } } in this example the cursor will always be visible in the capture, and the audio track should ideally have noise suppression and echo
cancellation features enabled, as well as an ideal audio sample rate of 44.1khz.
ScriptProcessorNode: audioprocess event - Web APIs
bubbles no
cancelable no default action none interface audioprocessingevent event handler property scriptprocessornode.onaudioprocess examples scriptnode.addeventlistener('audioprocess', function(audioprocessingevent) { // the input buffer is a song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingevent.outputbuffer; // loop through the output channels (in this case there is only one) for (var channel = 0; channel < outputbuffer.numberofchannels; c...
ServiceWorkerContainer: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessage examples in this example the service worker get the client's id from a fetch event and then sends it a message using client.postmessage: // in the service worker async function messageclient(clientid) { const client = await clients.get(clientid); client.postmessage('hi client!'); } addeventlistener('fetch', (event) => { messageclient(event.clientid); event.respondwith(() => { // ...
ServiceWorkerGlobalScope: activate event - Web APIs
bubbles no
cancelable no interface extendableevent event handler property serviceworkerglobalscope.onactivate examples the following snippet shows how you could use an activate event handler to upgrade a cache.
ServiceWorkerGlobalScope: install event - Web APIs
bubbles no
cancelable no interface extendableevent event handler property serviceworkerglobalscope.oninstall examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the service worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', ...
ServiceWorkerGlobalScope: message event - Web APIs
bubbles no
cancelable no interface extendablemessageevent event handler property onmessage examples in the below example a page gets a handle to the serviceworker object via serviceworkerregistration.active, and then calls its postmessage() function.
ServiceWorkerGlobalScope: notificationclick event - Web APIs
bubbles no
cancelable no interface notificationevent event handler onnotificationclick examples you can use the notificationclick event in an addeventlistener method: self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.ur...
ServiceWorkerGlobalScope: push event - Web APIs
bubbles no
cancelable no interface pushevent event handler property onpush example this example sets up a handler for push events that takes json data, parses it, and dispatches the message for handling based on information contained within the message.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
bubbles no
cancelable no interface pushsubscriptionchangeevent event handler property onpushsubscriptionchange usage notes although examples demonstrating how to share subscription related information with the application server tend to use fetch(), this is not necessarily the best choice for real-world use, since it will not work if the app is offline, for example.
SharedWorkerGlobalScope: connect event - Web APIs
bubbles no
cancelable no interface messageevent event handler property sharedworkerglobalscope.onconnect examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the onconnect event handler fires.
SpeechRecognition: audioend event - Web APIs
bubbles no
cancelable no interface event event handler onaudioend examples you can use the audioend event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('audioend', function() { console.log('audio capturing ended'); }); or use the onaudioend event handler property: recognition.onaudioend = function() { console.log('audio capturing ended'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition: audiostart event - Web APIs
bubbles no
cancelable no interface event event handler onaudiostart examples you can use the audiostart event in an onaudiostart method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('audiostart', function() { console.log('audio capturing started'); }); or use the onaudiostart event handler property: recognition.onaudiostart = function() { console.log('audio capturing started'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition: end event - Web APIs
bubbles no
cancelable no interface event event handler property onend examples you can use the end event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('end', function() { console.log('speech recognition service disconnected'); }); or use the onend event handler property: recognition.onend = function() { console.log('speech recognition service disconnected'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification...
SpeechRecognition: error event - Web APIs
bubbles no
cancelable no interface speechrecognitionerrorevent event handler property onerror examples you can use the error event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('error', function(event) { console.log('speech recognition error detected: ' + event.error'); }); or use the onerror event handler property: recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error'); } specifications specification status comment web speech apithe definition...
SpeechRecognition: nomatch event - Web APIs
bubbles no
cancelable no interface speechrecognitionevent event handler property onnomatch examples you can use the nomatch event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('nomatch', function() { console.log('speech not recognized'); }); or use the onnomatch event handler property: recognition.onnomatch = function() { console.log('speech not recognized'); } specifications specific...
SpeechRecognition: result event - Web APIs
the result event of the web speech api is fired when the speech recognition service returns a result — a word or phrase has been positively recognized and this has been communicated back to the app bubbles no
cancelable no interface speechrecognitionevent event handler property onresult examples this code is excerpted from our speech color changer example.
SpeechRecognition: soundend event - Web APIs
bubbles no
cancelable no interface event event handler property onsoundend examples you can use the soundend event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('soundend', function(event) { console.log('sound has stopped being received'); }); or use the onsoundend event handler property: recognition.onsoundend = function(event) { console.log('sound has stopped being received'); } specifications specification status comment web speech apithe definition of 'speech recognition eve...
SpeechRecognition: soundstart event - Web APIs
bubbles no
cancelable no interface event event handler property onsoundstart examples you can use the soundstart event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('soundstart', function() { console.log('some sound is being received'); }); or use the onsoundstart event handler property: recognition.onsoundstart = function() { console.log('some sound is being received'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that spec...
SpeechRecognition: speechend event - Web APIs
bubbles no
cancelable no interface event event handler property onspeechend examples you can use the speechend event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('speechend', function() { console.log('speech has stopped being detected'); }); or use the onspeechend event handler property: recognition.onspeechend = function() { console.log('speech has stopped being detected'); } specifications specification status comment web speech apithe definition of 'speech recognition ...
SpeechRecognition: speechstart event - Web APIs
bubbles no
cancelable no interface event event handler property onspeechstart examples you can use the speechstart event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('speechstart', function() { console.log('speech has been detected'); }); or use the onspeechstart event handler property: recognition.onspeechstart = function() { console.log('speech has been detected'); } specifications specification status comment web speech apithe definition of 'speech recognition even...
SpeechRecognition: start event - Web APIs
bubbles no
cancelable no interface event event handler property onstart examples you can use the start event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('start', function() { console.log('speech recognition service has started'); }); or use the onstart event handler property: recognition.onstart = function() { console.log('speech recognition service has started'); } specifications specification ...
SpeechSynthesis: voiceschanged event - Web APIs
the voiceschanged event of the web speech api is fired when the list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed (when the voiceschanged event fires.) bubbles no
cancelable no interface event event handler property onvoiceschanged examples this could be used to repopulate a list of voices that the user can choose between when the event fires.
SpeechSynthesisUtterance: boundary event - Web APIs
bubbles no
cancelable no interface speechsynthesisevent event handler onboundary examples you can use the boundary event in an addeventlistener method: utterthis.addeventlistener('boundary', function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); }); or use the onboundary event handler property: utterthis.onboundary = function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utteranc...
SpeechSynthesisUtterance: end event - Web APIs
bubbles no
cancelable no interface speechsynthesisevent event handler property onend examples you can use the end event in an addeventlistener method: utterthis.addeventlistener('end', function(event) { console.log('utterance has finished being spoken after ' + event.elapsedtime + ' milliseconds.'); }); or use the onend event handler property: utterthis.onend = function(event) { console.log('utterance has finished being spoken after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utte...
SpeechSynthesisUtterance: error event - Web APIs
bubbles no
cancelable no interface speechsynthesiserrorevent event handler property onerror examples you can use the error event in an addeventlistener method: utterthis.addeventlistener('error', function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error'); }); or use the onerror event handler property: utterthis.onerror = function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error'); } specifications specification status comment web speech apithe definition of 'spee...
SpeechSynthesisUtterance: mark event - Web APIs
bubbles no
cancelable no interface speechsynthesisevent event handler property onmark examples you can use the mark event in an addeventlistener method: utterthis.addeventlistener('mark', function(event) { console.log('a mark was reached: ' + event.name); }); or use the onmark event handler property: utterthis.onmark = function(event) { console.log('a mark was reached: ' + event.name); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specification.
SpeechSynthesisUtterance: pause event - Web APIs
bubbles no
cancelable no interface speechsynthesisevent event handler property onpause examples you can use the pause event in an addeventlistener method: utterthis.addeventlistener('pause', function(event) { console.log('speech paused after ' + event.elapsedtime + ' milliseconds.'); }); or use the onpause event handler property: utterthis.onpause = function(event) { console.log('speech paused after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specifica...
SpeechSynthesisUtterance: resume event - Web APIs
bubbles no
cancelable no interface speechsynthesisevent event handler property onresume examples you can use the resume event in an addeventlistener method: utterthis.addeventlistener('resume', function(event) { console.log('speech resumed after ' + event.elapsedtime + ' milliseconds.'); }); or use the onresume event handler property: utterthis.onresume = function(event) { console.log('speech resumed after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specification.
SpeechSynthesisUtterance: start event - Web APIs
bubbles no
cancelable no interface speechsynthesisevent event handler property onstart examples you can use the start event in an addeventlistener method: utterthis.addeventlistener('start', function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); }); or use the onstart event handler property: utterthis.onstart = function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specifica...
TextTrack: cuechange event - Web APIs
bubbles no
cancelable no interface event event handler property globaleventhandlers.oncuechange examples on the texttrack you can set up a listener for the cuechange event on a texttrack using the addeventlistener() method: track.addeventlistener('cuechange', function () { let cues = track.activecues; // array of current cues }); or you can just set the oncuechange event handler property: track.oncuechange = function () { let cues = track.activecues; // array of current cues } on the track element the underlying texttrack, indicated by ...
TextTrackList: addtrack event - Web APIs
bubbles no
cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.addeventlistener('addtrack', (event) => { console.log(`text track: ${event.track.label} added`); }); using the onaddtrack event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.onaddtrack = (event) => { console.log(`text track: ${event.track.label} added`); }; specifications specification status html living standardthe definition of 'addtrack' in that specification.
TextTrackList: change event - Web APIs
bubbles no
cancelable no interface event event handler property onchange examples using addeventlistener(): const mediaelement = document.queryselectorall('video, audio')[0]; mediaelement.texttracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); using the onchange event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; specifications specification status html living standardthe definition of 'change' in that specification.
TextTrackList: removeTrack event - Web APIs
bubbles no
cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.addeventlistener('removetrack', (event) => { console.log(`text track: ${event.track.label} removed`); }); using the onremovetrack event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.onremovetrack = (event) => { console.log(`text track: ${event.track.label} removed`); }; specifications specification status html living standardthe definition of 'removetrack' in that specificatio...
Supporting both TouchEvent and MouseEvent - Web APIs
further handling ev.preventdefault(); } event order although the specific ordering of touch and mouse events is implementation-defined, the standard indicates the following order is typical: for single input: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend mousemove mousedown mouseup click if the touchstart, touchmove or touchend event is
canceled during an interaction, no mouse or click events will be fired, and the resulting sequence of events would just be: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend community touch events community group mail list w3c #touchevents irc channel related topics and resources touch events overview using touch events touch and mouse (together...
UIEvent - Web APIs
uievent.
cancelbubble is a boolean indicating whether the bubbling of the event has been
canceled or not.
USBDevice.reset() - Web APIs
the reset() method of the usbdevice interface returns a promise that resolves when the device is reset and all app operations
canceled and their promises rejected.
USBDevice - Web APIs
usbdevice.reset() returns a promise that resolves when the device is reset and all app operations
canceled and their promises rejected.
Vibration API - Web APIs
canceling existing vibrations calling navigator.vibrate() with a value of 0, an empty array, or an array containing all zeros will
cancel any currently ongoing vibration pattern.
VideoTrackList: addtrack event - Web APIs
bubbles no
cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addeventlistener('addtrack', (event) => { console.log(`video track: ${event.track.label} added`); }); using the onaddtrack event handler property: const videoelement = document.queryselector('video'); videoelement.videotracks.onaddtrack = (event) => { console.log(`video track: ${event.track.label} added`); }; specifications specification status html living standardthe definition of 'addtrack' in that specification.
VideoTrackList: change event - Web APIs
bubbles no
cancelable no interface event event handler property onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.videotracks[0]; track.selected = !track.selected; }); using the onchange event handler property: const videoelement = ...
VideoTrackList: removetrack event - Web APIs
bubbles no
cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addeventlistener('removetrack', (event) => { console.log(`video track: ${event.track.label} removed`); }); using the onremovetrack event handler property: const videoelement = document.queryselector('video'); videoelement.videotracks.onremovetrack = (event) => { console.log(`video track: ${event.track.label} removed`); }; specifications specification status html living standardthe definition of 'removetrack' in that specification.
VisualViewport: resize event - Web APIs
bubbles no
cancelable no interface event event handler property onresize examples you can use the resize event in an addeventlistener method: visualviewport.addeventlistener('resize', function() { ...
VisualViewport: scroll event - Web APIs
bubbles no
cancelable no interface event event handler property onscroll examples you can use the scroll event in an addeventlistener method: visualviewport.addeventlistener('scroll', function() { ...
WebRTC API - Web APIs
this event does not bubble (except where otherwise stated) and is not
cancelable (except where otherwise stated).
WebSocket: close event - Web APIs
bubbles no
cancelable no interface closeevent event handler property onclose examples you might want to know when the connection has been closed so that you can update the ui or, perhaps, save data about the closed connection.
WebSocket: error event - Web APIs
bubbles no
cancelable no interface event event handler property onerror examples // create websocket connection const socket = new websocket('ws://localhost:8080'); // listen for possible errors socket.addeventlistener('error', function (event) { console.log('websocket error: ', event); }); specifications specification status html living standardthe definition of 'websocket error' in that specification.
Advanced techniques: Creating and sequencing audio - Web APIs
let sweeplength = 2; function playsweep() { let osc = audioctx.createoscillator(); osc.setperiodicwave(wave); osc.frequency.value = 440; let sweepenv = audioctx.creategain(); sweepenv.gain.
cancelscheduledvalues(audioctx.currenttime); sweepenv.gain.setvalueattime(0, audioctx.currenttime); // set our attack sweepenv.gain.linearramptovalueattime(1, audioctx.currenttime + attacktime); // set our release sweepenv.gain.linearramptovalueattime(0, audioctx.currenttime + sweeplength - releasetime); osc.connect(sweepenv).connect(audioctx.destination); osc.start(); o...
Web audio spatialization basics - Web APIs
n listen for a mouse event on our controls and run this function, as well as stop it when the mouse is released: // for each of our controls, move the boombox and change the position values movecontrols.foreach(function(el) { let moving; el.addeventlistener('mousedown', function() { let direction = this.dataset.control; if (moving && moving.frameid) { window.
cancelanimationframe(moving.frameid); } moving = moveboombox(direction); }, false); window.addeventlistener('mouseup', function() { if (moving && moving.frameid) { window.
cancelanimationframe(moving.frameid); } }, false) }) summary hopefully, this article has given you an insight into how web audio spatialization works, and what each of the p...
Web Authentication API - Web APIs
examples for security reasons, web authentication calls (create() and get()) are
cancelled if the browser window loses focus while the call is pending.
Using Web Workers - Web APIs
the event doesn't bubble and is
cancelable; to prevent the default action from taking place, the worker can call the error event's preventdefault() method.
Window: DOMContentLoaded event - Web APIs
bubbles yes
cancelable yes (although specified as a simple event that isn't
cancelable) interface event event handler property none the original target for this event is the document that has loaded.
Window: afterprint event - Web APIs
bubbles no
cancelable no interface event event handler property onafterprint examples using addeventlistener(): window.addeventlistener('afterprint', (event) => { console.log('after print'); }); using the onafterprint event handler property: window.onafterprint = (event) => { console.log('after print'); }; specifications specification status html living standard living standard ...
Window: animationend event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationend the original target for this event is the element that had the animation applied.
Window: animationiteration event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationiteration the original target for this event is the element that had the animation applied.
Window: animationstart event - Web APIs
bubbles yes
cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied.
Window: appinstalled event - Web APIs
bubbles no
cancelable no interface event event handler onappinstalled examples you can use the appinstalled event in an addeventlistener method: window.addeventlistener('appinstalled', function() { console.log('thank you for installing our app!'); }); or use the onappinstalled event handler property: window.onappinstalled = function() { console.log('thank you for installing our app!'); }; ...
Window: beforeprint event - Web APIs
bubbles no
cancelable no interface event event handler property onbeforeprint examples using addeventlistener(): window.addeventlistener('beforeprint', (event) => { console.log('before print'); }); using the onbeforeprint event handler property: window.onbeforeprint = (event) => { console.log('before print'); }; specifications specification status html living standard living standard ...
Window: blur event - Web APIs
bubbles no
cancelable no interface focusevent event handler property onblur sync / async sync composed yes examples live example this example changes the appearance of a document when it loses focus.
Window: clipboardchange event - Web APIs
bubbles no
cancelable no interface clipboardevent event handler property none examples javascript window.addeventlistener('clipboardchange', () => { console.log('clipboard contents changed'); }); specifications specification status clipboard api and eventsthe definition of 'clipboardchange event' in that specification.
Window: copy event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action.
Window: cut event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action.
Window: devicemotion event - Web APIs
bubbles no
cancelable no interface devicemotionevent event handler property window.ondevicemotion examples function handlemotionevent(event) { var x = event.accelerationincludinggravity.x; var y = event.accelerationincludinggravity.y; var z = event.accelerationincludinggravity.z; // do something awesome.
Window: deviceorientation event - Web APIs
bubbles no
cancelable no interface deviceorientationevent event handler property window.ondeviceorientation examples if (window.deviceorientationevent) { window.addeventlistener("deviceorientation", function(event) { // alpha: rotation around z-axis var rotatedegrees = event.alpha; // gamma: left to right var lefttoright = event.gamma; // beta: front back motion var fronttoback = event.beta; ...
Window: error event - Web APIs
bubbles no
cancelable no interface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise.
Window: focus event - Web APIs
bubbles no
cancelable no interface focusevent event handler property onfocus sync / async sync composed yes examples live example this example changes the appearance of a document when it loses focus.
Window: gamepadconnected event - Web APIs
bubbles no
cancelable no interface gamepadevent event handler property ongamepadconnected examples window.addeventlistener('gamepadconnected', event => { // all buttons and axes values can be accessed through event.gamepad; }); specifications specification status gamepad working draft ...
Window: gamepaddisconnected event - Web APIs
bubbles no
cancelable no interface gamepadevent event handler property ongamepaddisconnected examples window.addeventlistener('gamepaddisconnected', event => { console.log('lost connection with the gamepad.'); }); specifications specification status gamepad working draft ...
Window: hashchange event - Web APIs
bubbles yes
cancelable no interface hashchangeevent event handler onhashchange examples you can use the hashchange event in an addeventlistener method: window.addeventlistener('hashchange', function() { console.log('the hash has changed!') }, false); or use the onhashchange event handler property: function locationhashchanged() { if (location.hash === '#cool-feature') { console.log("you're visiting a cool feature!"); } } window.onhashchange = locationhashchanged; specifications specification status comment html living standardthe definition of 'hashch...
Window: languagechange event - Web APIs
bubbles no
cancelable no interface event event handler onlanguagechange examples you can use the languagechange event in an addeventlistener method: window.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: window.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html living standardthe definition of 'languagechange' in that specification.
Window: load event - Web APIs
bubbles no
cancelable no interface event event handler property onload examples log a message when the page is fully loaded: window.addeventlistener('load', (event) => { console.log('page is fully loaded'); }); the same, but using the onload event handler property: window.onload = (event) => { console.log('page is fully loaded'); }; live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>...
Window: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessage examples suppose a script sends a message to a different browsing context, such as another <iframe>, using code like this: const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const windowmessagebutton = document.queryselector('#window-message'); windowmessagebutton.addeventlistener('click', () => { targetframe.postmessage('hello there', targetorigin); }); the receiver can listen for the message using addeventlistener() with code like this: window.addeventliste...
Window: messageerror event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessageerror examples listen for messageerror using addeventlistener(): window.addeventlistener('messageerror', (event) => { console.error(event); }); the same, but using the onmessageerror event handler property: window.onmessageerror = (event) => { console.error(event); }; specifications specification status html living standard living standard ...
Window: offline event - Web APIs
bubbles no
cancelable no interface event event handler property onoffline examples // addeventlistener version window.addeventlistener('offline', (event) => { console.log("the network connection has been lost."); }); // onoffline version window.onoffline = (event) => { console.log("the network connection has been lost."); }; specifications specification status html living standardthe definition of 'offline event' in that specification.
Window: online event - Web APIs
bubbles no
cancelable no interface event event handler property ononline examples // addeventlistener version window.addeventlistener('online', (event) => { console.log("you are now connected to the network."); }); // ononline version window.ononline = (event) => { console.log("you are now connected to the network."); }; specifications specification status html living standardthe defi...
Window.open() - Web APIs
the purpose of the return false in the code is to
cancel default action of the link: if the onclick event handler is executed, then there is no need to execute the default action of the link.
Window: orientationchange event - Web APIs
bubbles no
cancelable no interface event event handler onorientationchange example you can use the orientationchange event in an addeventlistener method: window.addeventlistener("orientationchange", function(event) { console.log("the orientation of the device is now " + event.target.screen.orientation.angle); }); or use the onorientationchange event handler property: window.onorientationchange = function(event) { console.log("the orientation of the device is now " + event.target.screen.orientation.angle); }; specifications specification status compatibility standardthe definition of 'orientationchange' in that specificat...
Window: pagehide event - Web APIs
bubbles no
cancelable no interface pagetransitionevent event handler property onpagehide examples in this example, an event handler is established to watch for pagehide events and to perform special handling if the page is being persisted for possible reuse.
Window: pageshow event - Web APIs
bubbles no
cancelable no interface pagetransitionevent event handler property onpageshow examples this example sets up event handlers for events listed in the array events.
Window: paste event - Web APIs
bubbles yes
cancelable yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action.
Window: popstate event - Web APIs
bubbles yes
cancelable no interface popstateevent event handler property onpopstate the history stack if the history entry being activated was created by a call to history.pushstate() or was affected by a call to history.replacestate(), the popstate event's state property contains a copy of the history entry's state object.
Window: rejectionhandled event - Web APIs
bubbles no
cancelable no interface promiserejectionevent event handler property onrejectionhandled example you can use the rejectionhandled event to log promises that get rejected to the console, along with the reasons why they were rejected: window.addeventlistener("rejectionhandled", event => { console.log("promise rejected; reason: " + event.reason); }, false); specificat...
window.requestIdleCallback() - Web APIs
syntax var handle = window.requestidlecallback(callback[, options]) return value an id which can be used to
cancel the callback by passing it into the window.
cancelidlecallback() method.
Window: resize event - Web APIs
bubbles no
cancelable no interface uievent event handler property onresize in some earlier browsers it was possible to register resize event handlers on any html element.
Window: storage event - Web APIs
bubbles no
cancelable no interface storageevent event handler property onstorage examples log the samplelist item to the console when the storage event fires: window.addeventlistener('storage', () => { // when local storage changes, dump the list to // the console.
Window: transitionrun event - Web APIs
bubbles yes
cancelable no interface transitionevent event handler property ontransitionrun the original target for this event is the element that had the transition applied.
Window: transitionstart event - Web APIs
bubbles yes
cancelable no interface transitionevent event handler property globaleventhandlers.ontransitionstart the original target for this event is the element that had the transition applied.
Window: unload event - Web APIs
bubbles no
cancelable no interface event event handler property onunload it is fired after: beforeunload (
cancelable event) pagehide the document is in the following state: all the resources still exist (img, iframe etc.) nothing is visible anymore to the end user ui interactions are ineffective (window.open, alert, confirm, etc.) an error won't stop the unloading workflow please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below).
Worker: message event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and listens to messages from it using addeventlistener(): const worker = new worker("static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); alternatively, it could listen using the onmessage event handler property: const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.log(`received message from ...
Worker: messageerror event - Web APIs
bubbles no
cancelable no interface messageevent event handler property onmessageerror examples create a worker, and listen for message and messageerror events using addeventlistener(): // inside main.js const worker = new worker("static/scripts/worker.js"); worker.addeventlistener("message", (event) => { console.error(`received message from worker: ${event}`); }); worker.addeventlistener("messageerror", (event) => { console.error(`error receiving message from worker: ${event}`); }); the same, but using the onmessageerror event handler property: // inside main.js const worker = new worker("static/scripts/worker.js"); wo...
WorkerGlobalScope: languagechange event - Web APIs
bubbles no
cancelable no interface event event handler onlanguagechange examples you can use the languagechange event in an addeventlistener method: worker.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: worker.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html living standardthe definition of 'languagechange' in that specification.
XMLHttpRequest.abort() - Web APIs
var xhr = new xmlhttprequest(), method = "get", url = "https://developer.mozilla.org/"; xhr.open(method, url, true); xhr.send(); if (oh_noes_we_need_to_
cancel_right_now_or_else) { xhr.abort(); } specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequest: abort event - Web APIs
bubbles no
cancelable no interface progressevent event handler property onabort examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; m...
XMLHttpRequest: error event - Web APIs
bubbles no
cancelable no interface progressevent event handler property onerror examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.
XMLHttpRequest: load event - Web APIs
bubbles no
cancelable no interface progressevent event handler property onload examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttons...
XMLHttpRequest: loadend event - Web APIs
bubbles no
cancelable no interface progressevent event handler property onloadend examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width...
XMLHttpRequest: loadstart event - Web APIs
bubbles no
cancelable no interface progressevent event handler property onloadstart examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess =...
XMLHttpRequest: progress event - Web APIs
bubbles no
cancelable no interface progressevent event handler property onprogress examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsucc...
XMLHttpRequest: timeout event - Web APIs
bubbles no
cancelable no interface progressevent event handler property ontimeout examples const client = new xmlhttprequest(); client.open('get', 'http://www.example.org/example.txt'); client.ontimeout = () => { console.error('timeout!!') }; client.send(); you could also set up the event handler using the addeventlistener() method: client.addeventlistener('timeout', () => { console.error("timeout!!"); }); specifications specification status comment xmlhttprequestthe definition of 'timeout event' in that specification.
XRReferenceSpace: reset event - Web APIs
bubbles yes
cancelable no interface xrreferencespaceevent event handler property onreset usage notes the reset event indicates that the coordinate system has been reset or reconfigured by changing the reference space's origin, moving and rotating it as indicated by the event's transform property.
XRSession: end event - Web APIs
bubbles no
cancelable no interface xrsessionevent event handler xrsession.onend example to be informed when a webxr session comes to an end, you can add a handler to your xrsession instance using addeventlistener(), like this: xrsession.addeventlistener("end", function(event) { /* the session has shut down */ }); alternatively, you can use the xrsession.onend event handler property to establish a handler for the end event: xrsession.onend = function(event) { /* the session has shut down */ } specifications specification statu...
XRSession: inputsourceschange event - Web APIs
bubbles yes
cancelable no interface xrinputsourceschangeevent event handler property oninputsourceschange the event object contains lists of the newly-added and/or removed input devices in its added and removed properties.
XRSession: select event - Web APIs
bubbles yes
cancelable no interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
XRSession: selectend event - Web APIs
bubbles yes
cancelable no interface xrinputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
XRSession: selectstart event - Web APIs
bubbles yes
cancelable no interface xrinputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
XRSession: squeeze event - Web APIs
bubbles yes
cancelable no interface xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
XRSession: squeezeend event - Web APIs
bubbles yes
cancelable no interface xrinputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
XRSession: squeezestart event - Web APIs
bubbles yes
cancelable no interface xrinputsourceevent event handler property onsqueezestart for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
XRSession: visibilitychange event - Web APIs
bubbles yes
cancelable no interface xrsessionevent event handler property onvisibilitychange when the xrsession receives this event, the visibility state has already been changed.
XRSystem: devicechange event - Web APIs
bubbles no
cancelable no interface event event handler xrsystem.ondevicechange usage notes devicechange events are not delivered if the document which owns the xrsystem object has been granted permission to do so through the xr-spatial-tracking feature policy.
mssitemodejumplistitemremoved - Web APIs
syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mssitemodejumplistitemremoved", handler, usecapture) general info synchronous no bubbles no
cancelable no note this event is raised once for every item that has been removed since the last time mssitemodeshowjumplist was called.
msthumbnailclick - Web APIs
syntax event property object.onmsthumbnailclick = handler; addeventlistener method object.addeventlistener("msthumbnailclick", handler, usecapture) general info synchronous no bubbles no
cancelable no note the onmsthumbnailclick event is available only to documents that are launched from a pinned site shortcut.
ARIA: button role - Accessibility
a button is a widget used to perform actions such as submitting a form, opening a dialog,
cancelling an action, or performing a command such as inserting a new record or displaying information.
Accessibility: What users can do to browse more safely - Accessibility
examples include: transitionrun transitionstart transitionend transition
cancel edge 75 and above (desktop, in windows 10) according to eric bailey, in his april 30, 2019 article revisiting prefers-reduced-motion, the reduced motion media query, "while microsoft edge does not have support for prefers-reduced-motion, it will become chrome under the hood soon." safari 10.1 and above (desktop) do not enable auto-play (does not work for gifs) ios safari 10.3 and above (mob...
Mobile accessibility checklist - Accessibility
for touch events, at least one of the following must be true (wcag 2.1: pointer
cancellation): the down-event should not be used to trigger any action the action is triggered on the up event and an option to abort the action before its completion is available or an option to undo the action after its completion the up-event will undo any action that was triggered on a down event it is essential to trigger the action on the down event.
WebKit CSS extensions - CSS: Cascading Style Sheets
trols-volume-control-hover-background ::-webkit-media-controls-volume-slider ::-webkit-meter-bar ::-webkit-meter-even-less-good-value ::-webkit-meter-inner-element ::-webkit-meter-optimum-value ::-webkit-meter-suboptimum-value -webkit-media-text-track-container ::-webkit-outer-spin-button ::-webkit-progress-bar ::-webkit-progress-inner-element ::-webkit-progress-value ::-webkit-search-
cancel-button ::-webkit-search-results-button ::-webkit-slider-runnable-track ::-webkit-slider-thumb note: generally, if there is an invalid pseudo-element or pseudo-class within in a chain or group of selectors, the whole selector list is invalid.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
ults-decoration; -webkit-appearance: searchfield-results-decoration; } <div>lorem</div> chrome safari edge (works on chrome 51 on windows 7) searchfield-results-button div{ color: black; -moz-appearance: searchfield-results-button; -webkit-appearance: searchfield-results-button; } <div>lorem</div> safari edge searchfield-
cancel-button div{ color: black; -webkit-appearance: searchfield-
cancel-button; } <div>lorem</div> chrome safari edge snapshotted-plugin-overlay div{ color: black; -moz-appearance: snapshotted-plugin-overlay; -webkit-appearance: snapshotted-plugin-overlay; } <div>lorem</div> safari sheet div { color...
counter-reset - CSS: Cascading Style Sheets
syntax /* set "my-counter" to 0 */ counter-reset: my-counter; /* set "my-counter" to -1 */ counter-reset: my-counter -1; /* set "counter1" to 1, and "counter2" to 4 */ counter-reset: counter1 1 counter2 4; /*
cancel any reset that could have been set in less specific rules */ counter-reset: none; /* global values */ counter-reset: inherit; counter-reset: initial; counter-reset: unset; the counter-reset property is specified as either one of the following: a <custom-ident> naming the counter, followed optionally by an <integer>.
counter-set - CSS: Cascading Style Sheets
syntax /* set "my-counter" to 0 */ counter-set: my-counter; /* set "my-counter" to -1 */ counter-set: my-counter -1; /* set "counter1" to 1, and "counter2" to 4 */ counter-set: counter1 1 counter2 4; /*
cancel any counter that could have been set in less specific rules */ counter-set: none; /* global values */ counter-set: inherit; counter-set: initial; counter-set: unset; the counter-set property is specified as either one of the following: a <custom-ident> naming the counter, followed optionally by an <integer>.
touchstart - Event reference
element: touchstart document: touchstart bubbles yes
cancelable yes interface touchevent event handler property ontouchstart specifications specification status touch events recommendation ...
User input and controls - Developer guides
if you want to use touch events, you need to add event listeners and specify handler functions, which will be called when the event gets fired: element.addeventlistener("touchstart", handlestart, false);
element.addeventlistener("touch
cancel", handle
cancel, false);
element.addeventlistener("touchend", handleend, false);
element.addeventlistener("touchmove", handlemove, false); where element is the dom element you want to register the touch events on.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
html <!-- simple pop-up dialog box containing a form --> <dialog id="favdialog"> <form method="dialog"> <p><label>favorite animal: <select> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button value="
cancel">
cancel</button> <button id="confirmbtn" value="default">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <output aria-live="polite"></output> javascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var outputbox = document.queryselector('output'); v...
Global attributes - HTML: Hypertext Markup Language
the event handler attributes: onabort, onautocomplete, onautocompleteerror, onblur, on
cancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontextmenu, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemo...
Feature-Policy - HTTP
navigation-override controls the availability of mechanisms that enables the page author to take control over the behavior of spatial navigation, or to
cancel it outright.
Redirections in HTTP - HTTP
in this case, the response is a 303 (see other) redirect that links to a page indicating that the action has been scheduled, and eventually informs about its progress, or allows to
cancel it.
Loops and iteration - JavaScript
example 1 the following example iterates through the elements in an array until it finds the index of an element whose value is thevalue: for (let i = 0; i < a.length; i++) { if (a[i] === thevalue) { break; } } example 2: breaking to a label let x = 0; let z = 0; label
cancelloops: while (true) { console.log('outer loops: ' + x); x += 1; z = 1; while (true) { console.log('inner loops: ' + z); z += 1; if (z === 10 && x === 10) { break label
cancelloops; } else if (z === 10) { break; } } } continue statement the continue statement can be used to restart a while, do-while, for, or label statement.
Promise.prototype.then() - JavaScript
// return promise here, that will be rejected with 'error' after 1 second return new promise(rejectlater); }); p3.then(function(v) { // not called console.log('resolved', v); }, function(e) { console.error('rejected', e); // "rejected", 'error' }); window.setimmediate style promise-based polyfill using a function.prototype.bind() reflect.apply (reflect.apply()) method to create a (non-
cancellable) window.setimmediate-style function.
Mobile first - Progressive web apps (PWAs)
} @media (min-width: 600px) { html { background: #eee; height: 100%; } body { width: 600px; height: inherit; margin: 0 auto; background: url(../img/firefox-os.png) bottom left no-repeat, linear-gradient(to bottom, #fff, #eee); } .main > p { background: rgba(255,255,255,0.3); } nav li a { padding: 0 10px; font-size: 2em; } } the first one
cancels out the css display: table behaviour, hides the links to jump to and from the navigation, as they are not needed anymore in the wider layout, and changes the vertical menu to a horizontal menu that makes better use of the horizontal space available.
SVG Event Attributes - SVG: Scalable Vector Graphics
attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload document element event attributes oncopy, oncut, onpaste global event attributes on
cancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout,...
SVG Attribute reference - SVG: Scalable Vector Graphics
end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by, autoreverse, accelerate, decelerate animation addition attributes additive, accumulate event attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload global event attributes on
cancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout,...