Search completed in 1.15 seconds.
nsIAccessibleStates
accessible/public/nsiaccessible
states.idlscriptable please add a summary to this article.
...constants
state constants msaa
state flags - used for bitfield.
... constant value description
state_unavailable 0x00000001 the object is unavailable, that is disabled.
...And 55 more matches
Gecko states
« at apis support page introduction below you will find a list of supported
states by gecko.
...
state constants are defined in nsiaccessible
states.
...
states list
state_unavailable the object is unavailable, i.e.
...And 32 more matches
mozIStorageStatement
storage/public/mozistorage
statement.idlscriptable this interface lets you create and execute sql
statements on a mozistorageconnection.
... method overview void initialize(in mozistorageconnection adbconnection, in autf8string asql
statement); obsolete since gecko 1.9.1 void finalize(); mozistorage
statement clone(); autf8string getparametername(in unsigned long aparamindex); unsigned long getparameterindex(in autf8string aname); autf8string getcolumnname(in unsigned long acolumnindex); unsigned long getcolumnindex(in autf8string aname); void reset(); astring escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mo...
...; void bindint32parameter(in unsigned long aparamindex, in long avalue); void bindint64parameter(in unsigned long aparamindex, in long long avalue); void bindnullparameter(in unsigned long aparamindex); void bindblobparameter(in unsigned long aparamindex, [array,const,size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); mozistoragepending
statement executeasync(mozistorage
statementcallback acallback); boolean executestep(); boolean step(); void execute(); attributes attribute type description columncount unsigned long number of columns returned.
...And 30 more matches
React interactivity: Events and state - Learn web development
in this article we'll do this, digging into events and
state along the way, and ending up with an app in which we can successfully add and delete tasks, and toggle tasks as completed.
... objective: to learn about handling events and
state in react, and use those to start making the case study app interactive.
...
state and the use
state hook so far, we've used props to pass data through our components and this has served us just fine.
...And 29 more matches
Statements and declarations - JavaScript
javascript applications consist of
statements with an appropriate syntax.
... a single
statement may span multiple lines.
... multiple
statements may occur on a single line if each
statement is separated by a semicolon.
...And 22 more matches
Window: popstate event - Web APIs
the pop
state event of the window interface is fired when the active history entry changes while the user navigates the session history.
... it changes the current history entry to that of the last page the user visited or, if history.push
state() has been used to add a history entry to the history stack, that history entry is used instead.
... bubbles yes cancelable no interface pop
stateevent event handler property onpop
state the history stack if the history entry being activated was created by a call to history.push
state() or was affected by a call to history.replace
state(), the pop
state event's
state property contains a copy of the history entry's
state object.
...And 21 more matches
mozIStorageStatementWrapper
the mozistorage
statementwrapper interface is a storage
statement wrapper.
... when you call the mozistorageconnection interface's create
statement() method, you get a mozistorage
statement which has just direct bindings to sqlite.
... you can then wrap that
statement with a wrapper, which implements nsixpcscriptable and provides scriptable helpers letting you execute the
statement as a function, access bind variables by name as properties, etc.
...And 13 more matches
History.pushState() - Web APIs
in an html document, the history.push
state() method adds a
state to the browser's session history stack.
... syntax history.push
state(
state, title[, url]) parameters
state the
state object is a javascript object which is associated with the new history entry created by push
state().
... whenever the user navigates to the new
state, a pop
state event is fired, and the
state property of the event contains a copy of the history entry's
state object.
...And 12 more matches
RTCIceTransportState - Web APIs
the rtcicetransport
state enumerated type defines the string values which may be returned by the
state property on rtcicetransport objects.
... the transport
state indicates which stage of the candidate gathering process is currently underway.
...in this
state, checking of candidates to look for those which might be acceptable has not yet begun.
...And 10 more matches
RTCPeerConnection.connectionState - Web APIs
the read-only connection
state property of the rtcpeerconnection interface indicates the current
state of the peer connection by returning one of the string values specified by the enum rtcpeerconnection
state.
... when this property's value changes, a connection
statechange event is sent to the rtcpeerconnection instance.
... syntax var connection
state = rtcpeerconnection.connection
state; value the current
state of the connection, as a value from the enum rtcpeerconnection
state.
...And 10 more matches
RTCPeerConnection: iceconnectionstatechange event - Web APIs
an iceconnection
statechange event is sent to an rtcpeerconnection object each time the ice connection
state changes during the negotiation process.
... the new ice connection
state is available in the object's iceconnection
state} property.
... bubbles no cancelable no interface event event handler property oniceconnection
statechange one common task performed by the iceconnection
statechange event listener: to trigger ice restart when the
state changes to failed.
...And 10 more matches
mozIStorageStatementCallback
the mozistorage
statementcallback interface represents a callback handler that the storage api calls with result, error, and completion notifications while handling asynchronous database queries.
... storage/public/mozistorage
statementcallback.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void handlecompletion(in unsigned short areason); void handleerror(in mozistorageerror aerror); void handleresult(in mozistorageresultset aresultset); constants constant value description reason_finished 0 the
statement has finished executing normally.
...And 8 more matches
KeyboardEvent.getModifierState() - Web APIs
the keyboardevent.getmodifier
state() method returns the current
state of the specified modifier key: true if the modifier is active (that is the modifier key is pressed or locked), otherwise, false.
... syntax var active = event.getmodifier
state(keyarg); returns a boolean parameters keyarg a modifier key value.
... modifier keys on gecko when getmodifier
state() returns true on gecko?
...And 8 more matches
PopStateEvent - Web APIs
pop
stateevent is an event handler for the pop
state event on the window.
... a pop
state event is dispatched to the window every time the active history entry changes between two history entries for the same document.
... if the history entry being activated was created by a call to history.push
state() or was affected by a call to history.replace
state(), the pop
state event's
state property contains a copy of the history entry's
state object.
...And 8 more matches
History.replaceState() - Web APIs
the history.replace
state() method modifies the current history entry, replacing it with the
stateobj, title, and url passed in the method parameters.
... this method is particularly useful when you want to update the
state object or url of the current history entry in response to some user action.
... syntax history.replace
state(
stateobj, title, [url]) parameters
stateobj the
state object is a javascript object which is associated with the history entry passed to the replace
state method.
...And 7 more matches
RTCIceCandidatePairStats.state - Web APIs
the
state property in an rtcicecandidatepairstats object indicates the
state of the check list of which the candidate pair is a member.
... syntax
state = rtcicecandidatepairstats.
state; value a domstring whose value is one of those found in the rtcstatsicecandidatepair
state enumerated type.
...each pair has a
state, whose value is represented by rtcstatsicecandidatepair
state.
...And 7 more matches
RTCIceTransport.state - Web APIs
the read-only rtcicetransport property
state returns the current
state of the ice transport, so you can determine the
state of ice gathering in which the ice agent currently is operating.
... this differs from the gathering
state, which only indicates whether or not ice gathering is currently underway.
... syntax ice
state = icetransport.
state; value a domstring, whose value is one of those found in the enumerated type rtcicetransport
state, which indicates the stage of ice gathering that's currently underway.
...And 7 more matches
RTCPeerConnection.signalingState - Web APIs
the read-only signaling
state property on the rtcpeerconnection interface returns one of the string values specified by the rtcsignaling
state enum; these values describe the
state of the signaling process on the local end of the connection while connecting or reconnecting to another peer.
... because the signaling process is a
state machine, being able to verify that your code is in the expected
state when messages arrive can help avoid unexpected and avoidable failures.
... for example, if you receive an answer while the signaling
state isn't "have-local-offer", you know that something is wrong, since you should only receive answers after creating an offer but before an answer has been received and passed into rtcpeerconnection.setlocaldescription().
...And 7 more matches
Content states and the style system - Archive of obsolete content
content
states are what gecko uses to implement the various
state-dependent in css (examples would be :hover, :active, :focus, :target, :checked).
... we will focus on describing how changes in content
state are handled.
... generally, whenever a node's content
state changes, style has to be reresolved (recomputed) for that node and all of its descendants.
...And 6 more matches
History.state - Web APIs
the history.
state property returns a value representing the
state at the top of the history stack.
... this is a way to look at the
state without having to wait for a pop
state event.
... syntax const current
state = history.
state value the
state at the top of the history stack.
...And 6 more matches
ServiceWorkerState - Web APIs
the serviceworker
state is associated with its serviceworker's
state.
... values installing the service worker in this
state is considered an installing worker.
... during this
state, extendableevent.waituntil() can be called inside the install event handler to extend the life of the installing worker until the passed promise resolves successfully.
...And 6 more matches
WindowEventHandlers.onpopstate - Web APIs
the onpop
state property of the windoweventhandlers mixin is the eventhandler for processing pop
state events on the window.
... a pop
state event is dispatched to the window each time the active history entry changes between two history entries for the same document.
... if the activated history entry was created by a call to history.push
state(), or was affected by a call to history.replace
state(), the pop
state event's
state property contains a copy of the history entry's
state object.
...And 6 more matches
Ember interactivity: Events, classes and state - Learn web development
along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep track of the data
state of our app.
... objective: to learn how to create component classes and use events to control interactivity, and keep track of app
state using a service.
... storing todos with a service ember has built-in application-level
state management that we can use to manage the storage of our todos and allow each of our components to access data from that application-level
state.
...And 5 more matches
IDBRequest.readyState - Web APIs
the ready
state read-only property of the idbrequest interface returns the
state of the request.
... every request starts in the pending
state.
... the
state changes to done when the request completes successfully or when an error occurs.
...And 5 more matches
RTCDataChannel.readyState - Web APIs
the read-only rtcdatachannel property ready
state returns an enum of type rtcdatachannel
state which indicates the
state of the data channel's underlying data connection.
... syntax var
state = adatachannel.ready
state; values a string which is one of the values in the rtcdatachannel
state enum, indicating the current
state of the underlying data transport.
... rtcdatachannel
state enum the rtcdatachannel
state enum defines string constants which reflect the current status of the rtcdatachannel's underlying data connection.
...And 5 more matches
RTCDtlsTransport.state - Web APIs
the
state read-only property of the rtcdtlstransport interface provides information which describes a datagram transport layer security (dtls) transport
state.
... syntax let my
state = dtlstransport.
state; value a string whose value is taken from the rtcdtlstransport
state enumerated type.
... its value is one of the following: new the initial
state when dtls has not started negotiating yet.
...And 5 more matches
ServiceWorker.onstatechange - Web APIs
an eventlistener property called whenever an event of type
statechange is fired; it is basically fired anytime the serviceworker.
state changes.
... syntax serviceworker.on
statechange = function(
statechangeevent) { ...
... } serviceworker.addeventlistener('
statechange', function(
statechangeevent) { ...
...And 5 more matches
Warning: unreachable code after return statement - JavaScript
the javascript warning "unreachable code after return
statement" occurs when using an expression after a return
statement, or when using a semicolon-less return
statement but including an expression directly after.
... message warning: unreachable code after return
statement (firefox) error type warning what went wrong?
... unreachable code after a return
statement might occur in these situations: when using an expression after a return
statement, or when using a semicolon-less return
statement but including an expression directly after.
...And 5 more matches
FC_GetOperationState
name fc_getoperation
state - get the cryptographic operation
state of a session.
... syntax ck_rv fc_getoperation
state( ck_session_handle hsession, ck_byte_ptr poperation
state, ck_ulong_ptr puloperation
statelen ); parameters hsession [in] handle of the open session.
... poperation
state [out] pointer to a byte array of a length sufficient for containing the operation
state or null.
...And 4 more matches
FC_SetOperationState
name fc_setoperation
state - restore the cryptographic operation
state of a session.
... syntax ck_rv fc_setoperation
state( ck_session_handle hsession, ck_byte_ptr poperation
state, ck_ulong uloperation
statelen, ck_object_handle hencryptionkey, ck_object_handle hauthenticationkey ); parameters hsession [in] handle of the open session.
... poperation
state [in] pointer to a byte array containing the operation
state.
...And 4 more matches
JS_RestoreExceptionState
restores the exception
state from a jsexception
state object previously created using js_saveexception
state.
... syntax void js_restoreexception
state(jscontext *cx, jsexception
state *
state); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...
state jsexception
state * pointer to the jsexception
state object to restore exception
state from.
...And 4 more matches
JS_SaveExceptionState
saves the exception
state from the specified context.
... syntax jsexception
state * js_saveexception
state(jscontext *cx); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... description saves the current exception
state (that is, any pending exception, or a cleared exception
state) associated with the specified context cx, and returns a jsexception
state object holding this
state.
...And 4 more matches
Document.readyState - Web APIs
the document.ready
state property describes the loading
state of the document.
... when the value of this property changes, a ready
statechange event fires on the document object.
... syntax var string = document.ready
state; values the ready
state of a document can be one of following: loading the document is still loading.
...And 4 more matches
MediaSession.setPositionState() - Web APIs
the mediasession method setposition
state() is used to update the current document's media playback position and speed for presentation by user's device in any kind of interface that provides details about ongoing media.
... syntax navigator.mediasession.setposition
state(
statedict); parameters
statedict optional an object conforming to the mediaposition
state dictionary, providing updated information about the playback position and speed of the document's ongoing media.
... if the object is empty, the existing playback
state information is cleared.
...And 4 more matches
RTCIceTransport: gatheringstatechange event - Web APIs
a gathering
statechange event is sent to an rtcicetransport when its ice candidate gathering
state changes.
... the gathering
state, whose actual status can be found in the transport object's gathering
state property, indicates whether or not the ice agent has begun gathering candidates, and if so, if it has finished doing so.
... bubbles no cancelable no interface event event handler property ongathering
statechange the key difference between gathering
statechange and icegathering
statechange 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.
...And 4 more matches
RTCIceTransport.ongatheringstatechange - Web APIs
the ongathering
statechange event handler for the rtcicetransport interface specifies an event handler that is to be called when the gathering
statechange event occurs on the transport.
... this event is delivered whenever the transport's gathering
state property changes.
... syntax rtcicetransport.ongathering
statechange =
statechangehandler; value a function to be called when the rtcicetransport object's gathering
state changes.
...And 4 more matches
RTCPeerConnection.iceConnectionState - Web APIs
the read-only property rtcpeerconnection.iceconnection
state returns an enum of type rtciceconnection
state which
state of the ice agent associated with the rtcpeerconnection.
... you can detect when this value has changed by watching for the iceconnection
statechange event.
... syntax var
state = rtcpeerconnection.iceconnection
state; value the current
state of the ice agent and its connection.
...And 4 more matches
RTCPeerConnection.iceGatheringState - Web APIs
the read-only property rtcpeerconnection.icegathering
state returns an enum of type rtcicegathering
state that describes connection's ice gathering
state.
... you can detect when the value of this property changes by watching for an event of type icegathering
statechange.
... syntax var
state = rtcpeerconnection.icegathering
state; value the possible values are those of an enum of type rtcicegathering
state.
...And 4 more matches
RTCPeerConnection.oniceconnectionstatechange - Web APIs
the rtcpeerconnection.oniceconnection
statechange property is an event handler which specifies a function to be called when the iceconnection
statechange event is fired on an rtcpeerconnection instance.
... this happens when the
state of the connection's ice agent, as represented by the iceconnection
state property, changes.
... syntax rtcpeerconnection.oniceconnection
statechange = eventhandler; value this event handler can be set to function which is passed a single input parameter: an event object describing the iceconnection
statechange event which occurred.
...And 4 more matches
RTCPeerConnection.onicegatheringstatechange - Web APIs
the rtcpeerconnection.onicegathering
statechange property is an eventhandler which specifies a function to be called when the icegathering
statechange event is sent to an rtcpeerconnection instance.
... this happens when the ice gathering
state—that is, whether or not the ice agent is actively gathering candidates—changes.
... you don't need to watch for this event unless you have specific reasons to want to closely monitor the
state of ice gathering.
...And 4 more matches
ValidityState.patternMismatch - Web APIs
the read-only patternmismatch property of a validity
state object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's pattern attribute.
... input:invalid { border: red solid 3px; } note, in this case, we get a patternmismatch not a validity
state.toolong or validity
state.tooshort if the values are too long or too short because it is the pattern that is dictating the length of the value.
... had we used minlength and maxlength attributes instead, we may have seen validity
state.toolong or validity
state.tooshort being true.
...And 4 more matches
checkState - Archive of obsolete content
« xul reference home check
state type: integer, values 0, 1, or 2 this attribute may be used to create three
state buttons, numbered 0, 1 and 2.
... when in
state 0 or 1, pressing the button will switch to the opposite
state.
... when in
state 2, pressing the button will switch to
state 0.
...And 3 more matches
JS_DropExceptionState
destroys a jsexception
state object previously created using js_saveexception
state.
... syntax void js_dropexception
state(jscontext *cx, jsexception
state *
state); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...
state jsexception
state * pointer to the jsexception
state object to destroy.
...And 3 more matches
Animation.replaceState - Web APIs
the read-only animation.replace
state property of the web animations api returns the replace
state of the animation.
... syntax let myreplace
state = animation.replace
state; value a string that represents the replace
state of the anmation.
... the value can be one of: active: the initial value of the animation's replace
state; when the animation has been removed by the browser's automatically removing filling animations behavior.
...And 3 more matches
HTMLMediaElement.networkState - Web APIs
the htmlmediaelement.network
state property indicates the current
state of the fetching of media over the network.
... syntax var network
state = audioorvideo.network
state; value an unsigned short.
...also, ready
state is have_nothing.
...And 3 more matches
MediaPositionState.playbackRate - Web APIs
the mediaposition
state dictionary's playbackrate property is used when calling the mediasession method setposition
state() to tell the user agent the rate at which media is currently being played.
... for example, a browser might use this information along with the position property and the navigator.mediasession.playback
state, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
... syntax let position
state = { playbackrate: rate }; let playbackrate = position
state.playbackrate; value a floating-point value specifying a multiplier corresponding to the current relative rate at which the media being performed is playing.
...And 3 more matches
MediaPositionState.position - Web APIs
the mediaposition
state dictionary's position property is used when calling the mediasession method setposition
state() to provide the user agent with the current playback position, in seconds, of the currently-playing media.
... for example, a browser might use this information along with the position property and the navigator.mediasession.playback
state, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
... syntax let position
state = { position: timeinseconds }; let duration = position
state.duration; value a floating-point value indicating the current playback position within the media currently being performed, in seconds.
...And 3 more matches
RTCIceTransport.onstatechange - Web APIs
the on
statechange event handler for the rtcicetransport interface is a property which specifies a function to serve as the eventhandler for the
statechange event that is fired whenever the transport's
state changes.
... syntax rtcicetransport.on
statechange =
statechangehandler; value set this property to reference a function you provide that is called by the webrtc layer when the rtcicetransport object's
state changes.
... the event handler receives as its sole input an event object describing the
statechange event which occurred.
...And 3 more matches
RTCPeerConnection: icegatheringstatechange event - Web APIs
the icegathering
statechange event is sent to the onicegathering
statechange event handler on an rtcpeerconnection when the
state of the ice candidate gathering process changes.
... this signifies that the value of the connection's icegathering
state property has changed.
... bubbles no cancelable no interface event event handler onicegathering
statechange note: while you can determine that ice candidate gathering is complete by watching for icegathering
statechange events and checking for the value of icegathering
state to become complete, you can also simply have your handler for the icecandidate event look to see if its candidate property is null.
...And 3 more matches
RTCPeerConnection.onconnectionstatechange - Web APIs
the rtcpeerconnection.onconnection
statechange property specifies an eventhandler which is called to handle the connection
statechange event when it occurs on an instance of rtcpeerconnection.
... this happens whenever the aggregate
state of the connection changes.
... the aggregate
state is a combination of the
states of all of the individual network transports being used by the connection.
...And 3 more matches
RTCPeerConnection.onsignalingstatechange - Web APIs
the onsignaling
statechange event handler property of the rtcpeerconnection interface specifies a function to be called when the signaling
statechange event occurs on an rtcpeerconnection interface.
... the function receives as input the event object of type event; this event is sent when the peer connection's signaling
state changes, which may happen either because of a call to setlocaldescription() or to setremotedescription().
... syntax rtcpeerconnection.onsignaling
statechange = errorhandler; value set this to a function which you provide that receives an event object as input; this contains the signaling
statechange event.
...And 3 more matches
RTCStatsIceCandidatePairState - Web APIs
the rtcstatsicecandidatepair
state enumerated type represents the set of string values which are possible for the rtcicecandidatepairstats object's
state property.
... this represents the
state of this candidate pair within the ice check list for the rtcpeerconnection.
... see ice check lists in rtcicecandidatepairstats.
state for further information about how ice check lsits work.
...And 3 more matches
XMLHttpRequest.readyState - Web APIs
the xmlhttprequest.ready
state property returns the
state an xmlhttprequest client is in.
... an xhr client exists in one of the following
states: value
state description 0 unsent client has been created.
...during this
state, the request headers can be set using the setrequestheader() method and the send() method can be called which will initiate the fetch.
...And 3 more matches
XRRenderState.baseLayer - Web APIs
the read-only baselayer property of the xrrender
state interface returns the xrwebgllayer instance that is the source of bitmap images and a description of how the image is to be rendered in the device.
... this property is read-only; however, you can indirectly change its value using xrsession.updaterender
state.
... syntax var xrwebgllayer = xrrender
state.baselayer; value a xrwebgllayer object which is used as the source of the world's contents when rendering each frame of the scene.
...And 3 more matches
XRSession.updateRenderState() - Web APIs
the updaterender
state() method of the xrsession interface of webxr api schedules changes to be applied to the active render
state prior to rendering of the next frame.
... syntax xrsession.updaterender
state(new
state) parameters new
state an object conforming to the xrrender
stateinit dictionary specifying the properties of the session's render
state to update before rendering the next frame.
... invalid
stateerror this may occur for one of the following reasons: the xrsession has already ended, so you cannot change its render
state.
...And 3 more matches
XRSession.visibilityState - Web APIs
the read-only visibility
state property of the xrsession interface is a string indicating whether the webxr content is currently visible to the user, and if it is, whether it's the primary focus.
... every time the visibility
state changes, a visibilitychange event is fired on the xrsession object.
... syntax visibility
state = xrsession.visibility
state; value a domstring containing one of the values defined in the enumerated type xrvisibility
state; this string indicates whether or not the xr content is visible to the user and if it is, whether or not it's currently the primary focus.
...And 3 more matches
SyntaxError: function statement requires a name - JavaScript
the javascript exception "function
statement requires a name" occurs when there is a function
statement in the code that requires a name.
... message syntax error: expected identifier (edge) syntaxerror: function
statement requires a name [firefox] syntaxerror: unexpected token ( [chrome] error type syntaxerror what went wrong?
... there is a function
statement in the code that requires a name.
...And 3 more matches
JS::AutoSaveExceptionState
this article covers features introduced in spidermonkey 31 save and later restore the current exception
state of a given jscontext.
... syntax js::autosaveexception
state(jscontext *cx); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... description js::autosaveexception
state saves and later restores the current exception
state of a given jscontext.
...And 2 more matches
mozIStorageAsyncStatement
an asynchronous sql
statement.
... this differs from mozistorage
statement by only being usable for asynchronous execution.
... (mozistorage
statement can be used for both synchronous and asynchronous purposes.) this specialization for asynchronous operation allows us to avoid needing to acquire synchronization primitives also used by the asynchronous execution thread.
...And 2 more matches
mozIStoragePendingStatement
the mozistoragepending
statement interface represents a pending asynchronous database
statement, and offers the cancel() method which allows you to cancel the pending
statement.
... storage/public/mozistoragepending
statement.idlscriptable please add a summary to this article.
... 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.
...And 2 more matches
GetState
« nsiaccessible page summary this method retrieves
states of the accessible.
... void get
state( out unsigned long a
state, out unsigned long aextra
state ); parameters a
state[out] the first bit field (see
state_* constants in
states documentation).aextra
state[out] the second bit field (see ext_
state_* constants in
states documentation).
...remarks accessible
states are stored as bit fields which describe boolean properties of node.
...And 2 more matches
MediaPositionState.duration - Web APIs
the mediaposition
state dictionary's duration property is used when calling the mediasession method setposition
state() to provide the user agent with the overall total duration in seconds of the media currently being performed.
... for example, a browser might use this information along with the position property and the navigator.mediasession.playback
state, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
... syntax let position
state = { duration: durationinseconds }; let durationinseconds = position
state.duration; value a floating-point value indicating the overall duration, in seconds, of the media being performed.
...And 2 more matches
MediaSession.playbackState - Web APIs
the playback
state property of the mediasession interface indicates whether the current media session is playing or paused.
... syntax let playback
state = mediasession.playback
state; mediasession.playback
state = playback
state; value a domstring indicating the current playback
state of the media session.
... the value may be one of the following: none the browsing context doesn't currently know the current playback
state, or the playback
state is not available at this time.
...And 2 more matches
RTCPeerConnection: connectionstatechange event - Web APIs
the connection
statechange event is sent to the ontrack event handler on an rtcpeerconnection object after a new track has been added to an rtcrtpreceiver which is part of the connection.
... the new connection
state can be found in connection
state, and is one of the strings in the rtcpeerconnection
state enumerated type.
... bubbles no cancelable no interface event event handler onconnection
statechange examples for an rtcpeerconnection, pc, this example sets up a handler for connection
statechange messages to handle changes to the connectivity of the webrtc session.
...And 2 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
the channel property becomes available only after the request is sent and the connection was established, that is, on ready
state loaded, interactive or completed.
... error.wrappedjsobject.init(errname); return error; // xxx: errtype goes unused } function dumpsecurityinfo(xhr, error) { let channel = xhr.channel; try { dump("connection status:\n"); if (!error) { dump("\tsucceeded\n"); } else { dump("\tfailed: " + error.name + "\n"); } let secinfo = channel.securityinfo; // print general connection security
state dump("security information:\n"); if (secinfo instanceof ci.nsitransportsecurityinfo) { secinfo.queryinterface(ci.nsitransportsecurityinfo); dump("\tsecurity
state of connection: "); // check security
state flags if ((secinfo.security
state & ci.nsiwebprogresslistener.
state_is_secure) == ci.nsiwebprogresslistener.
state_is_secure) { dump("secure c...
...onnection\n"); } else if ((secinfo.security
state & ci.nsiwebprogresslistener.
state_is_insecure) == ci.nsiwebprogresslistener.
state_is_insecure) { dump("insecure connection\n"); } else if ((secinfo.security
state & ci.nsiwebprogresslistener.
state_is_broken) == ci.nsiwebprogresslistener.
state_is_broken) { dump("unknown\n"); dump("\tsecurity description: " + secinfo.shortsecuritydescription + "\n"); dump("\tsecurity error message: " + secinfo.errormessage + "\n"); } } else { dump("\tno security info available for this channel\n"); } // print ssl certificate details if (secinfo instanceof ci.nsisslstatusprovider) { var cert = secinfo.queryinterface(ci.nsisslstatusprovider) ...
...And 2 more matches
XPathResult.invalidIteratorState - Web APIs
the read-only invaliditerator
state property of the xpathresult interface signifies that the iterator has become invalid.
... syntax var iterator
state = result.invaliditerator
state; return value a boolean value indicating whether the iterator has become invalid.
... example the following example shows the use of the invaliditerator
state property.
...And 2 more matches
SyntaxError: missing ; before statement - JavaScript
the javascript exception "missing ; before
statement" occurs when there is a semicolon (;) missing somewhere and can't be added by automatic semicolon insertion (asi).
... message syntaxerror: expected ';' (edge) syntaxerror: missing ; before
statement (firefox) error type syntaxerror.
...javascript
statements must be terminated with semicolons.
...And 2 more matches
mozbrowserselectionstatechanged
the mozbrowserselection
statechanged event is fired when the text selected inside the browser <iframe> content changes.
... note that this is deprecated, and current implementations should use mozbrowsercaret
statechanged instead.
...
states the current
state of the selection.
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserselection
statechanged", function( event ) { if(event.details.visible) { console.log("the current selection is visible."); } else { console.log("the current selection is not visible."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
PRThreadState
a thread's thread
state is either joinable or unjoinable.
... syntax #include <prthread.h> typedef enum prthread
state { pr_joinable_thread, pr_unjoinable_thread } prthread
state; enumerators pr_unjoinable_thread thread termination happens implicitly when the thread returns from the root function.
...threads created with a pr_unjoinable_thread
state cannot be used as arguments to pr_jointhread.
...what happens when it returns from its root function depends on the thread
state passed to pr_createthread when the thread was created.
mozIStorageStatementParams
this interface has no defined properties, but has properties based on the named parameters found in the sql from the
statement it was accessed off of.
... for example, say you create a
statement like so: var
statement = dbconn.create
statement("select * from table_name where id = :item_id"); this object would have one property, item_id, that you can use to bind a value to that named parameter like so:
statement.params.item_id = 2; for more details on why you should bind parameters as opposed to hard-coding them into your
statement, please see the overview document about binding parameters.
... enumeration of properties you can also enumerate all the properties on this object with a for..in enumeration: // valuestobind is an object that contains key-value pairs // to bind to the
statement before executing it.
... for (let param in
statement.params)
statement.params[param] = valuestobind[param]; ...
nsIAccessibleStateChangeEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean isenabled(); boolean isextra
state(); attributes attribute type description
state unsigned long returns the
state of accessible (see constants declared in nsiaccessible
states).
...return value returns true if the
state is turned on.
... isextra
state() boolean isextra
state(); parameters none.
... return value returns true if the
state is extra
state.
BaseAudioContext.onstatechange - Web APIs
the on
statechange property of the baseaudiocontext interface defines an event handler function to be called when the
statechange event fires: this occurs when the audio context's
state changes.
... syntax baseaudiocontext.on
statechange = function() { ...
... }; example the following snippet is taken from our audiocontext
states demo (see it running live.) the on
statechange hander is used to log the current
state to the console every time it changes.
... audioctx.on
statechange = function() { console.log(audioctx.
state); } specifications specification status comment web audio apithe definition of 'on
statechange' in that specification.
BaseAudioContext.state - Web APIs
the
state read-only property of the baseaudiocontext interface returns the current
state of the audiocontext.
... syntax baseaudiocontext.
state; value a domstring.
... closed: the audio context has been closed (with the audiocontext.close() method.) example the following snippet is taken from our audiocontext
states demo (see it running live.) the audiocontext.on
statechange hander is used to log the current
state to the console every time it changes.
... audioctx.on
statechange = function() { console.log(audioctx.
state); } specifications specification status comment web audio apithe definition of '
state' in that specification.
BudgetState - Web APIs
the budget
state interface of the the web budget api provides the amount of the user agent's processing budget at a specific point in time.
... properties budget
state.budgetat returns the anticipated processing budget at a specific time.
... budget
state.time returns a timestamp at which the budgetat value is valid.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbudget
state experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ?
Document.visibilityState - Web APIs
the document.visibility
state read-only property returns the visibility of the document, that is in which context this element is now visible.
...the document may start in this
state, but will never transition to it from another value.
... syntax var string = document.visibility
state examples document.addeventlistener("visibilitychange", function() { console.log( document.visibility
state ); // modify behavior...
... }); specifications specification status comment page visibility (second edition)the definition of 'document.visibility
state' in that specification.
EventSource.readyState - Web APIs
the ready
state read-only property of the eventsource interface returns a number representing the
state of the connection.
... syntax var myready
state = eventsource.ready
state; value a number representing the
state of the connection.
... possible values are: 0 — connecting 1 — open 2 — closed examples var evtsource = new eventsource('sse.php'); console.log(evtsource.ready
state); note: you can find a full example on github — see simple sse demo using php.
... specifications specification status comment html living standardthe definition of 'ready
state' in that specification.
FileReader.readyState - Web APIs
the filereader ready
state property provides the current
state of the reading operation a filereader is in.
... a filereader exists in one of the following
states: value
state description 0 empty reader has been created.
... example var reader = new filereader(); console.log('empty', reader.ready
state); // ready
state will be 0 reader.readastext(blob); console.log('loading', reader.ready
state); // ready
state will be 1 reader.onloadend = function () { console.log('done', reader.ready
state); // ready
state will be 2 }; value a number which is one of the three possible
state constants define for the filereader api.
... specifications specification status comment file apithe definition of 'ready
state' in that specification.
HTMLMediaElement.readyState - Web APIs
the htmlmediaelement.ready
state property indicates the readiness
state of the media.
... syntax var ready
state = audioorvideo.ready
state; value an unsigned short.
... <audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addeventlistener('loadeddata', function() { if(obj.ready
state >= 2) { obj.play(); } }); specifications specification status comment html living standardthe definition of 'htmlmediaelement.ready
state' in that specification.
... living standard html5the definition of 'htmlmediaelement.ready
state' in that specification.
MediaRecorder.state - Web APIs
the mediarecorder.
state read-only property returns the current
state of the current mediarecorder object.
... syntax var
state = mediarecorder.
state values a animationplay
state object containing one of the following values: enumeration description inactive recording is not occuring — it has either not been started yet, or it has been started and then stopped.
... record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.
state); // will return "recording" console.log("recorder started"); } ...
... specifications specification status comment mediastream recordingthe definition of 'mediarecorder.
state' in that specification.
MediaSource.readyState - Web APIs
the ready
state read-only property of the mediasource interface returns an enum representing the
state of the current mediasource.
... syntax var myready
state = mediasource.ready
state; value a domstring.
... example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.ready
state); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video...
....play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'ready
state' in that specification.
MouseEvent.getModifierState() - Web APIs
the mouseevent.getmodifier
state() method returns the current
state of the specified modifier key: true if the modifier is active (i.e., the modifier key is pressed or locked), otherwise, false.
... see the document of keyboardevent.getmodifier
state() for details.
... syntax var active = event.getmodifier
state(keyarg); returns a boolean parameters keyarg a modifier key value.
... specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'getmodifier
state()' in that specification.
RTCIceTransport: statechange event - Web APIs
a
statechange event occurs when the rtcicetransport changes
state.
... the
state can be used to determine how far through the process of examining, verifying, and selecting a valid candidate pair is prior to successfully connecting the two peers for webrtc communications.
... bubbles no cancelable no interface event event handler property rtcicetransport.on
statechange 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.
... let icetransport = pc.getsenders()[0].transport.icetransport; icetransport.addeventlistener("
statechange", ev => { if (icetransport.
state === "failed") { handlefailure(pc); } }, false); the same code, using the on
statechange event handler property, looks like this: let icetransport = pc.getsenders()[0].transport.icetransport; icetransport.on
statechange = ev => { if (icetransport.
state === "failed") { handlefailure(pc); } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of '
statechange' in that specification.
RTCSctpTransport.state - Web APIs
the
state read-only property of the rtcsctptransport interface provides information which describes a stream control transmission protocol (sctp) transport
state.
... syntax var my
state = sctptransport.
state; value a string whose value is taken from the rtcsctptransport
state enumerated type.
... its value is one of the following: connecting the initial
state when the connection is being estabilished.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsctptransport.
state' in that specification.
ServiceWorker.state - Web APIs
the
state read-only property of the serviceworker interface returns a string representing the current
state of the service worker.
... syntax someurl = serviceworker.
state value a serviceworker
state definition (see the spec.) examples this code snippet is from the service worker registration-events sample (live demo).
... the code listens for any change in the serviceworker.
state and returns its value.
... serviceworker = registration.installing; document.queryselector('#kind').textcontent = 'installing'; } else if (registration.waiting) { serviceworker = registration.waiting; document.queryselector('#kind').textcontent = 'waiting'; } else if (registration.active) { serviceworker = registration.active; document.queryselector('#kind').textcontent = 'active'; } if (serviceworker) { log
state(serviceworker.
state); serviceworker.addeventlistener('
statechange', function(e) { log
state(e.target.
state); }); } specifications specification status comment service workersthe definition of '
state' in that specification.
validityState.badInput - Web APIs
the read-only badinput property of a validity
state object indicates if the user has provided input that the browser is unable to convert.
... example <input type="number" id="age"> var input = document.getelementbyid("age"); if (input.validity.badinput) { console.log("bad input detected…"); } else { console.log("content of input ok."); } specifications specification status comment html living standardthe definition of 'validity
state.badinput' in that specification.
... living standard live standard html 5.1the definition of 'validity
state.badinput' in that specification.
... html5the definition of 'validity
state.badinput' in that specification.
ValidityState.rangeOverflow - Web APIs
the read-only rangeoverflow property of a validity
state object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's max attribute.
... specifications specification status comment html living standardthe definition of 'validity
state.rangeoverflow' in that specification.
... living standard html 5.1the definition of 'validity
state.rangeoverflow' in that specification.
... recommendation html5the definition of 'validity
state.rangeoverflow' in that specification.
ValidityState.rangeUnderflow - Web APIs
the read-only rangeunderflow property of a validity
state object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's min attribute.
... specifications specification status comment html living standardthe definition of 'validity
state.rangeunderflow' in that specification.
... living standard html 5.1the definition of 'validity
state.rangeunderflow' in that specification.
... recommendation html5the definition of 'validity
state.rangeunderflow' in that specification.
ValidityState.stepMismatch - Web APIs
the read-only stepmismatch property of a validity
state object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's step attribute.
... specifications specification status comment html living standardthe definition of 'validity
state.stepmismatch' in that specification.
... living standard html 5.1the definition of 'validity
state.stepmismatch' in that specification.
... recommendation html5the definition of 'validity
state.stepmismatch' in that specification.
validityState.tooLong - Web APIs
the read-only toolong property of a validity
state object indicates if the value of an <input> or <textarea>, after having been edited by the user, exceeds the maximum code-unit length established by the element's maxlength attribute.
... specifications specification status comment html living standardthe definition of 'validity
state.toolong' in that specification.
... living standard html 5.1the definition of 'validity
state.toolong' in that specification.
... recommendation html5the definition of 'validity
state.toolong' in that specification.
validityState.tooShort - Web APIs
the read-only tooshort property of a validity
state object indicates if the value of an <input>, <button>, <select>, <output>, <fieldset> or <textarea>, after having been edited by the user, is less than the minimum code-unit length established by the element's minlength attribute.
... specifications specification status comment html living standardthe definition of 'validity
state.tooshort' in that specification.
... living standard html 5.1the definition of 'validity
state.tooshort' in that specification.
... recommendation html5the definition of 'validity
state.tooshort' in that specification.
ValidityState.typeMismatch - Web APIs
the read-only typemismatch property of a validity
state object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's type attribute.
... specifications specification status comment html living standardthe definition of 'validity
state.typemismatch' in that specification.
... living standard html 5.1the definition of 'validity
state.typemismatch' in that specification.
... recommendation html5the definition of 'validity
state.typemismatch' in that specification.
ValidityState - Web APIs
the validity
state interface represents the validity
states that an element can be in, with respect to constraint validation.
... specifications specification status comment html living standardthe definition of 'validity
state' in that specification.
... living standard living standard html 5.1the definition of 'validity
state' in that specification.
... html5the definition of 'validity
state' in that specification.
XMLHttpRequest.onreadystatechange - Web APIs
an eventhandler that is called whenever the ready
state attribute changes.
...the xmlhttprequest.onready
statechange property contains the event handler to be called when the ready
statechange event is fired, that is every time the ready
state property of the xmlhttprequest changes.
... syntax xmlhttprequest.onready
statechange = callback; values callback is the function to be executed when the ready
state changes.
... examples const xhr = new xmlhttprequest(), method = "get", url = "https://developer.mozilla.org/"; xhr.open(method, url, true); xhr.onready
statechange = function () { // in local files, status is 0 upon success in mozilla firefox if(xhr.ready
state === xmlhttprequest.done) { var status = xhr.status; if (status === 0 || (status >= 200 && status < 400)) { // the request has been completed successfully console.log(xhr.responsetext); } else { // oh no!
XRRenderState - Web APIs
the xrrender
state interface of the webxr device api contains configurable values which affect how the imagery generated by an xrsession gets composited.
... when you apply changes using the xrsession method updaterender
state(), the specified changes take effect after the current animation frame has completed, but before the next one begins.
... properties the followiing properties are available on xrrender
state objects.
... specifications specification status comment webxr device apithe definition of 'xrrender
state' in that specification.
XRSession.renderState - Web APIs
the read-only render
state property of an xrsession object indicates the returns a xrrender
state object describing how the user's environment which should be rendered.
... while this property is read only, you can call the xrsession method updaterender
state() to make changes.
... syntax var xrrender
state = xrsession.render
state; value an xrrender
state object describing how to render the scene.
... specifications specification status comment webxr device apithe definition of 'xrsession.render
state' in that specification.
animation-play-state - CSS: Cascading Style Sheets
the animation-play-
state css property sets whether an animation is running or paused.
... syntax /* single animation */ animation-play-
state: running; animation-play-
state: paused; /* multiple animations */ animation-play-
state: paused, running, running; /* global values */ animation-play-
state: inherit; animation-play-
state: initial; animation-play-
state: unset; values running the animation is currently playing.
... formal definition initial valuerunningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-play-
state>#where <single-animation-play-
state> = running | paused examples see css animations for examples.
... specifications specification status comment css animationsthe definition of 'animation-play-
state' in that specification.
state - Archive of obsolete content
« xul reference
state type: string this read only property indicates whether the popup is open or not.
...this
state will occur during the popupshowing event.
...this
state will occur during the popuphiding event.
Statement - MDN Web Docs Glossary: Definitions of Web-related terms
in a computer programming language, a
statement is a line of code commanding a task.
... every program consists of a sequence of
statements.
... learn more general knowledge
statement (computer science) on wikipedia technical reference javascript
statements and declarations ...
mozbrowsercaretstatechanged
the mozbrowsercaret
statechanged event is fired when the user selects content in a page loaded in a browser <iframe>.
...ether the selectall command is available (true) or not (false.) cancut: a boolean indicating whether the cut command is available (true) or not (false.) cancopy: a boolean indicating whether the copy command is available (true) or not (false.) canpaste: a boolean indicating whether the paste command is available (true) or not (false.) reason a domstring that defines the reason for the
state being changed.
... examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsercaret
statechanged", function( event ) { // do stuff with event.details }); related events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
JSExceptionState
this is used to save and restore exception
states.
... syntax struct jsexception
state; description a jsexception
state object is returned by the js_saveexception
state function, and is passed to functions js_restoreexception
state and js_dropexception
state.
... see also mxr id search for jsexception
state js_saveexception
state js_restoreexception
state js_dropexception
state ...
Animation.playState - Web APIs
the animation.play
state property of the web animations api returns and sets an enumerated value describing the playback
state of an animation.
... syntax var currentplay
state = animation.play
state; animation.play
state = new
state; value idle the current time of the animation is unresolved and there are no pending tasks.
... tears.foreach(function(el) { el.pause(); el.currenttime = 0; }); specifications specification status comment web animationsthe definition of 'play
state' in that specification.
Document.queryCommandState() - Web APIs
the querycommand
state() method will tell you if the current selection has a certain document.execcommand() command applied.
... syntax querycommand
state(string command) parameters command is a command from document.execcommand() return value querycommand
state() can return a boolean value or null if the
state is unknown.
... example html <div contenteditable="true">select a part of this text!</div> <button onclick="makebold();">test the
state of the 'bold' command</button> javascript function makebold() { var
state = document.querycommand
state("bold"); switch (
state) { case true: alert("the bold formatting will be removed from the selected text."); break; case false: alert("the selected text will be displayed in bold."); break; case null: alert("the
state of the 'bold' command is indeterminable."); break; } document.execcommand('bold'); } result specifications specification status comment execcommand ...
Document: readystatechange event - Web APIs
the ready
statechange event is fired when the ready
state attribute of a document has changed.
... bubbles no cancelable no interface event event handler property onready
statechange 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; } js const log = document.queryselector('.event-log-contents'); const reload = document.querys...
...elector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('ready
statechange', (event) => { log.textcontent = log.textcontent + `ready
state: ${document.ready
state}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment html living standardthe definition of 'ready
statechange' in that specification.
Element: MSManipulationStateChanged event - Web APIs
msmanipulation
statechanged fires when the
state of an element being manipulated has changed (ie.
... bubbles unknown cancelable unknown interface msmanipulationevent event handler property unknown get manipulation
states using the last
state and current
state properties.
... examples // listen for panning
state change events outerscroller.addeventlistener("msmanipulation
statechanged", function(e) { // check to see if they lifted while pulled to the top if (e.current
state == ms_manipulation_
state_inertia && outerscroller.scrolltop === 0) { refreshitemsasync(); } }); specifications not part of any specification.
MediaStreamTrack.readyState - Web APIs
the mediastreamtrack.ready
state read-only property returns an enumerated value giving the status of the track.
... syntax const
state = track.ready
state value it takes one of the following values: "live" which indicates that an input is connected and does its best-effort in providing real-time data.
... specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.ready
state' in that specification.
PushManager.permissionState() - Web APIs
the permission
state() method of the pushmanager interface returns a promise that resolves to a domstring indicating the permission
state of the push manager.
... syntax pushmanager.permission
state(options).then(function(pushmessaging
state) { ...
... specifications specification status comment push apithe definition of 'permission
state()' in that specification.
RTCIceTransport.gatheringState - Web APIs
the read-only rtcicetransport property gathering
state returns a domstring from the enumerated type rtcicegatherer
state that indicates what gathering
state the ice agent is currently in: "new", "gathering", or "complete".
... syntax gather
state = rtcicetransport.gathering
state; value a string from the rtcicegatherer
state enumerated type whose value indicates the current
state of the ice agent's candidate gathering process: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetransport.gathering
state' in that specification.
RTCPeerConnection: signalingstatechange event - Web APIs
an signaling
statechange event is sent to an rtcpeerconnection to notify it that its signaling
state, as indicated by the signaling
state property, has changed.
... bubbles no cancelable no interface event event handler property rtcpeerconnection.onsignaling
statechange 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.
... pc.addeventlistener("signaling
statechange", ev => { switch(pc.signaling
state) { case "stable": updatestatus("ice negotiation complete"); break; } }, false); using onsignaling
statechange, it looks like this: pc.onsignaling
statechange = ev => { switch(pc.signaling
state) { case "stable": updatestatus("ice negotiation complete"); break; } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'signaling
statechange' in that specification.
WebSocket.readyState - Web APIs
the websocket.ready
state read-only property returns the current
state of the websocket connection.
... syntax var ready
state = awebsocket.ready
state; value one of the following unsigned short values: value
state description 0 connecting socket has been created.
... specifications specification status comment html living standardthe definition of 'websocket: ready
state' in that specification.
WindowClient.visibilityState - Web APIs
the visibility
state read-only property of the windowclient interface indicates the visibility of the current client.
... syntax var myvis
state = windowclient.visibility
state; value a domstring (see document.visibility
state for values).
... example event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (let i = 0; i < clientlist.length; i++) { let client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if (client.visibility
state === 'hidden') return client.focus(); } } } if (clients.openwindow) { return clients.openwindow('/'); } })); }); specifications specification status comment service workersthe definition of 'visibility
state' in that specification.
XRRenderState.inlineVerticalFieldOfView - Web APIs
the inlineverticalfieldofview read-only property of the xrrender
state interface defines the angle of the field of view in radians used when computing projection matrices for "inline" xrsession objects.
... syntax var adouble = xrrender
state.inlineverticalfieldofview; value a number.
... specifications specification status comment unknownthe definition of 'xrrender
state.inlineverticalfieldofview' in that specification.
XRRenderState.depthFar - Web APIs
the depthfar read-only property of the xrrender
state interface returns the distance in meters of the far clip plane from the viewer.
... syntax var adouble = xrrender
state.depthfar; value a number.
... specifications specification status comment unknownthe definition of 'xrrender
state.depthfar' in that specification.
XRRenderState.depthNear - Web APIs
the depthnear read-only property of the xrrender
state interface returns the distance in meters of the near clip plane from the viewer.
... syntax var adouble = xrrender
state.depthnear; value a number.
... specifications specification status comment unknownthe definition of 'xrrender
state.depthnear' in that specification.
XRRenderState.inlineVerticalFieldOfView - Web APIs
the read-only inlineverticalfieldofview property of the xrrender
state interface returns the default vertical field of view for "inline" sessions and null for all immersive sessions.
... syntax var inlineverticalfieldofview = xrrender
state.inlineverticalfieldofview; value a number for "inline" sessions, which represents the default field of view, and null for immersive sessions.
... specifications specification status comment webxr device apithe definition of 'xrrender
state.inlineverticalfieldofview' in that specification.
XRRenderStateInit - Web APIs
the xrrender
stateinit dictionary is a writeable version of the xrrender
state interface, and is used when calling an xrsession's updaterender
state() method to apply changes to the render
state prior to rendering the next frame.
... usage notes any properties not specified in the xrrender
stateinit compliant object passed into updaterender
state() are left at their current values.
... specifications specification status comment webxr device apithe definition of 'xrrender
stateinit' in that specification.
XRVisibilityState - Web APIs
the xrvisibility
state enumerated type defines the string values which are valid for the xrsession interface's visibility
state property, which indicates whether or not an xr session is currently visible to the user, and if it is, whether or not it's currently the primary focus.
... values hidden the virtual scene generated by the xrsession is not currently visible to the user, so its requestanimationframe() callbacks are not being executed until thevisibility
state changes.
... specifications specification status comment webxr device apithe definition of 'xrvisibility
state' in that specification.
Using ARIA: Roles, states, and properties - Accessibility
aria defines semantics that can be applied to elements, with these divided into roles (defining a type of user interface element) and
states and properties that are supported by a role.
... authors must assign an aria role and the appropriate
states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (via use of an appropriate html element).
...header definition directory document feed figure group heading img list listitem math none note presentation row rowgroup rowheader separator table term textbox toolbar tooltip landmark roles banner complementary contentinfo form main navigation region search live region roles alert log marquee status timer window roles alertdialog dialog
states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-required aria-selected aria-sort aria-valuemax aria-valuemin aria-valueno...
:state() - CSS: Cascading Style Sheets
the :
state css pseudo-class represents any custom element with the specified custom
state in elementinternals.
states.
... custom-element:
state(foo) { /* styles to apply when `custom-element` is in the `foo`
state */ } syntax syntax not found in db!
... my code block and/or include a list of links to useful code samples that live elsewhere: x y z specifications specification status comment unknownthe definition of 'the :
state() selector' in that specification.
state - Archive of obsolete content
« xul reference home
state type: one of the values below indicates whether the splitter has collapsed content or not.
... this attribute will be updated automatically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each
state.
statedatasource - Archive of obsolete content
« xul reference home
statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree
state information.
...if you do not specify this attribute,
state information will be stored in the local store (rdf:local-store).
mozIStorageStatementRow
this interface has no defined properties, but has properties based on the name of the columns in the sql result from the
statement it was accessed off of.
... for example, say you create a
statement like so: var
statement = dbconn.create
statement("select id, name from table_name"); the object would have two properties, id and name, that can be used to get the value of the column after you have called mozistorage
statement.executestep() like so: while (
statement.executestep()) { let id =
statement.row.id; let name =
statement.row.name; } see also storage mozistorage
statement ...
BudgetState.budgetAt - Web APIs
the budgetat read-only property of the budget
state interface returns the anticipated processing budget at the specified time.
... syntax var budget = budget
state.budgetat value a double.
BudgetState.time - Web APIs
the time read-only property of the budget
state interface returns a timestamp at which the budgetat value is valid.
... syntax var time = budget
state.time value a timestamp.
persistentState - Web APIs
the mediakeysystemconfiguration.persistent
state read-only property indicates whether the ability to persist
state is required.
... syntax var persistent
state = mediasystemconfiguration.persistent
state; specifications specification status comment encrypted media extensionsthe definition of 'persistent
state' in that specification.
MediaPositionState - Web APIs
the media session api's mediaposition
state dictionary is used to represent the current playback position of a media session.
... specifications specification status comment media session standardthe definition of 'mediaposition
state' in that specification.
PermissionStatus.state - Web APIs
the
state read-only property of the permissionstatus interface returns the
state of a requested permission.
... syntax var permission = permissionstatus.
state; example navigator.permissions.query({name:'geolocation'}).then(function(permissionstatus) { console.log('geolocation permission
state is ', permissionstatus.
state); permissionstatus.onchange = function() { console.log('geolocation permission status has changed to ', this.
state); }; }); specification specification status comment permissionsthe definition of '
state' in that specification.
RTCIceGathererState - Web APIs
the rtcicegatherer
state enumerated type provides the string values which can be returned by an rtcicetransport object's gathering
state.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicegatherer
state' in that specification.
substate - Archive of obsolete content
« xul reference home sub
state type: one of the values below on splitters which have
state="collapsed" and collapse="both", determines which direction the splitter is actually collapsed in.
Index - Web APIs
75 animation.play
state api, animation, property, reference, web animations, play
state, web animations api the animation.play
state property of the web animations api returns and sets an enumerated value describing the playback
state of an animation.
...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.
... 250 baseaudiocontext.on
statechange api, audio, audiocontext, baseaudiocontext, event handler, reference, web audio api, on
statechange the following snippet is taken from our audiocontext
states demo (see it running live.) the on
statechange hander is used to log the current
state to the console every time it changes.
...And 179 more matches
Editor Embedding Guide - Archive of obsolete content
get the current command
state of a given command -- getcommand
state: commandmanager->getcommand
state(acommand,acommandparams) index of commands and parameters cmd_bold toggles bold style on selection.
... getcommand
state "
state_all"(boolean), "
state_begin"(boolean), "
state_end"(boolean), "
state_mixed"(boolean), "
state_enabled" (boolean) docommand no parameters example normal bold cmd_italics toggles italics style on selection.
... getcommand
state "
state_all"(boolean), "
state_begin"(boolean), "
state_end"(boolean), "
state_mixed"(boolean), "
state_enabled" (boolean) docommand no parameters example normal italics cmd_underline toggles underline on selection.
...And 109 more matches
Storage
create
statements to execute on the connection - mozistorage
statement.
... bind parameters to a
statement as necessary.
... execute the
statement.
...And 57 more matches
Parser API
position of the first character after the parsed source region): interface sourcelocation { source: string | null; start: position; end: position; } each position object consists of a line number (1-indexed) and a column number (0-indexed): interface position { line: uint32 >= 1; column: uint32 >= 0; } programs interface program <: node { type: "program"; body: [
statement ]; } a complete program source tree.
... functions interface function <: node { id: identifier | null; params: [ pattern ]; defaults: [ expression ]; rest: identifier | null; body: block
statement | expression; generator: boolean; expression: boolean; } a function declaration or expression.
... the body of the function may be a block
statement, or in the case of an expression closure, an expression.
...And 56 more matches
nsIWebProgressListener
ress awebprogress, in nsirequest arequest, in nsiuri alocation, [optional] in unsigned long aflags); void onprogresschange(in nsiwebprogress awebprogress, in nsirequest arequest, in long acurselfprogress, in long amaxselfprogress, in long acurtotalprogress, in long amaxtotalprogress); void onsecuritychange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long a
state); void on
statechange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long a
stateflags, in nsresult astatus); void onstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage); constants
state transition flags these flags indicate the various
states that requests may transition through as they are be...
... for any given request, on
statechange() is called once with the
state_start flag, zero or more times with the
state_transferring flag or once with the
state_redirecting flag, and then finally once with the
state_stop flag.
... note: for document requests, a second
state_stop is generated (see the description of
state_is_window for more details).
...And 55 more matches
Control flow and error handling - JavaScript
« previousnext » javascript supports a compact set of
statements, specifically control flow
statements, that you can use to incorporate a great deal of interactivity in your application.
... this chapter provides an overview of these
statements.
... the javascript reference contains exhaustive details about the
statements in this chapter.
...And 51 more matches
nsITextInputProcessor
dom/interfaces/base/nsitextinputprocessor.idlscriptable this interface is a text input events synthesizer and manages its composition and modifier
state 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) the motivation of this interface is to provide better api than nsidomwindowutils to dispatch key events and create, modify, and commit composition in higher level.
...for solving that issue, methods of this interface have been designed for performing a key operation or representing a change of composition
state.
... for example, the implementation of this interface manages modifier
state and composition
state, initializes dom events from minimum information, and doesn't dispatch some events if they are not necessary.
...And 49 more matches
Sqlite.jsm
sqlite.jsm offers some compelling advantages over the low-level storage xpcom interfaces: automatic
statement management.
... sqlite.jsm will create, manage, and destroy
statement instances for you.
... you don't need to worry about caching created
statement instances, destroying them when you are done, etc.
...And 45 more matches
Loops and iteration - JavaScript
this chapter of the javascript guide introduces the different iteration
statements available to javascript.
... the
statements for loops provided in javascript are: for
statement do...while
statement while
statement labeled
statement break
statement continue
statement for...in
statement for...of
statement for
statement a for loop repeats until a specified condition evaluates to false.
... a for
statement looks as follows: for ([initialexpression]; [conditionexpression]; [incrementexpression])
statement when a for loop executes, the following occurs: the initializing expression initialexpression, if any, is executed.
...And 45 more matches
ui/button/toggle - Archive of obsolete content
like action buttons, you can control their
state on a per-window or per-tab basis as well as globally.
... usage creating buttons to create a button you must give it an id, an icon, and a label: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onchange: function(
state) { console.log(
state.label + " checked
state: " +
state.checked); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel: badged buttons new in firefox 36.
...by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(
state) { button.badge =
state.badge + 1; if (
state.checked) { button.badgecolor = "#aa00aa"; } else { button.badgecolor = "#00aaaa"; } } specifying multiple icons you can specify just one icon, or multiple icons in different sizes.
...And 43 more matches
Gecko info for Windows accessibility vendors
roles,
states and events: please read the msaa documentation on msdn if you are unfamiliar with these.
... gecko also helps determine when to load a new window by firing two event_
state_change's on the root role_document accessible -- the first
state change indicates the document pane is now busy loading.
... the second
state change indicates the document pane has finished.
...And 42 more matches
RTCPeerConnection - Web APIs
e rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local device and a remote peer.propertiesalso inherits properties from: eventtargetcantrickleicecandidatesthe read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates.connection
state the read-only connection
state property of the rtcpeerconnection interface indicates the current
state of the peer connection by returning one of the string values specified by the enum rtcpeerconnection
state.currentlocaldescription read only the read-only property rtcpeerconnection.currentlocaldescription returns an rtcsessiondescription object describing the local end of the connection as it wa...
...however, browsers are not required to provide any default ice servers at all.iceconnection
state read only the read-only property rtcpeerconnection.iceconnection
state returns an enum of type rtciceconnection
state which
state of the ice agent associated with the rtcpeerconnection.icegathering
state read only the read-only property rtcpeerconnection.icegathering
state returns an enum of type rtcicegathering
state that describes connection's ice gathering
state.
...use rtcpeerconnection.currentlocaldescription or rtcpeerconnection.localdescription to get the current
state of the endpoint.
...And 33 more matches
IME handling guide
if ime is available on focused elements, we call that
state "enabled".
... if ime is not fully available(i.e., user cannot enable ime), we call this
state "disabled".
...these methods automatically manage composition
state and dispatch widgetcompositionevent properly.
...And 32 more matches
mozIStorageConnection
it is the primary interface for interacting with a database, including creating prepared
statements, executing sql, and examining database errors.
... method overview void asyncclose([optional] in mozistoragecompletioncallback acallback); void begintransaction(); void begintransactionas(in print32 transactiontype); mozistorage
statement clone([optional] in boolean areadonly); void close(); void committransaction(); void createaggregatefunction(in autf8string afunctionname, in long anumarguments, in mozistorageaggregatefunction afunction); mozistorageasync
statement createasync
statement(in autf8string asql
statement); void createfunction(in autf8string afunctionname, in long anum...
...arguments, in mozistoragefunction afunction); mozistorage
statement create
statement(in autf8string asql
statement); void createtable(in string atablename, in string atableschema); mozistoragepending
statement executeasync([array, size_is(anum
statements)] in mozistoragebase
statement a
statements, in unsigned long anum
statements, [optional] in mozistorage
statementcallback acallback ); void executesimplesql(in autf8string asql
statement); boolean indexexists(in autf8string aindexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8string afunctionname); mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8st...
...And 32 more matches
ui/button/action - Archive of obsolete content
usage creating buttons to create a button you must give it an id, an icon, and a label: var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(
state) { console.log("button '" +
state.label + "' was clicked"); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel using the toolbar customization feature: badged buttons new in firefox 36.
...by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(
state) { button.badge =
state.badge + 1; if (
state.checked) { button.badgecolor = "#aa00aa"; } else { button.badgecolor = "#00aaaa"; } } specifying multiple icons you can specify just one icon, or multiple icons in different sizes.
...you can also add, or change, the listener afterwards: var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: firstclick }); function firstclick(
state) { console.log("you clicked '" +
state.label + "'"); button.removelistener("click", firstclick); button.on("click", subsequentclicks); } function subsequentclicks(
state) { console.log("you clicked '" +
state.label + "' again"); } the listener is passed a
state object that contains all the button's properties.
...And 31 more matches
Index - Archive of obsolete content
for this we have to first create four icons, one for each tinderbox
state (none, success, test failed, and busted), then create a set of css rules that displays the icon corresponding to the current tinderbox
state: 398 tinderbox add-ons, extensions tinderbox is a web tool for tracking the status of the mozilla source code.
... 440 block and line layout cheat sheet gecko the details of block and line layout are tricky; this document serves as a "cheat sheet" that describes how the vagary of different
state flags control what's going on.
... 442 content
states and the style system developing mozilla content
states are what gecko uses to implement the various
state-dependent in css (examples would be :hover, :active, :focus, :target, :checked).
...And 31 more matches
Working with the History API - Web APIs
html5 introduced the push
state() and replace
state() methods for add and modifying history entries, respectively.
... these methods work in conjunction with the onpop
state event.
... adding and modifying history entries using push
state() changes the referrer that gets used in the http header for xmlhttprequest objects created after you change the
state.
...And 30 more matches
nsIDOMWindowUtils
izer createcompositionstringsynthesizer(); obsolete since gecko 38.0 void disablenontestmouseevents(in boolean adisable); boolean dispatchdomeventviapresshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodal
state(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in u...
...tpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccountscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); astring getvisiteddependentcomputedstyle(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodal
state(); void leavemodal
state(); void loadsheet(in nsiuri sheeturi, in unsigned long type); nsidomnodelist nodesfromrect(in float ax, in float ay, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, in boolean aignorerootscrollframe, in boolean aflushlayout); void processupdates(); obsolete since gecko 13.0 void purgepccoun...
... imeisopen boolean returns the ime open
state.
...And 27 more matches
Making decisions in your code — conditionals - Learn web development
in this article, we'll explore how so-called conditional
statements work in javascript.
... human beings (and other animals) make decisions all the time that affect their lives, from small ("should i eat one cookie or two?") to large ("should i stay in my home country and work on my father's farm, or should i move to america and study astrophysics?") conditional
statements allow us to represent such decision making in javascript, from the choice that must be made (for example, "one cookie or two"), to the resulting outcome of those choices (perhaps the outcome of "ate one cookie" might be "still felt hungry", and the outcome of "ate two cookies" might be "felt full, but mom scolded me for eating all the cookies".) if...else
statements let's look at by far ...
...the most common type of conditional
statement you'll use in javascript — the humble if...else
statement.
...And 24 more matches
nsISessionStore
void deletetabvalue(in nsidomnode atab, in astring akey); void deletewindowvalue(in nsidomwindow awindow, in astring akey); nsidomnode duplicatetab(in nsidomwindow awindow, in nsidomnode atab); nsidomnode forgetclosedtab(in nsidomwindow awindow, in unsigned long aindex); nsidomnode forgetclosedwindow(in unsigned long aindex); astring getbrowser
state(); unsigned long getclosedtabcount(in nsidomwindow awindow); astring getclosedtabdata(in nsidomwindow awindow); unsigned long getclosedwindowcount(); astring getclosedwindowdata(); astring gettab
state(in nsidomnode atab); astring gettabvalue(in nsidomnode atab, in astring akey); astring getwindow
state(in nsidomwindow awindow); ...
... astring getwindowvalue(in nsidomwindow awindow, in astring akey); void init(in nsidomwindow awindow); void persisttabattribute(in astring aname); void restorelastsession(); void setbrowser
state(in astring a
state); void settab
state(in nsidomnode atab, in astring a
state); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwindow
state(in nsidomwindow awindow, in astring a
state, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type d...
... getbrowser
state() returns the current
state of all of windows and all of their tabs.
...And 24 more matches
2D maze game with device orientation - Game development
} </style> <script src="src/phaser-arcade-physics.2.2.2.min.js"></script> <script src="src/boot.js"></script> <script src="src/preloader.js"></script> <script src="src/mainmenu.js"></script> <script src="src/howto.js"></script> <script src="src/game.js"></script> </head> <body> <script> (function() { var game = new phaser.game(320, 480, phaser.canvas, 'game'); game.
state.add('boot', ball.boot); game.
state.add('preloader', ball.preloader); game.
state.add('mainmenu', ball.mainmenu); game.
state.add('howto', ball.howto); game.
state.add('game', ball.game); game.
state.start('boot'); })(); </script> </body> </html> so far we have a simple html website with some basic content in the <head> section: charset, title, css styling and the inclusion of the...
...the <body> contains initialization of the phaser framework and the definitions of the game
states.
... back to game
states: the line below is adding a new
state called boot to the game: game.
state.add('boot', ball.boot); the first value is the name of the
state and the second one is the object we want to assign to it.
...And 23 more matches
How to build custom form controls - Learn web development
in particular, it's important to clearly define all the
states of your control.
... to do this, it's good to start with an existing control whose
states and behavior are well known, so that you can simply mimic those as much as possible.
...here is the result we want to achieve: this screenshot shows the three main
states of our control: the normal
state (on the left); the active
state (in the middle) and the open
state (on the right).
...And 23 more matches
Index
pyxpcom is actively used in active
state komodo products, for example.
... 204 mozistorageasync
statement stub an asynchronous sql
statement.
... 205 mozistoragebindingparams interfaces, interfaces:scriptable, storage the mozistoragebindingparams interface is used to bind values to parameters prior to calling mozistorage
statement.executeasync().
...And 21 more matches
nsIDownloadProgressListener
when you no longer need to listen to the download manager's
state, call nsidownloadmanager.removelistener() to stop listening.
... as the
states of downloads change, the methods described here are called by the download manager so your code can take whatever steps it needs to.
... method overview void ondownload
statechange(in short a
state, in nsidownload adownload); void onlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri alocation, in nsidownload adownload); obsolete since gecko 1.9.1 void onprogresschange(in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress, in nsidownload adownload); void onsecuritychange(in nsiwebprogress awebprogress, in nsireq...
...And 21 more matches
Web Replay
learn more web replay allows firefox content processes to record their behavior, replay it later, and rewind to earlier
states.
... step back when paused, the reverse step button in the debugger developer tool will step to the previous line executed and allow inspecting program
state there.
... the tab will pause at this point and allow
state to be inspected, forward/reverse stepping, and so forth.
...And 20 more matches
Functions - JavaScript
like the program itself, a function is composed of a sequence of
statements called the function body.
... to return a value other than the default, a function must have a return
statement that specifies the value to return.
... a function without a return
statement will return a default value.
...And 20 more matches
Working with Svelte stores - Learn web development
in this article we will show another way to handle
state management in svelte — stores.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app
state, run cd mdn-svelte-tutorial/06-stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores remember to run npm install && npm run dev to start your app in development mode.
... repl to code along with us using the repl, start at https://svelte.dev/repl/d1fa84a5a4494366b179c87395940039?version=3.23.2 dealing with our app
state we have already seen how our components can communicate with each other using props, two-way data binding, and events.
...And 19 more matches
Power profiling overview
c-
states intel processors have aggressive power-saving features.
... the first is the ability to switch frequently (thousands of times per second) between active and idle
states, and there are actually several different kinds of idle
states.
... these different
states are called c-
states.
...And 19 more matches
nsIHTMLEditor
refox 5.0 / thunderbird 5.0 / seamonkey 2.2) method overview void adddefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void addinsertionlistener(in nsicontentfilter infilter); void align(in astring aalign); boolean breakisvisible(in nsidomnode anode); boolean candrag(in nsidomevent aevent); void checkselection
stateforanonymousbuttons(in nsiselection aselection); nsidomelement createanonymouselement(in astring atag, in nsidomnode aparentnode, in astring aanonclass, in boolean aiscreatedhidden); nsidomelement createelementwithdefaults(in astring atagname); void decreasefontsize(); void dodrag(in nsidomevent aevent); void getalignment(out boolean amixed, out short a...
...align); astring getbackgroundcolor
state(out boolean amixed); nsidomelement getelementorparentbytagname(in astring atagname, in nsidomnode anode); astring getfontcolor
state(out boolean amixed); astring getfontface
state(out boolean amixed); astring getheadcontentsashtml(); astring gethighlightcolor
state(out boolean amixed); void getindent
state(out boolean acanindent, out boolean acanoutdent); void getinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); astring getinlinepropertywithattrvalue(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray ...
...getlinkedobjects(); void getlistitem
state(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getlist
state(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); astring getparagraph
state(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignorespuriousdragevent); void increasefontsize(); void indent(in astring aindent); void insertelementatselection(in nsidomelement aelement, in boolean adeleteselection); void insertfromdrop(in nsidomevent aevent); void inserthtml(in astring ainputstring); void inserthtmlwithcontext(in astring ainputstring, in...
...And 18 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
a set of system messages that confer accessibility-related events such as focus changes, changes to document content and
state changes in ui objects like checkboxes.
... myth: "msaa sucks" reality: this
statement may come from another engineer or even an employee of an at vendor.
...[important] get_acc
state: a 32 bit field representing possible on/off
states, such as focused, focusable, selected, selectable, visible, protected (for passwords), checked, etc.
...And 18 more matches
switch - JavaScript
the switch
statement evaluates an expression, matching the expression's value to a case clause, and executes
statements associated with that case, as well as
statements in cases that follow the matching case.
... syntax switch (expression) { case value1: //
statements executed when the //result of expression matches value1 [break;] case value2: //
statements executed when the //result of expression matches value2 [break;] ...
... case valuen: //
statements executed when the //result of expression matches valuen [break;] [default: //
statements executed when none of //the values match the value of the expression [break;]] } expression an expression whose result is matched against each case clause.
...And 18 more matches
try...catch - JavaScript
the try...catch
statement marks a block of
statements to try and specifies a response should an exception be thrown.
... syntax try { try_
statements } [catch (exception_var_1 if condition_1) { // non-standard catch_
statements_1 }] ...
... [catch (exception_var_2) { catch_
statements_2 }] [finally { finally_
statements }] try_
statements the
statements to be executed.
...And 18 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
perfect negotiation works by assigning each of the two peers a role to play in the negotiation process that's entirely separate from the webrtc connection
state: a polite peer, which uses ice rollback to prevent collisions with incoming offers.
...false; pc.onnegotiationneeded = async () => { try { makingoffer = true; await pc.setlocaldescription(); signaler.send({ description: pc.localdescription }); } catch(err) { console.error(err); } finally { makingoffer = false; } }; note that setlocaldescription() without arguments automatically creates and sets the appropriate description based on the current signaling
state.
...here, it will be always be an offer, because the negotiationneeded event is only fired in stable
state.
...And 17 more matches
Signaling and video calling - Web APIs
{ urls: "stun:stun.stunprotocol.org" } ] }); mypeerconnection.onicecandidate = handleicecandidateevent; mypeerconnection.ontrack = handletrackevent; mypeerconnection.onnegotiationneeded = handlenegotiationneededevent; mypeerconnection.onremovetrack = handleremovetrackevent; mypeerconnection.oniceconnection
statechange = handleiceconnection
statechangeevent; mypeerconnection.onicegathering
statechange = handleicegathering
statechangeevent; mypeerconnection.onsignaling
statechange = handlesignaling
statechangeevent; } when using the rtcpeerconnection() constructor, we will specify an rtcconfiguration-compliant object providing configuration parameters for the connection.
... rtcpeerconnection.oniceconnection
statechange the iceconnection
statechange event is sent by the ice layer to let you know about changes to the
state of the ice connection.
...we'll look at the code for this example in ice connection
state below.
...And 17 more matches
ARIA Test Cases - Accessibility
new tests for internet explorer 8 rc1 on this msdn page the aria
state/role mapping in ie8 to msaa roles can be directly checked.
... also, as a clever feature for at testing, the firing of events (like event_object_
statechange) can be invoked from the examples.
... expected at behavior: same as basic button above, plus if the
state is pressed, at should indicate that when focus lands on the button and when toggling.
...And 17 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
22 arpanet glossary, infrastructure the arpanet (advanced research projects agency network) was an early computer network, constructed in 1969 as a robust medium to transmit sensitive military data and to connect leading research groups throughout the united
states.
... 34 block (scripting) codingscripting, glossary, javascript in javascript, a block is a collection of related
statements enclosed in braces ("{}").
... for example, you can put a block of
statements after an if (condition) block, indicating that the interpreter should run the code inside the block if the condition is true, or skip the whole block if the condition is false.
...And 16 more matches
IAccessible2
1.0 66 introduced gecko 1.9 inherits from: iaccessible last changed in gecko 1.9 (firefox 3) method overview [propget] hresult attributes([out] bstr attributes ); [propget] hresult extendedrole([out] bstr extendedrole ); [propget] hresult extended
states([in] long maxextended
states, [out, size_is(,maxextended
states), length_is(, nextended
states)] bstr extended
states, [out] long nextended
states ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult indexinparent([out] long indexinparent ); [propget] hresult locale([out] ia2locale locale ); [propget] hresult localizedextendedrole([o...
...ut] bstr localizedextendedrole ); [propget] hresult localizedextended
states([in] long maxlocalizedextended
states, [out, size_is(,maxlocalizedextended
states), length_is(, nlocalizedextended
states)] bstr localizedextended
states, [out] long nlocalizedextended
states ); [propget] hresult nextended
states([out] long nextended
states ); [propget] hresult nrelations([out] long nrelations ); [propget] hresult relation([in] long relationindex, [out] iaccessiblerelation relation ); [propget] hresult relations([in] long maxrelations, [out, size_is(maxrelations), length_is( nrelations)] iaccessiblerelation relations, [out] long nrelations ); hresult role([out] long role ); hresult scrollto([in] enum ia2scrolltype scrolltype ); hresult scrolltopoint([in] enum ia2coordinatetype coordinatetype, [...
...in] long x, [in] long y ); [propget] hresult
states([out] accessible
states
states ); [propget] hresult uniqueid([out] long uniqueid ); [propget] hresult windowhandle([out] hwnd windowhandle ); methods attributes() returns the attributes specific to this iaccessible2 object, such as a cell's formula.
...And 16 more matches
Event reference
pop
state a session history entry is being navigated to (in certain cases).
... storage events change (see non-standard events) storage update events checking downloading error noupdate obsolete updateready value change events broadcast checkbox
statechange hashchange input radio
statechange ready
statechange valuechange uncategorized events invalid message message open show less common and non-standard events abortable fetch events event name fired when abort a dom request is aborted, i.e.
...lete error success upgradeneeded versionchange script events afterscriptexecute beforescriptexecute menu events dommenuitemactive dommenuiteminactive window events close popup events popuphidden popuphiding popupshowing popupshown tab events visibilitychange battery events chargingchange chargingtimechange dischargingtimechange levelchange call events alerting busy callschanged cf
statechange connecting dialing disconnected disconnecting error held, holding incoming resuming
statechange voicechange sensor events compassneedscalibration devicemotion deviceorientation orientationchange smartcard events icccardlockerror iccinfochange smartcard-insert smartcard-remove stkcommand stksessionend card
statechange sms and ussd events delivered received sent ussdreceived frame event...
...And 16 more matches
Video player styling basics - Developer guides
the markup for the custom controls now looks as follows: <div id="video-controls" class="controls" data-
state="hidden"> <button id="playpause" type="button" data-
state="play">play/pause</button> <button id="stop" type="button" data-
state="stop">stop</button> <div class="progress"> <progress id="progress" value="0" min="0"> <span id="progress-bar"></span> </progress> </div> <button id="mute" type="button" data-
state="mute">mute/unmute</button> <button id="volinc" typ...
...e="button" data-
state="volup">vol+</button> <button id="voldec" type="button" data-
state="voldown">vol-</button> <button id="fs" type="button" data-
state="go-fullscreen">fullscreen</button> </div> related css alteration the previous article simply set the display property of the video controls to block in order to display them.
... this has now been changed to use a data-
state attribute, which this code already uses to handle its fullscreen implementation.
...And 16 more matches
Notes on HTML Reflow - Archive of obsolete content
reflow
state the reflow
state object, nshtmlreflow
state, is used to pass constraining information "down" from parent frames to child frames.
... for example, a <div> with a constrained width (e.g., set via the css width property) would note this in the reflow
state object before flowing its children.
... when reflow begins, the root reflow
state is initialized with information about the top-level container for the document's presentation; e.g., the width and height of the application window.
...And 15 more matches
RDF Modifications - Archive of obsolete content
sume we have single query with as follows: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> these query
statements will cause any photos with both a title and a description to be displayed.
...the builder scans through the query
statements one by one.
... the content tag can safely be skipped at this part of the process, so the builder moves onto the member
statement.
...And 15 more matches
Transformations - Web APIs
saving and restoring
state before we look at the transformation methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings.
... save() saves the entire
state of the canvas.
... restore() restores the most recently saved canvas
state.
...And 15 more matches
Block and Line Layout Cheat Sheet - Archive of obsolete content
the details of block and line layout are tricky; this document serves as a "cheat sheet" that describes how the vagary of different
state flags control what's going on.
... mflags flags set on the frame to indicate its
state.
...this flag causes the nsblockreflow
state's constructor to set the brs_istopmarginroot and brs_isbottommarginroot flags.
...And 14 more matches
Index - Archive of obsolete content
51 check
state xul attributes, xul reference no summary!
... 337 sizemode xul attributes, xul reference this attribute is used to save and restore the
state of a window (together with the persist attribute) and for css styles (e.g.
... 347
state xul attributes, xul reference no summary!
...And 14 more matches
MenuItems - Archive of obsolete content
the top 16px square is the icon in normal
state the bottom part in hovered
state.
...to indicate the current
state of the toolbar, a checkbox would be displayed next to the menu item label.
...from within a command listener, you can execute code which will change the
state of the toolbar or status bar or whatever it is that need changing.
...And 14 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
padding: 3px 0; display: table; } #controls .property > * { float: left; } #controls .property .name { width: 90px; padding: 0px 10px 0px 0px; text-align: right; line-height: 150%; } /* button */ #controls .button { height: 24px; padding: 0 10px; background-color: #379b4a; border-radius: 3px; font-size: 14px; color: #fff; display: inline; float: left; } #controls .button[data-
state='disabled'] { background-color: #ccc !important; color: #777 !important; } #controls .button[data-
state='disabled']:hover { background-color: #ccc !important; cursor: default !important; } #controls .button:hover { cursor: pointer; background-color: #208b20; } /* active point */ .ui-input-slider { height: 24px; line-height: 20px; } #delete-point { margin: 0 58px 0 0; float: right ...
... width: 100%; height: 30px; padding: 0 0 0 15px; display: table; position: relative; } #gradient-axes .axis { width: 50px; height: 20px; margin: 5px 0; background-color: #ddd; text-align: center; float: left; transition: all 0.3s; position: absolute; } #gradient-axes .axis:hover { margin: 2px 0; height: 26px; background-color: #ccc; cursor: pointer; } #gradient-axes .axis[data-
state='active'] { margin: 2px 0; height: 26px; } #gradient-axes .axis[data-
state='active']:after { content: "*"; color: #fff; padding: 3px; } #gradient-axes .axis[axisid='0'] { background-color: #da5c5c; } #gradient-axes .axis[axisid='1'] { background-color: #5cda9b; } #gradient-axes .axis[axisid='2'] { background-color: #5c9bda; } #gradient-axes .axis[axisid='3'] { background-color: #5c5...
...ntchild; option_value = option.getattribute('data-value'); if (option_value === null) option.setattribute('data-value', uval); list.appendchild(node.firstelementchild); uval++; } node.appendchild(select); node.appendchild(list); select.onclick = this.toggle.bind(this); list.onclick = this.updatevalue.bind(this); document.addeventlistener('click', clickout); this.
state = 0; this.time = 0; this.dropmenu = list; this.select = select; this.toggle(false); this.value = {}; this.topic = topic; if (label) select.textcontent = label; else this.setnodevalue(list.children[selected]); dropdowns[topic] = this; }; dropdown.prototype.toggle = function toggle(
state) { if (typeof(
state) === 'boolean') this.
state =
state === false ?
...And 14 more matches
for - JavaScript
the for
statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a
statement (usually a block
statement) to be executed in the loop.
... syntax for ([initialization]; [condition]; [final-expression])
statement initialization an expression (including assignment expressions) or variable declaration evaluated once before the loop begins.
...variables declared with let are local to the
statement.
...And 14 more matches
if...else - JavaScript
the if
statement executes a
statement if a specified condition is truthy.
... if the condition is falsy, another
statement can be executed.
... syntax if (condition)
statement1 [else
statement2] condition an expression that is considered to be either truthy or falsy.
...And 14 more matches
Monitoring downloads - Archive of obsolete content
handling download
state changes once the code above is run, our ondownload
statechange() method is called whenever a download's
state changes.
... that code looks like this: ondownload
statechange: function(a
state, adownload) { var
statement; switch(adownload.
state) { case components.interfaces.nsidownloadmanager.download_downloading: // add a new row for the download being started; each row includes the // source uri, size, and start time.
... var dbconn = this.storageservice.opendatabase(this.dbfile);
statement = dbconn.create
statement("replace into items values " + "(?1, ?2, ?3, 0, 0.0, 0)");
statement.bindstringparameter(0, adownload.source.spec);
statement.bindint64parameter(1, adownload.size);
statement.bindint64parameter(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...
...And 13 more matches
Grammar and types - JavaScript
in javascript, instructions are called
statements and are separated by semicolons (;).
... a semicolon is not necessary after a
statement if it is written on its own line.
... but if more than one
statement on a line is desired, then they must be separated by semicolons.
...And 13 more matches
UI pseudo-classes - Learn web development
in this article, we will explore in detail the different ui pseudo-classes available to us in modern browsers for styling forms in different
states.
... :checked, :indeterminate, and :default: respectively target checkboxes and radio buttons that are checked, in an indeterminate
state (neither checked or not checked), and the default selected option when the page loads (e.g.
... note: a number of the pseudo-classes discussed here are concerned with styling form controls based on their validation
state (is their data valid, or not?) you'll learn much more about setting and controlling validation constraints in our next article — client-side form validation — but for now we'll keep things simple with regards to form validation, so it doesn't confuse things.
...And 12 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app
state, run cd mdn-svelte-tutorial/05-advanced-concepts or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts remember to run npm install && npm run dev to start your app in development mode.
... add the following import
statement below the existing ones: import moreactions from './moreactions.svelte' then add the described functions at the end of the <script> section: const checkalltodos = (completed) => todos.foreach(t => t.completed = completed) const removecompletedtodos = () => todos = todos.filter(t => !t.completed) now go to the bottom of the todos.svelte markup section and replace the btn-gro...
...this also means that in this case, a reactive
statement like $: console.log('todos', todos) won't be very useful.
...And 12 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
objective: learn and put into practice some basic svelte concepts, like creating components, passing data using props, render javascript expressions into our markup, modify the components
state and iterating over lists.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app
state, run cd mdn-svelte-tutorial/03-adding-dynamic-behavior or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-behavior remember to run npm install && npm run dev to start your app in development mode.
... the
state of our component will be represented by these three top-level variables.
...And 12 more matches
CustomizableUI.jsm
set to null to ensure that reset/indefault
state don't care about the toolbar's collapsed
state.
...note that customizableui won't restore
state in the area, allow the user to customize it in customize mode, or otherwise deal with it, until the area has been registered.
... furthermore, by default the placements of the area will be kept in the saved
state (!) and restored if you re-register the area at a later point.
...And 12 more matches
Bytecode Descriptions
(a jsop::enditer is always emitted at the end of the loop, and extra copies are emitted on "exit slides", where a break, continue, or return
statement exits the loop.) typically a single try note entry marks the contiguous chunk of bytecode from the instruction after jsop::iter to jsop::enditer (inclusive); but if that range contains any instructions on exit slides, after a jsop::enditer, then those must be correctly noted as outside the loop.
...if the function call is not inside a with
statement, use jsop::gimplicitthis instead.
...this is used to implement switch
statements when the jsop::tableswitch optimization is not possible.
...And 12 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
it does not indicate whether this checkbox is currently checked: if the checkbox’s
state is changed, this content attribute does not reflect the change.
... note: although not required by the specification, firefox will by default persist the dynamic disabled
state of an <input> across page loads.
... ui pseudo-classes captions super relevant to the <input> element: pseudo-class description :enabled any currently enabled element that can be activated (selected, clicked on, typed into, etc.) or accept focus and also has a disabled
state, in which it can't be activated or accept focus.
...And 12 more matches
with - JavaScript
use of the with
statement is not recommended, as it may be the source of confusing bugs and compatibility issues.
... the with
statement extends the scope chain for a
statement.
... syntax with (expression)
statement expression adds the given expression to the scope chain used when evaluating the
statement.
...And 12 more matches
Space Manager High Level Design - Archive of obsolete content
the primary classes that interact with the space manager are: nsblockreflow
state nsblockframe nsboxtoblockadaptor the general interaction model is to create a space manager for a block frame in the context of a reflow, and to associate it with the blockreflow
state so it is passed down to child frames' reflow methods.
...during reflow, the space manager stores the space taken up by floats (updatespacemanager in nsblockframe) and provides information about the space available for other elements (getavailablespace in nsblockreflow
state).
... data model class/component diagram nsspacemanager: the central point of management of the space taken up by floats in a block nsbanddata: provides information about the frames occupying a band of occupied or available space nsblockbanddata: a specialization of nsbanddata that is used by nsblockreflow
state to determine the available space, float impacts, and where floats are cleared.
...And 11 more matches
Getting started with React - Learn web development
objective: to set up a local react development environment, create a start app, and understand the basics of how it works hello react as its official tagline
states, react is a library for building user interfaces.
... </p> <a classname="app-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer" > learn react </a> </header> </div> ); } export default app; the app.js file consists of three main parts: some import
statements at the top, the app component in the middle, and an export
statement at the bottom.
... import
statements the import
statements at the top of the file allow app.js to use code that has been defined elsewhere.
...And 11 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
first, import use
state into the todo component like we did before with the app component, by updating the first import
statement to this: import react, { use
state } from "react"; we'll now use this to set an isediting
state, the default
state of which should be false.
... add the following line just inside the top of your todo(props) { … } component definition: const [isediting, setediting] = use
state(false); next, we're going to rethink the <todo /> component — from now on, we want it to display one of two possible “templates", rather than the single template it's used so far: the "view" template, when we are just viewing a todo; this is what we’ve used in rest of the tutorial so far.
... copy this block of code into the todo() function, beneath your use
state() 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.nam...
...And 11 more matches
Index
it can be read as something like an "ideal future
state" for the engine.
... 24 js::autosaveexception
state jsapi reference, reference, référence(2), spidermonkey js::autosaveexception
state saves and later restores the current exception
state of a given jscontext.
...the allocation will then be retried (and may still fail.) 68 js::setoutofmemorycallback jsapi reference, reference, référence(2), spidermonkey unlike the error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding to capture the current
state of heap allocation before anything is freed.
...And 11 more matches
nsIPromptService
omptservice = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); method overview void alert(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); void alertcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheck
state); boolean confirm(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); boolean confirmcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheck
state); print32 confirmex(in nsidomwindow aparent,in wstring adialogtitle,in wstring atext, in unsigned long abuttonflags,in wstring abutton0title, in wst...
...ring abutton1title,in wstring abutton2title,in wstring acheckmsg, inout boolean acheck
state); boolean prompt(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring avalue, in wstring acheckmsg, inout boolean acheck
state); boolean promptusernameandpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring ausername, inout wstring apassword, in wstring acheckmsg, inout boolean acheck
state); boolean promptpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring apassword, in wstring acheckmsg, inout boolean acheck
state); boolean select(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in pruint32 acount, [array, size_is(acount)] in wstring aselectlist, ...
...void alertcheck( in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheck
state ); parameters aparent the parent window for the dialog.
...And 11 more matches
Getting Started - Developer guides
at this stage, you need to tell the xmlhttp request object which javascript function will handle the response, by setting the onready
statechange property of the object and naming it after the function to call when the request changes
state, like this: httprequest.onready
statechange = nameofthefunction; note that there are no parentheses or parameters after the function name, because you're assigning a reference to the function, rather than actually calling it.
... alternatively, instead of giving a function name, you can use the javascript technique of defining functions on the fly (called "anonymous functions") to define the actions that will process the response, like this: httprequest.onready
statechange = function(){ // process the server response here.
...for example, use the following before calling send() for form data sent as a query string: httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); step 2 – handling the server response when you sent the request, you provided the name of a javascript function to handle the response: httprequest.onready
statechange = nameofthefunction; what should this function do?
...And 11 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
note: if a checkbox is unchecked when its form is submitted, there is no value submitted to the server to represent its unchecked
state (e.g.
...it does not indicate whether this checkbox is currently checked: if the checkbox’s
state is changed, this content attribute does not reflect the change.
... unlike other browsers, firefox by default persists the dynamic checked
state of an <input> across page loads.
...And 11 more matches
break - JavaScript
the break
statement terminates the current loop, switch, or label
statement and transfers program control to the
statement following the terminated
statement.
... syntax break [label]; label optional identifier associated with the label of the
statement.
... if the
statement is not a loop or switch, this is required.
...And 11 more matches
Treehydra Manual - Archive of obsolete content
users only need to define their esp property variables, abstract values, and the flow semantics of gimple
statements, and the library will do all of the sub
state tracking and fixed-point solving.
...concrete
state.
... a memory
state in the programming language being analyzed.
...And 10 more matches
Result Generation - Archive of obsolete content
once you have selected a starting point, you use a number of
statements which indicate where to go next when navigating the graph.
...query processing a query for an rdf datasource consists of a number of
statements, placed as children of the query element.
...this allows for a fairly efficient means of updating results when, for instance, a new
statement is added to the rdf graph.
...And 10 more matches
button - Archive of obsolete content
attributes accesskey, autocheck, check
state, checked, command, crop, dir, disabled, dlgtype, group, icon, image, label, open, orient, tabindex, type properties accesskey, accessibletype, autocheck, check
state, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <button label="press me" oncommand="alert('you pressed me!');"/> attributes accesskey type: char...
... autocheck type: boolean if this attribute is true or left out, the checked
state of the button will be switched each time the button is pressed.
... if this attribute is false, the checked
state must be adjusted manually.
...And 10 more matches
Accessibility API cross-reference
they also define a list of possible object
states, such as focused, read-only, checked, etc.
... these tables describe how various accessibility apis define possible roles of an object, and
states.
...they also define a list of possible object
states, such as focused, read-only, checked, etc.
...And 10 more matches
toolbarbutton - Archive of obsolete content
attributes accesskey, autocheck, check
state, checked, command, crop, dir, disabled, dlgtype, group, image, label, oncommand, open, orient, tabindex, title, type, validate properties accesskey, accessibletype, autocheck, check
state, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <toolbar id="test-toolbar"> <toolbarbutton accesskey="p" label="plain"/> <toolbarbutto...
... autocheck type: boolean if this attribute is true or left out, the checked
state of the button will be switched each time the button is pressed.
... if this attribute is false, the checked
state must be adjusted manually.
...And 9 more matches
Anatomy of a video game - Game development
the above chunk of code has two
statements.
... the first
statement creates a function as a global variable called main().
...the second
statement calls the main() function, defined in the first
statement.
...And 9 more matches
Index - Learn web development
89 javascript building blocks article, assessment, beginner, codingscripting, conditionals, functions, guide, introduction, javascript, landing, loops, module, events, l10n:priority in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional
statements, loops, functions, and events.
...in this article, we'll explore how so-called conditional
statements work in javascript.
... 135 getting started with css beginner, css, classes, elements, example, learn, selectors, syntax,
state in this article we will take a simple html document and apply css to it, learning some practical things about the language along the way.
...And 9 more matches
Creating our first Vue component - Learn web development
along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props, and saving data
state.
... objective: to learn how to create a vue component, render it inside another component, pass data into it using props, and save its
state.
... what we need is some component
state.
...And 9 more matches
HTML parser threading
it acquires mspeculationmutex and while holding it, it creates a new speculation and adds it to the queue of speculations, flushes the tree ops to the main thread, marks the nshtml5streamparser as being in a speculating
state and sets the newly created speculation object as the tree op sink (instead of the tree op stage described earlier) of the tree builder.
...culation object has a queue of tree ops (into which the tree builder will now flush ops to instead of the tree op stage), an owning reference to the nshtml5owningutf16buffer that contains the starting point of the speculation, an index into the nshtml5owningutf16buffer defining the exact starting point within the buffer, the line number of the tokenizer at that point and a snapshot of the tree op
state.
...the tree builder snapshot contains a copy of the tree builder stack, a copy of the list of open formatting elements and copies of various fields that define the tree builder
state.
...And 9 more matches
Promise
internally, a promise can be in one of three
states: pending, when the final value is not available yet.
... this is the only
state that may transition to one of the other two
states.
... method overview promise then([optional] function onfulfill, [optional] function onreject); promise catch([optional] function onreject); constructor creates a new promise, initially in the pending
state, and provides references to the resolving functions that can be used to change its
state.
...And 9 more matches
Introduction to NSPR
in nspr, a mutual exclusion lock (or mutex) of type prlock controls locking, and associated condition variables of type prcondvar communicate changes in
state among threads.
...the thread must also rein
state the monitored invariant before exiting the monitor.
...that blocked
state is not interruptible, nor is it timed.
...And 9 more matches
nsIDocShell
method overview void addsessionstorage(in nsiprincipal principal, in nsidomstorage storage); void add
state(in nsivariant adata, in domstring atitle, in domstring aurl, in boolean areplace); void beginrestore(in nsicontentviewer viewer, in boolean top); void createaboutblankcontentviewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom interface guidelines void finishres...
... busyflags unsigned long current busy
state for docshell.
... valid
states are defined in constants.
...And 9 more matches
Component; nsIPrefBranch
getboolpref() called to get the
state of an individual boolean preference.
... boolean getboolpref( in string aprefname, [optional] in boolean adefaultvalue ); parameters aprefname the boolean preference to get the
state of.
... getcharpref() called to get the
state of an individual string preference.
...And 9 more matches
nsISHEntry
lasses["@mozilla.org/browser/session-history-entry;1"] .createinstance(components.interfaces.nsishentry); method overview void addchildshell(in nsidocshelltreeitem shell); nsidocshelltreeitem childshellat(in long index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilayouthistory
state layouthistory
state, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation); native code only!
... void syncpresentation
state(); attributes attribute type description cachekey nsisupports set and get the cache key for the entry.
...in practice, two entries a and b will have the same docidentifier if we arrived at b by clicking an anchor link in a or if b was created by a's calling history.push
state().
...And 9 more matches
WebRTC API - Web APIs
close the data channel has completed the closing process and is now in the closed
state.
... closing the rtcdatachannel has transitioned to the closing
state, indicating that it will be closed soon.
... connection
statechange the connection's
state, which can be accessed in connection
state, has changed.
...And 9 more matches
ARIA: button role - Accessibility
a toggle button is a two-
state button that can be either off (not pressed) or on (pressed).
... associated aria roles,
states, and properties aria-pressed defines the button as a toggle button.
... the value of aria-pressed describes the
state of the button.
...And 9 more matches
XUL Events - Archive of obsolete content
the event handler should be placed on an observer.checkbox
statechangethe checkbox
statechange event is executed when the
state of a <checkbox> element has changed.closethe close event is executed when a request has been made to close the window when the user presses the close button.commandthe command event is executed when an element is activated.commandupdatethe commandupdate event is executed when a command update occurs on a <commandset>.
...the default action of the event can be prevented to prevent the popup to appear.popupshownthe popupshown event is executed when a <menupopup>, <panel> or <tooltip> has become visible.radio
statechangethe radio
statechange event is executed when the
state of a <radio> element has changed.valuechangethe valuechange event is executed when the value of an element, <progress> for example, has changed.
...note: this event may fire several times or while resizing the window (for example, see bug 715867), so always check if the window
state changed by inspecting window.window
state in the event.
...And 8 more matches
LiveConnect Overview - Archive of obsolete content
beginning with javascript 1.4, you can catch this exception in a try...catch
statement.
...place the forname assignment
statement in a try block to handle the exception, as follows: function getclass(javaclassname) { try { var theclass = java.lang.class.forname(javaclassname); } catch (e) { return ("the java exception is " + e); } return theclass; } in this example, if javaclassname evaluates to a legal class name, such as "java.lang.string", the assignment succeeds.
...} catch (e) { if (e instanceof java.io.filenotfound) { // handling for filenotfound } else { throw e; } } see exception handling
statements for more information about javascript exceptions.
...And 8 more matches
Looping code - Learn web development
exiting loops with break if you want to exit a loop before all the iterations have been completed, you can use the break
statement.
... we already met this in the previous article when we looked at switch
statements — when a case is met in a switch
statement that matches the input expression, the break
statement immediately exits the switch
statement and moves onto the code after it.
... it's the same with loops — a break
statement will immediately exit the loop and make the browser move on to any code that follows it.
...And 8 more matches
Observer Notifications
user-interaction-active nsidomwindow null sent once every 5000ms while this chrome document sees some kind of user activity (for example, keyboard or mouse events), and at the exact moment of the
state transition from idle to active.
...by this point, the wgp being destroyed will have cleaned up most of its
state, including its browsingcontext children and jswindowactors.
... network:offline-status-changed called when the offline
state has changed.
...And 8 more matches
WebIDL bindings
unless
stated otherwise, a type only has one representation.
... also, unless
stated otherwise, nullable types are represented by wrapping nullable<> around the base type.
... dom
state the return value depends on the
state of the "dom", by which we mean all objects specified via web idl.
...And 8 more matches
Pointer events - Web APIs
additionally, a pointer event contains the usual properties present in mouse events (client coordinates, target element, button
states, etc.) in addition to new properties for other forms of input: pressure, contact geometry, tilt, etc.
... terminology active buttons
state the condition when a pointer has a non-zero value for the buttons property.
...for example, a pen that is a down
state is considered active because it can produce additional events when the pen is lifted or moved.
...And 8 more matches
Rendering and the WebXR frame animation callback - Web APIs
hardare vertical refresh rate when the browser is ready to refresh the <canvas> within which your webxr content is displayed, it calls your frame rendering callback, which uses the specified timestamp and any other relevant data, such as models and textures, as well as application
state, to render the scene—as it should appear at the specified time—into the webgl backbuffer.
...this is due to early displays using the ac electrical grid's current flow waveform, which cycles 60 times per second in the united
states (50 in europe), for timing purposes.
... webxr frames your frame rendering callback function receives as input two parameters: the time to which the frame corresponds, and an xrframe object describing the
state of the scene as of that time.
...And 8 more matches
ARIA: listbox role - Accessibility
associated aria roles,
states, and properties associated roles option one or more nested options are required.
... list a section containing listitem elements
states and properties aria-activedescendant holds the id string of the currently active element within the listbox.
... (for further details and a full list of aria
states and properties see the aria listbox (role) documentation.) keyboard interactions when a single-select listbox receives focus: if none of the options are selected before the listbox receives focus, the first option receives focus.
...And 8 more matches
Accessibility documentation index - Accessibility
12 how to file aria-related bugs aria, bugzilla the
state of aria technology has always depended on the community.
...here's where to file bugs: 13 using aria: roles,
states, and properties aria, accessibility, overview, reference aria defines semantics that can be applied to elements, with these divided into roles (defining a type of user interface element) and
states and properties that are supported by a role.
... authors must assign an aria role and the appropriate
states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (via use of an appropriate html element).
...And 8 more matches
Functions - JavaScript
a function in javascript is similar to a procedure—a set of
statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output.
... defining functions function declarations a function definition (also called a function declaration, or function
statement) consists of the function keyword, followed by: the name of the function.
... the javascript
statements that define the function, enclosed in curly brackets, {...}.
...And 8 more matches
continue - JavaScript
the continue
statement terminates execution of the
statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration.
... syntax continue [label]; label identifier associated with the label of the
statement.
... description in contrast to the break
statement, continue does not terminate the execution of the loop entirely: instead, in a while loop, it jumps back to the condition.
...And 8 more matches
label - JavaScript
the labeled
statement can be used with break or continue
statements.
... it is prefixing a
statement with an identifier which you can refer to.
... syntax label :
statement label any javascript identifier that is not a reserved word.
...And 8 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
phase 5: xpi packaging we actually completed our hello world extension in phase 4, but you can’t distribute the source files in this
state to other users.
...this will allow the user to save and restore session snapshots (browser window
states) at any time.
...in lines 4–6, we use the nslsessionstore interface’s getbrowser
state method to get a json text-string representation of the
states of all currently open browser windows.
...And 7 more matches
Accessibility in React - Learn web development
change the import
statement at the top of todo.js so that it includes useref: import react, { useref, use
state } from "react"; then, create two new constants beneath the hooks in your todo() function.
... change the import
statement of todo.js again to add useeffect: import react, { useeffect, useref, use
state } from "react"; useeffect() takes a function as an argument; this function is executed after the component renders.
... let's see this in action; put the following useeffect() call just above the return
statement in the body of todo(), and pass into it a function that logs the words "side effect" to your console: useeffect(() => { console.log("side effect"); }); to illustrate the difference between the main render process and code run inside useeffect(), add another log – put this one below the previous addition: console.log("main render"); now, open the app in your browser.
...And 7 more matches
Listening to events on all tabs
void onsecuritychange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, unsigned long a
state ); parameters abrowser the browser that fired the notification.
... arequest the nsirequest that has new security
state.
... a
state a value composed of the security
state flags and the security strength flags described in the documentation for nsiwebprogresslistener.
...And 7 more matches
AddonManager
addonlistcallback() a callback that is passed an array of addons void addonlistcallback( in addon addons[] ) parameters addons the array of addons passed back from the asynchronous request constants addoninstall
states constant description
state_available an install that is waiting to be started.
...
state_downloading an install that is in the process of being downloaded.
...
state_checking an install that is checking for updated information.
...And 7 more matches
inIDOMUtils
k(in nsidomelement aelement, in domstring apseudoclass); void clearpseudoclasslocks(in nsidomelement aelement); [implicit_jscontext] jsval colornametorgb(in domstring acolorname); nsiarray getbindingurls(in nsidomelement aelement); nsidomnodelist getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontent
state(in nsidomelement aelement); void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcssstylerules(in nsidomelement aelement, [optional] in domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); ...
...n nsidomcssstylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselectorindex, [optional] in domstring apseudo); void setcontent
state(in nsidomelement aelement, in unsigned long long a
state); constants constant value description exclude_shorthands (1<<0) include_aliases (1<<1) content
state flags the content
state flags are used in a bitmask.
... value
state 1 :active 2 :focus 4 :hover 8 :-moz-drag-over 16 :target 1<<29 :-moz-focusring methods getbindingurls() returns an array of nsiuri objects representing the current xml binding for the specified element.
...And 7 more matches
RTCIceTransport - Web APIs
this is particularly useful if you need to access
state information about the connection.
... gathering
state read only a domstring indicating which gathering
state the ice agent is currently in.
... the value is one of those included in the rtcicegatherer
state enumerated type: "new", "gathering", or "complete".
...And 7 more matches
Border-image generator - CSS: Cascading Style Sheets
border image generator html content <div id="container"> <div id="gallery"> <div id="image-gallery"> <img class="image" src="https://udn.realityripple.com/samples/2c/fa0192d18e.png" data-
stateid="border1"/> <img class="image" src="https://udn.realityripple.com/samples/b8/dacdd63e77.png" data-
stateid="border2"/> <img class="image" src="https://udn.realityripple.com/samples/07/1fcc357205.png" data-
stateid="border3"/> <img class="image" src="https://udn.realityripple.com/samples/7b/dd37c1d691.png" data-
stateid="border4"/> <img class="image" src="https://udn.realityripple.com/samples/a9/b9fff72dab.png" data-
stateid="border5"...
.../> <img class="image" src="https://udn.realityripple.com/samples/fb/c0b285d3da.svg" data-
stateid="border6"/> </div> </div> <div id="load-actions" class="group section"> <div id="toggle-gallery" data-action="hide"> </div> <div id="load-image" class="button"> upload image </div> <input id="remote-url" type="text" placeholder="load an image from url"/> <div id="load-remote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="name"> control box </div> <div class="separator"></div> <div class="property"> <div class="name">scale</div> <div class="ui-input-slider" data-topic="scale" ...
...ntchild; option_value = option.getattribute('data-value'); if (option_value === null) option.setattribute('data-value', uval); list.appendchild(node.firstelementchild); uval++; } node.appendchild(select); node.appendchild(list); select.onclick = this.toggle.bind(this); list.onclick = this.updatevalue.bind(this); document.addeventlistener('click', clickout); this.
state = 0; this.time = 0; this.dropmenu = list; this.select = select; this.toggle(false); this.value = {}; this.topic = topic; if (label) select.textcontent = label; else this.setnodevalue(list.children[selected]); dropdowns[topic] = this; }; dropdown.prototype.toggle = function toggle(
state) { if (typeof(
state) === 'boolean') this.
state =
state === false ?
...And 7 more matches
Color picker tool - CSS: Cascading Style Sheets
position: relative; float: right; } #delete #trash-can { width: 80%; height: 80%; border: 2px dashed #fff; border-radius: 5px; background: url('https://mdn.mozillademos.org/files/6085/trash-can.png') no-repeat center; position: absolute; top: 10%; left: 10%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; transition: all 0.2s; } #delete[drag-
state='enter'] { background-color: #999; } /** * color theme */ #color-theme { margin: 0 8px 0 0; border: 1px solid #eee; display: inline-block; float: right; } #color-theme .box { width: 80px; height: 92px; float: left; } /** * color info box */ #color-info { width: 360px; float: left; } #color-info .title { width: 100%; padding: 15px; font-size: 18px; text-align: center; back...
...ette .controls .lock { width: 24px; height: 24px; margin: 10px; padding: 3px; background-image: url('https://mdn.mozillademos.org/files/6077/lock.png'); background-repeat: no-repeat; background-position: bottom right; } #color-palette .controls .lock:hover { /*background-image: url('images/unlocked-hover.png');*/ background-position: bottom left; } #color-palette .controls .lock[locked-
state='true'] { /*background-image: url('images/locked.png');*/ background-position: top left ; } #color-palette .controls .lock[locked-
state='true']:hover { /*background-image: url('images/lock-hover.png');*/ background-position: top right; } /** * canvas */ #canvas { width: 100%; height: 300px; min-height: 250px; border-top: 1px solid #ddd; background-image: url('https://mdn.mozillademo...
...itle.classname = 'title'; palette.classname = 'palette'; controls.classname = 'controls'; lock.classname = 'lock'; title.textcontent = text; controls.appendchild(lock); container.appendchild(title); container.appendchild(controls); container.appendchild(palette); lock.addeventlistener('click', function () { this.locked = !this.locked; lock.setattribute('locked-
state', this.locked); }.bind(this)); for(var i = 0; i < size; i++) { var sample = new colorsample(); this.samples.push(sample); palette.appendchild(sample.node); } this.container = container; this.title = title; }; var createhuepalette = function createhuepalette() { var palette = new palette('hue', 12); uicolorpicker.subscribe('picker', function(color) { if...
...And 7 more matches
animation - CSS: Cascading Style Sheets
it is a shorthand for animation-name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, animation-fill-mode, and animation-play-
state.
... /* @keyframes duration | timing-function | delay | iteration-count | direction | fill-mode | play-
state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* @keyframes name | duration | timing-function | delay */ animation: 3s linear 1s slidein; /* @keyframes name | duration */ animation: slidein 3s; <div class="grid"> <div class="col"> <div class="note"> given the following animation: <pre>@keyframes slidein { from { transform: scalex(0); } to { transform: scalex(1); } }</pre> </div> <div class="row"> <div clas...
...mation')); var button = array.from(document.queryselectorall('button')); function togglebutton (btn, type) { btn.classlist.remove('play', 'pause', 'restart'); btn.classlist.add(type); btn.title = type.touppercase(type); } function playpause (i) { var btn = button[i]; var anim = animation[i]; if (btn.classlist.contains('play')) { anim.style.animationplay
state = 'running'; togglebutton(btn, 'pause'); } else if (btn.classlist.contains('pause')) { anim.style.animationplay
state = 'paused'; togglebutton(btn, 'play'); } else { anim.classlist.remove('a' + (i + 1)); settimeout(function () { togglebutton(btn, i === 0 ?
...And 7 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
you can perform this conversion explicitly using the boolean() function: boolean(''); // false boolean(234); // true however, this is rarely necessary, as javascript will silently perform this conversion when it expects a boolean, such as in an if
statement (see below).
...so if a variable is defined using var in a compound
statement (for example inside an if control structure), it will be visible to the entire function.
... operators javascript's numeric operators are +, -, *, / and % which is the remainder operator (which is the same as modulo.) values are assigned using =, and there are also compound assignment
statements such as += and -=.
...And 7 more matches
Details of the object model - JavaScript
inheriting properties suppose you create the mark object as a workerbee with the following
statement: var mark = new workerbee; when javascript sees the new operator, it creates a new generic object and implicitly sets the value of the internal property [[prototype]] to the value of workerbee.prototype and passes this new object as the value of the this keyword to the workerbee constructor function.
...once these properties are set, javascript returns the new object and the assignment
statement sets the variable mark to that object.
...for example, you can add a specialty property to all employees with the following
statement: employee.prototype.specialty = 'none'; as soon as javascript executes this
statement, the mark object also has the specialty property with the value of "none".
...And 7 more matches
block - JavaScript
a block
statement (or compound
statement in other languages) is used to group zero or more
statements.
... syntax block
statement {
statementlist } labelled block
statement labelidentifier: {
statementlist }
statementlist
statements grouped within the block
statement.
... description the block
statement is often called compound
statement in other languages.
...And 7 more matches
while - JavaScript
the while
statement creates a loop that executes a specified
statement as long as the test condition evaluates to true.
... the condition is evaluated before executing the
statement.
... syntax while (condition)
statement condition an expression evaluated before each pass through the loop.
...And 7 more matches
fill - SVG: Scalable Vector Graphics
for shapes and text it's a presentation attribute that defines the color (or any svg paint servers like gradients or patterns) used to paint the element; for animation it defines the final
state of the animation.
...w3.org/2000/svg"> <!-- simple color fill --> <circle cx="50" cy="50" r="40" fill="pink" /> <!-- fill circle with a gradient --> <defs> <radialgradient id="mygradient"> <stop offset="0%" stop-color="pink" /> <stop offset="100%" stop-color="black" /> </radialgradient> </defs> <circle cx="150" cy="50" r="40" fill="url(#mygradient)" /> <!-- keeping the final
state of an animated circle which is a circle with a radius of 40.
... animate for <animate>, fill defines the final
state of the animation.
...And 7 more matches
RDF Query Syntax - Archive of obsolete content
« previousnext » let's look at a simple query with two
statements.
... each
statement is placed as a direct child of the <query> element within the template.
... </rule> </template> </vbox> this query has two
statements, each specified with a different tag.
...And 6 more matches
Persistent Data - Archive of obsolete content
« previousnext » this section describes how to save the
state of a xul window.
... remembering
state when building a large application, you will typically want to be able to save some of the
state of a window across sessions.
...conveniently, xul provides such a mechanism to save the
state of a window.
...And 6 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
listing 1 - querying a mysql database from rhino // import the java sql packages importpackage( java.sql ); // load the mysql driver java.lang.class.forname( "com.mysql.jdbc.driver" ); // create connection to the database var conn = drivermanager.getconnection( "jdbc:mysql://localhost/rhino", "urhino", "prhino" ); // create a
statement handle var stmt = conn.create
statement(); // get a resultset var rs = stmt.executequery( "select * from employee" ); // get the metadata from the resultset var meta = rs.getmetadata(); // loop over the records, dump out column names and values while( rs.next() ) { for( var i = 1; i <= meta.getcolumncount(); i++ ) { print( meta.getcolumnname( i ) + ": " + rs.getobject( i ) + "\n" ); } ...
... print( "----------\n" ); } // cleanup rs.close(); stmt.close(); conn.close(); this code starts off by using a rhino function named importpackage which is just like using the import
statement in java.
...the sql
statement is prepared, executed, and printed with the help of the metadata obtained from the resultset.
...And 6 more matches
Pseudo-classes and pseudo-elements - Learn web development
a pseudo-class is a selector that selects elements that are in a specific
state, e.g.
...they target some bit of your document that is in a certain
state, behaving as if you had added a class into your html.
... :any-link matches both the :link and :visited
states of a link.
...And 6 more matches
Framework main features - Learn web development
regardless of their opinions on how components should be written, each framework's components offer a way to describe the external properties they may need, the internal
state that the component should manage, and the events a user can trigger on the component's markup.
... </figcaption> </figure>
state we talked about the concept of
state in the previous chapter — a robust
state-handling mechanism is key to an effective framework, and each component may have data to control the
state of.
...like props,
state can be used to affect how a component is rendered.
...And 6 more matches
TypeScript support in Svelte - Learn web development
code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app
state, run cd mdn-svelte-tutorial/07-typescript-support or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/07-typescript-support remember to run npm install && npm run dev to start your app in development mode.
...you'll also have to update any corresponding import
statements (don't include the .ts in your import
statements; typescript chose to omit the extensions).
...in those cases you can declare the typed variable in a different
statement, like this: let completetodos: number $: completedtodos = todos.filter((t: todotype) => t.completed).length you can't specify the type in the reactive assignment itself.
...And 6 more matches
Componentizing our Svelte app - Learn web development
code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app
state, run cd mdn-svelte-tutorial/04-componentizing-our-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app remember to run npm install && npm run dev to start your app in development mode.
...the child component will execute the handler, passing the needed information as a parameter, and the handler will modify the parent's
state.
... we will just declare the onclick prop assigning a dummy handler to prevent errors, like this: export let onclick = (clicked) => {} and we'll declare the following reactive
statement — $: onclick(filter) — to call the onclick handler whenever the filter variable is updated.
...And 6 more matches
Accessible Toolkit Checklist
get_acc
state: a 32 bit field representing possible on/off
states, such as focused, focusable, selected, selectable, visible, protected (for passwords), checked, etc.
... supporting the basic msaa
states on every item: unavailable, focused, readonly, offscreen, focusable to avoid extra work, utilize implementing an msaa server mnemonics ability to define in xml for any widget with a text label (via attribute or a preceding char in label) automatically define mnemonics for all standard common dialogs (like yes/no confirmations and retry/exit error dialogs) s...
... msaa support, including the haspopup
state default buttons ability to define in xml enter key fires it, but not when another widget has focus that needs the enter key layout engine - drawing dark border dynamically when the currently focused widget does not need the enter key events - making keystrokes do the right thing msaa support (default
state) links enter key activate...
...And 6 more matches
Application cache implementation overview
after these steps the update is in initialized
state waiting to be scheduled.
... when the update is about to actually start, the scheduling service calls nsofflinecacheupdate::begin() method, that switches the update to checking
state (+invokes onchecking event) and starts fetch of the manifest file.
...nsofflinecacheupdate::loadcompleted() is called for each finished entry load, including the manifest and is the main place handling each update
state as following: on checking
state, a
state the update is at after manifest parsing has been done, loadcompleted checks whether the new hash, i.e.
...And 6 more matches
PKCS11 FAQ
if no new sessions are available, the one read-only session is used, and the
state is saved and restored after each multipart operation.
... which function does nss use to get login
state information?
... nss calls c_getsessioninfo to get the login/logout
state.
...And 6 more matches
mozIStorageFunction
this is called by the database engine when the function registered with mozistorageconnection.createfunction() is used in an executing sql
statement or trigger.
... note this callback is executed on the thread that the
statement or trigger is executing on.
... if you use mozistorageconnection.executeasync() or, mozistorage
statement.executeasync() this callback will run on a different thread from the rest of your code.
...And 6 more matches
nsINavHistoryResultObserver
method overview void batching(in boolean atogglemode); void containerclosed(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containeropened(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void container
statechanged(in nsinavhistorycontainerresultnode acontainernode, in unsigned long aold
state, in unsigned long anew
state); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschan...
... containerclosed() obsolete since gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) called when a container node's
state changes from opened to closed.
...implement the container
statechanged() method instead.
...And 6 more matches
nsITaskbarProgress
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void setprogress
state(in nstaskbarprogress
state state, in unsigned long long currentvalue optional, in unsigned long long maxvalue optional); constants constant value description
state_no_progress 0 stop displaying progress on the taskbar button.
...
state_indeterminate 1 display a cycling, indeterminate progress bar.
...
state_normal 2 display a determinate, normal progress bar.
...And 6 more matches
EffectTiming.fill - Web APIs
for example, setting fill to "none" means the animation's effects are not applied to the element if the current time is outside the range of times during which the animation is running, while "forwards" ensures that once the animation's end time has been passed, the element will continue to be drawn in the
state it was in at its last rendered frame.
...the animation's effects are not visible when its play
state is pending with a delay, when its play
state is finished, or during its enddelay or delay.
... "forwards" the affected element will continue to be rendered in the
state of the final animation framecontinue to be applied to the after the animation has completed playing, in spite of and during any enddelay or when its play
state is finished.
...And 6 more matches
Using the Gamepad API - Web APIs
the gamepad api introduces new events on the window object for reading gamepad and controller (hereby referred to as gamepad)
state.
... in addition to these events, the api also adds a gamepad object, which you can use to query the
state of a connected gamepad, and a navigator.getgamepads() method which you can use to get a list of gamepads known to the page.
...epad; } else { delete gamepads[gamepad.index]; } } window.addeventlistener("gamepadconnected", function(e) { gamepadhandler(e, true); }, false); window.addeventlistener("gamepaddisconnected", function(e) { gamepadhandler(e, false); }, false); this previous example also demonstrates how the gamepad property can be held after the event has completed — a technique we will use for device
state querying later.
...And 6 more matches
Web applications and ARIA FAQ - Accessibility
aria provides additional semantics to describe the role,
state, and functionality of many familiar user interface controls, such as menus, sliders, trees, and dialogs.
... javascript toolkits aria roles,
states, and properties have been added to a number of popular javascript user interface toolkits, including: dojo/dijit jquery ui fluid infusion google closure google web toolkit bbc glow yahoo!
...the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current
state of it.
...And 6 more matches
Cognitive accessibility - Accessibility
adaptability guideline 1.3
states "content should be adaptable." create content that can be presented in different ways without losing information or structure.
...guideline 2.2
states "provide users enough time to read and use content." a time limit is any process that happens without user initiation after a set time or on a periodic basis, such as being logged out after 30 minutes or having 15 minutes to make a purchase.
... ensure that people can continue an activity without loss of data after re-authenticating an expired session, for example, saving the
state of a questionnaire.
...And 6 more matches
Syntax - CSS: Cascading Style Sheets
css
statements rulesets are the main building blocks of a style sheet, which often consists of only a big list of them.
...it will use other and specific kinds of
statements to do that.
... a
statement is a building block that begins with any non-space characters and ends at the first closing brace or semi-colon (outside a string, non-escaped and not included into another {}, () or [] pair).
...And 6 more matches
Promise - JavaScript
a promise is in one of these
states: pending: initial
state, neither fulfilled nor rejected.
...you will also hear the term resolved used with promises — this means that the promise is settled or “locked in” to match the
state of another promise.
...
states and fates contains more details about promise terminology.
...And 6 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
an open-source software license is a
statement that anyone is free to use your source code in whatever way they want.
... the open source definition
states what conditions the oss license must satisfy.
... titles and their licenses license representative software titles modified bsd freebsd, netbsd, openbsd mpl firefox, thunderbird (also triple-licensed mpl/lgpl/gpl) gpl linux kernel, gimp lgpl gtk+, openoffice.org modified bsd license this license permits free duplication, distribution, and modification provided that a copyright
statement and liability disclaimer are included.
...And 5 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
orient whether a box's contents will be vertically or horizontally arrayed depends on the elements in their initial
state.
...you would use this to set a hidden or absent
state, for example items that aren't displayed in contextual menus.
... persist the persist attribute is an easy way to record and store a xul element’s
state after it has been changed by a user operation.
...And 5 more matches
Tree View Details - Archive of obsolete content
when the user clicks the twisty to open a row, the tree will call the view's toggleopen
state method.
... note: as of this writing (gecko 2.0), custom nsitreeview implementations must be prepared to handle a call to toggleopen
state for any row index which returns true for a call to iscontainer, regardless of whether the container is empty.
... review of the methods here is a review of the methods needed to implement hierarchical views: getlevel(row) hasnextsibling(row, afterindex) getparentindex(row) iscontainer(row) iscontainerempty(row) iscontaineropen(row) toggleopen
state(row) the afterindex argument to hasnextsibling function is used as optimization to only start looking for the next sibling after that point.
...And 5 more matches
WAI-ARIA basics - Learn web development
states — special properties that define the current conditions of elements, such as aria-disabled="true", which specifies to a screenreader that a form input is currently disabled.
...
states differ from properties in that properties don't change throughout the lifecycle of an app, whereas
states can change, generally programmatically via javascript.
... the spec also contains a list of all the properties and
states, with links to further information — see definitions of
states and properties (all aria-* attributes).
...And 5 more matches
JavaScript basics - Learn web development
you start by declaring a variable with the var (less recommended, dive deeper for the explanation) or the let keyword, followed by the name you give to the variable: let myvariable; note: a semicolon at the end of a line indicates where a
statement ends.
... it is only required when you need to separate
statements on a single line.
... however, some people believe it's good practice to have semicolons at the end of each
statement.
...And 5 more matches
HTMLIFrameElement.setVisible()
the setvisible() method of the htmliframeelement is used to change the visibility
state of the browser <iframe>.
... the visible
state of a browser <iframe> has nothing to do with its actual visibility (which is handled through css).
... the visible
state is used to define the level of resources required by the browser <iframe>.
...And 5 more matches
Browser API
api extensions: the api includes several new methods and events to manipulate and listen for changes to the embedded content's
state, interited by the htmliframeelement interface.
... htmliframeelement.setvisible() changes the visibility
state of a browser <iframe>.
... htmliframeelement.getvisible() indicates the current visibility
state of the browser <iframe>.
...And 5 more matches
HTTP Cache
clearing of the internal io
state - is then put to the end of the open_priority level.
... invoking open callbacks cacheentry, implementing the nsicacheentry interface, is responsible for managing the cache entry internal
state and to properly invoke oncacheentrycheck and oncacheentryavaiable callbacks to all callers of nsicachestorage.asyncopenuri.
... keeps its internal
state like notloaded, loading, empty, writing, ready, revalidating.
...And 5 more matches
Promise.jsm
internally, a promise can be in one of three
states: pending, when the final value is not available yet.
... this is the only
state that may transition to one of the other two
states.
...in this case, the
state of the promise can be observed but not directly controlled.
...And 5 more matches
sslfnc.html
default
state is a third
state similar to on, that provides backward compatibility with older netscape server products.
... a a pointer supplied by the application that can be used to pass
state information.
... arg a pointer supplied by the application that can be used to pass
state information.
...And 5 more matches
Tracing JIT
at any moment, the trace monitor is in one of three major
states: monitoring, recording, or executing.
... the transitions between these
states are somewhat complex and delicate, but the overall picture is simple: monitoring the trace monitor's initial
state is monitoring.
... first the monitor allocates a native stack for the trace to use, and a
state structure containing various key pointers into the spidermonkey interpreter's
state, including a pointer to the native stack.
...And 5 more matches
Building the WebLock UI
first of all, it's important to be able to represent the basic
state of the lock as soon as it's loaded.
...since the weblock component is always initialized as unlocked, we can have the client code - the javascript code in the interface - represent this
state and track it as the user manipulates the iweblock interface.
...one of the most efficient ways to expose this is to use radio buttons, which allow the user to toggle a particulart
state, as the figure above illustrates.
...And 5 more matches
nsIXPCScriptable
tptr obj, in jsval id, in jsvalptr vp); prbool setproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool enumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool newenumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 enum_op, in jsvalptr
statep, out jsid idp); prbool newresolve(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in pruint32 flags, out jsobjectptr objp); prbool convert(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 type, in jsvalptr vp); void finalize(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); pr...
... prbool newenumerate( in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 enum_op, in jsvalptr
statep, out jsid idp ); parameters wrapper cx the pointer to the jscontext newenumerate is being called from.
... enum_op indicates what
statep and idp represent, as well as indicates how the function should behave.
...And 5 more matches
Animation - Web APIs
animation.play
state read only returns an enumerated value describing the playback
state of an animation.
... animation.replace
state returns the replace
state of the animation.
... animation.onremove allows you to set and run an event handler that fires when the animation is removed (i.e., put into an active replace
state).
...And 5 more matches
Document - Web APIs
document.undomanager read only … document.visibility
stateread only returns a string denoting the visibility
state of the document.
... document.ready
stateread only returns loading status of the document.
... document.onready
statechange represents the event handling code for the ready
statechange event.
...And 5 more matches
Using the Permissions API - Web APIs
querying permission
state in our example, the permissions functionality is handled by one function — handlepermission().
...depending on the value of the
state property of the permissionstatus object returned when the promise resolves, it reacts differently: "granted" the "enable geolocation" button is hidden, as it isn't needed if geolocation is already active.
... "denied" the "enable geolocation" button is revealed (this code needs to be here too, in case the permission
state is already set to denied for this origin when the page is first loaded).
...And 5 more matches
Using DTMF with WebRTC - Web APIs
in this case, we
state that we want to receive audio but not video.
... function connectanddial() { callerpc = new rtcpeerconnection(); hasaddtrack = (callerpc.addtrack !== undefined); callerpc.onicecandidate = handlecallericeevent; callerpc.onnegotiationneeded = handlecallernegotiationneeded; callerpc.oniceconnection
statechange = handlecallericeconnection
statechange; callerpc.onsignaling
statechange = handlecallersignaling
statechangeevent; callerpc.onicegathering
statechange = handlecallergathering
statechangeevent; receiverpc = new rtcpeerconnection(); receiverpc.onicecandidate = handlereceivericeevent; if (hasaddtrack) { receiverpc.ontrack = handlereceivertrackevent; } else { receiverpc.onadds...
...to accomplish that, we watch for the caller to receive an iceconnection
statechange event.
...And 5 more matches
Starting up and shutting down a WebXR session - Web APIs
it introduced support for augmented reality (ar) through the webxr ar module, which has is approaching a stable
state.
... set the webgl context as the source for the xr system by creating an xrwebgllayer and passing set the value of the session's render
state property baselayer.
...nction runsession(session) { let worlddata; session.addeventlistener("end", onsessionend); let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); // set up webgl data and such worlddata = loadglprograms(session, "worlddata.xml"); if (!worlddata) { return null; } // finish configuring webgl worlddata.session.updaterender
state({ baselayer: new xrwebgllayer(worlddata.session, gl) }); // start rendering the scene referencespace = await worlddata.session.requestreferencespace("unbounded"); worlddata.referencespace = referencespace.getoffsetreferencespace( new xrrigidtransform(worlddata.playerspawnposition, worlddata.playerspawnorientation)); worlddata.animationframerequestid = worlddata.session.req...
...And 5 more matches
Web APIs
quest basiccardresponse batterymanager beforeinstallpromptevent beforeunloadevent biquadfilternode blob blobbuilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetoothremotegattcharacteristic bluetoothremotegattdescriptor bluetoothremotegattserver bluetoothremotegattservice body broadcastchannel budgetservice budget
state buffersource bytelengthqueuingstrategy bytestring c cdatasection css cssconditionrule csscounterstylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyle...
...ion mssitemodeevent magnetometer mathmlelement mediacapabilities mediacapabilitiesinfo mediaconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess mediakeysystemconfiguration mediakeys medialist mediametadata mediaposition
state mediaquerylist mediaquerylistevent mediaquerylistlistener mediarecorder mediarecordererrorevent mediasession mediasessionactiondetails mediasettingsrange mediasource mediastream mediastreamaudiodestinationnode mediastreamaudiosourcenode mediastreamaudiosourceoptions mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions medi...
...venttiming performanceframetiming performancelongtasktiming performancemark performancemeasure performancenavigation performancenavigationtiming performanceobserver performanceobserverentrylist performancepainttiming performanceresourcetiming performanceservertiming performancetiming periodicwave permissionstatus permissions photocapabilities plugin pluginarray point pointerevent pop
stateevent positionoptions processinginstruction progressevent promiserejectionevent publickeycredential publickeycredentialcreationoptions publickeycredentialrequestoptions pushevent pushmanager pushmessagedata pushregistrationmanager pushsubscription r rtcansweroptions rtccertificate rtcconfiguration rtcdtmfsender rtcdtmftonechangeevent rtcdatachannel rtcdatachannelevent rtcdtlstranspo...
...And 5 more matches
The HTML autocomplete attribute - HTML: Hypertext Markup Language
in the united
states, this would be the
state.
... "postal-code" a postal code (in the united
states, this is the zip code).
...if you need to break the phone number up into its components, you can use these values for those fields: "tel-country-code" the country code, such as "1" for the united
states, canada, and other areas in north america and parts of the caribbean.
...And 5 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
the html details element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open"
state.
... note: the common use of a triangle which rotates or twists around to represent opening or closing the widget is why these are sometimes called "twisties." a <details> widget can be in one of two
states.
... the default closed
state displays only the triangle and the label inside <summary> (or a user agent-defined default string if no <summary>).
...And 5 more matches
do...while - JavaScript
the do...while
statement creates a loop that executes a specified
statement until the test condition evaluates to false.
... the condition is evaluated after executing the
statement, resulting in the specified
statement executing at least once.
... syntax do
statement while (condition);
statement a
statement that is executed at least once and is re-executed each time the condition evaluates to true.
...And 5 more matches
throw - JavaScript
the throw
statement throws a user-defined exception.
... execution of the current function will stop (the
statements after throw won't be executed), and control will be passed to the first catch block in the call stack.
... description use the throw
statement to throw an exception.
...And 5 more matches
Strict mode - JavaScript
it doesn't apply to block
statements enclosed in {} braces; attempting to apply it to such contexts does nothing.
... strict mode for scripts to invoke strict mode for an entire script, put the exact
statement "use strict"; (or 'use strict';) before any other
statements.
... strict mode for functions likewise, to invoke strict mode for a function, put the exact
statement "use strict"; (or 'use strict';) in the function's body before any other
statements.
...And 5 more matches
Chrome Authority - Archive of obsolete content
to obtain these privileges, the module must declare its intent with a
statement like the following: var {cc, ci} = require("chrome"); the "chrome" built-in pseudo module is provided by the "toolkit/loader" module.
... note: the require("chrome")
statement is the only way to access chrome functionality and the components api.
...this list is generated by scanning all included modules for require(xyz)
statements and recording the particular "xyz" strings that they reference.
...And 4 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button { list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button
states, but we'll get into that further ahead.
...the other types, checkbox and radio are useful when you have buttons that change
state when the user clicks on them.
... only a few icons have different
states (rows).
...And 4 more matches
RDF Datasource How-To - Archive of obsolete content
the "rdf universe" consists of a set of
statements about internet resources; for example, "my home page was last modified april 2nd", or "that news article was sent by bob".
... in the most abstract sense, a datasource is a collection of such
statements.
... more concretely, a datasource is a translator that can present information as a collection of rdf
statements.
...And 4 more matches
sizemode - Archive of obsolete content
« xul reference home sizemode type: one of the values below the
state of the window.
... normal the window appears in a normal
state at the desired size.
... this attribute is used to save and restore the
state of a window (together with the persist attribute) and for css styles (e.g.
...And 4 more matches
window - Archive of obsolete content
sizemode type: one of the values below the
state of the window.
... normal the window appears in a normal
state at the desired size.
... this attribute is used to save and restore the
state of a window (together with the persist attribute) and for css styles (e.g.
...And 4 more matches
for each...in - Archive of obsolete content
the for each...in
statement is deprecated as the part of ecma-357 (e4x) standard.
... the for each...in
statement iterates a specified variable over all values of object's properties.
... for each distinct property, a specified
statement is executed.
...And 4 more matches
Desktop gamepad controls - Game development
to update the
state of the gamepad's currently pressed buttons we will need a function that will do exactly that on every frame: function gamepadupdatehandler() { buttonspressed = []; if(controller.buttons) { for(var b=0; b<controller.buttons.length; b++) { if(controller.buttons[b].pressed) { buttonspressed.push(b); } } } } we first reset the butt...
... next, in the draw() function we do two things — execute the gamepadupdatehandler() function to get the current
state of pressed buttons on every frame, and use the gamepadbuttonpressedhandler() function to check the buttons we are interested to see whether they are pressed, and do something if they are: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); // ...
...here's the gamepadapi object, which contains useful variables and functions: var gamepadapi = { active: false, controller: {}, connect: function(event) {}, disconnect: function(event) {}, update: function() {}, buttons: { layout: [], cache: [], status: [], pressed: function(button,
state) {} } axes: { status: [] } }; the controller variable stores the information about the connected gamepad, and there's an active boolean variable we can use to know if the controller is connected or not.
...And 4 more matches
Implementing controls using the Gamepad API - Game development
gamepad object there's lots of useful information contained in the gamepad object, with the
states of buttons and axes being the most important: id: a string containing information about the controller.
... axes: the
state of each axis, represented by an array of floating-point values.
... buttons : the
state of each button, represented by an array of gamepadbutton objects containing pressed and value properties.
...And 4 more matches
Website security - Learn web development
this vulnerability is present if user input that is passed to an underlying sql
statement can change the meaning of the
statement.
... for example, the following code is intended to list all users with a particular name (username) that has been supplied from an html form:
statement = "select * from users where name = '" + username + "';" if the user specifies a real name, the
statement will work as intended.
... however, a malicious user could completely change the behavior of this sql
statement to the new
statement in the following example, by simply specifying the text in bold for the username.
...And 4 more matches
Getting started with Svelte - Learn web development
it extends javascript by reinterpreting specific directives of the language to achieve true reactivity and ease component
state management.
...top-level variables is the way svelte handles the component
state, and they are reactive by default.
... a first look at svelte reactivity in the context of a ui framework, reactivity means that the framework can automatically update the dom when the
state of any component is changed.
...And 4 more matches
Getting started with Vue - Learn web development
it also allows you to take advantage of libraries for client-side routing and
state management when you need to.
... additionally, vue takes a "middle ground" approach to tooling like client-side routing and
state management.
...this allows you to select a different routing/
state management library if they better fit your application.
...And 4 more matches
Performance
performance best practices declaring
stateless functions once per process bad: // addon.js services.mm.loadframescript("framescript.js", true) // framescript.js const precomputedconstants = // ...
...message.target result = helper(frameglobal.content, message.data) frameglobal.sendasyncmessage("my-addon:response-from-child", {something: result}) } function addframe(frameglobal) { frameglobal.addmessagelistener("my-addon:request-from-parent", dosomething) } javascript modules are per-process singletons and thus all their objects are only initialized once, which makes them suitable for
stateless callbacks.
... store heavyweight
state once per process bad: // addon.js var main = new myaddonservice(); main.onchange(
statechange); function
statechange() { services.mm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // framescript.js var maincopy; function onupdate(message) { maincopy = myaddonservice.deserialize(message.data.newconfig); } addmessagelistener("my-addon:update-configuration", onupdate) // maincopy used by other functions the main issue here is that a separate object is kept for each tab.
...And 4 more matches
Embedding the editor
introduction this document describes the current
state of editor embeddability, problems with the existing implementation, some possible embedding scenarios that we need to deal with, and an embedding solution that will fulfill them.
...editor assumes xul document structure there is c++ and js code in the editor that assumes that the editor is living in a xul document, and that there are xul document nodes out there whose attributes can be tweaked to change the
state of the ui (e.g.
... alternative solution: rather than having multiple editors in this scenario, we could have a single editor, which is capable of saving and restoring
state such that it can be transferred between the various subdocuments being edited.
...And 4 more matches
Embedding Tips
register your own nsiwebprogresslistener object to listen for progress and
state notifications.
... register your ownnsiwebprogresslistener object to listen for progress and
state notifications.
...as the operation progresses, methods on the listener such as on
statechange, onprogresschange etc.
...And 4 more matches
Deferred
a deferred object is returned by the obsolete promise.defer() method to provide a new promise along with methods to change its
state.
...n(resolve, reject) { dosomething(function cb(good) { if (good) resolve(); else reject(); }); }); method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending
state.
... methods resolve() fulfills the associated promise with the specified value, or propagates the
state of an existing promise.
...And 4 more matches
source-editor.jsm
sourceeditor.events.dirty_changed "dirtychanged" fired when the dirty
state of the editor is changed.
... the dirty
state indicates whether or not there are unsaved changes to the text.
... the "dirtychanged" event is sent when the dirty
state of the editor changes.
...And 4 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
e; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified format */ if (ascii) { char *obuf; char *name, *email, *org, *
state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not specified)")...
...; org = cert_getorgname(subject); if (!org) org = strdup("(not specified)");
state = cert_get
statename(subject); if (!
state)
state = strdup("(not specified)"); country = cert_getcountryname(subject); if (!country) country = strdup("(not specified)"); pr_fprintf(outfile, "\ncertificate request generated by netscape certutil\n"); pr_fprintf(outfile, "common name: %s\n", name); pr_fprintf(outfile, "email: %s\n", email); pr_fprintf(outfile, "organization: %s\n", org); pr_fprintf(outfile, "
state: %s\n",
state); pr_fprintf(outfile, "country: %s\n\n", country); pr_fprintf(outfile, "%s\n", ns_certreq_header); numbytes = ...
...like sample 5, but finds key matching cert in header */ int main(int argc, char **argv) { secstatus rv; plopt
state *opt
state; ploptstatus status; prbool initialized = pr_false; commandtype cmd = unknown; const char *dbdir = null; secupwdata pwdata = { pw_none, 0 }; char *subjectstr = null; certname *subject ...
...And 4 more matches
nsIBlocklistService
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 29 (firefox 29 / thunderbird 29 / seamonkey 2.26) method overview unsigned long getaddonblocklist
state(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); unsigned long getpluginblocklist
state(in nsiplugintag plugin, [optional] in astring appversion, [optional] in astring toolkitversion); boolean isaddonblocklisted(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); constants constant value description
state_not_blocked 0
state_softblocked 1 ...
...
state_blocked 2
state_outdated 3 methods getaddonblocklist
state() determine the blocklist
state of an add-on.
... unsigned long getaddonblocklist
state( in jsval addon, in astring appversion, optional in astring toolkitversion optional ); parameters addon the addon object whose blocklist
state is to be determined.
...And 4 more matches
nsIHttpServer
*/ readonly attribute nsihttpserveridentity identity; /** * retrieves the string associated with the given key in this, for the given * path's saved
state.
... */ astring get
state(in astring path, in astring key); /** * sets the string associated with the given key in this, for the given path's * saved
state.
... */ void set
state(in astring path, in astring key, in astring value); /** * retrieves the string associated with the given key in this, in * entire-server saved
state.
...And 4 more matches
nsIMsgFolder
ore(in nsisupports semholder); void getnewmessages(in nsimsgwindow awindow, in nsiurllistener alistener); void writetofoldercache(in nsimsgfoldercache foldercache, in boolean deep); long getnumnewmessages(in boolean deep); void setnumnewmessages(in long numnewmessages); acstring generatemessageuri(in nsmsgkey msgkey); void addmessagedisposition
state(in nsimsgdbhdr amessage,in nsmsgdisposition
state adispositionflag); void markmessagesread(in nsisupportsarray messages, in boolean markread); void markallmessagesread(); void markmessagesflagged(in nsisupportsarray messages, in boolean markflagged); void markthreadread(in nsimsgthread thread); void setlabelformessages(in nsisupportsarray messages, in n...
... charsetoverride boolean biff
state unsigned long locked boolean readonly flags unsigned long direct access to the set/get all the flags at once.
... constants constant value description nsmsgbiff
state_newmail 0 user has new mail waiting.
...And 4 more matches
Debugger.Object - Firefox Developer Tools
while most debugger.object instances are created by spidermonkey in the process of exposing debuggee’s behavior and
state to the debugger, the debugger can use debugger.object.prototype.makedebuggeevalue to create debugger.object instances for given debuggee objects, or use debugger.object.prototype.copy and debugger.object.prototype.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals.
... isgeneratorfunction if the referent is a debuggee function, returns true if the referent was created with a function* expression or
statement, or false if it is some other sort of function.
...(this is always equal to obj.script.isgeneratorfunction, assuming obj.script is a debugger.script.) isasyncfunction if the referent is a debuggee function, returns true if the referent is an async function, defined with an async function expression or
statement, or false if it is some other sort of function.
...And 4 more matches
HTMLInputElement - Web APIs
validity read only validity
state object: returns the element's current validity
state.
... properties that apply only to elements of type checkbox or radio checked boolean: returns / sets the current
state of the element when type is checkbox or radio.
... defaultchecked boolean: returns / sets the default
state of a radio button or checkbox as originally specified in html that created this object.
...And 4 more matches
IDBRequest - Web APIs
each request has a ready
state that is set to the 'pending'
state; this changes to 'done' when the request is completed or fails.
... when the
state is set to done, every request returns a result and an error, and an event is fired on the request.
... when the
state is still pending, any attempt to access the result or error raises an invalid
stateerror exception.
...And 4 more matches
Page Visibility API - Web APIs
the page visibility api provides events you can watch for to know when a document becomes visible or hidden, as well as features to look at the current visibility
state of the page.
... when the user minimizes the window or switches to another tab, the api sends a visibilitychange event to let listeners know the
state of the page has changed.
... visibility
states of an <iframe> are the same as the parent document.
...And 4 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
invalid
stateerror the rtcpeerconnection is closed, or it's in a
state which isn't compatible with the specified description's type.
... for example, if the type is rollback and the signaling
state is one of stable, have-local-pranswer, or have-remote-pranswer, this exception is thrown, because you can't roll back a connection that's either fully established or is in the final stage of becoming connected.
... usage notes when you call setremotedescription(), the ice agent checks to make sure the rtcpeerconnection is in either the stable or have-remote-offer signaling
state.
...And 4 more matches
WebXR Device API - Web APIs
xrframe while presenting an xr session, the
state of all tracked objects which make up the session are represented by an xrframe.
...events which communicate tracking
states will also use xrframe to contain that information.
... xrrender
state provides a set of configurable properties which change how the imagery output by an xrsession is composited.
...And 4 more matches
Migrating from webkitAudioContext - Web APIs
the web audio api went through many iterations before reaching its current
state.
... changes to determining playback
state the playback
state attribute of audiobuffersourcenode and oscillatornode has been removed.
... depending on why you used this attribute, you can use the following techniques to get the same information: if you need to compare this attribute to unscheduled_
state, you can basically remember whether you've called start() on the node or not.
...And 4 more matches
ARIA: switch role - Accessibility
the aria switch role is functionally identical to the checkbox role, except that instead of representing "checked" and "unchecked"
states, which are fairly generic in meaning, the switch role represents the
states "on" and "off." this example creates a widget and assigns the aria switch role to it.
...unlike a <checkbox> or role="checkbox", there is no indeterminate or mixed
state.
... associated aria roles,
states, and properties aria-checked attribute the aria-checked attribute is required when using the switch role, as it represents the current
state of the widget that the switch role is applied to.
...And 4 more matches
ARIA: checkbox role - Accessibility
elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's
state to assistive technology.
...instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have two checked
states ("checked" or "not checked"), with an indeterminate
state settable via javascript.
... similarly, an element with role="checkbox" can expose three
states through the aria-checked attribute: true, false, or mixed.
...And 4 more matches
An overview of accessible web applications and widgets - Accessibility
designed to fill the gap between standard html tags and the desktop-style controls found in dynamic web applications, aria provides roles and
states that describe the behavior of most familiar ui widgets.
... the aria specification is split up into three different types of attributes: roles,
states, and properties.
...
states describe the current interaction
state of an element, informing the assistive technology if it is busy, disabled, selected, or hidden.
...And 4 more matches
JavaScript modules - JavaScript
browser support use of native javascript modules is dependent on the import and export
statements; these are supported in browsers as follows: import desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsimportchrome full support 61edge full support 16 full support ...
...this is done using the export
statement.
... a more convenient way of exporting all the items you want to export is to use a single export
statement at the end of your module file, followed by a comma-separated list of the features you want to export wrapped in curly braces.
...And 4 more matches
Arrow function expressions - JavaScript
syntax basic syntax (param1, param2, …, paramn) => {
statements } (param1, param2, …, paramn) => expression // equivalent to: => { return expression; } // parentheses are optional when there's only one parameter name: (singleparam) => {
statements } singleparam => {
statements } // the parameter list for a function with no parameters should be written with a pair of parentheses.
... () => {
statements } advanced syntax // parenthesize the body of a function to return an object literal expression: params => ({foo: bar}) // rest parameters and default parameters are supported (param1, param2, ...rest) => {
statements } (param1 = defaultvalue1, param2, …, paramn = defaultvaluen) => {
statements } // destructuring within the parameter list is also supported var f = ([a, b] = [1, 2], {x: c} = {x: a + b}) => a + b + c; f(); // 6 description see also "es6 in depth: arrow functions" on hacks.mozilla.org.
... shorter functions var elements = [ 'hydrogen', 'helium', 'lithium', 'beryllium' ]; // this
statement returns the array: [8, 6, 7, 9] elements.map(function(element) { return element.length; }); // the regular function above can be written as the arrow function below elements.map((element) => { return element.length; }); // [8, 6, 7, 9] // when there is only one parameter, we can remove the surrounding parentheses elements.map(element => { return element.length; }); // [8, 6, 7, 9] // when the only
statement in an arrow function is `return`, we can remove `return` and remove // the surrounding curly brackets elements.map(element => element.length);...
...And 4 more matches
undefined - JavaScript
a method or
statement also returns undefined if the variable that is being evaluated does not have an assigned value.
...in the following code, the variable x is not initialized, and the if
statement evaluates to true.
... var x; if (x === undefined) { // these
statements execute } else { // these
statements do not execute } note: the strict equality operator (as opposed to the standard equality operator) must be used here, because x == undefined also checks whether x is null, while strict equality doesn't.
...And 4 more matches
empty - JavaScript
an empty
statement is used to provide no
statement, although the javascript syntax would expect one.
... syntax ; description the empty
statement is a semicolon (;) indicating that no
statement will be executed, even if javascript syntax requires one.
... the opposite behavior, where you want multiple
statements, but javascript only allows a single one, is possible using a block
statement, which combines several
statements into a single one.
...And 4 more matches
for...of - JavaScript
the for...of
statement creates a loop iterating over iterable objects, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined iterables.
... it invokes a custom iteration hook with
statements to be executed for the value of each distinct property of the object.
... syntax for (variable of iterable) {
statement } variable on each iteration a value of a different property is assigned to variable.
...And 4 more matches
tabs - Archive of obsolete content
" and is located in the add-on's "data" directory: var tabs = require("sdk/tabs"); var { attach, detach } = require('sdk/content/mod'); var { style } = require('sdk/stylesheet/style'); var { togglebutton } = require("sdk/ui/button/toggle"); var style = style({ uri: './style.css' }); var button = togglebutton({ id: "stylist", label: "stylist", icon: "./icon-16.png", onchange: function(
state) { if (
state.checked) { attach(style, tabs.activetab); } else { detach(style, tabs.activetab); } } }); private windows if your add-on has not opted into private browsing, then you won't see any tabs that are hosted by private browser windows.
... ready
state new in firefox 33.
... a string telling you the load
state of the document hosted by this tab.
...And 3 more matches
Enhanced Extension Installation - Archive of obsolete content
there are not enough guards in the upgrade and uninstall process to handle failure and abort the operation, restoring the previous
state.
... the
state of the world install locations in firefox 1.0 extensions can be installed into only two locations: the firefox user's profile directory directory, e.g.
...a nfs home directory and simply placing a text "link" file in the applicable directory above that links to the location of the extension in its installed
state at the other location.
...And 3 more matches
Layout System Overview - Archive of obsolete content
the presentation shell also receives notifications about changes in cursor and focus
states, whereby the selection and caret updates can be made visible.
...this is important because no frame is generated for these elements yet changes to their style values and to the content elements still need to be handled by layout, in case their display
state changes from 'none' to something else.
...frame construction is generally achieved by the use of
stateless methods, but in some cases there is the need to provide context to frames created as children of a container.
...And 3 more matches
OpenClose - Archive of obsolete content
testing menu open
state to check if a menu is open, check the
state of the menu's open property.
... for other types of popups, the
state property may be examined to determine whether a popup is open or not.
...when a popup is closed, the
state property has the value closed, whereas a popup that is visible has a value for the
state property of open.
...And 3 more matches
The Implementation of the Application Object Model - Archive of obsolete content
the second reason to have local/remote merging is to save
state and/or to record customizations that the user has made to his or her user interface.
...
statement #1 the two points raised in the previous two paragraphs, namely (1) redundancy of methods in the interfaces as well as a likely code redundancy in the implementation of some of those methods, and (2) the desire to be insulated from the layout dll should those interfaces change, imply that a layer needs to exist between the pluggable content and the content tree interfaces.
...
statement #2 all content nodes that reside in the aom and that implement the content tree interfaces must be the same class of object.
...And 3 more matches
RDF in Mozilla FAQ - Archive of obsolete content
rdf can generally be viewed in two ways: either as a graph with nodes and arcs, or as a "soup" of logical
statements.
... a datasource is a subgraph (or collection of
statements, depending on your viewpoint) that are for some reason collected together.
...this is like overlaying graphs, or merging collections of
statements ("microtheories") together.
...And 3 more matches
Loop - MDN Web Docs Glossary: Definitions of Web-related terms
examples for loop syntax: for (
statement 1;
statement 2;
statement 3){ execute code block }
statement 1 is executed once before the code block is run.
...
statement 2 defines the condition needed to execute the code block.
...
statement 3 is executed every time the code block is run.
...And 3 more matches
Styling links - Learn web development
previous overview: styling text next when styling links, it is important to understand how to make use of pseudo-classes to style link
states effectively, and how to style links for use in common varied interface features such as navigation menus and tabs.
... objective: to learn how to style link
states, and how to use links effectively in common ui features like navigation menus.
... link
states the first thing to understand is the concept of link
states — different
states that links can exist in, which can be styled using different pseudo-classes: link (unvisited): the default
state that a link resides in, when it isn't in any other
state.
...And 3 more matches
Introducing asynchronous JavaScript - Learn web development
it represents an intermediate
state, as it were.
...one difference is that we've included a number of console.log()
statements to illustrate an order that you might think the code would execute in.
...esponse.blob(); }).then((myblob) => { let objecturl = url.createobjecturl(myblob); image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }).catch((error) => { console.log('there has been a problem with your fetch operation: ' + error.message); }); console.log ('all done!'); the browser will begin executing the code, see the first console.log()
statement (starting) and execute it, and then create the image variable.
...And 3 more matches
Graceful asynchronous programming with Promises - Learn web development
essentially, a promise is an object that represents an intermediate
state of an operation — in effect, a promise that a result of some kind will be returned at some point in the future.
...as we said before, this object represents an intermediate
state that is initially neither success nor failure — the official term for a promise in this
state is pending.
... when a promise is created, it is neither in a success or failure
state.
...And 3 more matches
Introduction to client-side frameworks - Learn web development
in software development, this underlying data is known as
state.
...the real problem is this: every time we change our application’s
state, we need to update the ui to match.
...let's say that our
state is an array of objects structured like this: const
state = [ { id: 'todo-0', name: 'learn some frameworks!' } ] how do we show one of those tasks to our user?
...And 3 more matches
Componentizing our React app - Learn web development
above the return
statement of app(), make a new const called tasklist and use map() to transform it.
... copy the <form> tags and everything between them from inside app.js, and paste them inside form()’s return
statement.
...e="off" /> <button type="submit" classname="btn btn__primary btn__lg"> add </button> </form> ); } export default form; the <filterbutton /> do the same things you did to create form.js inside filterbutton.js, but call the component filterbutton() and copy the html for the first button inside the <div> element with the class of filters from app.js into the return
statement.
...And 3 more matches
Starting our Svelte Todo list app - Learn web development
objective: to learn how to create a svelte component, render it inside another component, pass data into it using props, and save its
state.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app
state, run cd mdn-svelte-tutorial/02-starting-our-todo-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/02-starting-our-todo-app remember to run npm install && npm run dev to start your app in development mode.
...for example: <button class="btn toggle-btn" aria-pressed="true"> <span class="visually-hidden">show</span> <span>all</span> <span class="visually-hidden">tasks</span> </button> here, aria-pressed tells assistive technology (like screen readers) that the button can be in one of two
states: pressed or unpressed.
...And 3 more matches
Understanding client-side JavaScript frameworks - Learn web development
react interactivity: events and
state with our component plan worked out, it's now time to start updating our app from a completely static ui to one that actually allows us to interact and change things.
... in this article we'll do this, digging into events and
state along the way.
...ember interactivity: events, classes and
state at this point we'll start adding some interactivity to our app, providing the ability to add and display new todo items.
...And 3 more matches
mozbrowsersecuritychange
the mozbrowsersecuritychange event is fired when the browser <iframe> has connected to the server, and when the mixed content
state changes.
... details the details property returns an anonymous javascript object with the following properties:
state a domstring representing the current
state of ssl security.
... possible values are: broken: indicates an unknown security
state.
...And 3 more matches
Enc Dec MAC Output Public Key as CSR
ecfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified format */ if (ascii) { char *obuf; char *name, *email, *org, *
state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not specified)"); ...
... org = cert_getorgname(subject); if (!org) org = strdup("(not specified)");
state = cert_get
statename(subject); if (!
state)
state = strdup("(not specified)"); country = cert_getcountryname(subject); if (!country) country = strdup("(not specified)"); pr_fprintf(outfile, "\ncertificate request generated by netscape certutil\n"); pr_fprintf(outfile, "common name: %s\n", name); pr_fprintf(outfile, "email: %s\n", email); pr_fprintf(outfile, "organization: %s\n", org); pr_fprintf(outfile, "
state: %s\n",
state); pr_fprintf(outfile, "country: %s\n\n", country); pr_fprintf(outfile, "%s\n", ns_certreq_header); numbytes = pr_write(outfile, obu...
... */ int main(int argc, char **argv) { secstatus rv; secstatus rvshutdown; plopt
state *opt
state; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; pk11slotinfo *slot = null; prbool ascii = pr_false; commandtype cmd = unknown; prfiledesc *infile = null; prfiledesc *outfile ...
...And 3 more matches
sample2
; if (signalgtag == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified format */ if (ascii) { char *obuf; char *name, *email, *org, *
state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not specified)"); org = cert_getorgname(subject); if (!org) org = strdup("(not specified)");
state = cert_get
statename(subject); if ...
...(!
state)
state = strdup("(not specified)"); country = cert_getcountryname(subject); if (!country) country = strdup("(not specified)"); pr_fprintf(outfile, "\ncertificate request generated by netscape certutil\n"); pr_fprintf(outfile, "common name: %s\n", name); pr_fprintf(outfile, "email: %s\n", email); pr_fprintf(outfile, "organization: %s\n", org); pr_fprintf(outfile, "
state: %s\n",
state); pr_fprintf(outfile, "country: %s\n\n", country); pr_fprintf(outfile, "%s\n", ns_certreq_header); numbytes = pr_write(outfile, obuf, total); if (numbytes != total) { pr_fprintf(pr_stderr, "write error\n"); return secfailure; } pr_fprintf(outfile, "\n%s\n", ns_certreq_trailer); } else { numbytes = pr_write(outfile, result.data, result.len); if (numbytes != (int)result.len) { pr_fprintf(pr_stderr, "write erro...
...like sample 5, but finds key matching cert in header */ int main(int argc, char **argv) { secstatus rv; plopt
state *opt
state; ploptstatus status; prbool initialized = pr_false; commandtype cmd = unknown; const char *dbdir = null; secupwdata pwdata = { pw_none, 0 }; char *subjectstr = null; certname *subject = 0; unsigned int serialnumber = 0; char *serialnumberstr = null; char *truststr = null; certcertdbhandle *certhandle; const char *nicknamestr = null; char *issuernamestr = null; prbool selfsign = pr_false...
...And 3 more matches
JSNewEnumerateOp
syntax typedef bool (* jsnewenumerateop)(jscontext *cx, js::handleobject obj, js::autoidvector &properties); // added in spidermonkeysidebar 38 typedef bool (* jsnewenumerateop)(jscontext *cx, js::handleobject obj, jsiterateop enum_op, js::mutablehandlevalue
statep, js::mutablehandleid idp); // obsolete since jsapi 37 name type description cx jscontext * the context in which the enumeration is taking place.
...
statep js::mutablehandleid obsolete since jsapi 37 in/out parameter.
...(spidermonkey, noting the jsclass_new_enumerate flag, will cast that function pointer back to type jsnewenumerateop before calling it.) the behavior depends on the value of enum_op: jsenumerate_init a new, opaque iterator
state should be allocated and stored in *
statep.
...And 3 more matches
Gecko object attributes
please see the aria
states and properties module for more information.
...please see the aria
states and properties module for more information.
...a
state change event for the a11y api's busy
state will be fired on the container object currently marked as busy, once it is no longer busy.
...And 3 more matches
mozIStorageAggregateFunction
note this callback is executed on the thread that the
statement or trigger is executing on.
... if you use mozistorageconnection.executeasync() or, mozistorage
statement.executeasync() this callback will run on a different thread from the rest of your code.
... note this callback is executed on the thread that the
statement or trigger is executing on.
...And 3 more matches
nsIWebProgress
these flags indicate the
state transistions to observe, corresponding to nsiwebprogresslistener.on
statechange().
... constant value description notify_
state_request 0x00000001 only receive the nsiwebprogresslistener.on
statechange() event if the a
stateflags parameter includes nsiwebprogresslistener::
state_is_request.
... notify_
state_document 0x00000002 only receive the nsiwebprogresslistener.on
statechange() event if the a
stateflags parameter includes nsiwebprogresslistener::
state_is_document.
...And 3 more matches
Index - Firefox Developer Tools
dom inspector can serve as a sanity check to verify the
state of the dom, or it can be used to manipulate the dom by hand, if desired.
...it periodically samples the
state of the javascript engine and records the stack for the code executing at the time.
... 113 the firefox javascript debugger debugger, debugging, dev tools, javascript, tools, l10n:priority the javascript debugger enables you to step through javascript code and examine or modify its
state to help track down bugs.
...And 3 more matches
How to create a DOM tree - Web APIs
dynamically creating a dom tree consider the following xml document: <?xml version="1.0"?> <people> <person first-name="eric" middle-initial="h" last-name="jung"> <address street="321 south st" city="denver"
state="co" country="usa"/> <address street="123 main st" city="arlington"
state="ma" country="usa"/> </person> <person first-name="jed" last-name="brown"> <address street="321 north st" city="atlanta"
state="ga" country="usa"/> <address street="123 west st" city="seattle"
state="wa" country="usa"/> <address street="321 south avenue" city="denver"
state="co" country="usa"/> </pers...
...m = doc.createelement("people"); var personelem1 = doc.createelement("person"); personelem1.setattribute("first-name", "eric"); personelem1.setattribute("middle-initial", "h"); personelem1.setattribute("last-name", "jung"); var addresselem1 = doc.createelement("address"); addresselem1.setattribute("street", "321 south st"); addresselem1.setattribute("city", "denver"); addresselem1.setattribute("
state", "co"); addresselem1.setattribute("country", "usa"); personelem1.appendchild(addresselem1); var addresselem2 = doc.createelement("address"); addresselem2.setattribute("street", "123 main st"); addresselem2.setattribute("city", "arlington"); addresselem2.setattribute("
state", "ma"); addresselem2.setattribute("country", "usa"); personelem1.appendchild(addresselem2); var personelem2 = doc.createe...
...lement("person"); personelem2.setattribute("first-name", "jed"); personelem2.setattribute("last-name", "brown"); var addresselem3 = doc.createelement("address"); addresselem3.setattribute("street", "321 north st"); addresselem3.setattribute("city", "atlanta"); addresselem3.setattribute("
state", "ga"); addresselem3.setattribute("country", "usa"); personelem2.appendchild(addresselem3); var addresselem4 = doc.createelement("address"); addresselem4.setattribute("street", "123 west st"); addresselem4.setattribute("city", "seattle"); addresselem4.setattribute("
state", "wa"); addresselem4.setattribute("country", "usa"); personelem2.appendchild(addresselem4); var addresselem5 = doc.createelement("address"); addresselem5.setattribute("street", "321 south avenue"); addresselem5.setattribute("city", "d...
...And 3 more matches
Pointer Lock API - Web APIs
it continues to send events regardless of mouse button
state.
... document.exitpointerlock = document.exitpointerlock || document.mozexitpointerlock; // attempt to unlock document.exitpointerlock(); pointerlockchange event when the pointer lock
state changes—for example, when calling requestpointerlock(), exitpointerlock(), the user pressing the esc key, etc.—the pointerlockchange event is dispatched to the document.
... locked
state when pointer lock is enabled, the standard mouseevent properties clientx, clienty, screenx, and screeny are held constant, as if the mouse is not moving.
...And 3 more matches
Adding captions and subtitles to HTML5 video - Developer guides
as a consequence, the video controls now look as follows: <div id="video-controls" class="controls" data-
state="hidden"> <button id="playpause" type="button" data-
state="play">play/pause</button> <button id="stop" type="button" data-
state="stop">stop</button> <div class="progress"> <progress id="progress" value="0" min="0"> <span id="progress-bar"></span> </progress> </div> <button id="mute" type="button" data-
state="mute">mute/unmute</button> <button id="volinc" typ...
...e="button" data-
state="volup">vol+</button> <button id="voldec" type="button" data-
state="voldown">vol-</button> <button id="fs" type="button" data-
state="go-fullscreen">fullscreen</button> <button id="subtitles" type="button" data-
state="subtitles">cc</button> </div> css changes the video controls have undergone some minor changes in order to make space for the extra button, but these are relatively straightforward.
... no image is used for the captions button, so it is simply styled as: .controls button[data-
state="subtitles"] { height:85%; text-indent:0; font-size:16px; font-size:1rem; font-weight:bold; color:#666; background:#000; border-radius:2px; } there are also other css changes that are specific to some extra javascript implementation, but these will be mentioned at the appropriate place below.
...And 3 more matches
Expressions and operators - JavaScript
'adult' : 'minor'; this
statement assigns the value "adult" to the variable status if age is eighteen or more.
...often two separate
statements can and should be used instead.
...the syntax is: delete object.property; delete object[propertykey]; delete property; // legal only within a with
statement where object is the name of an object, property is an existing property, and propertykey is a string or symbol referring to an existing property.
...And 3 more matches
Working with objects - JavaScript
(note that you may need to wrap the object literal in parentheses if the object appears where a
statement is expected, so as not to have the literal be confused with a block
statement.) object initializers are expressions, and each object initializer results in a new object being created whenever the
statement in which it appears is executed.
... the following
statement creates an object and assigns it to the variable x if and only if the expression cond is true: if (cond) var x = {greeting: 'hi there'}; the following example creates myhonda with three properties.
... now you can create an object called mycar as follows: var mycar = new car('eagle', 'talon tsi', 1993); this
statement creates mycar and assigns it the specified values for its properties.
...And 3 more matches
eval() - JavaScript
syntax eval(string) parameters string a string representing a javascript expression,
statement, or sequence of
statements.
...if the argument represents one or more javascript
statements, eval() evaluates the
statements.
... examples using eval in the following code, both of the
statements containing eval() return 42.
...And 3 more matches
return - JavaScript
the return
statement ends function execution and specifies a value to be returned to the function caller.
... description when a return
statement is used in a function body, the execution of the function is stopped.
... the following return
statements all break the function execution: return; return true; return false; return x; return x + y / 3; automatic semicolon insertion the return
statement is affected by automatic semicolon insertion (asi).
...And 3 more matches
Performance fundamentals - Web Performance
unlike responsiveness and framerate, users don't directly perceive memory usage, but memory usage closely approximates "user
state".
... an ideal system would maintain 100% of user
state at all times: all applications in the system would run simultaneously, and all applications would retain the
state created by the user the last time the user interacted with the application (application
state is stored in computer memory, which is why the approximation is close).
...rather, a well-designed system has been optimized to use as much memory as possible to maintain user
state, while meeting other upp goals.
...And 3 more matches
Progress Listeners - Archive of obsolete content
example create an object which implements nsiwebprogresslistener: const
state_start = ci.nsiwebprogresslistener.
state_start; const
state_stop = ci.nsiwebprogresslistener.
state_stop; var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), on
statechange: function(awebprogress, arequest, aflag, astatus) { // if you use mylistener for more than one tab/window, ...
...use // awebprogress.domwindow to obtain the tab/window which triggers the
state change if (aflag &
state_start) { // this fires when the load event is initiated } if (aflag &
state_stop) { // this fires when the load finishes } }, onlocationchange: function(aprogress, arequest, auri) { // this fires when the location bar changes; that is load event is confirmed // or when the user switches tabs.
... }, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, arequest, astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, a
state) {} } attach the progress listener to a <browser> or a <tabbrowser> element using addprogresslistener, for example for firefox put the following code in a load listener of a main window: gbrowser.addprogresslistener(mylistener); when used with a browser, the second argument is a mask which determines the type of events that will be received.
...And 2 more matches
Session store API - Archive of obsolete content
in order to properly restore your extension's
state when a tab is restored, it needs to use the session store api's settabvalue() method to save any data it will need in order to restore its
state, and then call gettabvalue() to retrieve the previous setting when the tab is restored.
...similarly, it can now restore the user's session while in that
state.
... the session restore process the exact sequence of events that occurs when a session is being restored is: a session
state is about to be restored.
...And 2 more matches
JXON - Archive of obsolete content
if you want a complete bidirectional jxon library (modelled on the json global object), skip to the dedicated paragraph (but please read the note about the const
statement compatibility).
...before implementing it in a working environment, please read the note about the const
statement compatibility.
...eatedocument(snamespaceuri || null, squalifiedname || "", odocumenttype || null); loadobjtree(onewdoc, onewdoc, oobjtree); return onewdoc; }; const svalprop = "keyvalue", sattrprop = "keyattributes", sattrspref = "@", /* you can customize these values */ acache = [], risnull = /^\s*$/, risbool = /^(?:true|false)$/i; })(); note: the current implementation of const (constant
statement) is not part of ecmascript 5.
...And 2 more matches
MMgc - Archive of obsolete content
memory profiler mmgc's memory profiler can display the
state of your application's heap, showing the different classes of object in memory, along with object counts, byte counts, and percentage of total memory.
...thus the queue itself is a perfect way to maintain marking
state between marking increments.
...the problem then becomes: how to account for the fact that the mutator is changing the
state of the heap between marking increments how much time to spend marking in each increment mark consistency a correct collector never deletes a live object (duh).
...And 2 more matches
Mozilla Crypto FAQ - Archive of obsolete content
based on
statements made in various internet forums it appears that the developers of gnu privacy guard may create a plugin module to support invocation of gnupg functionality from mozilla; network associates may also create a commercial pgp plugin for mozilla.
... however, in an advisory opinion issued in reference to the bernstein case, the bureau of export administration (bxa) has
stated the following: "concerning the posting onto a mirror or archive site of already-posted source code, notification is required only for the initial posting." bxa and nsa have already been notified of the posting of encryption-related source code on the mozilla site, and in light of this opinion we have therefore decidednot to ask mirror sites to provide notification themselves.
...for the
statement by the bureau of export administration on notification requirements for mirror sites, see the section "notification requirements" in the bernstein advisory opinion contained in the letter dated february 17, 2000, from james lewis of bxa to cindy cohn, counsel for daniel bernstein.
...And 2 more matches
Splitters - Archive of obsolete content
the syntax of a splitter is as follows: <splitter id="identifier"
state="open" collapse="before" resizebefore="closest" resizeafter="closest"> the attributes are as follows: id the unique identifier of the splitter.
...
state indicates the
state of the splitter.
... collapse this indicates which side of the panel should collapse when the splitter notch (or grippy) is clicked or set into a collapsed
state.
...And 2 more matches
Reference - Archive of obsolete content
alert(function.constructor.constructor) alert(function.constructor.constructor.constructor.constructor) function == object however the following
statement suggests that function is object.
...which still suggests that function is object object.prototype.myfunction = function() {}; o = new function(); alert(o.myfunction); //available in function o = new object(); alert(o.myfunction); //available in object but the following
statement is again quite shocking to all the above if we create a prototype method for function , and create instances of function and object it shows that the method is only available in function.
...while also holding in account the previous example where it was avalable in both instances when prototyping object it should be : function->object->instance or (function=object)->instance and ofcourse function == object return false ;) and the following
statements also tells me that function == object although math is only an instance of object...
...And 2 more matches
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
hover and non-link elements section 5.11.3 of css2 defines the three dynamic pseudo-classes (:hover, :active, and :focus) and then goes on to say: css doesn't define which elements may be in the above
states, or how the
states are entered and left.
... thus, although authors are used to thinking of these
states as applying exclusively to hyperlinks, they are not so restricted by css2.
... any element can, in theory, be in any of the three
states, and thus can be styled based on those
states.
...And 2 more matches
What is accessibility? - Learn web development
note: the world health organization's disability and health fact sheet
states that "over a billion people, about 15% of the world's population, have some form of disability", and "between 110 million and 190 million adults have significant difficulties in functioning." people with visual impairments people with visual impairments include people with blindness, low-level vision, and color blindness.
...that's a large and significant population of users to just miss out on because your site isn't coded properly — almost the same size as the population of the united
states of america.
... the united
states centers for disease control estimate that, as of 2018, 1 in 4 u.s.
...And 2 more matches
Getting started with CSS - Learn web development
styling things based on
state the final type of styling we shall take a look at in this tutorial is the ability to style things based on their
state.
...this has different
states depending on whether it is unvisited, visited, being hovered over, focused via the keyboard, or in the process of being clicked (activated).
... you can use css to target these different
states — the css below styles unvisited links pink and visited links green.
...And 2 more matches
HTML text fundamentals - Learn web development
string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; why do we need semantics?
...string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; ordered ordered lists are lists in which the order of the items does matter—let's take a set of directions as an example: drive to the end...
...string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; active learning: marking up our recipe page so at this point in the article, you have all the information you need to mark up our recipe page...
...And 2 more matches
Video and Audio APIs - Learn web development
on is invoked when the play button is clicked: play.addeventlistener('click', playpausemedia); now to define playpausemedia() — add the following, again at the bottom of your code: function playpausemedia() { if(media.paused) { play.setattribute('data-icon','u'); media.play(); } else { play.setattribute('data-icon','p'); media.pause(); } } here we use an if
statement to check whether the video is paused.
... we use an if
statement to check whether the active class has been set on the rwd button, indicating that it has already been pressed.
... we start off with an if
statement that checks to see whether the current time is less than 3 seconds, i.e., if rewinding by another three seconds would take it back past the start of the video.
...And 2 more matches
Basic math in JavaScript — numbers and operators - Learn web development
operator precedence let's look at the last example from above, assuming that num2 holds the value 50 and num1 holds the value 10 (as originally
stated above): num2 + num1 / 8 + 2; as a human being, you may read this as "50 plus 10 equals 60", then "8 plus 2 equals 10", and finally "60 divided by 10 equals 6".
...we have already used the most basic one, =, loads of times — it simply assigns the variable on the left the value
stated on the right: let x = 3; // x contains the value 3 let y = 4; // y contains the value 4 x = y; // x now contains the same value y contains, 4 but there are some more complex types, which provide useful shortcuts to keep your code neater and more efficient.
... to: display the correct text label on a button depending on whether a feature is turned on or off display a game over message if a game is over or a victory message if the game has been won display the correct seasonal greeting depending what holiday season it is zoom a map in or out depending on what zoom level is selected we'll look at how to code such logic when we look at conditional
statements in a future article.
...And 2 more matches
Solve common problems in your JavaScript code - Learn web development
for example: function myfunction() { alert('this is my function.'); }; this code won't do anything unless you call it with the following
statement: myfunction(); function scope remember that functions have their own scope — you can't access a variable value set inside a function from outside the function, unless you declared the variable globally (i.e.
... running code after a return
statement remember also that when you return from a function, the javascript interpreter exits the function — no code after the return
statement will run.
... in fact, some browsers (like firefox) will give you an error message in the developer console if you have code after a return
statement.
...And 2 more matches
Object building practice - Learn web development
the context is like the paper, and now we want to command our pen to draw something on it: first, we use beginpath() to
state that we want to draw a shape on the paper.
... last of all, we use the fill() method, which basically
states "finish drawing the path we started with beginpath(), and fill the area it takes up with the color we specified earlier in fillstyle." you can start testing your object out already.
... immediately inside the for loop, we use an if
statement to check whether the current ball being looped through is the same ball as the one we are currently checking.
...And 2 more matches
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
we need to wire up the todo.hbs template to the service, so that checking the relevant checkbox changes the
state of each todo.
...ngistrue}} content for the block form of "if" {{/if}} so let's try replacing this part of footer.hbs: <strong>{{this.todos.incomplete.length}}</strong> todos left with the following: <strong>{{this.todos.incomplete.length}}</strong> {{#if this.todos.incomplete.length === 1}} todo {{else}} todos {{/if}} left this will give us an error, however — in ember, these simple if
statements can currently only test for a truthy/falsy value, not a more complex expression such as a comparison.
... to give the todo component access to the service: import component from '@glimmer/component'; import { inject as service } from '@ember/service'; export default class todocomponent extends component { @service('todo-data') todos; } next, go back again to our todo-data.js service file and add the following action just below the previous ones, which will allow us to toggle a completion
state for each todo: @action togglecompletion(todo) { todo.iscompleted = !todo.iscompleted; } updating the template to show completed
state finally, we will edit the todo.hbs template such that the checkbox's value is now bound to the iscompleted property on the todo, and so that on change, the togglecompletion() method on the todo service is invoked.
...And 2 more matches
React resources - Learn web development
react devtools we used console.log() to check on the
state and props of our application in this tutorial, and you'll also have seen some of the useful warnings and error message that react gives you both in the cli and your browser's javascript console.
... it adds a new panel to your browser's developer tools, and with it you can inspect the
state and props of various components, and even edit
state and props to make immediate changes to your application.
...until the arrival of hooks, es6 classes were the only way to bring
state into components or manage rendering side effects.
...And 2 more matches
Vue conditional rendering: editing existing todos - Learn web development
this is similar to how an if
statement works in javascript.
... note the
state of the checkbox after you cancel — not only has the app forgotten the
state of the checkbox, but the done status of that todo item is now out of whack.
... fixing this is fortunately quite easy — we can do this by converting our isdone data item into a computed property — another advantage of computed properties is that they preserve reactivity, meaning (among other things) that their
state is saved when the template changes like ours is now doing.
...And 2 more matches
JSAPI User Guide
what spidermonkey does the javascript engine compiles and executes scripts containing javascript
statements and functions.
...the caller can catch the exception using a javascript try/catch
statement.
...*/ js_reporterror(cx, "command failed with exit code %d", rc); return false; } this is very much like the javascript
statement throw new error("command failed with exit code " + rc);.
...And 2 more matches
History Service Design
performance to ensure performance a bunch of
statements, commonly used when adding or reading visit informations, are created at startup.
... these
statements can be reused avoiding the overhead due to create
statement calls, before closing the connection these
statements need to be finalized though, since not doing that would cause leaking.
... the internal syncing service takes care of initializing places, syncing data to disk and finalize
statements, so usually that's not a problem.
...And 2 more matches
An Overview of XPCOM
the example in encapsulating the constructor is a simple and
stateless version of factories, but real world programming isn't usually so simple, and in general factories need to store
state.
...when the factory preserves
state, you can ask if there are outstanding references and find out if the factory created any objects.
... another
state that a factory can save is whether or not an object is a singleton.
...And 2 more matches
nsIAccessibleRetrieval
getcachedaccessnode(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsidomnode getrelevantcontentnodefor(in nsidomnode anode); astring getstringeventtype(in unsigned long aeventtype); astring getstringrelationtype(in unsigned long arelationtype); astring getstringrole(in unsigned long arole); nsidomdomstringlist getstring
states(in unsigned long a
states, in unsigned long aextra
states); methods getaccessiblefor() return an nsiaccessible for a dom node in pres shell 0.
...getstring
states() returns a list which contains accessible
states as strings.
... nsidomdomstringlist getstring
states( in unsigned long a
states, in unsigned long aextra
states ); parameters a
states accessible
states.
...And 2 more matches
nsIAppShell
ptr aevent); obsolete since gecko 1.9 void exit(); void favorperformancehint(in boolean favorperfoverstarvation, in unsigned long starvationdelay); void getnativeevent(in prboolref arealevent, in voidptrref aevent); obsolete since gecko 1.9 void listentoeventqueue(in nsieventqueue aqueue, in prbool alisten); obsolete since gecko 1.9 void resumenative(); void run(); void runinstable
state(in nsirunnable arunnable); void spindown(); obsolete since gecko 1.9 void spinup(); obsolete since gecko 1.9 void suspendnative(); attributes attribute type description eventloopnestinglevel unsigned long the current event loop nesting level.
...runinstable
state() allows running of a "synchronous section", in the form of an nsirunnable once the event loop has reached a "stable
state".
... a stable
state is reached when the currently executing task/event has finished, (see: webappapis.html#synchronous-section).
...And 2 more matches
nsICommandLine
state unsigned long the type of command line being processed.
... see
state constants.
... constants
state constants constant value description
state_initial_launch 0 the first launch of the application instance.
...And 2 more matches
nsIDOMChromeWindow
title domstring obsolete since gecko 1.9.1 window
state unsigned short returns current window
state, the value is one of
state_* constants.
... constants constant value description
state_maximized 1 the window is maximized.
...
state_minimized 2 the window is minimized.
...And 2 more matches
nsIDOMNSHTMLDocument
id, in boolean doshowui, in domstring value); boolean execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); boolean querycommand
state(in domstring commandid); boolean querycommandsupported(in domstring commandid); domstring querycommandtext(in domstring commandid); obsolete since gecko 14.0 domstring querycommandvalue(in domstring commandid); void releaseevents(in long eventflags); void routeevent(in nsidomevent evt); void write(); obsolete since gecko 2.0 void writ...
... return value for
stateful commands, returns true if the command is in an indeterminate
state, false otherwise.
... for instance, if there is a selection and part of the selected text is bold, then then bold command is in an indeterminate
state.
...And 2 more matches
nsIMsgDBView
ter acommandupdater); void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); void docommand(in nsmsgviewcommandtypevalue command); void docommandwithfolder(in nsmsgviewcommandtypevalue command, in nsimsgfolder destfolder); void getcommandstatus(in nsmsgviewcommandtypevalue command, out boolean selectable_p, out nsmsgviewcommandcheck
statevalue selected_p); void viewnavigate(in nsmsgnavigationtypevalue motion, out nsmsgkey resultid, out nsmsgviewindex resultindex, out nsmsgviewindex threadindex, in boolean wrap); boolean navigatestatus(in nsmsgnavigationtypevalue motion); nsmsgkey getkeyat(in nsmsgviewindex index); nsimsgdbhdr getmsghdrat(in nsmsgviewindex index); nsimsgfolder getfolderf...
... void getcommandstatus(in nsmsgviewcommandtypevalue command, out boolean selectable_p, out nsmsgviewcommandcheck
statevalue selected_p); parameters command the nsmsgviewcommandtypevalue to perform.
... return values selectable_p the
state of the command.
...And 2 more matches
nsINavHistoryContainerResultNode
state unsigned short the current
state of the container.
... this is one of the
state constants.
... constants
state constants constant value description
state_closed 0 the container is closed.
...And 2 more matches
nsITransaction
inherits from: nsisupports last changed in gecko 1.7 method overview void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type description istransient boolean the transaction's transient
state.
...if the transient
state is false, a reference to the transaction is held by the transaction manager so that the transactions' undotransaction() and redotransaction() methods can be called.
... if the transient
state is true, the transaction manager returns immediately after the transaction's dotransaction() method is called, no references to the transaction are maintained.
...And 2 more matches
nsITreeView
iononcell(in wstring action, in long row, in nsitreecolumn col); void performactiononrow(in wstring action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in astring value); void setcellvalue(in long row, in nsitreecolumn col, in astring value); void settree(in nsitreeboxobject tree); void toggleopen
state(in long index); attributes attribute type description rowcount long the total number of rows in the tree (including the offscreen rows).
... note: nsitreeview implementations must be prepared to handle a call to toggleopen
state for any row index which returns true for a call to iscontainer, even if iscontainerempty returns true.
... toggleopen
state() called on the view when an item is opened or closed, e.g., by clicking the twisty, keyboard access, et cetera.
...And 2 more matches
Performance
when you execute a sql
statement in isolation, an implicit transaction is created around that
statement.
...queries careful reordering of the sql
statement, or creating the proper indices, can often improve performance.
... see the sqlite optimizer overview on the sqlite web site for information on how sqlite uses indices and executes
statements.
...And 2 more matches
CanvasRenderingContext2D.restore() - Web APIs
the canvasrenderingcontext2d.restore() method of the canvas 2d api restores the most recently saved canvas
state by popping the top entry in the drawing
state stack.
... if there is no saved
state, this method does nothing.
... fore more information about the drawing
state, see canvasrenderingcontext2d.save().
...And 2 more matches
Constraint validation API - Web APIs
constraint validation interfaces validity
state the validity
state interface represents the validity
states that a form control element can have, with respect to its defined constraints.
...api extends the interfaces for the form-associated elements listed below with a number of new properties and methods (elements that can have a form attribute that indicates their form owner): htmlbuttonelement htmlfieldsetelement htmlinputelement htmlobjectelement htmloutputelement htmlselectelement htmltextareaelement properties validity a read-only property that returns a validity
state object, whose properties represent validation errors for the value of that element.
... setcustomvalidity(message) sets a custom error message string to be shown to the user upon submitting the form, explaining why the value is not valid — when a message is set, the validity
state is set to invalid.
...And 2 more matches
Key Values - Web APIs
pauses the current application or
state, if applicable.
...this saves the
state of the computer to disk and then shuts down; the computer can be returned to its previous
state by restoring the saved
state information.
... appcommand_bass_down "audiobassboostdown" reduces bass boosting or cycles downward through bass boost modes or
states.
...And 2 more matches
MSManipulationEvent.initMSManipulationEvent() - Web APIs
syntax msmanipulationevent.initmsmanipulationevent(typearg, canbubblearg, cancelablearg, viewarg, detailarg, last
state, current
state); parameters typearg [in] type: domstring the type of the event being created.
... last
state [in] type: integer indicates the last
state of the manipulation event.
... current
state [in] type: integer indicates the current
state of the manipulation event.
...And 2 more matches
MSManipulationEvent - Web APIs
events msmanipulation
statechanged: event fires when the
state of an element being manipulated has changed.
... properties property description current
stateread only returns the current
state of a manipulation event.
... last
stateread only returns the last
state after a manipulation change event.
...And 2 more matches
MediaRecorder.resume() - Web APIs
when the resume() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.
state is "inactive", raise a dom invalid
state error and terminate these steps.
... if mediarecorder.
state is not "inactive", continue to the next step.
... set mediarecorder.
state to "recording".
...And 2 more matches
PermissionStatus - Web APIs
the permissionstatus interface of the permissions api provides the
state of an object and an event handler for monitoring changes to said
state.
... properties permissionstatus.
state read only returns the
state of a requested permission; one of 'granted', 'denied', or 'prompt'.
... permissionstatus.statusread only returns the
state of a requested permission; one of 'granted', 'denied', or 'prompt'.
...And 2 more matches
RTCDtlsTransport - Web APIs
><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcdtlstransport</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesicetransport read only the read-only rtcdtlstransport property icetransport contains a reference to the underlying rtcicetransport.
state read only the
state read-only property of the rtcdtlstransport interface provides information which describes a datagram transport layer security (dtls) transport
state.methodsthis interface has no methods.
... examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various
states.
... the function returns an object containing properties whose values indicate how many of the senders are in each
state.
...And 2 more matches
ServiceWorker - Web APIs
a serviceworker object has an associated serviceworker.
state, related to its lifecycle.
... serviceworker.
state read only returns the
state of the service worker.
... event handlers serviceworker.on
statechange read only an eventlistener property called whenever an event of type
statechange is fired; it is basically fired anytime the serviceworker.
state changes.
...And 2 more matches
ServiceWorkerRegistration - Web APIs
serviceworkerregistration.installing read only returns a service worker whose
state is installing.
... serviceworkerregistration.waiting read only returns a service worker whose
state is installed.
... serviceworkerregistration.active read only returns a service worker whose
state is activated.
...And 2 more matches
A simple RTCDataChannel sample - Web APIs
once this is done, our handlereceivemessage() method will be called each time data is received by the remote peer, and the handlereceivechannelstatuschange() method will be called any time the channel's connection
state changes, so we can react when the channel is fully opened and when it's closed.
... when the local peer experiences an open or close event, the handlesendchannelstatuschange() method is called: function handlesendchannelstatuschange(event) { if (sendchannel) { var
state = sendchannel.ready
state; if (
state === "open") { messageinputbox.disabled = false; messageinputbox.focus(); sendbutton.disabled = false; disconnectbutton.disabled = false; connectbutton.disabled = true; } else { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; } ...
...} } if the channel's
state has changed to "open", that indicates that we have finished establishing the link between the two peers.
...And 2 more matches
WebRTC Statistics API - Web APIs
rtciceserverstats rtcstats inbound-rtp statistics describing the
state of one of the connection's inbound data streams.
... rtcaudiosourcestats or rtcvideosourcestats rtcmediasourcestats rtcstats rtcaudiosourcestats or rtcvideosourcestats outbound-rtp statistics describing the
state of one of the outbound data streams on this connection.
... rtcoutboundrtpstreamstats rtcsentrtpstreamstats rtcrtpstreamstats rtcstats peer-connection statistics describing the
state of the rtcpeerconnection.
...And 2 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
fortunately, physicists like galileo, newton, lorentz, and einstein have given us the principle of relativity, which
states that the laws of physics have the same form in every frame of reference.
... but the location isn't enough to describe an object in 3d space because an object's
state in space isn't only about its location, but about its rotation or facing direction, otherwise known as its orientation.
...lback a fairly basic (but typical) callback for rendering frames might look like this: function myanimationframecallback(time, frame) { let adjustedrefspace = applypositionoffsets(xrreferencespace); let pose = frame.getviewerpose(adjustedrefspace); animationframerequestid = frame.session.requestanimationframe(myanimationframecallback); if (pose) { let gllayer = frame.session.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); checkglerror("binding the framebuffer"); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); checkglerror("clearing the framebuffer"); const deltatime = (time - lastframetime) * 0.001; lastframetime = time; for (let view of pose.views) { ...
...And 2 more matches
Web Audio API best practices - Web APIs
when you create an audio context (either offline or online) it is created with a
state, which can be suspended, running, or closed.
... when working with an audiocontext, if you create the audio context from inside a click event the
state should automatically be set to running.
... here is a simple example of creating the context from inside a click event: const button = document.queryselector('button'); button.addeventlistener('click', function() { const audioctx = new audiocontext(); }, false); if however, you create the context outside of a user gesture, its
state will be set to suspended and it will need to be started after user interaction.
...And 2 more matches
Synchronous and asynchronous requests - Web APIs
var xhr = new xmlhttprequest(); xhr.open("get", "/bar/foo.txt", true); xhr.onload = function (e) { if (xhr.ready
state === 4) { if (xhr.status === 200) { console.log(xhr.responsetext); } else { console.error(xhr.statustext); } } }; xhr.onerror = function (e) { console.error(xhr.statustext); }; xhr.send(null); line 2 specifies true for its third parameter to indicate that the request should be handled asynchronously.
...this handler looks at the request's ready
state to see if the transaction is complete in line 4; if it is, and the http status is 200, the handler dumps the received content.
...the callback routine is called whenever the
state of the request changes.
...And 2 more matches
ARIA: row role - Accessibility
if the interaction provides for the selection
state of individual cells, if left to right and top to botton navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, use grid or treegrid instead.
... associated wai-aria roles,
states, and properties context roles role="rowgroup" an optional contextual row parent, it establishes a relationship between descendant rows.
...
states and properties aria-expanded
state the aria-expanded attribute, which defines the
state of the row, can take one of three values, or be omitted: aria-expanded="true: row is currently expanded.
...And 2 more matches
HTML To MSAA - Accessibility
map html element role name value
states relations actions events notes a role_system_ link n/a value of @href attribute
state_system_ selectable if @name attribute is presented
state_system_ linked if @href attribute is presented or click event listener is registered
state_system_ traversed if link is traversed n/a "jump" if @href is valid n/a br role_system_ whitespace '\n' (new line char)
state_system_ readonly n/a n/a n...
.../a button role_system_ pushbutton from child nodes n/a
state_system_ focusable
state_system_ default if @type attribute has value "submit" n/a "press" n/a caption bstr role n/a n/a n/a description_for (0x100f), points to table element div bstr role n/a n/a n/a n/a n/a n/a fieldset role_system_ grouping text equivalent from child legend element n/a n/a labelled_by (1003), points to legend element n/a n/a hr role_system_ separator n/a n/a n/a n/a n/a n/a img, input @type=image role_system_ graphic from @alt attribute, empty @alt attribute means name can't be calculated at all n/a
state_system_ animated if image has more than one frame n/a "showlongdesc" if @longdesc attribute is presented n/a if @usemap attribute is used then image accessible has children for each ...
...map item input @type=button, submit, reset role_system_ pushbutton from @value attribute, @alt attribute, default label, @src attribute, @data attribute n/a
state_system_ default if @type attribute has value "submit" n/a "press" n/a input @type=text, textarea role_system_ text n/a value property of input dom element
state_system_ readonly if @readonly attribute is used n/a "activate" n/a input @type=password role_system_ text n/a n/a
state_system_ readonly if @readonly attribute is used
state_system_ protected n/a "activate" n/a input type="checkbox" role_system_ checkbutton n/a n/a
state_system_ marqueed used as
state checkable
state_system_ mixed for html 5 if intermediate property of dom element returns true
state_system_ checked if checked property of dom element returns t...
...And 2 more matches
At-rules - CSS: Cascading Style Sheets
at-rules are css
statements that instructs css how to behave.
... nested at-rules — a subset of nested
statements, which can be used as a
statement of a style sheet as well as inside of conditional group rules: @media — a conditional group rule that will apply its content if the device meets the criteria of the condition defined using a media query.
...these
statements share a common syntax and each of them can include nested
statements—either rulesets or nested at-rules.
...And 2 more matches
Introducing the CSS Cascade - CSS: Cascading Style Sheets
to simplify the development process, web developers often use a css reset style sheet, forcing common properties values to a known
state before beginning to make alterations to suit their specific needs.
... resetting styles after your content has finished altering styles, it may find itself in a situation where it needs to restore them to a known
state.
...the css property all lets you quickly set (almost) everything in css back to a known
state.
...And 2 more matches
Using media queries - CSS: Cascading Style Sheets
to test and monitor media
states using the window.matchmedia() and mediaquerylist.addlistener() javascript methods.
...thus, if any of the queries in a list is true, the entire media
statement returns true.
...} testing for multiple queries you can use a comma-separated list to apply styles when the user's device matches any one of various media types, features, or
states.
...And 2 more matches
<easing-function> - CSS: Cascading Style Sheets
for these values, 0.0 represents the initial
state, and 1.0 represents the final
state.
...this causes the animation to go farther than the final
state, and then return.
...p0 is (0, 0) and represents the initial time and the initial
state, p3 is (1, 1) and represents the final time and the final
state.
...And 2 more matches
<menu> - HTML: Hypertext Markup Language
permitted content if the element is in the list menu
state: flow content, or alternatively, zero or more occurrences of <li>, <script>, and <template>.
... (list menu is the default
state, unless the parent element is a <menu> in the context menu
state.) if the element is in the context menu
state: zero or more occurrences, in any order, of <menu> (context menu
state only), <menuitem>, <hr>, <script>, and <template>.
...must only be specified when the parent element is a <menu> in the context menu
state.
...And 2 more matches
An overview of HTTP - HTTP
http is
stateless, but not sessionless http is
stateless: there is no link between two requests being successively carried out on the same connection.
...but while the core of http itself is
stateless, http cookies allow the use of
stateful sessions.
... using header extensibility, http cookies are added to the workflow, allowing session creation on each http request to share the same context, or the same
state.
...And 2 more matches
SyntaxError: return not in function - JavaScript
the javascript exception "return (or yield) not in function" occurs when a return or yield
statement is called outside of a function.
... message syntaxerror: 'return'
statement outside of function (edge) syntaxerror: return not in function (firefox) syntaxerror: yield not in function (firefox) error type syntaxerror.
... a return or yield
statement is called outside of a function.
...And 2 more matches
async function expression - JavaScript
you can also define async functions using an async function
statement.
... syntax async function [name]([param1[, param2[, ..., paramn]]]) {
statements } as of es2015, you can also use arrow functions.
...
statements the
statements which comprise the body of the function.
...And 2 more matches
debugger - JavaScript
the debugger
statement invokes any available debugging functionality, such as setting a breakpoint.
... if no debugging functionality is available, this
statement has no effect.
... syntax debugger; examples using the debugger
statement the following example shows code where a debugger
statement has been inserted, to invoke a debugger (if one exists) when the function is called.
...And 2 more matches
for await...of - JavaScript
the for await...of
statement creates a loop iterating over async iterable objects as well as on sync iterables, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined async/sync iterables.
... it invokes a custom iteration hook with
statements to be executed for the value of each distinct property of the object.
... like the await operator, the
statement can only be used inside an async function.
...And 2 more matches
function* - JavaScript
param]]]) {
statements } name the function name.
...
statements the
statements comprising the body of the function.
... a return
statement in a generator, when executed, will make the generator finish (i.e.
...And 2 more matches
function declaration - JavaScript
the function declaration (function
statement) defines a function with the specified parameters.
... syntax function name([param[, param,[..., param]]]) { [
statements] } name the function name.
...
statements optional the
statements which comprise the body of the function.
...And 2 more matches
let - JavaScript
the let
statement declares a block-scoped local variable, optionally initializing it to a value.
... description let allows you to declare variables that are limited to the scope of a block
statement, or expression on which it is used, unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.
...} you may encounter errors in switch
statements because there is only one block.
...And 2 more matches
Understanding WebAssembly text format - WebAssembly
like in an es2015 module, wasm functions must be explicitly exported by an export
statement inside the module.
... in this example you’ll notice an (export "getanswerplus1") section, declared just after the func
statement in the second function — this is a shorthand way of declaring that we want to export this function, and defining the name we want to export it as.
... this is functionally equivalent to including a separate function
statement outside the function, elsewhere in the module in the same manner as we did before, e.g.: (export "getanswerplus1" (func $functionname)) the javascript code to call our above module looks like so: webassembly.instantiatestreaming(fetch('call.wasm')) .then(obj => { console.log(obj.instance.exports.getanswerplus1()); // "43" }); importing functions from javascript we have already seen javascript calling webassembly functions, but what about webassembly calling javascript functions?
...And 2 more matches
panel - Archive of obsolete content
n/toggle'); var sdkpanels = require("sdk/panel"); var self = require("sdk/self"); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onchange: handlechange }); var mypanel = sdkpanels.panel({ contenturl: self.data.url("panel.html"), onhide: handlehide }); function handlechange(
state) { if (
state.checked) { mypanel.show({ position: button }); } } function handlehide() { button.
state('window', {checked: false}); } updating panel content you can update the panel's content by: sending a message to a content script that updates the dom in the same document.
...however, doing this will cause any content scripts to be unloaded and then reloaded, so it may be less efficient, and you'll lose any
state associated with the scripts.
...function handleclick(
state) { textentrypanel.show(); } // when the panel is displayed it generated an event called // "show": we will listen for that event and when it happens, // send our own "show" event to the panel's script, so the // script can prepare the panel for display.
...function handleclick(
state) { textentrypanel.show(); } // when the panel is displayed it generated an event called // "show": we will listen for that event and when it happens, // send our own "show" event to the panel's script, so the // script can prepare the panel for display.
/loader - Archive of obsolete content
s // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', // resolve all other non-relative module requirements as follows: // devtools/gcli -> resource:///modules/devtools/gcli.js // panel -> resource:///modules/panel.js '': 'resource:///modules/', } }) all relative url require()
statements (those that start with ".") are first resolved relative to the requirer module id and the result of it is then resolved using the paths option.
...while reuse may sound like a compelling idea it comes with the side effect of shared
state, which can cause problems.
...this alternative approach of providing capabilities via modules makes it possible to build module capability graphs by analyzing require
statements.
...for example the sdk uses this feature during test execution to create an identical environment with a different
state to test how specific modules handle unloads.
Adding a Button to the Toolbar - Archive of obsolete content
le called "index.js" in the root of your addon directory and add the following code to it: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(
state) { tabs.open("https://www.mozilla.org/"); } now run the add-on with jpm run.
...you can change the icon, and the other
state attributes, either globally, for a specific window, or for a specific tab.
... read more about updating
state.
...with the toolbar api you get a complete horizontal strip of user interface real e
state.
Forms related code snippets - Archive of obsolete content
date picker (before implementing it in a working environment, please read the note about the const
statement compatibility) <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later.
...cell:hover { background-color: #999999; cursor: pointer; } td.zdp-empty-cell { cursor: not-allowed; } </style> </head> <body> <form name="myform"> <p> from: <input type="text" readonly class="date-picker" name="date-from" /> to: <input type="text" readonly class="date-picker" name="date-to" /> </p> </form> </body> </html> note: the current implementation of const (constant
statement) is not part of ecmascript 5.
...similar to variables declared with the let
statement, constants declared with const will be block-scoped.
...if you want a full browser compatibility of this library, please replace all the const
statements with the var
statements.
jspage - Archive of obsolete content
{if(c[a]){c[a].keys.each(function(e){this.addevent(a,e);},this);}}return this;}});element.nativeevents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,dommousescroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,domcontentloaded:1,ready
statechange:1,error:1,abort:1,scroll:1}; (function(){var a=function(b){var c=b.relatedtarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.haschild(c)); };element.events=new hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(browser.engine.gecko)?"dommousescroll":"mousewhe...
...");document.fireevent("domready");};window.addevent("load",b);if(browser.engine.trident){var a=document.createelement("div"); (function(){($try(function(){a.doscroll();return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})(); }else{if(browser.engine.webkit&&browser.engine.version<525){(function(){(["loaded","complete"].contains(document.ready
state))?b():arguments.callee.delay(50); })();}else{document.addevent("domcontentloaded",b);}}})();var json=new hash(this.json&&{stringify:json.stringify,parse:json.parse}).extend({$specialchars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replacechars:function(a){return json.$specialchars[a]||"\\u00"+math.floor(a.charcodeat()/16).tostring(16)+(a.charcodeat()%16).tostr...
...ipt, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",issuccess:null,emulation:true,urlencoded:true,encoding:"utf-8",evalscripts:false,evalresponse:false,nocache:false},initialize:function(a){this.xhr=new browser.request(); this.setoptions(a);this.options.issuccess=this.options.issuccess||this.issuccess;this.headers=new hash(this.options.headers);},on
statechange:function(){if(this.xhr.ready
state!=4||!this.running){return; }this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onready
statechange=$empty;if(this.options.issuccess.call(this,this.status)){this.response={text:this.xhr.responsetext,xml:this.xhr.responsexml}; this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:...
...ncoding)?"; charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-form-urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime();g=(g)?f+"&"+g:f; }var e=b.lastindexof("/");if(e>-1&&(e=b.indexof("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.touppercase(),b,this.options.async); this.xhr.onready
statechange=this.on
statechange.bind(this);this.headers.each(function(m,l){try{this.xhr.setrequestheader(l,m);}catch(n){this.fireevent("exception",[l,m]); }},this);this.fireevent("request");this.xhr.send(g);if(!this.options.async){this.on
statechange();}return this;},cancel:function(){if(!this.running){return this; }this.running=false;this.xhr.abort();this.xhr.onready
statechange=$empty;this.xhr=new brows...
Introduction to XUL - Archive of obsolete content
widgets are pieces of the application largely self-contained, generally corresponding to a rectangle of window real e
state.
... xul file preamble xul is xml, and a good xul file begins with the standard xml version and doctype
statements.
...broadcaster nodes are declared as <broadcaster> elements in the xul description, and are involved with the communication of changes of
state between widgets.
... broadcasters can broadcast any change of
state, which can be tied to the value of any attribute in another xul widget.
Broadcasters and Observers - Archive of obsolete content
« previousnext » there may be times when you want several elements to respond to events or changes of
state easily.
...they work the same as commands except that a command is used for actions, while a broadcaster is instead used for holding
state information.
... making elements observers elements that are watching the broadcaster are called observers because they observe the
state of the broadcaster.
...use commands for actions and use broadcasters for
state.
menuitem - Archive of obsolete content
autocheck type: boolean if this attribute is true or left out, the checked
state of the button will be switched each time the button is pressed.
... if this attribute is false, the checked
state must be adjusted manually.
...do menuitem.setattribute("checked", "false") instead of menuitem.removeattribute("checked")) when the user unchecks the menuitem, as a value of false will both correctly hide the checkmark and persist its hidden
state.
... visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
menupopup - Archive of obsolete content
attributes ignorekeys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top properties accessibletype, anchornode, popupboxobject, position,
state, triggernode methods hidepopup, moveto, openpopup, openpopupatscreen, setconsumerollupevent, showpopup, sizeto examples the following example shows how a menupopup may be attached to a menulist.
...
state type: string this read only property indicates whether the popup is open or not.
...this
state will occur during the popupshowing event.
...this
state will occur during the popuphiding event.
panel - Archive of obsolete content
attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype, label, popupboxobject, popup,
state methods hidepopup, moveto, openpopup, openpopupatscreen, sizeto examples the following example shows how a panel may be attached to a label.
...
state type: string this read only property indicates whether the popup is open or not.
...this
state will occur during the popupshowing event.
...this
state will occur during the popuphiding event.
splitter - Archive of obsolete content
attributes collapse, resizeafter, resizebefore,
state, sub
state style classes tree-splitter examples <!-- this bar has some styling associated with it.
...
state type: one of the values below indicates whether the splitter has collapsed content or not.
... this attribute will be updated automatically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each
state.
... sub
state type: one of the values below on splitters which have
state="collapsed" and collapse="both", determines which direction the splitter is actually collapsed in.
tooltip - Archive of obsolete content
attributes crop, default, label, noautohide, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, page, position properties accessibletype, label, popupboxobject, position,
state methods hidepopup, moveto, openpopup, openpopupatscreen, showpopup, sizeto examples <tooltip id="moretip" orient="vertical" style="background-color: #33dd00;"> <label value="click here to see more information"/> <label value="really!" style="color: red;"/> </tooltip> <vbox> <button label="simple" tooltiptext="a simple popup"/> <button label="more" tooltip="moretip"/> </vbox...
...
state type: string this read only property indicates whether the popup is open or not.
...this
state will occur during the popupshowing event.
...this
state will occur during the popuphiding event.
tree - Archive of obsolete content
attributes disablekeynavigation, disabled, editable, enablecolumndrag, flags, hidecolumnpicker, onselect, rows, seltype,
statedatasource, tabindex, treelines properties accessibletype, builderview, columns, contentview, currentindex, disablekeynavigation, disabled, editingcolumn, editingrow, enablecolumndrag, firstordinalcolumn, inputfield, seltype, selstyle, tabindex, treeboxobject, view examples a tree with several columns <tree flex="1" rows="2"> <treecols> <treecol id="sender" label="sender" flex="1"/...
... visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
...
statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree
state information.
...if you do not specify this attribute,
state information will be stored in the local store (rdf:local-store).
2006-09-29 - Archive of obsolete content
details can be located at layout confusion refactoring the nshtmlreflow
state(computeblockboxdata, initconstraints) and nsimageframe::getdesiredsize which uses ns_inrinsicsize, into the following method: /** * compute the size that a frame will occupy.
... called while * constructing the nshtmlreflow
state to be used to reflow the frame, * in order to fill its mcomputedwidth and mcomputedheight member * variables.
... */ virtual nssize computesize(nscoord aavailwidth, nscoord amargin, nscoord aborder, nscoord apadding, prbool ashrinkwrap) = 0; details can be located at refactoring some of nshtmlreflow
state.
...on the reflow branch, check the dirty and dirty_children frame
state flags.
Introduction to SSL - Archive of obsolete content
government restrictions on products that support anything stronger than 40-bit encryption, disabling support for all 40-bit ciphers effectively restricts access to network browsers that are available only in the united
states (unless the server involved has a special global server id that permits the international client to "step up" to stronger encryption).
...cipher suites supported by the ssl protocol that use the rsa key-exchange algorithm strength category and recommended use cipher suites strongest cipher suite permitted for deployments within the united
states only.
... strong cipher suites permitted for deployments within the united
states only.
...cipher suites supported by red hat when using fortezza for ssl 3.0 strength category and recommended use cipher suites strong fortezza cipher suites permitted for deployments within the united
states only.
@cc_on - Archive of obsolete content
the @cc_on
statement activates conditional compilation support within comments in a script.
... syntax @cc_on remarks the @cc_on
statement activates conditional compilation within comments in a script.
... it is strongly recommended that you use the @cc_on
statement in a comment, so that browsers that do not support conditional compilation will accept your script as valid syntax: an @if or @set
statement outside of a comment also activates conditional compilation.
... example the following example illustrates the use of the @cc_on
statement.
@if - Archive of obsolete content
the @if
statement conditionally executes a group of
statements, depending on the value of an expression.
... remarks when you write an @if
statement, you do not have to place each clause on a separate line.
... the @if
statement is typically used to determine which text among several options should be used for text output.
... example the following example illustrates the use of the @if...@elif...@else...@end
statement.
@set - Archive of obsolete content
the @set
statement creates variables used with conditional compilation
statements.
...variables created using @set are generally used in conditional compilation
statements, but can be used anywhere in javascript code.
...nan can be checked for using the @if
statement: @if (@newvar != @newvar) ...
... see also conditional compilation conditional compilation variables @cc_on
statement @if
statement ...
Archived JavaScript Reference - Archive of obsolete content
this operation leaves oldbuffer in a detached
state.date.prototype.tolocaleformat()the non-standard tolocaleformat() method converts a date to a string using the specified formatting.
...see also the newer version of date.prototype.tolocaledatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in
statement iterates a specified variable over all values of object's properties.
... for each distinct property, a specified
statement is executed.function.aritynot part of any standard.function.prototype.isgenerator()the non-standard isgenerator() method used to determine whether or not a function is a generator.
...do not use it!handler.enumerate()the handler.enumerate() method used to be a trap for for...in
statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers.legacy generator functionthe legacy generator function
statement declares legacy generator functions with the specified parameters.legacy generator function expressionthe function keyword can be used to define a legacy generator function inside an expression.
Implementing game control mechanisms - Game development
setting up the environment let's start with a quick overview of the game's folder structure, javascript files and in-game
states, so we know what's happening where.
...the src folder contains the javascript files split as a separate
states — boot.js, preloader.js, mainmenu.js and game.js — these are loaded into the index file in this exact order.
... every
state has its own default methods: preload(), create(), and update().
... the first one is needed for preloading required assets, create() is executed once the
state had started, and update() is executed on every frame.
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
an http method is safe if it doesn't alter the
state of the server.
... even if safe methods have a read-only semantic, servers can alter their
state: e.g.
...in particular, an application should not allow get requests to alter its
state.
... a call to a safe method, not changing the
state for the server: get /pagex.html http/1.1 a call to a non-safe method, that may change the
state of the server: post /pagex.html http/1.1 a call to an idempotent but non-safe method: delete /idx/delete http/1.1 learn more general knowledge definition of safe in the http specification.
Practical positioning examples - Learn web development
add the following css: .info-box li { float: left; list-style-type: none; width: 150px; } .info-box li a { display: inline-block; text-decoration: none; width: 100%; line-height: 3; background-color: red; color: black; text-align: center; } finally for this section we'll set some styles on the link
states.
... first, we'll set the :focus and :hover
states of the tabs to look different when they are focused/hovered, providing users with some visual feedback.
...transitions are an interesting feature that allow you to make changes between
states happen smoothly, rather than just going "on", "off" abruptly.
... setting the checked
state there is one final bit of css to add — put the following at the bottom of your css: input[type=checkbox]:checked + aside { right: 0px; } the selector is pretty complex here — we are selecting the <aside> element adjacent to the <input> element, but only when it is checked (note the use of the :checked pseudo-class to achieve this).
Advanced form styling - Learn web development
let's start by unstyling the original check boxes: input[type="checkbox"] { -webkit-appearance: none; appearance: none; } we can use the :checked and :disabled pseudo-classes to change the appearance of our custom checkbox as its
state changes: input[type="checkbox"] { position: relative; width: 1em; height: 1em; border: 1px solid gray; /* adjusts the position of the checkboxes on the text baseline */ vertical-align: -2px; /* set here so that windows' high-contrast mode can override */ color: green; } input[type="checkbox"]::before { content: "✔"; position: absolute; font-size: 1.2em; right: -1px; ...
..."checkbox"]:checked::before { /* use `visibility` instead of `display` to avoid recalculating layout */ visibility: visible; } input[type="checkbox"]:disabled { border-color: black; background: #ddd; color: gray; } you'll find more out about such pseudo-classes and more in the next article; the above ones do the following: :checked — the checkbox (or radio button) is in a checked
state — the user has clicked/activated it.
... :disabled — the checkbox (or radio button) is in a disabled
state — it cannot be interacted with.
... in the next article of this module, we will explore the different ui pseudo-classes available to us in modern browsers for styling forms in different
states.
Example 1 - Learn web development
basic
state html <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* --------...
... background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } result for basic
state active
state html <div class="select active"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { posit...
... background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } result for active
state open
state html <div class="select active"> <span class="value">cherry</span> <ul class="optlist"> <li class="option highlight">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { posi...
...der: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #fff; } result for open
state ...
Getting started with HTML - Learn web development
string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; nesting elements elements can be placed within other elements.
...if we wanted to
state that our cat is very grumpy, we could wrap the word very in a <strong> element, which means that the word is to have strong(er) text formatting: <p>my cat is <strong>very</strong> grumpy.</p> there is a right and wrong way to do nesting.
...string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; boolean attributes sometimes you will see attributes written without values.
...string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; whitespace in html in the examples above, you may have noticed that a lot of whitespace is included in the code.
Client-side storage - Learn web development
however, this does not mean cookies are completely useless on the modern-day web — they are still used commonly to store data related to user personalization and
state, e.g.
...this
state will also persist across page/browser reloads, because the name is stored in web storage.
... name in web storage localstorage.setitem('name', nameinput.value); // run namedisplaycheck() to sort out displaying the // personalized greetings and updating the form display namedisplaycheck(); }); at this point we also need an event handler to run a function when the "forget" button is clicked — this is only displayed after the "say hello" button has been clicked (the two form
states toggle back and forth).
... deleting a note as
stated above, when a note's delete button is pressed, the note is deleted.
Drawing graphics - Learn web development
one of the basic trigonometric formulae
states that the length of the adjacent multiplied by the tangent of the angle is equal to the opposite, hence we come up with 50 * math.tan(degtorad(60)).
... save
state (if necessary) using save() — this is needed when you want to save settings you've updated on the canvas before continuing, which is useful for more advanced applications.
...else
statement to check whether the sprite value is at 5 (the last sprite, given that the sprite numbers run from 0 to 5).
...else
statement to see if the value of posx has become greater than width/2, which means our character has walked off the right edge of the screen.
Ember resources and troubleshooting - Learn web development
see also: reactiveconf 2017: secrets of the glimmer vm what is the
state of the mut helper?
... handle loading and error
states from the minimally required data.
... both loading and error can render default templates as well as customized templates defined elsewhere in the application, unifying loading/error
states.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creat...
Adding a new todo form: Vue events, methods, and models - Learn web development
go back to app.vue and add the following import
statement just below the previous one, inside your <script> element: import todoform from './components/todoform'; you also need to register the new component in your app component — update the components property of the component object so that it looks like this: components: { todoitem, todoform } finally for this section, render your todoform component inside your app by addi...
...we also lose all local
state on page refresh.
...we can add the modifier to our v-model
statement like so: v-model.trim="label".
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Debugging on Windows
ht be too broad: (ns|promise)[^\:]*[ss]tring.* ...add common functions to this list should probably make a .reg file for easy importing obtaining stdout and other file handles running the following command in the command window in visual studio returns the value of stdout, which can be used with various debugging methods (such as nsgenericelement::list) that take a file* param: debug.evaluate
statement {,,msvcr80d}(&__iob_func()[1]) (alternatively you can evaluate {,,msvcr80d}(&__iob_func()[1]) in the quickwatch window) similarly, you can open a file on the disk using fopen: >debug.evaluate
statement {,,msvcr80d}fopen("c:\\123", "w") 0x10311dc0 { ..snip..
... } >debug.evaluate
statement ((nsgenericelement*)0x03f0e710)->list((file*)0x10311dc0, 1) <void> >debug.evaluate
statement {,,msvcr80d}fclose((file*)0x10311dc0) 0x00000000 note that you may not see the debugging output until you flush or close the file handle.
... you can use helper functions from nsxpconnect.cpp to inspect and modify the
state of javascript code from the msvs debugger.
... also this magical command only works when the vc++ stack is in certain
states.
Limitations of chrome scripts
there is a shim that gives you access to the domwindow property of the nsiwebprogress object passed into on
statechange.
... javascript code modules (jsms) in single-process firefox, you can use javascript code modules (jsms) to maintain global
state.
... in multiprocess firefox, a jsm loaded into one process does not share any
state with the same jsm loaded into a different process: so you can't use a jsm to share
state between the chrome and content processes.
... if an add-on wants to use a jsm to share
state in this way, it's best to load the jsm in the chrome process, and have frame scripts store and access the jsm's
state by sending messages to the chrome process using the message manager.
Gecko Keypress Event
that is, when the currently selected keyboard layout produces a unicode character (according to the current
state of capslock and numlock), the charcode property contains that character.
... the charcode value depends on the
state of capslock and numlock (except they are currently ignored if alt (option) is down on mac - see bug 432953).
...however, the shift key must be used to enter '+' on us keyboard layout, and so the
state of the shift key causes the modifiers not to match those specified in the handler.
...there should be no chrome access keys with punctuation characters or other characters that would normally require depressing the shift key.) during accel key handling, if the event includes the shift modifier, but an alternative charcode is not a bicameral letter (i.e., it does not have upper and lower case forms), then the shift modifier
state should be ignored if there is no exactly matching handler (requiring shift to be down).
IPDL Tutorial
an ipdl protocol declares how actors communicate: it declares the possible messages that may be sent between actors, as well as a
state machine describing when messages are allowed to be sent.
... the `manages`
statement declares that this protocol manages pplugininstance.
...the `manages`
statement also means that pplugininstance actors are tied to the lifetime of the plugin actor that creates them: if this pplugin instance is destroyed, all the pplugininstances associated with it become invalid or are destroyed as well.
... each subprotocol must include a `manager`
statement.
FxAccountsOAuthClient.jsm
first and only argument is an object that has "
state" and "code" properties.
...fxaccountsoauthclient fxaccountsoauthclient( object options object parameters string client_id string
state string oauth_uri string content_uri [optional] string scope [optional] string action [optional] string authorizationendpoint ); parameters client_id - oauth id returned from client registration.
...
state - oauth
state value that will be returned to the client as-is upon redirection.
...parameters none examples using the fxaccountsoauthclient chrome code let parameters = { oauth_uri: oauth_server_endpoint, client_id: oauth_client_id, content_uri: content_server_url,
state: oauth_
state } let client = new fxaccountsoauthclient({ parameters: parameters }); client.oncomplete = function (tokendata) { // tokendata consists of two properties: "tokendata.
state" and "tokendata.code" }; client.launchwebflow(); ...
PopupNotifications.jsm
eventcallback a javascript function to be invoked when the notification changes
state.
... the callback's first parameter is a string identifying the
state change that occurred.
... notification events if you specify an event callback using the options parameter when calling show(), the callback function gets invoked when the
state of the notification changes.
... the first parameter to the callback is a string identifying the
state change, and may be one of the following: "dismissed" the notification has been dismissed by the user (for example, by clicking away or by switching tabs).
Deferred
a deferred object is returned by the promiseutils.defer() method to provide a new promise along with methods to change its
state.
... method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending
state.
... methods resolve() fulfills the associated promise with the specified value, or propagates the
state of an existing promise.
...if this value is a promise, then the associated promise will be resolved to the passed promise, and follow the
state as the provided promise (including any future transitions).
Cached Monitors
cached monitors functions cached monitors allow the client to associate monitoring protection and
state change synchronization in a lazy fashion.
... pr_cwait waits for a notification that a monitor's
state has changed.
... pr_cnotify notifies a thread waiting for a change in the
state of monitored data.
... pr_cnotifyall notifies all the threads waiting for a change in the
state of monitored data.
Index
organization unit: server products division
state or province: california country (must be exactly 2 characters): us username: someuser email address: someuser@netscape.com enter password or pin for "communicator certificate db": [password will not echo] generated public/private key pair certificate request generated certificate has been signed certificate "mytestcert" added to database exported certificate to x509.raw and x509.cacert.
... certificate request generated by netscape phone: 650-555-0123 common name: john smith email: (not ed) organization: example corp
state: california country: us -----begin new certificate request----- miibidcbywibadbmmqswcqydvqqgewjvuzetmbega1uecbmkq2fsawzvcm5pytew mbqga1uebxmntw91bnrhaw4gvmlldzevmbmga1uechmmrxhhbxbszsbdb3jwmrmw eqydvqqdewpkb2huifntaxromfwwdqyjkozihvcnaqebbqadswawsajbamvupdoz kmhnox7rep8cc0lk+ffweuyidx9w5k/bioqokvejxyqzhit9athzbvmosf1y1s8j czdubcg1+ibnxaecaweaaaaama0gcsqgsib3dqebbquaa0earyqzvpyrutq486ny q...
... 266 fc_getoperation
state nss no summary!
... 279 fc_setoperation
state nss no summary!
Shell global objects
the reverse applies as well: the original hook, that we rein
state after the call to fun completes, might be asked for the source code of compilations that fun performed, and which, presumably, only hook knows how to find.
... haschild(parent, child) return true if child is a child of parent, as determined by a call to tracechildren setsavedstacksrng
state(seed) set this compartment's savedstacks' rng
state.
... gc
state() report the global gc
state.
... setrng
state(seed0, seed1) set this compartment's rng
state.
Redis Tips
but the
statement is meaningless.
... event logging lists, zsets, pubsub queues lists (rpush, blpop, blpoprpush, etc.) priority queues zsets membership sets, bitstrings
state hashes heartbeats zsets hit counters zsets message broadcast pubsub search reverse indexes (never use keys in production) documentation redis has fantastic documentation.
... node.js redis client: https://github.com/mranney/node_redis npm install redis python redis client: https://github.com/andymccurdy/redis-py there are some gotchas with the python api: https://github.com/andymccurdy/redis-py#api-reference select
statement not implemented del is 'delete' in python zadd argument order is wrong setex argument order is wrong the default redis port is 6379.
... (try this by breaking one of the set
statements by leaving out the value argument.) you'll get one return value for each operation that didn't crash.
nsIAnnotationService
use the form "namespace/value", so your name would be like "bills_extension/page_
state" or "history/thumbnail".
...use the form "namespace/value", so your name would be like "bills_extension/page_
state" or "history/thumbnail".
...use the form "namespace/value", so your name would be like "bills_extension/page_
state" or "history/thumbnail".
...use the form "namespace/value", so your name would be like "bills_extension/page_
state" or "history/thumbnail".
nsIAppShellService
boolean createstartup
state(in long awindowwidth, in long awindowheight); obsolete since gecko 1.8 nsixulwindow createtoplevelwindow(in nsixulwindow aparent, in nsiuri aurl, in pruint32 achromemask, in long ainitialwidth, in long ainitialheight, in nsiappshell aappshell); nsiwebnav createwindowlessbrowser (in bool aischrome) void destroyhiddenwindow(); void doprofilestartup(in nsicmdline...
... createstartup
state() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) creates the initial
state of the application by launching tasks specfied by "general.startup.*" prefs.
... boolean createstartup
state( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened.
... ensure1window() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) ensures that at least one window exists after creating the startup
state.
nsIAppStartup
to use the service: var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(components.interfaces.nsiappstartup); method overview void createhiddenwindow(); boolean createstartup
state(in long awindowwidth, in long awindowheight); obsolete since gecko 1.9.1 void destroyhiddenwindow(); void doprofilestartup(in nsicmdlineservice acmdlineservice, in boolean caninteract); obsolete since gecko 1.9.1 void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gecko 1.9.1 void enterlastwindowclosingsurvivalarea(); void exitlas...
... createstartup
state() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) creates the initial
state of the application by launching tasks specfied by "general.startup.*" prefs.
... boolean createstartup
state( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened.
... ensure1window() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) ensures that at least one window exists after creating the startup
state.
nsICommandLineRunner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method overview void init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long
state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text provided by each command-line handler.
...void init( in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long
state ); parameters argc the number of arguments being passed.
...
state the type of command line being processed.
... this is an nsicommandline
state flag.
nsIDownloadManager
ecko 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 save
state(); obsolete since gecko 1.8 void startbatchupdate(); obsolete since gecko 1.9.1 attributes attribute type description activedownloadcount long the number of files currently being downloaded.
... exceptions thrown ns_error_failure if the download is not in the following
states: download_canceled or download_failed.
... save
state() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) update the download datasource.
... void save
state(); parameters none.
nsINavHistoryResultViewer
methods containerclosed() called when a container node's
state changes from closed to opened.
... void containerclosed( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node whose
state changed.
... containeropened() called when a container node's
state changes from closed to opened.
... void containeropened( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node whose
state changed.
nsIRadioInterfaceLayer
long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description current
state jsval read only.
... obsolete since gecko 13.0 microphonemuted bool radio
state jsval read only.
... speakerenabled bool constants call
state constants constant value description call_
state_unknown 0 call_
state_dialing 1 call_
state_alerting 2 call_
state_busy 3 call_
state_connecting 4 call_
state_connected 5 call_
state_holding 6 call_
state_held 7 call_
state_resuming 8 call_
state_disconnecting 9 call_
state_disconnected 10 call_
state_incoming 11 datacall_
state_unknown 0 datacall_
state_connecting 1 datacall_
state_connected 2 datacall_
state_disconnecting 3 datacall_
state_disconnected 4 call_
state_ringing 2 obsolete since gecko 14.0 methods answercall() void answercall( in unsigned long callindex ); parameters callindex missing description exceptions thrown missing exception missing description deactivatedataca...
...void dial( in domstring number ); parameters number missing description exceptions thrown missing exception missing description enumeratecalls() will continue calling callback.enumeratecall
state until the callback returns false.
nsIWebBrowserPersist
stream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in boolean aisprivate); attributes attribute type description current
state unsigned long current
state of the persister object.
... persist_
state_ready 1 persister is ready to save data.
... persist_
state_saving 2 persister is saving data.
... persist_
state_finished 3 persister has finished saving data.
nsIMsgCloudFileProvider
acallback the nsirequestobserver for monitoring the start and stop
states of the refresh operation.
... acallback the nsirequestobserver for monitoring the start and stop
states of the delete operation.
... acallback the nsirequestobserver for monitoring the start and stop
states of the new account creation operation.
... void createexistingaccount(in nsirequestobserver acallback); parameters acallback the nsirequestobserver for monitoring the start and stop
states of the creation operation.
Accessibility Inspector - Firefox Developer Tools
states — a list of the different accessibility-relevant
states that can apply to the current item.
... for example, one of the links in one demo has
states of focusable, linked, selectable text, opaque, enabled, and sensitive.
... for a full list of internal
states, see gecko
states.
...this can include style-related attributes such as margin-left and text-indent, and other useful
states for accessibility information, such as draggable and level (e.g., what heading level is it, in the case of headings).
Debugger - Firefox Developer Tools
the promise’s
state, fulfillment or rejection value, and the allocation and resolution stacks can be obtained using the promise-related accessor properties of the debugger.object instance promise.
... ondebugger
statement(frame) debuggee code has executed adebugger
statement inframe.
...(the other possibility is for the finally block to exit due to a return, continue, or break
statement, or a new exception.
... iscompilableunit(source) given a string of source code, designated bysource, return false if the string might become a valid javascript
statement with the addition of more lines.
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.
... since the same promise is used for both pending play and pending pause requests, authors are advised to check the
state of the animation when the promise is resolved.
...you'll typically use a construct similar to this when using the ready promise: animation.ready.then(function() { // do whatever needs to be done when // the animation is ready to run }); example in the following example, the
state of the animation will be running when the current ready promise is resolved because the animation does not leave the pending play
state in between the calls to pause and play and hence the current ready promise does not change.
... animation.pause(); animation.ready.then(function() { // displays 'running' alert(animation.play
state); }); animation.play(); specifications specification status comment web animationsthe definition of 'animation.ready' in that specification.
CanvasRenderingContext2D.save() - Web APIs
the canvasrenderingcontext2d.save() method of the canvas 2d api saves the entire
state of the canvas by pushing the current
state onto a stack.
... the drawing
state the drawing
state that gets saved onto a stack consists of: the current transformation matrix.
... syntax void ctx.save(); examples saving the drawing
state this example uses the save() method to save the default
state and restore() to restore it later, so that you are able to draw a rect with the default
state later.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // save the default
state ctx.save(); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); // restore the default
state ctx.restore(); ctx.fillrect(150, 40, 100, 100); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.save' in that specification.
CanvasRenderingContext2D - Web APIs
the canvas
state the canvasrenderingcontext2d rendering context contains a variety of drawing style
states (attributes for line styles, fill styles, shadow styles, text styles).
... the following methods help you to work with that
state: canvasrenderingcontext2d.save() saves the current drawing style
state using a stack so you can revert any change you make to it using restore().
... canvasrenderingcontext2d.restore() restores the drawing style
state to the last element on the '
state stack' saved by save().
...all
state should be preserved.
HTMLMediaElement - Web APIs
htmlmediaelement.disableremoteplayback a boolean that sets or returns the remote playback
state, indicating whether the media element is allowed to have a remote playback ui.
... htmlmediaelement.network
state read only returns a unsigned short (enumeration) indicating the current
state of fetching the media over the network.
... htmlmediaelement.ready
state read only returns a unsigned short (enumeration) indicating the readiness
state of the media.
... pause fired when a request to pause play is handled and the activity has entered its paused
state, most commonly occurring when the media's htmlmediaelement.pause() method is called.
The HTML DOM API - Web APIs
ment deprecated html element interfaces htmlmarqueeelement obsolete html element interfaces htmlbasefontelement htmlfontelement htmlframeelement htmlframesetelement htmlisindexelement htmlmenuitemelement web app and browser integration interfaces these interfaces offer access to the browser window and document that contain the html, as well as to the browser's
state, available plugins (if any), and various configuration options.
... formdataevent htmlformcontrolscollection htmloptionscollection radionodelist validity
state canvas and image interfaces these interfaces represent objects used by the canvas api as well as the <img> element and <picture> elements.
... beforeunloadevent hashchangeevent history location pagetransitionevent pop
stateevent web components interfaces these interfaces are used by the web components api to create and manage the available custom elements.
... eventsource examples in this example, an <input> element's input event is monitored in order to update the
state of a form's "submit" button based on whether or not a given field currently has a value.
History - Web APIs
state read only returns an any value representing the
state at the top of the history stack.
... this is a way to look at the
state without having to wait for a pop
state event.
... push
state() pushes the given data onto the session history stack with the specified title (and, if provided, url).
... replace
state() updates the most recent entry on the history stack to have the specified data, title, and, if provided, url.
Ajax navigation example - Web APIs
nknown error."); } function ajaxload () { var vmsg, nstatus = this.status; switch (nstatus) { case 200: vmsg = json.parse(this.responsetext); document.title = opageinfo.title = vmsg.page; document.getelementbyid(stargetid).innerhtml = vmsg.content; if (bupdateurl) { history.push
state(opageinfo, opageinfo.title, opageinfo.url); bupdateurl = false; } break; default: vmsg = nstatus + ": " + (ohttpstatus[nstatus] || "unknown"); switch (math.floor(nstatus / 100)) { /* case 1: // informational 1xx con...
...xmlhttprequest(); bisloading = true; oreq.onload = ajaxload; oreq.onerror = ajaxerror; if (spage) { opageinfo.url = filterurl(spage, null); } oreq.open("get", filterurl(opageinfo.url, "json"), true); oreq.send(); oloadingbox.parentnode || document.body.appendchild(oloadingbox); } function requestpage (surl) { if (history.push
state) { bupdateurl = true; getpage(surl); } else { /* ajax navigation is not supported */ location.assign(surl); } } function processlink () { if (this.classname === sajaxclass) { requestpage(this.href); return false; } return true; } function init () { opageinfo.ti...
...tle = document.title; history.replace
state(opageinfo, opageinfo.title, opageinfo.url); for (var olink, nidx = 0, nlen = document.links.length; nidx < nlen; document.links[nidx++].onclick = processlink); } const /* customizable constants */ stargetid = "ajax-content", sviewkey = "view_as", sajaxclass = "ajax-nav", /* not customizable constants */ rsearch = /\?.*$/, rhost = /^[^\?]*\?*&*/, rview = new regexp("&" + sviewkey + "\\=[^&]*|&*$", "i"), rendqstmark = /\?$/, oloadingbox = document.createelement("div"), ocover = document.createelement("div"), oloadingimg = new image(), opageinfo = { title: null, url: location.href }, ohttpstatus = /* http://www.iana.org/assignments/http-status-codes/...
...sgo/ipfksaaah+qqjcgaaacwaaaaaeaaqaaadmwi6imkqorfjdoe82p4wgccc4ceuqradylesojembgsuc2g7sdx3lqgbmlajibufbslkaaah+qqjcgaaacwaaaaaeaaqaaadmgi63p7wcrhznfvdmghu2nfwlwci3wgc3tswhufgxtaukgcbtgenbmjaejsxgmlwzpeaach5bakkaaaalaaaaaaqabaaaamyclrc/jdksatlqtsckdcecajdii7hcq4emtcpyrcuubjcyrghvtqlaib1yhicnlsrkaaaowaaaaaaaaaaaa=="; ocover.appendchild(oloadingimg); oloadingbox.appendchild(ocover); onpop
state = function (oevent) { bupdateurl = false; opageinfo.title = oevent.
state.title; opageinfo.url = oevent.
state.url; getpage(); }; window.addeventlistener ?
Timing element visibility with the Intersection Observer API - Web APIs
visibleads = []; previouslyvisibleads.foreach(function(adbox) { updateadtimer(adbox); adbox.dataset.lastviewstarted = 0; }); } } else { previouslyvisibleads.foreach(function(adbox) { adbox.dataset.lastviewstarted = performance.now(); }); visibleads = previouslyvisibleads; previouslyvisibleads = null; } } since the event itself doesn't
state whether the document has switched from visible to invisible or vice-versa, the document.hidden property is checked to see if the document is not currently visible.
... since it's theoretically possible to get called multiple times, we only proceed if we haven't already paused the timers and saved the visibility
states of the existing ads.
...if the target element is intersecting with the root, we know it has just transitioned from the obscured
state to the visible
state.
... if the ad has transitioned to the not-intersecting
state, we remove the ad from the set of visible ads.
MediaRecorder.start() - Web APIs
then, each time that amount of media has been recorded, an event will be delivered to let you act upon the recorded media, while a new blob is created to record the next slice of the media assuming the mediarecorder's
state is inactive, start() sets the
state to recording, then begins capturing media from the input stream.
... when the source stream ends,
state is set to inactive and data gathering stops.
... invalid
stateerror the mediarecorder is not in the inactive
state; you can't start recording media if it's already being recorded.
... see the
state property.
MediaRecorder.stop() - Web APIs
when the stop() method is invoked, the ua queues a task that runs the following steps: if mediarecorder.
state is "inactive", raise a dom invalid
state error and terminate these steps.
... if the mediarecorder.
state is not "inactive", continue on to the next step.
... set the mediarecorder.
state to "inactive" and stop capturing media.
... syntax mediarecorder.stop() errors an invalid
state error is raised if the stop() method is called while the mediarecorder object’s mediarecorder.
state is "inactive" — it makes no sense to stop media capture if it is already stopped.
MediaStreamTrack - Web APIs
mediastreamtrack.ready
state read only returns an enumerated value giving the status of the track.
...the track
state is set to ended.
... events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface: ended sent when playback of the track ends (when the value ready
state changes to ended).
... unmute sent to the track when data becomes available again, ending the muted
state.
Pinch zoom gestures - Web APIs
<style> div { margin: 0em; padding: 2em; } #target { background: white; border: 1px solid black; } </style> global
state supporting a two-pointer gesture requires preserving a pointer's event
state during various event phases.
... this application uses two global variables to cache the event
state.
... // global vars to cache event
state var evcache = new array(); var prevdiff = -1; register event handlers event handlers are registered for the following pointer events: pointerdown, pointermove and pointerup.
...in this application, the event's
state must be cached in case this down event is part of a two-pointer pinch/zoom gesture.
RTCOfferOptions.iceRestart - Web APIs
usage notes when the rtcpeerconnection object's ice connection
state changes to failed, you should try to trigger an ice restart.
... fundamentally, this renegotiation is triggered by generating and using new values for the ice username fragment ("ufrag")}} example this example shows a handler for the iceconnection
statechange event.
... it watches for the ice connection
state to transition to "failed", which indicates that an ice restart should be tried in order to attempt to bring the connection back up.
... pc.oniceconnection
statechange = function(evt) { if (pc.iceconnection
state === "failed") { if (pc.restartice) { pc.restartice(); } else { pc.createoffer({ icerestart: true }) .then(pc.setlocaldescription) .then(sendoffertoserver); } } } if the
state changes to failed, this handler starts by looking to see if the rtcpeerconnection includes the restartice() method; if it does, we call that to request an ice restart.
SpeechSynthesis - Web APIs
speechsynthesis.paused read only a boolean that returns true if the speechsynthesis object is in a paused
state.
... speechsynthesis.speaking read only a boolean that returns true if an utterance is currently in the process of being spoken — even if speechsynthesis is in a paused
state.
... speechsynthesis.pause() puts the speechsynthesis object into a paused
state.
... speechsynthesis.resume() puts the speechsynthesis object into a non-paused
state: resumes it if it was already paused.
Streams API - Web APIs
readablestreamdefaultcontroller represents a controller allowing control of a readablestream's
state and internal queue.
... writablestreamdefaultcontroller represents a controller allowing control of a writablestream's
state.
... bytestream-related interfaces important: these are not implemented anywhere as yet, and questions have been raised as to whether the spec details are in a finished enough
state for them to be implemented.
... readablebytestreamcontroller represents a controller allowing control of a readablestream's
state and internal queue.
WebGLRenderingContext - Web APIs
state information webglrenderingcontext.activetexture() selects the active texture unit.
... webglrenderingcontext.useprogram() uses the specified webglprogram as part the current rendering
state.
...the webgl rendering context is an interface, through which you can set and query the
state of the graphics machine, send data to the webgl, and execute draw commands.
... saving the
state of the graphics machine within a single context interface is not unique to webgl.
Clearing with colors - Web APIs
this only changes some internal
state of webgl, but does not draw anything yet.
...all other methods are for setting and querying webgl
state variables (such as the clear color).
...this is why webgl/opengl is often called a
state machine.
... by tweaking those "dials" and "switches" you can modify the internal
state of the webgl machine, which in turn changes how input (in this case, a clear command) translates into output (in this case, all pixels are set to green).
Window - Web APIs
window.updatecommands() updates the
state of commands of the current chrome window (ui).
... windoweventhandlers.onpop
state called when a back button is pressed.
... pop
state fired when the active history entry changes.
... also available using the onpop
state event handler property.
XRSession.onvisibilitychange - Web APIs
the onvisibilitychange attribute of the xrsession object is the event handler for the visibilitychange event, which is dispatched when the visibility
state of the xr session changes.
... the visibility
state of the session is accessible via xrsession.visibility
state.
... note: the visibility
state of xr session affects the frame loop so callbacks registered via xrsession.requestanimationframe() might not be called.
... consult xrsession.visibility
state article for details.
XRSession - Web APIs
render
state read only an xrrender
state object which contains options affecting how the imagery is rendered.
... visibility
state read only a domstring whose value is one of those found in the xrvisibility
state enumerated type, indicating whether or not the session's imagery is visible to the user, and if so, if it's being visible but not currently the target for user events.
... updaterender
state() updates the properties of the session's render
state to match the values specified in the specified xrrender
stateinit dictionary.
... visibilitychange an xrsessionevent which is sent to the session when its visibility
state as indicated by the visibility
state changes.
XRSessionEvent() - Web APIs
these objects represent events announcing
state changes in an xrsession representing an augmented or virtual reality session.
... visibilitychange fired at the session whenever its visibility
state changes.
... examples this example creates a listiener that watches for the visibility
state of the session to change.
... xrsession.addeventlistener("visibility
state", e => { switch(e.session.visibility
state) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); specifications specification status comment webxr device apithe definition of 'xrsessionevent() constructor' in that specification.
XRSessionEvent - Web APIs
the webxr device api's xrsessionevent interface describes an event which indicates the change of the
state of an xrsession.
... visibilitychange fired at the session whenever its visibility
state changes.
... examples this example creates a listiener that watches for the visibility
state of the session to change.
... xrsession.addeventlistener("visibility
state", e => { switch(e.session.visibility
state) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); specifications specification status comment webxr device apithe definition of 'xrsessionevent' in that specification.
ARIA: table role - Accessibility
if a table maintains a selection
state, has two-dimensional navigation, or allows the user to rearrange cell order use grid or treegrid instead.
...if the interaction provides for the selection
state of individual cells, if left to right and top to bottom navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, use grid or treegrid instead.
... associated wai-aria roles,
states, and properties role="rowgroup" an optional child of the table, the row group encapsulates a group of rows, similar to thead, tbody, and tfoot.
... the first rule of aria use is if you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role,
state or property to make it accessible, then do so.
WAI-ARIA Roles - Accessibility
for a full list of roles, see using aria: roles,
states, and properties aria: alert rolethe alert role can be used to tell the user an element has been dynamically updated.
...elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's
state to assistive technology.aria: comment rolethe comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.aria: complementary rolethe complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated.
...if possible, use the html <aside> element instead.aria: contentinfo rolethe contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, navigation links, and privacy
statements.
...this should be used on an element that wraps an element with an insertion role, and one with a deletion role.aria: switch rolethe aria switch role is functionally identical to the checkbox role, except that instead of representing "checked" and "unchecked"
states, which are fairly generic in meaning, the switch role represents the
states "on" and "off."aria: tab rolethe aria tab role indicates an interactive element inside a tablist that, when activated, displays its associated tabpanel.aria: table rolethe table value of the aria role attribute identifies the element containing the role as having a non-interactive table structure containing data arranged...
Box-shadow generator - CSS: Cascading Style Sheets
</div> </div> </div> <div id="element_properties" class="category"> <div class="title"> class element properties </div> <div class="group"> <div class="group property"> <div class="ui-slider-name"> border </div> <div class="ui-checkbox" data-topic='border-
state' data-
state="true"></div> </div> <div id="z-index" class="slidergroup"> <div class="ui-slider-name"> z-index </div> <div class="ui-slider-btn-set" data-topic="z-index" data-type="sub"></div> <div class="ui-slider" data-topic="z-index" data-min="-10" data-max=...
....length; for (var i = 0; i < size; i++) new slider(elem[i]); } return { init : init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe } })(); /** * ui-buttonmanager */ var buttonmanager = (function checkboxmanager() { var subscribers = []; var buttons = []; var checkbox = function checkbox(node) { var topic = node.getattribute('data-topic'); var
state = node.getattribute('data-
state'); var name = node.getattribute('data-label'); var align = node.getattribute('data-text-on');
state = (
state === "true"); var checkbox = document.createelement("input"); var label = document.createelement("label"); var id = 'checkbox-' + topic; checkbox.id = id; checkbox.setattribute('type', 'checkbox'); checkbox.checked =
state; label.setat...
...ve.shadowid = null; colopicker.setcolor(classes[id].bgcolor); slidermanager.setvalue("top", active.top); slidermanager.setvalue("left", active.left); slidermanager.setvalue("rotate", active.rotate); slidermanager.setvalue("z-index", active.zindex); slidermanager.setvalue("width", active.width); slidermanager.setvalue("height", active.height); buttonmanager.setvalue("border-
state", active.border); active.updateshadows(); } var disableclass = function disableclass(topic) { classes[topic].toggledisplay(false); buttonmanager.setvalue(topic, false); } var addshadow = function addshadow(position) { if (animate === true) return -1; active.shadows.splice(position, 0, new shadow()); active.render.splice(position, 0, null); } var swapshadow = ...
...30; classes['before'].toggledisplay(false); classes['after'].toggledisplay(false); buttonmanager.setvalue('before', false); buttonmanager.setvalue('after', false); buttonmanager.subscribe("before", classes['before'].toggledisplay.bind(classes['before'])); buttonmanager.subscribe("after", classes['after'].toggledisplay.bind(classes['after'])); buttonmanager.subscribe("border-
state", function(value) { active.toggleborder(value); }); } return { init : init, addshadow : addshadow, swapshadow : swapshadow, addcssclass : addcssclass, disableclass : disableclass, deleteshadow : deleteshadow, setactiveclass : setactiveclass, setactiveshadow : setactiveshadow } })(); /** * layer manager */ var layermanager = (function layermana...
ime-mode - CSS: Cascading Style Sheets
the ime-mode css property controls the
state of the input method editor (ime) for text fields.
... values auto no change is made to the current input method editor
state.
... normal the ime
state should be normal; this value can be used in a user style sheet to override the page's setting.
...users may correct the inappropriate behavior of sites that don't follow this recommendation by placing the following css into their user stylesheet: input[type=password] { ime-mode: auto !important; } the mac version of gecko 1.9 (firefox 3) can't recover the previous
state of the ime when a field for which it is disabled loses focus, so mac users may get grumpy when you use the disabled value.
Audio and Video Delivery - Developer guides
to deliver video and audio, the general workflow is usually something like this: check what format the browser supports via feature detection (usually a choice of two, as
stated above).
...audio and custom controls in html: <audio id="my-audio" src="http://jplayer.org/audio/mp3/miaow-01-tempered-song.mp3"></audio> <button id="my-control">play</button> add a bit of javascript to detect events to play and pause the audio: window.onload = function() { var myaudio = document.getelementbyid('my-audio'); var mycontrol = document.getelementbyid('my-control'); function switch
state() { if (myaudio.paused == true) { myaudio.play(); mycontrol.innerhtml = "pause"; } else { myaudio.pause(); mycontrol.innerhtml = "play"; } } function checkkey(e) { if (e.keycode == 32 ) { //spacebar switch
state(); } } mycontrol.addeventlistener('click', function() { switch
state(); }, false); window.addeventlistener( "keypress", ...
...er firefogg — video and audio encoding for firefox ffmpeg2 — comprehensive command line encoder libav — comprehensive command line encoder vid.ly — video player,transcoding and delivery internet archive — free transcoding and storage detecting when no sources have loaded to detect that all child <source> elements have failed to load, check the value of the media element's network
state attribute.
... h.264 support in firefox this article explains the
state of support for the h.264 video format in firefox/firefox os, including code examples, tips and tricks.
Media events - Developer guides
this corresponds to the have_future_data ready
state.
... canplaythrough sent when the ready
state changes to have_enough_data, indicating that the entire media can be played without interruption, assuming the download rate remains at least at the current level.
... pause sent when the playback
state is changed to paused (paused property is true).
... play sent when the playback
state is no longer paused, as a result of the play method, or the autoplay attribute.
<button>: The Button element - HTML: Hypertext Markup Language
unlike other browsers, firefox persists the dynamic disabled
state of a <button> across page loads.
... firefox, unlike other browsers, persists the dynamic disabled
state of a <button> across page loads.
...otherwise they will try to submit form data and to load the (nonexistent) response, possibly destroying the current
state of the document.
... if overridden, it is important to ensure that the
state change when focus is moved to the button is high enough that people experiencing low vision conditions will be able to perceive it.
<menuitem> - HTML: Hypertext Markup Language
permitted parents the <menu> element, where that element is in the popup menu
state.
... (if specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu
state.) permitted aria roles none dom interface htmlmenuitemelement attributes this element includes the global attributes; in particular title can be used to describe the command, or provide usage hints.
... disabled boolean attribute which indicates that the command is not available in the current
state.
... checkbox: represents a command that can be toggled between two different
states.
Iterators and generators - JavaScript
generator functions while custom iterators are a useful tool, their creation requires careful programming due to the need to explicitly maintain their internal
state.
... syntaxes expecting iterables some
statements and expressions expect iterables.
... the next() method also accepts a value, which can be used to modify the internal
state of the generator.
...this exception will be thrown from the current suspended context of the generator, as if the yield that is currently suspended were instead a throw value
statement.
Numbers and dates - JavaScript
the next four
statements build a string value based on the time.
... the first
statement creates a variable temp, assigning it a value using a conditional expression; if hour is greater than 12, (hour - 12), otherwise simply hour, unless hour is 0, in which case it becomes 12.
... the next
statement appends a minute value to temp.
...then a
statement appends a seconds value to temp in the same way.
Deprecated and obsolete features - JavaScript
legacy generator legacy generator function
statement and legacy generator function expression are deprecated.
... use function*
statement and function* expression instead.
... string.prototype.substr probably won't be removed anytime soon, but it's defined in annex b of the ecma-262 standard, whose introduction
states: "… programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code.
... number number.tointeger() parallelarray parallelarray
statements for each...in is deprecated.
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
this happens within any block
statement, when let or const declarations are accessed before they are defined.
...this happens within any block
statement, when let or const declarations are accessed before they are defined.
... examples invalid cases in this case, the variable "foo" is redeclared in the block
statement using let.
... function test() { let foo = 33; if (true) { let foo = (foo + 55); // referenceerror: can't access lexical // declaration `foo' before initialization } } test(); valid cases to change "foo" inside the if
statement, you need to remove the let that causes the redeclaration.
Date.prototype.getYear() - JavaScript
examples years between 1900 and 1999 the second
statement assigns the value 95 to the variable year.
... var xmas = new date('december 25, 1995 23:15:00'); var year = xmas.getyear(); // returns 95 years above 1999 the second
statement assigns the value 100 to the variable year.
... var xmas = new date('december 25, 2000 23:15:00'); var year = xmas.getyear(); // returns 100 years below 1900 the second
statement assigns the value -100 to the variable year.
... var xmas = new date('december 25, 1800 23:15:00'); var year = xmas.getyear(); // returns -100 setting and getting a year between 1900 and 1999 the third
statement assigns the value 95 to the variable year, representing the year 1995.
Lexical grammar - JavaScript
ecmascript also defines certain keywords and literals and has rules for automatic insertion of semicolons to end
statements.
... `string text` `string text line 1 string text line 2` `string text ${expression} string text` tag `string text ${expression} string text` automatic semicolon insertion some javascript
statements must be terminated with semicolons and are therefore affected by automatic semicolon insertion (asi): empty
statement let, const, variable
statement import, export, module declaration expression
statement debugger continue, break, throw return the ecmascript specification mentions three rules of semicolon insertion.
...a semicolon is inserted at the end, when a
statement with restricted productions in the grammar is followed by a line terminator.
... these
statements with "no lineterminator here" rules are: postfixexpressions (++ and --) continue break return yield, yield* module return a + b // is transformed by asi into return; a + b; specifications specification ecmascript (ecma-262)the definition of 'lexical grammar' in that specification.
class expression - JavaScript
syntax const myclass = class [classname] [extends otherclassname] { // class body }; description a class expression has a similar syntax to a class declaration (
statement).
... as with class
statements, the body of a class expression is executed in strict mode.
... there are several differences between class expressions and class
statements, however: class expressions may omit the class name ("binding identifier"), which is not possible with class
statements.
...this is not the case with class
statements.
function* expression - JavaScript
syntax function* [name]([param1[, param2[, ..., paramn]]]) {
statements } parameters name optional the function name.
...
statements the
statements which comprise the body of the function.
... description a function* expression is very similar to and has almost the same syntax as a function*
statement.
... the main difference between a function* expression and a function*
statement is the function name, which can be omitted in function* expressions to create anonymous generator functions.
Function expression - JavaScript
syntax the expression is not allowed at the start of a
statement.
... function [name]([param1[, param2[, ..., paramn]]]) {
statements } as of es2015, you can also use arrow functions.
...
statements optional the
statements which comprise the body of the function.
... description a function expression is very similar to and has almost the same syntax as a function declaration (see function
statement for details).
for...in - JavaScript
the for...in
statement iterates over all enumerable properties of an object that are keyed by strings (ignoring ones keyed by symbols), including inherited enumerable properties.
... syntax for (variable in object)
statement variable a different property name is assigned to variable on each iteration.
...the for...in loop
statement will return all enumerable properties, including those with non–integer names and those that are inherited.
...ngle = {a: 1, b: 2, c: 3}; function coloredtriangle() { this.color = 'red'; } coloredtriangle.prototype = triangle; var obj = new coloredtriangle(); for (const prop in obj) { if (obj.hasownproperty(prop)) { console.log(`obj.${prop} = ${obj[prop]}`); } } // output: // "obj.color = red" specifications specification ecmascript (ecma-262)the definition of 'for...in
statement' in that specification.
import - JavaScript
the static import
statement is used to import read only live bindings which are exported by another module.
...the import
statement cannot be used in embedded scripts unless such script has a type="module".
...for example, if the module imported above includes an export doalltheamazingthings(), you would call it like this: mymodule.doalltheamazingthings(); import a single export from a module given an object or value named myexport which has been exported from the module my-module either implicitly (because the entire module is exported) or explicitly (using the export
statement), this inserts myexport into the current scope.
...the import
statement may then be used to import such defaults.
CSS and JavaScript animation performance - Web Performance
they each have their own user scenarios: css transitions provide an easy way to make animations occur between the current style and an end css
state, e.g., a resting button
state and a hover
state.
... even if an element is in the middle of a transition, the new transition starts from the current style immediately instead of jumping to the end css
state.
... css animations, on the other hand, allow developers to make animations between a set of starting property values and a final set rather than between two
states.
... css animations consist of two components: a style describing the css animation, and a set of key frames that indicate the start and end
states of the animation's style, as well as possible intermediate points.
Index - XSLT: Extensible Stylesheet Language Transformations
it behaves like a switch
statement in procedural languages.
...in this it is similar to an if
statement in other languages.
... to achieve the functionality of an if-then-else
statement, however, use the <xsl:choose> element with one <xsl:when> and one <xsl:otherwise> children.
...because xslt permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of scope 53 <xsl:when> element, reference, xslt, when the <xsl:when> element always appears within an <xsl:choose> element, acting like a case
statement.
dev/panel - Archive of obsolete content
it's equivalent to document.ready
state === "interactive".
...it's equivalent to document.ready
state === "complete".
...clients connect to the server and send it messages to examine and modify the
state of the program being debugged.
places/bookmarks - Archive of obsolete content
each retrieved bookmark item represents only a snapshot of
state at a specific time.
... options : object optional options: name type resolve function a resolution function that is invoked during an attempt to save a bookmark item that is not derived from the latest
state from the platform.
... invoked with two arguments, mine and platform, where mine is the item that is being saved, and platform is the current
state of the item on the item.
Intercepting Page Loads - Archive of obsolete content
in a nutshell, there are a lot of
state and status changes going on when a page loads, and the notify constants allow you to filter out the events you don't need to listen to.
...in this case, your best bet is to use on
statechange, and filter to when the
state flags indicate a document has begun being loaded: if ((a
stateflags & components.interfaces.nsiwebprogresslistener.
state_start) && (a
stateflags & components.interfaces.nsiwebprogresslistener.
state_is_document)) note the use of the binary mask & operator.
...make sure you access it from inside the
state validation if condition.
The Essentials of an Extension - Archive of obsolete content
if the application or version range don't match, you won't be allowed to install the extension, or the extension will be installed in a disabled
state.
...any errors or missing information will cause the installation process to fail, or the extension to be installed in a disabled
state.
...the line that we skipped in the chrome.manifest file
states that this xul file is an overlay for the main browser window: overlay chrome://browser/content/browser.xul chrome://xulschoolhello/content/browseroverlay.xul with this line, firefox knows that it needs to take the contents of browseroverlay.xul and overlay it on the main browser window, browser.xul.
Specifying the appearance - Archive of obsolete content
for this we have to first create four icons, one for each tinderbox
state (none, success, test failed, and busted), then create a set of css rules that displays the icon corresponding to the current tinderbox
state: statusbarpanel#tinderbox-status { list-style-image: url("chrome://navigator/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image: url("chrome://navigator/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] { list-style-image: url("chrome://navigator/content/tb-testfailed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-style-image: url("chrome://navigator/content/tb-bust...
...there is one rule for each possible tinderbox
state.
... make your own icons for the four
states or use the following icons: no status , success , test failed and busted .
confirm - Archive of obsolete content
method of install object syntax int confirm( string atext ); int confirm( string atext, string adialogtitle, number abuttonflags, string abutton0title, string abutton1title, string abutton2title, string acheckmsg, object acheck
state ); parameters the second, extended confirm() method is supported starting with gecko 1.8.
... acheck
state an object with a boolean value property representing the
state of the checkbox: when the dialog box is shown, its checkbox will be checked when this object's value is true.
...also: user closed the dialog window 1 'ok' or button 0 2 the third button previous versions of the xpinstall api
stated the return value of confirm() to be a boolean.
Rule Compilation - Archive of obsolete content
for instance, for an sqlite datasource, an sql
statement is used as the query.
...if you show the vbox by setting the hidden
state to false, the template builder will be invoked and the content will be generated.
...changing the hidden
state of an element isn't the only way to cause content to be generated.
Simple Example - Archive of obsolete content
first, we set the datasources and ref attributes as needed: <vbox datasources="template-guide-ex2.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> this time, we need to use a new
statement, the member condition as well as a triple.
...first, any known variables are filled into the member
statement for the current result.
...yphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg, ?title = 'canal') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?title = 'obelisk') since the triple is the last
statement, three matches total have been found.
Template and Tree Listeners - Archive of obsolete content
the primary use of this listener is to store some
state before the template is rebuilt and restore it afterwards.
...for instance, the observer may have an ontoggleopen
state method which will be called when the user opens or closes a row.
...for instance, the ontoggleopen
state method of any observers will be called before the tree item is opened.
Adding Methods to XBL-defined Elements - Archive of obsolete content
ngs:" value="52"/> <button label="show" oncommand="document.getelementbyid('num').showtitle(true)"/> <button label="hide" oncommand="document.getelementbyid('num').showtitle(false)"/> xbl: <binding id="labeledbutton"> <content> <xul:label xbl:inherits="value=title"/> <xul:label xbl:inherits="value"/> </content> <implementation> <method name="showtitle"> <parameter name="
state"/> <body> if (
state) { document.getanonymousnodes(this)[0].setattribute("style", "visibility: visible"); } else { document.getanonymousnodes(this)[0].setattribute("style", "visibility: collapse"); } </body> </method> </implementation> </binding> two buttons added to the xul have oncommand handlers which are used to change the visibili...
...this method checks to see whether the element is being hidden or shown from the '
state' parameter that is passed in.
...ource <binding id="labeledbutton"> <content> <xul:label xbl:inherits="value=title"/> <xul:label xbl:inherits="value"/> <xul:button label="show" oncommand="document.getbindingparent(this).showtitle(true);"/> <xul:button label="hide" oncommand="document.getbindingparent(this).showtitle(false);"/> </content> <implementation> <method name="showtitle"> <parameter name="
state"/> <body> if (
state) { document.getanonymousnodes(this)[0].setattribute("style","visibility: visible"); } else { document.getanonymousnodes(this)[0].setattribute("style","visibility: collapse"); } </body> </method> </implementation> </binding> the oncommand handlers here first get a reference to their parent bound element.
Document Object Model - Archive of obsolete content
for example, we could get the
state of a check box by using the code below: var
state = document.getelementbyid('casecheck').checked; the value casecheck corresponds to the id of the case sensitive checkbox.
... once we have an indication of whether it is checked or not, we can use the
state to perform the search.
...the second line of the function body changes the hidden
state so that the element is visible again.
Modifying a XUL Interface - Archive of obsolete content
in this next example, we reverse the
state of the checked property whenever the button is pressed.
...example 7 : source view <script> function update
state(){ var name = document.getelementbyid("name"); var sindex = document.getelementbyid("group").selectedindex; name.disabled = sindex == 0; } </script> <radiogroup id="group" onselect="update
state();"> <radio label="random name" selected="true"/> <hbox> <radio label="specify a name:"/> <textbox id="name" value="jim" disabled="true"/> </hbox> </radiogroup> in this example a func...
...tion update
state() is called whenever a select event is fired on the radio group.
More Tree Features - Archive of obsolete content
when the user expands and collapses the parent, the view's toggleopen
state function will be called to toggle the item between open and closed.
... for a content tree view, this will set the open attribute to reflect the current
state.
...remembering
state of columns as with all elements, the persist attribute can be used to save the
state of the columns in-between sessions.
Skinning XUL Files by Hand - Archive of obsolete content
yling, which we summarize briefly here, because they appear in mozilla with some frequency, but reserve for another article: pseudo-class parent-child element:pseudo-class { attribute: value; } parent > child { attribute: value; } button:hover { border: 1px; } menu#file > menuitem { font-weight: bold; } pseudo-classes reflect
states of the element: when the mouse moves over a button, for example, the appropriate pseudo-class stylesheet rules are applied.
...when you declare a button in your xul to be of a particular class, you take advantage of all of the styles defined for the various
states of that button.
...the pseudo-class is connected to an element (or not: you can also define styles that apply to any element in the
state specified by a pseudo-class) with the ":" character.
listbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
... invertselection() return type: no return value reverses the selected
state of all items.
...other items in the list box that are selected are not affected, and retain their selected
state.
param - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] for sql templates, used to bind values to parameters specified within an sql
statement.
... attributes index, name, type attributes index type: integer the index within the sql
statement of the parameter.
... name type: string the name of a parameter within the sql
statement.
preference - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the
state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
... type getelementvalue(in domelement element); retrieves the value that should be written to preferences based on the current
state of the supplied element.
richlistbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
... invertselection() return type: no return value reverses the selected
state of all items.
...other items in the list box that are selected are not affected, and retain their selected
state.
nsIContentPolicy - Archive of obsolete content
shouldload() can be called while the dom and layout of the document involved is in an inconsistent
state.
... query any dom properties that depend on the current
state of the dom outside the "context" node (e.g., lengths of node lists).
... note: shouldprocess() can be called while the dom and layout of the document involved is in an inconsistent
state.
2006-10-20 - Archive of obsolete content
he
stated that he was able to pre-package the extensions that he wanted by following this walkthrough and a little bit of help from this post.
...paul reed
stated that he is also going to decommission comet, the machine that performed seamonkey trunk gtk1 builds, this friday.
...paul reed re
states his overall goal that are "getting us to not rely on hardware that you have to have in a certain position for it to boot" to use standard known configuration for every nightly build that is produced.
2006-10-27 - Archive of obsolete content
these were the following choices
stated: search the filesystem for unneeded files delete or archive them, add a hard disk, move all or part of the concerned filesystem there move that tinderbox to a different machine with more empty disk space on october 23rd: nick responded to gavin and tony's posting.
... nick
stated that the build engineers knew that there was a problem with the tinderbox and that they would be solving the problem by adding a hard disk, and moving all or part of the concerned filesystem there.
...urk
stated that currently fedora has their release 6 directory locked out with access forbidden via web and ftp while the mirrors are mirroring for the release tuesday.
Extentsions FAQ - Archive of obsolete content
could there be more than two images to reflect more than two
states?does the rules in the css file have to be in any particular order (if two rules match, which is chosen)?
... i have two
states switching images in the tool bar and would have no problem implementing a third, so yes it's possible.
... //setting the
state document.getelementbyid("toolbar-button").setattribute("toolbar-button", "on"); //or document.getelementbyid("toolbar-button").setattribute("toolbar-button","off"); //css #myexten-toolbar-button[myexten-toolbar-button="on"] { list-style-image: url("chrome://myexten/skin/toolbar-button.png"); -moz-image-region: rect(0px 24px 24px 0px);} #myexten-toolbar-button[myexten-toolbar-button="off"] { list-style-image: url("chrome://myexten/skin/toolbar-button-off.png"); -moz-image-region: rect(0px 24px 24px 0px);} to implement a third i would simply change add an attribute and the corresponding css see http://www.w3.org/tr/rec-css2/cascade.html#cascade friday, october 13 - 20, 2006 (↑ top) how to get a refenece to the sidebar window assuming you have chrom...
NPP_Destroy - Archive of obsolete content
**save
state or other information to save for reuse by a new instance of this plug-in at the same url.
... use the optional save parameter if you want to save and reuse some
state or other information.
... mac os if you want to restore
state information if this plug-in is later recreated, use np_memalloc to create an npsaveddata structure.
Legacy generator function - Archive of obsolete content
the legacy generator function
statement declares legacy generator functions with the specified parameters.
... syntax function name([param,[, param,[..., param]]]) { [
statements] } name the function name.
...
statements the
statements which comprise the body of the function.
handler.enumerate() - Archive of obsolete content
the handler.enumerate() method used to be a trap for for...in
statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers.
... description the handler.enumerate method is a trap for for...in
statements.
... examples the following code traps for...in
statements.
Bounce off the walls - Game development
we could merge those two
statements into one to save on code verbosity: if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } if either of the two
statements is true, reverse the movement of the ball.
...it is very similar actually, all you have to do is to repeat the
statements for x instead of y: if(x + dx > canvas.width || x + dx < 0) { dx = -dx; } if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } at this point you should insert the above code block into the draw() function, just before the closing curly brace.
...the ball should bounce right after if touches the wall, not when it's already halfway in the wall, so let's adjust our
statements a bit to include that.
Block (scripting) - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, a block is a collection of related
statements enclosed in braces ("{}").
... for example, you can put a block of
statements after an if (condition) block, indicating that the interpreter should run the code inside the block if the condition is true, or skip the whole block if the condition is false.
... learn more learn about it javascript block
statement ...
CSS and JavaScript accessibility best practices - Learn web development
es on the web: <p>visit the <a href="https://www.mozilla.org">mozilla homepage</a>.</p> some very simple link styling is shown below: a { color: #ff0000; } a:hover, a:visited, a:focus { color: #a60000; text-decoration: none; } a:active { color: #000000; background-color: #a60000; } the standard link conventions are underlined and a different color (default: blue) in their standard
state, another color variation when the link has previously been visited (default: purple), and yet another color when the link is activated (default: red).
...something should definitely happen when
states change, and you shouldn't get rid of the pointer cursor or the outline — both are very important accessibility aids for those using keyboard controls.
...you could style form focus/hover
states to make this behaviour more consistent across browsers or fit in better with your page design, but don't get rid of it altogether — again, people rely on these clues to help them know what is going on.
Client-side form validation - Learn web development
validity: returns a validity
state object that contains several properties describing the validity
state of the element.
... you can find full details of all the available properties in the validity
state reference page; below is listed a few of the more common ones: patternmismatch: returns true if the value does not match the specified pattern, and false if it does match.
... emailerror.innerhtml = ''; // reset the content of the message emailerror.classname = 'error'; // 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 ...
HTML basics - Learn web development
this
states where the element begins or starts to take effect — in this case where the paragraph begins.
...this
states where the element ends — in this case where the paragraph ends.
...if we wanted to
state that our cat is very grumpy, we could wrap the word "very" in a <strong> element, which means that the word is to be strongly emphasized: <p>my cat is <strong>very</strong> grumpy.</p> you do however need to make sure that your elements are properly nested.
Advanced text formatting - Learn web development
string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; quotations html also has features available for marking up quotations; which element you use depends on whether you are marking up a block or...
...string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; abbreviations another fairly common element you'll meet when looking around the web is <abbr> — this is used to wrap around an abbreviation...
...string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; marking up contact details html has an element for marking up contact details — <address>.
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
s is very similar to the version from the simple spinner example, earlier: function draw(timestamp) { if(!starttime) { starttime = timestamp; } rotatecount = (timestamp - starttime) / 3; if(rotatecount > 359) { rotatecount %= 360; } spinner.style.transform = 'rotate(' + rotatecount + 'deg)'; raf = requestanimationframe(draw); } now it is time to set up the initial
state of the app when the page first loads.
... result.style.display = 'none'; spinnercontainer.style.display = 'none'; next, define a reset() function, which sets the app back to the original
state required to start the game again after it has been played.
...you also use settimeout() to call reset() after 5 seconds — as explained earlier, this function resets the game back to its original
state so that a new game can be started.
Introduction to web APIs - Learn web development
client-side storage apis are becoming a lot more widespread in web browsers — the ability to store data on the client-side is very useful if you want to create an app that will save its
state between page loads, and perhaps even work when the device is offline.
...eryselector('.volume'); const audiosource = audioctx.createmediaelementsource(audioelement); next up we include a couple of event handlers that serve to toggle between play and pause when the button is pressed and reset the display back to the beginning when the song has finished playing: // play/pause audio playbtn.addeventlistener('click', function() { // check if context is in suspended
state (autoplay policy) if (audioctx.
state === 'suspended') { audioctx.resume(); } // if track is stopped, play it if (this.getattribute('class') === 'paused') { audioelement.play(); this.setattribute('class', 'playing'); this.textcontent = 'pause' // if track is playing, stop it } else if (this.getattribute('class') === 'playing') { audioeleme...
... they use events to handle changes in
state we already discussed events earlier on in the course in our introduction to events article, which looks in detail at what client-side web events are and how they are used in your code.
Useful string methods - Learn web development
tring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; fixing capitalization in this exercise we have the names of cities in the united kingdom, but the capitalization is all messed up.
...tring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; making new strings from old parts in this last exercise, the array contains a bunch of strings containing information about train stations in...
...tring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; test your skills!
What went wrong? Troubleshooting JavaScript - Learn web development
try saving and refreshing again, and your console.log()
statement should return the <p> element we want.
... syntaxerror: missing ; before
statement this error generally means that you have missed a semicolon at the end of one of your lines of code, but it can sometimes be more cryptic.
... note: see our syntaxerror: missing ; before
statement reference page for more details about this error.
Adding features to our bouncing balls demo - Learn web development
inside the if()
statements, if the tests return true we don't want to update velx/vely; we want to instead change the value of x/y so the evil circle is bounced back onto the screen slightly.
...but there are a couple of differences: in the outer if
statement, you no longer need to check whether the current ball in the iteration is the same as the ball that is doing the checking — because it is no longer a ball, it is the evil circle!
... in the inner if
statement, you no longer want to make the objects change color when a collision is detected — instead, you want to set any balls that collide with the evil circle to not exist any more (again, how do you think you'd do that?).
Routing in Ember - Learn web development
typically, when writing web applications, you want the page to be represented by the url so that if (for any reason), the page needs to refresh, the user isn't surprised by the
state of the web app — they can link directly to significant views of the app.
... go back to todomvc/app/components/footer.hbs, and find the following bit of markup: <a href="#">all</a> <a href="#">active</a> <a href="#">completed</a> update it to <linkto @route='index'>all</linkto> <linkto @route='active'>active</linkto> <linkto @route='completed'>completed</linkto> <linkto> is a built-in ember component that handles all the
state changes when navigating routes, as well as setting an "active" class on any link that matches the url, in case there is a desire to style it differently from inactive links.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Handling common accessibility problems - Learn web development
you should make sure interactive elements like buttons and links have appropriate focus/hover/active
states set, to give the user visual clues as to their function.
... to deal with complex form widgets, you need to use aria attributes like roles to
state what role different elements have in a widget (for example, are they a tab, or a tab panel?), aria-disabled to say whether a control is disabled or not, etc.
... include an accessibility policy/
statement somewhere findable on your site to say what you did.
Accessibility/LiveRegionDevGuide
(at-spi only) a global variable can be set in a document:load:complete event listener and reset in a object:
state-changed:busy listener.
... an event containing an object that does not have
state visible is probably from a hidden tab.
... an event containing an object that has
state selectable is not a live region.
Mozilla accessibility architecture
each of these accessible nodes supports at minimum the generic cross-platform accessibility interface nsiaccessible (which provides a text name, enumerated role identifier and a set of
state flags) and sometimes additional interfaces.
... dommenuitemactive, dommenubaractive mozilla dom event_focus domnodeinserted w3c dom mutation event event_create (atk) event_reorder (msaa) domsubtreemodified w3c dom mutation event event_reorder domnoderemoved w3c dom mutation event event_destroy (atk) event_reorder (msaa) checkbox
statechange, radio
statechange mozilla dom event_
state_change popupshowing mozilla dom event_menustart popuphiding mozilla dom event_menuend nsdocaccessible::scrollpositiondidchange(), then nsdocaccessible::scrolltimercallback() nsiscrollpositonlistener and nsitimer callbacks event_scrollingend (quick timer i...
...s used to determine when scrolling pauses or stops, to avoid extra events being fired) nsdocaccessible::on
statechange(), :nsdocaccessible:onlocationchange() nsiwebprogresslistener callback event_
state_change (msaa) event_reorder (atk) dom mutation events - multiple uses dom mutation events are a great thing.
What to do and what not to do in Bugzilla
canconfirm privilege the canconfirm privilege allows you to confirm bugs and also to start your bug reports in the confirmed
state (new).
... a guide for confirming layout bugs (bugs in web page rendering) reporting new bugs you should report a bug in the new
state after going through the triaging process as described in the two above-mentioned guides.
... priority/target milestone as
stated in the bugzilla etiquette, you must not change the target milestone and priority fields.
Experimental features in Firefox
the value changes over time depending on what the user is doing, their preferences, and the
state of the browser in general.
...see bug 1318984 for more details on the
state of this api.
...there currently is no real plan to ship this on desktop, but you can track the
state of that just in case it changes in bug 1551302.
HTMLIFrameElement.getVisible()
the getvisible() method of the htmliframeelement is used to request the current visible
state of the browser <iframe>.
...if the request is successful, the request's result is a boolean indicating the visible
state of the browser <iframe>.
... example var browser = document.queryselector('iframe'); var request = browser.getvisible(); request.onsuccess = function() { console.log('the visible
state is: ' + this.result ?
Roll your own browser: An embedding how-to
active
state's komodo: development environment, based on mozilla's xul.
... active
state's komodo: development environment, based on mozilla's xul.
... mac external projects active
state's komodo: development environment, based on mozilla's xul.
Download
a download object represents a single download, with associated
state and actions.
... you should use the individual
state properties instead, since this value may not be updated after the last piece of data is transferred.
...you should use the individual
state properties (for example, the succeeded property) instead.
Examples
this
state will propagate to newpomise, and components.utils.reporterror will report all the details of the exception to the console.
..."you have file.txt in your temporary directory." : "you don't have file.txt in your temporary directory."); }).then(null, components.utils.reporterror); chaining promises the promise returned by then eventually assumes the
state of the promise returned by the callback.
... deferred.reject(ex); } // we don't return the deferred to the caller, but only the contained // promise, so that the caller cannot accidentally change its
state.
Midas
document.querycommandenabled determines whether the given command can be executed on the document in its current
state.
... document.querycommandindeterm determines whether the current selection is in an indetermined
state.
... document.querycommand
state determines whether the given command has been executed on the current selection.
NSPR's Position On Abrupt Thread Termination
if they cannot, because of some
state corruption, then they must assume that the corruption, like the
state, is shared, and their only resource is for the process to terminate.
... to make this solution work requires that a function that encounters an error be designed such that it first repairs its immediate
state, and then reports that error to its caller.
...they are alternatives to large
state machines with mostly non-blocking library functions.
PR_CNotifyAll
notifies all the threads waiting for a change in the
state of monitored data.
... pr_failure indicates that the referenced monitor could not be located or that the calling thread was not in the monitor description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cnotifyall notifies all threads waiting for the monitor's
state to change.
... all of the threads waiting on the
state change are then scheduled to reenter the monitor.
PR_CWait
wait for a notification that a monitor's
state has changed.
... description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cwait waits for a notification that the monitor's
state has changed.
...when the thread resumes execution, it is the caller's responsibility to test the
state of the monitored data to determine the appropriate action.
PR_Notify
notifies a monitor that a change in
state of the monitored data has occurred.
... description notification of a monitor signals the change of
state of some monitored data.
...when the notification occurs, the runtime promotes a thread that is waiting on the monitor to a ready
state.
PR_Wait
waits for an application-defined
state of the monitored data to exist.
...the resumption from the wait is merely a hint that a change of
state has occurred.
...act on the
state change ...
Encrypt Decrypt MAC Keys As Session Objects
*/ int main(int argc, char **argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; plopt
state *opt
state; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype cmd = unknown; const char *command = null; const char *dbdir = null; co...
...progname + 1 : argv[0]; /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(opt
state->value); break; case 'd': dbdir = strdup(opt
state->value); break; case 'f': pwdata.source = pw_fromfile; ...
... pwdata.data = strdup(opt
state->value); break; case 'p': pwdata.source = pw_plaintext; pwdata.data = strdup(opt
state->value); break; case 'i': infilename = strdup(opt
state->value); break; case 'o': outfilename = strdup(opt
state->value); break; case 'z': noisefilename = strdup(opt
state->value); break; default: usage(progname); break; } } pl_destroyopt
state(opt
state); if (!command || !dbdir || !infilename || !outfilename) usage(progname); if (pl_strlen(command)==0) usage(progname); cmd = command[0] == 'a' ?
Encrypt and decrypt MAC using token
*/ int main(int argc, char **argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; plopt
state *opt
state; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype cmd = unknown; const char *command = null; const char *dbdir = null; co...
...progname + 1 : argv[0]; /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(opt
state->value); break; case 'd': dbdir = strdup(opt
state->value); break; case 'f': pwdata.source = pw_fromfile; ...
... pwdata.data = strdup(opt
state->value); break; case 'p': pwdata.source = pw_plaintext; pwdata.data = strdup(opt
state->value); break; case 'i': infilename = strdup(opt
state->value); break; case 'o': outfilename = strdup(opt
state->value); break; case 'z': noisefilename = strdup(opt
state->value); break; default: usage(progname); break; } } pl_destroyopt
state(opt
state); if (!command || !dbdir || !infilename || !outfilename) usage(progname); if (pl_strlen(command)==0) usage(progname); cmd = command[0] == 'a' ?
NSS API Guidelines
many of the data structures in the security code contain some sort of session
state or session context.
... the exception to this global effects rule may be functions which set global
state for an application at initialization time.
...for instance, in most ssl functions this is the nspr socket, or the ssl socket structure: update, final, encrypt, decrypt type functions operating on their
state contexts, etc.
Encrypt Decrypt_MAC_Using Token
*/ int main(int argc, char **argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; plopt
state *opt
state; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype cmd = unknown; const char *command = null; const char *dbdir = null; co...
...progname + 1 : argv[0]; /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(opt
state->value); break; case 'd': dbdir = strdup(opt
state->value); break; case 'f': pwdata.source = pw_fromfile; ...
... pwdata.data = strdup(opt
state->value); break; case 'p': pwdata.source = pw_plaintext; pwdata.data = strdup(opt
state->value); break; case 'i': infilename = strdup(opt
state->value); break; case 'o': outfilename = strdup(opt
state->value); break; case 'z': noisefilename = strdup(opt
state->value); break; default: usage(progname); break; } } pl_destroyopt
state(opt
state); if (!command || !dbdir || !infilename || !outfilename) usage(progname); if (pl_strlen(command)==0) usage(progname); cmd = command[0] == 'a' ?
NSS Sample Code Sample_3_Basic Encryption and MACing
*/ int main(int argc, char **argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; plopt
state *opt
state; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype cmd = unknown; const char *command = null; const char *dbdir = null; co...
...progname + 1 : argv[0]; /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(opt
state->value); break; case 'd': dbdir = strdup(opt
state->value); break; case 'f': pwdata.source = pw_fromfile; ...
... pwdata.data = strdup(opt
state->value); break; case 'p': pwdata.source = pw_plaintext; pwdata.data = strdup(opt
state->value); break; case 'i': infilename = strdup(opt
state->value); break; case 'o': outfilename = strdup(opt
state->value); break; case 'z': noisefilename = strdup(opt
state->value); break; default: usage(progname); break; } } pl_destroyopt
state(opt
state); if (!command || !dbdir || !infilename || !outfilename) usage(progname); if (pl_strlen(command)==0) usage(progname); cmd = command[0] == 'a' ?
SpiderMonkey Internals
interpreter like many portable interpreters, spidermonkey's interpreter is mainly a single, tremendously long function that steps through the bytecode one instruction at a time, using a switch
statement (or faster alternative, depending on the compiler) to jump to the appropriate chunk of code for the current instruction.
... all
state associated with an interpreter instance is passed through formal parameters to the interpreter entry point; most implicit
state is collected in a type named jscontext.
...contains well-known string constants, their atoms, the global atom hash table and related
state, the js_atomize() function that turns a counted string of bytes into an atom, and literal pool (jsatommap) methods.
JSAPI Cookbook
* it will be automatically restored when we return, unless we call saved
state.drop().
... */ js::autosaveexception
state saved
state(cx); if (!js_callfunctionname(cx, global, "cleanup", 0, null, &r)) { /* the new error replaces the previous one, so discard the saved exception
state.
... */ saved
state.drop(); return false; } return success; object properties getting a property // javascript var x = y.myprop; the jsapi function that does this is js_getproperty.
JS_NewGlobalObject
when that happens, the global should not be in a half-baked
state.
... but this creates a problem for consumers that need to set slots on the global to put it in a consistent
state.
... if callers have no additional
state on the global to set up, they may pass fireonnewglobalhook to js_newglobalobject, which causes that function to fire the hook as its final act before returning.
JS_SetFunctionCallback
the callback must not modify the current
state of execution.
... the call stack cannot be relied upon, because this callback may be invoked from the jit code when the stack frame and context are in an indeterminate
state.
... note that debuggers should probably use js_setcallhook in preference to this function, because it is invoked when the javascript stack is guaranteed to be in a consistent
state (and therefore it is valid to inspect and modify local variables, generate stack traces, and set breakpoints.) callback syntax typedef void (* jsfunctioncallback)(const jsfunction *fun,const jsscript *scr, const jscontext *cx, int entering); name type description fun const jsfunction * the javascript function being invoked or exited.
TPS Tests
//www.google.com", title "google.com", changes: { // these properties are ignored by calls other than bookmarks.modify title: "google" } }, { folder: "foldera" }, { folder: "folderb" } ], "menu/foldera": [ { uri: "http://www.yahoo.com", title: "testing yahoo", changes: { location: "menu/folderb" } } ] }; // the
state of bookmarks after the first 'modify' action has been performed // on them.
... (implementation detail) two final cleanup phases are run to wipe the server
state and unregister devices.
... you will have to manually quit the browser at each phase, but you will be able to inspect the browser
state manually.
Using RAII classes in Mozilla
raii classes are useful when two operations (e.g., lock/unlock, addref/release, push
state/pop
state) must be paired.
...for example, instead of writing: autolock lock(mmutex); which causes the lock to be held until the end of the block, one might write: autolock(mmutex); which erroneously causes the lock to be released at the end of the
statement.
...moz_guard_object_notifier_init is added as a
statement in the constructor.
Gecko events
is supported: yes event_
state_change an object's
state has changed.
... is supported: yes
states:
state_focused,
state_busy, xxx: event_location_change an object has changed location, shape, or size.
...event_hyperlink_selected_link_changed the hyperlink selected
state changed from selected to unselected or from unselected to selected.
Starting WebLock
does not affect * internal
state of enumerator.
... lock and unlock the lock and unlock methods simply set a boolean representing
state in the object.
...the only
state that it needs to maintain is the current url node - the one that will be return on the next call to getnext.
PyXPCOM
pyxpcom is actively used in active
state komodo products, for example.
... history pyxpcom was initially developed by active
state tool corporation, and came out of their komodo project.
... other resources pythonext - extension that provides pyxpcom samples - demo applications using pyxpcom community python-xpcom bindings mailing list (active
state) #pyxpcom on irc.mozilla.org source code the pyxpcom code is available here: http://hg.mozilla.org/pyxpcom/ to build pyxpcom, see building pyxpcom.
mozIStorageBindingParamsArray
the mozistoragebindingparamsarray interface is a container for mozistoragebindingparams objects, and is used to store sets of bound parameters that will be used by the mozistorage
statement.executeasync().
... last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create these objects by calling the mozistorage
statement.newbindingparamsarray().
...the appended parameters will be used when mozistorage
statement.executeasync() is called.
mozIStorageValueArray
see also storage introduction and how-to article mozistorageconnection database connection to a specific file or in-memory data storage mozistorage
statement create and execute sql
statements on a sqlite database.
... mozistorageprogresshandler monitor progress during the execution of a
statement.
... mozistorage
statementwrapper storage
statement wrapper ...
nsIAccessible
role,
states and name these includes main properties used to describe the accessible.
... nsiaccessible.role to get the role of the accessible nsiaccessible.get
state() to get
states of the accessibe nsiaccessible.name, nsiaccessible.value to get the name and the value of the accessible tree navigation you can navigate through the accessible tree by the following methods and attributes.
... get
state provides a bit fields of accessible
states which describe boolean properties of accessible.
nsIApplicationUpdateService
methods adddownloadlistener() adds a listener that receives progress and
state information about the update that is currently being downloaded.
...void adddownloadlistener( in nsirequestobserver listener ); parameters listener an object implementing nsirequestobserver and optionally nsiprogresseventsink that will be notified of
state and progress information as the update is downloaded.
...removedownloadlistener() removes a listener that is receiving progress and
state information about the update that is currently being downloaded.
nsIContentViewer
void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports a
state, in nsishentry ashentry); void pagehide(in boolean isunload); boolean permitunload([optional] in boolean acallercloseswindow); boolean requestwindowclose(); void resetclosewindow(); void setbounds([const] in nsintrectref abounds); native code only!
...this is used to clear out the saved presentation
state.
...void open( in nsisupports a
state, in nsishentry ashentry ); parameters a
state a
state object that might be useful in attaching the dom window.
nsIEditorIMESupport
obsolete since gecko 2.0 void endcomposition(); obsolete since gecko 2.0 void forcecompositionend(); void getpreferredime
state(out unsigned long a
state); native code only!
...native code only!getpreferredime
state get preferred ime status of current widget.
... void getpreferredime
state( out unsigned long a
state ); parameters a
state native code only!getquerycaretrect obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete.
nsILocalFileMac
obsolete since gecko 2.0 methods native code only!getcfurl note: observes the
state of the followlinks attribute.
...native code only!getfsref note: observes the
state of the followlinks attribute.
...native code only!getfsspec note: observes the
state of the followlinks attribute.
nsINavHistoryResultViewObserver
inherits from: nsisupports last changed in gecko 1.9.0 method overview boolean candrop(in long index, in long orientation); void ondrop(in long row, in long orientation); void ontoggleopen
state(in long index); void oncycleheader(in nsitreecolumn column); void oncyclecell(in long row, in nsitreecolumn column); void onselectionchanged(); void onperformaction(in wstring action); void onperformactiononrow(in wstring action, in long row); void onperformactiononcell(in wstring action, in long row, in nsitreecolumn column); constants ...
... ontoggleopen
state() called when an item is opened or closed.
... void ontoggleopen
state( in long index ); parameters index the item being toggled.
nsIScrollable
scrollbar
states visibility
states of a scrollbar.
... return value an integer representing the
state of the scrollbar.
... scrollbarpref an integer representing the
state of the scrollbar.
nsIUpdate
errorcode long a numeric error code that conveys additional information about the
state of a failed update or failed certificate attribute check during an update check.
... if the update is not in the "failed"
state, this value is zero.
...
state astring the
state of the selected patch: "downloading" the update is being downloaded.
nsIXULSortService
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void insertcontainernode(in nsirdfcompositedatasource db, in nsrdfsort
state sort
stateptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify); native code only!
...void insertcontainernode( in nsirdfcompositedatasource db, in nsrdfsort
state sort
stateptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify ); parameters db sort
stateptr root trueparent container node anotify sort() sort the contents of the widget containing anode using asortkey as the comparison key, and asorthints as how to sort.
...asorthints one or more hints as to how to sort: ascending: sort the contents in ascending order descending: sort the contents in descending order comparecase: perform case sensitive comparisons integer: treat values as integers, non-integers are compared as strings two
state: do not allow the natural (unordered
state) see also nsixultemplatequeryprocessor ...
Debugger.Script - Firefox Developer Tools
accessor properties of the debugger.script prototype object a debugger.script instance inherits the following accessor properties from its prototype: isgeneratorfunction true if this instance refers to a jsscript for a function defined with a function* expression or
statement.
... isasyncfunction true if this instance refers to a jsscript for an async function, defined with an async function expression or
statement.
... a[i] = i*i; calling getalloffsets() on that code might yield an array like this: [[0], [5, 20], , [10]] this array indicates that: the first line’s code starts at offset 0 in the script; the for
statement head has two entry points at offsets 5 and 20 (for the initialization, which is performed only once, and the loop test, which is performed at the start of each iteration); the third line has no code; and the fourth line begins at offset 10.
about:debugging (before Firefox 68) - Firefox Developer Tools
service worker
state from firefox 52, the list of service workers shows the
state of the service worker in its lifecycle.
... three
states are distinguished: "registering": this covers all
states between the service worker's initial registration, and its assuming control of pages.
... that is, it subsumes the "installing", "activating", and "waiting"
states.
about:debugging - Firefox Developer Tools
service worker
state the list of service workers shows the
state of the service worker in its lifecycle.
... three
states are possible: registering: this covers all
states between the service worker's initial registration, and its assuming control of pages.
... that is, it subsumes the installing, activating, and waiting
states.
AddressErrors - Web APIs
please check for any errors."; const invalidcountryerror = "at this time, we only ship to the united
states, canada, great britain, japan, china, and germany."; let shippingaddress = ev.target.shippingaddress; let shippingaddresserrors = {}; let updatedetails = {}; if (!validcountries.includes(shippingaddress.country)) { ev.target.shippingoptions = []; shippingaddresserrors.country = invalidcountryerror; updatedetails = { error: genericaddresserror, shippingaddresser...
...please check for any errors."; const invalidcountryerror = "at this time, we only ship to the united
states, canada, great britain, japan, china, and germany."; let shippingaddress = ev.target.shippingaddress; let shippingaddresserrors = {}; let updatedetails = {}; if (!validcountries.includes(shippingaddress.country)) { ev.target.shippingoptions = []; shippingaddresserrors.country = invalidcountryerror; updatedetails = { error: genericaddresserror, shippingaddresser...
... that's done by removing all shipping options currently set on the request, then set up an object named shippingaddresserrors which contains a country property which is an error message describing why the
stated country isn't being permitted as a value.
Animation.finish() - Web APIs
exceptions invalid
state the player's playback rate is 0 or the animation's playback rate is greater than 0 and the end time of the animation is infinity.
... examples the following example shows how to use the finish() method and catch an invalid
state error.
... interfaceelement.addeventlistener("mousedown", function() { try { player.finish(); } catch(e if e instanceof invalid
state) { console.log("finish() called on paused or finished animation."); } catch(e); logmyerrors(e); //pass exception object to error handler } }); the following example finishes all the animations on a single element, regardless of their direction of playback.
AudioContext.close() - Web APIs
this method throws an invalid_
state_err exception if called on an offlineaudiocontext.
... example the following snippet is taken from our audiocontext
states demo (see it running live.) when the stop button is clicked, close() is called.
... when the promise resolves, the example is reset to its beginning
state.
AudioContext.resume() - Web APIs
this method will cause an invalid_
state_err exception to be thrown if called on an offlineaudiocontext.
... example the following snippet is taken from our audiocontext
states demo (see it running live.) when the suspend/resume button is clicked, the audiocontext.
state is queried — if it is running, suspend() is called; if it is suspended, resume() is called.
... susresbtn.onclick = function() { if(audioctx.
state === 'running') { audioctx.suspend().then(function() { susresbtn.textcontent = 'resume context'; }); } else if(audioctx.
state === 'suspended') { audioctx.resume().then(function() { susresbtn.textcontent = 'suspend context'; }); } } specifications specification status comment web audio apithe definition of 'resume()' in that specification.
AudioContext.suspend() - Web APIs
this method will cause an invalid_
state_err exception to be thrown if called on an offlineaudiocontext.
... example the following snippet is taken from our audiocontext
states demo (see it running live.) when the suspend/resume button is clicked, the audiocontext.
state is queried — if it is running, suspend() is called; if it is suspended, resume() is called.
... susresbtn.onclick = function() { if(audioctx.
state === 'running') { audioctx.suspend().then(function() { susresbtn.textcontent = 'resume context'; }); } else if(audioctx.
state === 'suspended') { audioctx.resume().then(function() { susresbtn.textcontent = 'suspend context'; }); } } specifications specification status comment web audio apithe definition of 'close()' in that specification.
AudioTrackList.onchange - Web APIs
to determine the new
state of media's tracks, you'll have to look at their audiotrack.enabled flags.
... example this snippet establishes a handler for the change event that looks at each of the tracks in the list, calling a function to update the
state of a user interface control that indicates the current
state of the track.
...o").audiotracks; tracklist.onchange = function(event) { tracklist.foreach(function(track) { updatetrackenabledbutton(track.id, track.enabled); }); }; the updatetrackenabledbutton(), in this example, should be a function that finds a user interface control using the track's id (perhaps the app uses the track id as the control element's id) and the track's enabled flag to determine which
state the control should be in now.
AudioWorkletProcessor.process - Web APIs
if the combination of the return value and the
state of the node causes the browser to decide to stop the node, process() will not be called again.
... note: an absence of the return
statement means that the method returns undefined, and as this is a falsy value, it is like returning false.
... omitting an explicit return
statement may cause hard-to-detect problems for your nodes.
BaseAudioContext - Web APIs
baseaudiocontext.
state read only returns the current
state of the audiocontext.
... event handlers baseaudiocontext.on
statechange an event handler that runs when an event of type
statechange has fired.
... this occurs when the audiocontext's
state changes, due to the calling of one of the
state change methods (audiocontext.suspend, audiocontext.resume, or audiocontext.close).
BudgetService.getBudget() - Web APIs
the getbudget() property of the budgetservice interface returns a promise that resolves to an array of budget
state objects indicating the expected
state of the budget at times in the future.
... syntax var apromise = budgetservice.getbudget(); apromise.then(function(budget
state[]){ ...
... returns a promise that resolves to an instance of budget
state.
EventTarget.addEventListener() - Web APIs
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); } else { listener.call(self,e); } }; if (type=="domcontentloaded") { var wrapper2=function(e) { if (document.ready
state=="complete") { wrapper(e); } }; document.attachevent("onready
statechange",wrapper2); eventlisteners.push({object:this,type:type,listener:listener,wrapper:wrapper2}); if (document.ready
state=="complete") { var e=new event(); e.srcelement=window; wrapper2(e); } } else { this.attachevent("on"+t...
... }; var removeeventlistener=function(type,listener /*, usecapture (will be ignored) */) { var counter=0; while (counter<eventlisteners.length) { var eventlistener=eventlisteners[counter]; if (eventlistener.object==this && eventlistener.type==type && eventlistener.listener==listener) { if (type=="domcontentloaded") { this.detachevent("onready
statechange",eventlistener.wrapper); } else { this.detachevent("on"+type,eventlistener.wrapper); } eventlisteners.splice(counter, 1); break; } ++counter; } }; element.prototype.addeventlistener=addeventlistener; element.prototype.removeeventlistener=removeeventlistener; if (htmldocument) { htmldocument.proto...
...however, since the function definition itself does not change, the same function may still be called for every duplicate listener (especially if the code gets optimized.) also in both cases, because the function reference was kept but repeatedly redefined with each add, the remove-
statement from above can still remove a listener, but now only the last one added.
FileEntrySync - Web APIs
invalid_
state_err the file is no longer valid for some reason other than it having been deleted.
... file() returns a file that represents the current
state of the file that this fileentry represents.
... invalid_
state_err the file is no longer valid for some reason other than it having been deleted.
FileError - Web APIs
invalid_
state_err 7 the operation cannot be performed on the current
state of the interface object.
... for example, the
state that was cached in an interface object has changed since it was last read from disk.
... no_modification_allowed_err 6 the
state of the underlying file system prevents any writing to a file or a directory.
FileException - Web APIs
invalid_
state_err 7 the operation cannot be performed on the current
state of the interface object.
... for example, the
state that was cached in an interface object has changed since it was last read from disk.
... no_modification_allowed_err 6 the
state of the underlying file system prevents any writing to a file or a directory.
GlobalEventHandlers.onanimationiteration - Web APIs
var box = document.getelementbyid("box"); var iterationcounter = 0; box.onanimationiteration = function(event) { box.style.animationplay
state = "paused"; document.getelementbyid("play").innerhtml = "start iteration #" + (iterationcounter+1); }; this sets up two global variables: box, which references the "box" element that we're animating, and iterationcounter, which is initially zero, which indicates how many iterations of the animation have occurred.
...it simply sets the box's animation-play-
state to "paused", then updates the text displayed in the button to indicate that clicking the button will start playing the next iteration of theanimation.
... finally, we set up a handler for a click on the button that runs the animation: document.getelementbyid("play").addeventlistener("click", function(event) { box.style.animationplay
state = "running"; iterationcounter++; }, false); this sets the box element's animation-play-
state to "running" and increments the iteration counter.
HTMLBodyElement - Web APIs
windoweventhandlers.onpop
state is an eventhandler representing the code to be called when the pop
state event is raised.
... living standard technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpop
state, onresize, onstorage, and onunload, have been moved to windoweventhandlers.
... the following properties have been added: onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onload, onmessage, onoffline, ononline, onpop
state, onresize, onstorage, and onunload.
History API - Web APIs
another use for the go() method is to refresh the current page by either passing 0, or by invoking it without an argument: // the following
statements // both have the effect of // refreshing the page window.history.go(0) window.history.go() you can determine the number of pages in the history stack by looking at the value of the length property: let numberofentries = window.history.length interfaces history allows manipulation of the browser session history (that is, the pages visited in the tab or frame that the current page is ...
... examples the following example assigns a listener to the onpop
state property.
... window.onpop
state = function(event) { alert(`location: ${document.location},
state: ${json.stringify(event.
state)}`) } history.push
state({page: 1}, "title 1", "?page=1") history.push
state({page: 2}, "title 2", "?page=2") history.replace
state({page: 3}, "title 3", "?page=3") history.back() // alerts "location: http://example.com/example.html?page=1,
state: {"page":1}" history.back() // alerts "location: http://example.com/example.html,
state: null" history.go(2) // alerts "location: http://example.com/example.html?page=3,
state: {"page":3}" specifications specification status comment html living standardthe definition of 'his...
KeyframeEffect.setKeyframes() - Web APIs
implicit to/from keyframes in newer browser versions, you are able to set a beginning or end
state for an animation only (i.e.
...for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end
state of the animation, and the beginning
state is implied.
...this is equivalent to specifying start and end
states in percentages in css stylesheets using @keyframes.
MediaRecorder.onerror - Web APIs
invalid
stateerror an attempt was made to stop or pause or an inactive recorder, start or resume an active recorder, or otherwise manipulate the mediarecorder while in the wrong
state.
...recording stops, the mediarecorder's
state becomes inactive, one last dataavailable event is sent to the mediarecorder with the remaining received data, and finally a stop event is sent.
...nction recordstream(stream) { let recorder = null; let bufferlist = []; try { recorder = new mediarecorder(stream); } catch(err) { return err.name; /* return the error name */ } recorder.ondataavailable = function(event) { bufferlist.push(event.data); }; recorder.onerror = function(event) { let error = event.error; switch(error.name) { case invalid
stateerror: shownotification("you can't record the video right " + "now.
MediaRecorder.pause() - Web APIs
when a mediarecorder object’s pause()method is called, the browser queues a task that runs the below steps: if mediarecorder.
state is "inactive", raise a dom invalid
state error and terminate these steps.
... set mediarecorder.
state to "paused".
... exceptions invalid
stateerror the mediarecorder is currently "inactive"; you can't pause recording if it's not active.
MediaRecorder.requestData() - Web APIs
when the requestdata() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.
state is not "recording", raise a dom invalid
state error and terminate these steps.
... if mediarecorder.
state is "recording", continue to the next step.
... syntax mediarecorder.requestdata() errors an invalid
state error is raised if the requestdata() method is called while the mediarecorder object’s mediarecorder.
state is not "recording" — the media cannot be captured if recording is not occurring.
MediaSession - Web APIs
playback
state indicates whether the current media session is playing.
... setposition
state() sets the current playback position and speed of the media currently being presented.
...); navigator.mediasession.setactionhandler('nexttrack', function() {}); } the following example sets up event handlers for pausing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; navigator.mediasession.setactionhandler('play', play); navigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); navigator.mediasession.playback
state = "playing"; } function pause() { audio.pause(); navigator.mediasession.playback
state = "paused"; } specifications specification status comment media session standardthe definition of 'mediasession' in that specification.
MediaSource.addSourceBuffer() - Web APIs
invalid
stateerror the mediasource is not in the "open" ready
state.
...e full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.ready
state); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuf...
...fer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'addsourcebuffer()' in that specification.
MediaSource.endOfStream() - Web APIs
return value undefined exceptions exception explanation invalid
stateerror mediasource.ready
state is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e.
...e full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.ready
state); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuf...
...fer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'endofstream()' in that specification.
MediaSource - Web APIs
mediasource.ready
state read only returns an enum representing the
state of the current mediasource, whether it is not currently attached to a media element (closed), attached and ready to receive sourcebuffer objects (open), or attached but the stream has been ended via mediasource.endofstream() (ended.) mediasource.duration gets and sets the duration of the current media being presented.
...ther investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.ready
state); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuf...
...fer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); }; function fetchab (url, cb) { console.log(url); var xhr = new xmlhttprequest; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); }; specifications specification status comment media source extensionsthe definition of 'mediasource' in that specification.
MediaStreamTrack.enabled - Web APIs
the value of enabled, in essence, represents what a typical user would consider the muting
state for a track, whereas the muted property indicates a
state in which the track is temporarily unable to output data, such as a scenario in which frames have been lost in transit.
... pausebutton.onclick = function(evt) { const new
state = !myaudiotrack.enabled; pausebutton.innerhtml = new
state ?
... "▶️" : "⏸️"; myaudiotrack.enabled = new
state; } this creates a variable, new
state, which is the opposite of the current value of enabled, then uses that to select either the emoji character for the "play" icon or the character for the "pause" icon as the new innerhtml of the pause button's element.
MediaStreamTrack: mute event - Web APIs
note: the condition that most people think of as "muted" (that is, a user-toggled
state of silencing a track) is actually managed using the mediastreamtrack.enabled property, for which there are no events.
... musictrack.addeventlistener("mute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#aaa"; }, false); musictrack.addeventlistener("unmute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#fff"; }, false); with these event handlers in place, when the track musictrack enters its muted
state, the element with the id timeline-widget gets its background color changed to #aaa.
... when the track exits the muted
state—detected by the arrival of an unmute event—the background color is restored to white.
MediaStreamTrack: unmute event - Web APIs
this ends the muted
state that began with the mute event.
... musictrack.addeventlistener("mute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#aaa"; }, false); musictrack.addeventlistener("unmute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#fff"; }, false); with these event handlers in place, when the track musictrack enters its muted
state, the element with the id timeline-widget gets its background color changed to #aaa.
... when the track exits the muted
state—detected by the arrival of an unmuted event—the background color is restored to white.
Using the MediaStream Recording API - Web APIs
first of all, mediarecorder.start() is used to start recording the stream once the record button is pressed: record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.
state); console.log("recorder started"); record.style.background = "red"; record.style.color = "black"; } when the mediarecorder is recording, the mediarecorder.
state property will return a value of "recording".
... stop.onclick = function() { mediarecorder.stop(); console.log(mediarecorder.
state); console.log("recorder stopped"); record.style.background = ""; record.style.color = ""; } note that the recording may also stop naturally if the media stream ends (e.g.
... grabbing and using the blob when recording has stopped, the
state property returns a value of "inactive", and a stop event is fired.
MouseEvent - Web APIs
mouseevent.getmodifier
state() returns the current
state of the specified modifier key.
... see the keyboardevent.getmodifier
state() for details.
... obsolete from document object model (dom) level 2 events specification, added the mouseevent() constructor, the getmodifier
state() method and the buttons property.
NodeIterator.detach() - Web APIs
originally, it detached the nodeiterator from the set over which it iterates, releasing any resources used by the set and setting the iterator's
state to invalid.
... once this method had been called, calls to other methods on nodeiterator would raise the invalid_
state_err exception.
... syntax nodeiterator.detach(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); nodeiterator.detach(); // detaches the iterator nodeiterator.nextnode(); // throws an invalid_
state_err exception specifications specification status comment domthe definition of 'nodeiterator.detach' in that specification.
PaymentResponse.complete() - Web APIs
syntax completepromise = paymentrequest.complete(result); parameters result optional a domstring indicating the
state of the payment operation upon completion.
... note: in older versions of the specification, an empty string, "", was used instead of unknown to indicate a completion without a known result
state.
... invalid
stateerror the payment has already completed, or complete() was called while a request to retry the payment is pending.
PerformanceTiming - Web APIs
performancetiming.domloading read only when the parser started its work, that is when its document.ready
state changes to 'loading' and the corresponding ready
statechange event is thrown.
... performancetiming.dominteractive read only when the parser finished its work on the main document, that is when its document.ready
state changes to 'interactive' and the corresponding ready
statechange event is thrown.
... performancetiming.domcomplete read only when the parser finished its work on the main document, that is when its document.ready
state changes to 'complete' and the corresponding ready
statechange event is thrown.
Multi-touch interaction - Web APIs
<style> div { margin: 0em; padding: 2em; } #target1 { background: white; border: 1px solid black; } #target2 { background: white; border: 1px solid black; } #target3 { background: white; border: 1px solid black; } </style> global
state to support multi-touch interaction, preserving a pointer's event
state during various event phases is required.
... this application uses three arrays to cache event
state, one cache per target element.
...the event's
state must be cached, in case this down event is part of a multi-touch interaction.
RTCPeerConnection: icecandidate event - Web APIs
indicating that ice gathering is complete once all ice transports have finished gathering candidates and the value of the rtcpeerconnection object's icegathering
state has made the transition to complete, an icecandidate event is sent with the value of complete set to null.
... if you need to perform any special actions when there are no further candidates expected, you're much better off watching the ice gathering
state by watching for icegathering
statechange events: pc.addeventlistener("icegathering
statechange", ev => { switch(pc.icegathering
state) { case "new": /* gathering is either just starting or has been reset */ break; case "gathering": /* gathering has begun or is ongoing */ break; case "complete": /* gathering has ended */ break; } }); as you can see in this example, the ic...
...egathering
statechange event lets you know when the value of the rtcpeerconnection property icegathering
state has been updated.
RTCPeerConnection.restartIce() - Web APIs
the next time the connection's signaling
state changes to stable, the connection will fire the negotiationneeded event.
... example this example creates a handler for the iceconnection
statechange event that handles a transition to the failed
state by restarting ice in order to try again.
... pc.addeventlistener("iceconnection
statechange", event => { if (pc.iceconnection
state === "failed") { /* possibly reconfigure the connection in some way here */ /* then request ice restart */ pc.restartice(); } }); with this code in place, a transition to the failed
state during ice negotiation will cause a negotiationneeded event to be fired, in response to which your code should renegotiate as usual.
RTCRtpSender.setStreams() - Web APIs
exceptions invalid
stateerror the sender's connection is closed.
... function addtrackstostream(stream) { let senders = pc.getsenders(); senders.foreach((sender) => { if (sender.track && (sender.transport.
state === connected)) { sender.setstreams(stream); } }); } after calling the rtcpeerconnection method getsenders() to get the list of the connection's senders, the addtrackstostream() function iterates over the list.
... for each sender, if the sender's track is non-null and its transport's
state is connected, we call setstreams() to add the track to the stream specified.
RTCStatsReport - Web APIs
candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegathering
state to new during an ice restart.
...since this only provides statistics related to inbound data, without considering the local peer's
state, any values that require knowledge of both, such as round-trip time, is not included.
...this information considers only the outbound rtp stream, so any data which requires information about the
state of the remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers'
states.
RTCStatsType - Web APIs
candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegathering
state to new during an ice restart.
...since this only provides statistics related to inbound data, without considering the local peer's
state, any values that require knowledge of both, such as round-trip time, is not included.
...this information considers only the outbound rtp stream, so any data which requires information about the
state of the remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers'
states.
SourceBuffer.abort() - Web APIs
exceptions exception explanation invalid
stateerror the mediasource.ready
state property of the parent media source is not equal to open, or this sourcebuffer has been removed from the mediasource.
... example the spec description of abort() is somewhat confusing — consider for example step 1 of reset parser
state.
...in lines 92-101, the seek() function is defined — note that abort() is called if mediasource.ready
state is set to open, which means that it is ready to receive new source buffers — at this point it is worth aborting the current segment and just getting the one for the new seek position (see checkbuffer() and getcurrentsegment().) specifications specification status comment media source extensionsthe definition of 'abort()' in that specification.
Streams API concepts - Web APIs
important: byte streams are not implemented anywhere as yet, and questions have been raised as to whether the spec details are in a finished enough
state for them to be implemented.
...there are two methods available in the spec to facilitate this: readablestream.pipethrough() — pipes the stream through a transform stream, which is a pair comprised of a writable stream that has data written to it, and a readable stream that then has the data read out of it — this acts as a kind of treadmill that constantly takes data in and transforms it to a new
state.
... internal queues employ a queuing strategy, which dictates how to signal backpressure based on the internal queue
state.
TextRange - Web APIs
textrange.querycommandenabled() returns a boolean indicating whether the specified command can be executed successfully with the execcommand method in the current
state of the given document.
... textrange.querycommand
state() returns the boolean indicating the current
state of the specified command.
... you can also see document.querycommand
state().
Using Touch Events - Web APIs
the touchevent interface represents an event sent when the
state of contacts with a touch-sensitive surface changes.
... 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.
... this interface's attributes include the
state of several modifier keys (for example the shift key) and the following touch lists: touches - a list of all of the touch points currently on the screen.
VideoTrackList.onchange - Web APIs
to determine the new
state of media's tracks, you'll have to look at their videotrack.selected flags.
... example this snippet establishes a handler for the change event that looks at each of the tracks in the list, calling a function to update the
state of a user interface control that indicates the current
state of the track.
...videotracks; tracklist.onchange = function(event) { tracklist.foreach(function(track) { updatetrackselectedbutton(track.id, track.selected); }); }; the updatetrackselectedbutton(), in this example, should be a function that finds a user interface control using the track's id (perhaps the app uses the track id as the control element's id) and the track's selected flag to determine which
state the control should be in now.
WebGLRenderingContext.makeXRCompatible() - Web APIs
invalid
stateerror the webgl context has been lost or there is no available webxr device.
...*/ 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 invalid
stateerror: 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("...
... handlers are provided for both webglcontextlost and webglcontextrestored; in the first case, we make sure we're aware that the
state can be recovered, while in the latter we actually reload the scene to ensure we have the correct resources for the current screen or headset configuration.
Color masking - Web APIs
the color mask
state of webgl is preserved, so we do not need to call colormask() every frame to set up the color mask.
... this is an important aspect of the webgl
state machine.
... finally, color masking teaches us that webgl is not only a
state machine, it is also a graphics pipeline.
WebGL best practices - Web APIs
cted following a call to gllinkprogram errors due to mismatch between the vertex and fragment shader (link errors) must have been detected following a call to gllinkprogram errors due to exceeding resource limits must have been detected following any draw call or a call to glvalidateprogram a call to glvalidateprogram must report all errors associated with a program object given the current gl
state.
...(+/-2.0 max is probably not good enough for you) implicit defaults the vertex language has the following predeclared globally scoped default precision
statements: precision highp float; precision highp int; precision lowp sampler2d; precision lowp samplercube; the fragment language has the following predeclared globally scoped default precision
statements: precision mediump int; precision lowp sampler2d; precision lowp samplercube; in webgl 1, "highp float" support is optional in fragment shaders using highp precision unconditionally in fragme...
...pipelines are more or less the tuple of shader program, depth/stencil/multisample/blend/rasterization
state) in webgl: ...
WebRTC connectivity - Web APIs
it's a legacy notification of a
state which can be detected instead by watching for the icegathering
state to change to complete, by watching for the icegathering
statechange event.
...a rollback restores the sdp offer (and the connection configuration by extension) to the configuration it had the last time the connection's signaling
state was stable.
...in other words, if the local peer is in the
state have-local-offer, indicating that the local peer had previously sent an offer, calling setremotedescription() with a received offer triggers rollback so that the negotiation switches from the remote peer being the caller to the local peer being the caller.
Writing WebSocket client applications - Web APIs
var examplesocket = new websocket("wss://www.example.com/socketserver", "protocolone"); on return, examplesocket.ready
state is connecting.
... the ready
state will become open once the connection is ready to transfer data.
... if you want to open a connection and are flexible about the protocols you support, you can specify an array of protocols: var examplesocket = new websocket("wss://www.example.com/socketserver", ["protocolone", "protocoltwo"]); once the connection is established (that is, ready
state is open), examplesocket.protocol will tell you which protocol the server selected.
Movement, orientation, and motion: A WebXR example - Web APIs
: gl.getuniformlocation(shaderprogram, 'umodelviewmatrix'), normalmatrix: gl.getuniformlocation(shaderprogram, 'unormalmatrix'), usampler: gl.getuniformlocation(shaderprogram, 'usampler') }, }; buffers = initbuffers(gl); texture = loadtexture(gl, 'https://cdn.glitch.com/a9381af1-18a9-495e-ad01-afddfd15d000%2ffirefox-logo-solid.png?v=1575659351244'); xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl) }); if (session_type == "immersive-vr") { refspacetype = "local"; } else { refspacetype = "viewer"; } mat4.fromtranslation(cubematrix, viewerstartposition); vec3.copy(cubeorientation, viewerstartorientation); xrsession.requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspace.getoffsetrefe...
...we connect the session to the webgl layer so it konws what to use as a rendering surface by calling xrsession.updaterender
state() with a baselayer set to a new xrwebgllayer.
... let lastframetime = 0; function drawframe(time, frame) { let session = frame.session; let adjustedrefspace = xrreferencespace; let pose = null; animationframerequestid = session.requestanimationframe(drawframe); adjustedrefspace = applyviewercontrols(xrreferencespace); pose = frame.getviewerpose(adjustedrefspace); if (pose) { let gllayer = session.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); logglerror("bindframebuffer"); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); // clear everything gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); logglerror("glclear"); const deltatime = (time - lastframetime) * 0.001; // convert to seconds lastframetime = time; for ...
Keyframe Formats - Web APIs
implicit to/from keyframes in newer browser versions, you are able to set a beginning or end
state for an animation only (i.e.
...for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end
state of the animation, and the beginning
state is implied.
...this is equivalent to specifying start and end
states in percentages in css stylesheets using @keyframes.
Web Locks API - Web APIs
the api provides optional functionality that may be used as needed, including: returning values from the asynchronous task shared and exclusive lock modes conditional acquisition diagnostics to query the
state of locks in an origin an escape hatch to protect against deadlocks locks are scoped to origins; the locks acquired by a tab from https://example.com have no effect on the locks acquired by a tab from https://example.org:8080 as they are separate origins.
... monitoring the navigator.locks.query() method can be used by scripts to introspect the
state of the lock manager for the origin.
...the results are a snapshot of the lock manager
state, which identifies held and requested locks and some additional data (e.g.
Window: beforeunload event - Web APIs
the html specification
states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event.
... examples the html specification
states that authors should use the event.preventdefault() method instead of using event.returnvalue.
... window.addeventlistener('beforeunload', (event) => { // cancel the event as
stated by the standard.
XMLHttpRequest.response - Web APIs
the value is null if the request is not yet complete or was unsuccessful, with the exception that when reading text data using a responsetype of "text" or the empty string (""), the response can contain the response so far while the request is still in the loading ready
state (3).
...it works by creating an xmlhttprequest object and creating a listener for ready
statechange events such that that when ready
state changes to done (4), the response is obtained and passed into the callback function provided to load().
... var url = 'somepage.html'; //a local page function load(url, callback) { var xhr = new xmlhttprequest(); xhr.onready
statechange = function() { if (xhr.ready
state === 4) { callback(xhr.response); } } xhr.open('get', url, true); xhr.send(''); } specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequest.responseText - Web APIs
you know the entire content has been received when the value of ready
state becomes xmlhttprequest.done (4), and status becomes 200 ("ok").
... exceptions invalid
stateerror the xmlhttprequest.responsetype is not set to either the empty string or "text".
... example var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); // if specified, responsetype must be empty string or "text" xhr.responsetype = 'text'; xhr.onload = function () { if (xhr.ready
state === xhr.done) { if (xhr.status === 200) { console.log(xhr.response); console.log(xhr.responsetext); } } }; xhr.send(null); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequest.send() - Web APIs
exceptions exception description invalid
stateerror send() has already been invoked for the request, and/or the request is complete.
...}; xhr.send(null); // xhr.send('string'); // xhr.send(new blob()); // xhr.send(new int8array()); // xhr.send(document); example: post var xhr = new xmlhttprequest(); xhr.open("post", '/server', true); //send the proper header information along with the request xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.onready
statechange = function() { // call a function when the
state changes.
... if (this.ready
state === xmlhttprequest.done && this.status === 200) { // request finished.
XMLHttpRequest - Web APIs
xmlhttprequest.onready
statechange an eventhandler that is called whenever the ready
state attribute changes.
... xmlhttprequest.ready
state read only returns an unsigned short, the
state of the request.
... event handlers onready
statechange as a property of the xmlhttprequest instance is supported in all browsers.
XRSession.environmentBlendMode - Web APIs
important: environmentblendmode is part of the webxr augmented reality module, which has not yet reached a stable
state.
...the alpha values specified in the xrsession's render
state property's baselayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque).
... in this mode, the xrsession's render
state.baselayer property provides relative weights of the artificial layer during the compositing process.
XRSession.requestAnimationFrame() - Web APIs
the callback takes two parameters as inputs: an xrframe describing the
state of all tracked objects for the session, and a time stamp you can use to compute any animation updates needed.
...the callback receives as input two parameters: time a domhighrestimestamp indicating the time offset at which the updated viewer
state was received from the webxr device.
... xrframe an xrframe object describing the
state of the objects being tracked by the session.
XRSession: visibilitychange event - Web APIs
upon receiving the event, you can check the value of the session's visibility
state property to determine the new visibility
state.
... bubbles yes cancelable no interface xrsessionevent event handler property onvisibilitychange when the xrsession receives this event, the visibility
state has already been changed.
... examples this example demonstrates how to listen for a visibilitychange event on a webxr session, using addeventlistener() to begin listening for the event: navigator.xr.requestsession("inline").then((xrsession) => { xrsession.addeventlistener("visibilitychange", e => { switch(e.session.visiblity
state) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); }); when a visibility
state change occurs, the event is received and dispatched to a function mysessionvisible(), with a boolean parameter indicating whether or not the session is presently being displayed to the user.
XRWebGLLayer - Web APIs
examples binding the layer to a webgl context this snippet, taken from drawing a frame in movement, orientation, and motion: a webxr example, shows how the xrwebgllayer is obtained from the xrsession object's rendering
state and is then bound as the current rendering webgl framebuffer by calling the webgl bindframebuffer() function.
... let gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); rendering every view in a frame each time the gpu is ready to render the scene to the xr device, the xr runtime calls the function you specified when you called the xrsession method requestanimationframe() to ask to render the frame.
... let pose = xrframe.getviewerpose(xrreferencespace); if (pose) { let gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebffer); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the view */ } } specifications specification status comment webxr device apithe definition of 'xrwebgllayer' in that specification.
ARIA: cell role - Accessibility
associated wai-aria roles,
states, and properties context roles role="row" an element with role="row" is a row of cells within a tabular structure.
...
states and properties aria-colspan similar to the html <th> and <td> colspan attribute, it defines the number of columns spanned by the cell.
... keyboard interactions none required javascript features the first rule of aria use is if you can use a native feature with the semantics and behavior you require already built in, instead of repurposing an element and adding an aria role,
state or property to make it accessible, then do so.
ARIA: grid role - Accessibility
even though both data grids and layout grids employ the same aria roles,
states, and properties, differences in their content and purpose surface factors that are important to consider in keyboard interaction design.
... associated aria roles,
states, and properties roles treegrid (subclass) if a grid has columns that can expanded or collapsed, a treegrid can be used.
...
states and properties aria-level indicates the hierarchical level of the grid within other structures.
ARIA: gridcell role - Accessibility
if a gridcell is conditionally toggled into a
state where editing is prohibited, toggle aria-readonly on the gridcell element.
... associated wai-aria roles,
states, and properties grid communicates that a parent element is a a table or tree style grouping of information.
... best practices the first rule of aria is: if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding an aria role,
state or property to make it accessible.
ARIA - Accessibility
for instance, native elements have built-in keyboard accessibility, roles and
states.
...the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current
state of it and therefore must be kept updated with javascript.
...var progressbar = document.getelementbyid("percent-loaded"); // set its aria roles and
states, // so that assistive technologies know what kind of widget it is.
Mobile accessibility checklist - Accessibility
use alt and title where appropriate (see steve faulkner's post about using the html title attribute for a good guide.) if the above attributes are not applicable, use appropriate aria
states and properties such as aria-label, aria-labelledby, or aria-describedby.
... handling
state standard controls such as radio buttons and checkboxes are handled by the operating system.
... however, for other custom controls
state changes must be provided via aria
states such as aria-checked, aria-disabled, aria-selected, aria-expanded, and aria-pressed.
:checked - CSS: Cascading Style Sheets
the :checked css pseudo-class selector represents any radio (<input type="radio">), checkbox (<input type="checkbox">), or option (<option> in a <select>) element that is checked or toggled to an on
state.
... /* matches any checked/selected radio, checkbox, or option */ :checked { margin-left: 25px; border: 1px solid blue; } the user can engage this
state by checking/selecting an element, or disengage it by unchecking/deselecting the element.
..."]:checked { box-shadow: 0 0 0 3px orange; } /* checkbox element, when checked */ input[type="checkbox"]:checked { box-shadow: 0 0 0 3px hotpink; } /* option elements, when selected */ option:checked { box-shadow: 0 0 0 3px lime; color: red; } result toggling elements with a hidden checkbox this example utilizes the :checked pseudo-class to let the user toggle content based on the
state of a checkbox, all without using javascript.
:visited - CSS: Cascading Style Sheets
the alpha component of the element's non-:visited
state will be used instead, except when that component is 0, in which case the style set in :visited will be ignored entirely.
... html <a href="#test-visited-link">have you visited this link yet?</a><br> <a href="">you've already visited this link.</a> css a { /* specify non-transparent defaults to certain properties, allowing them to be styled with the :visited
state */ background-color: white; border: 1px solid white; } a:visited { background-color: yellow; border-color: hotpink; color: hotpink; } result specifications specification status comment html living standardthe definition of ':visited' in that specification.
...as never matched <link> elements with link pseudo-classes.safari ios full support 12samsung internet android full support 1.0notes full support 1.0notes notes chromium has never matched <link> elements with link pseudo-classes.restrict css properties allowed in a
statement using :visited for privacychrome full support 6edge full support 12firefox full support 4ie full support 8opera full support 15safari full support ...
Using CSS animations - CSS: Cascading Style Sheets
animations consist of two components, a style describing the css animation and a set of keyframes that indicate the start and end
states of the animation’s style, as well as possible intermediate waypoints.
... animation-play-
state lets you pause and resume the animation sequence.
...0% indicates the first moment of the animation sequence, while 100% indicates the final
state of the animation.
Using CSS transitions - CSS: Cascading Style Sheets
animations that involve transitioning between two
states are often called implicit transitions as the
states in between the start and final
states are implicitly defined by the browser.
...the relevant portions are shown here: a { color: #fff; background-color: #333; transition: all 1s ease-out; } a:hover, a:focus { color: #333; background-color: #fff; } this css establishes the look of the menu, with the background and text colors both changing when the element is in its :hover and :focus
states.
... this is treated as if the initial
state had never occurred and the element was always in its final
state.
Media queries - CSS: Cascading Style Sheets
you can also use mediaquerylist.addlistener() to be notified whenever the
state of a query changes.
... with this functionality, your site or app can respond to changes in the device configuration, orientation, or
state.
... testing media queries programmatically describes how to use media queries in your javascript code to determine the
state of a device, and to set up listeners that notify your code when the results of media queries change (such as when the user rotates the screen or resizes the browser).
Cross-browser audio basics - Developer guides
media playing events we also have another set of events that are useful for reacting to the
state of the media playback.
...this is when the
state of the media switches from paused to playing.
...this is when the
states switch from playing to paused.
User input and controls - Developer guides
when screen orientation matters for your application, through the screen orientation api you can read the screen orientation
state and perform other actions.
... screen orientation when screen orientation matters for your application, you can read the screen orientation
state, be informed when this
state changes, and able to lock the screen orientation to a specific
state (usually portrait or landscape) through the screen orientation api.
... contenteditable demo this is a working example showing how contenteditable can be used to create an editable document section, the
state of which is then saved using localstorage.
HTML attribute: pattern - HTML: Hypertext Markup Language
if a non-null value doesn't conform to the constraints set by the pattern value, the validity
state object's read-only patternmismatch property will be true.
...if the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the validity
state object's read-only typemismatch property will be true.
... input:invalid { border: red solid 3px; } had we used minlength and maxlength attributes instead, we may have seen validity
state.toolong or validity
state.tooshort being true.
<input type="button"> - HTML: Hypertext Markup Language
a settimeout() function is then used to reset the button back to its enabled
state after two seconds.
... type="button" value="enabled"> const button = document.queryselector('input'); button.addeventlistener('click', disablebutton); function disablebutton() { button.disabled = true; button.value = 'disabled'; window.settimeout(function() { button.disabled = false; button.value = 'enabled'; }, 2000); } if the disabled attribute isn't specified, the button inherits its disabled
state from its parent element.
...="button 3"> </fieldset> const button = document.queryselector('input'); const fieldset = document.queryselector('fieldset'); button.addeventlistener('click', disablebutton); function disablebutton() { fieldset.disabled = true; window.settimeout(function() { fieldset.disabled = false; }, 2000); } note: firefox will, unlike other browsers, by default, persist the dynamic disabled
state of a <button> across page loads.
<input type="radio"> - HTML: Hypertext Markup Language
it's fairly uncommon to actually want to allow the form to be submitted without any of the radio buttons in a group selected, so it is usually wise to have one default to the checked
state.
... unlike other browsers, firefox by default persists the dynamic checked
state of an <input> across page loads.
... notice that when clicking on a radio button, there's a nice, smooth fade out/in effect as the two buttons change
state.
Using the application cache - HTML: Hypertext Markup Language
this sets the application cache's
state to obsolete.
... cache
states each application cache has a
state, which indicates the current condition of the cache.
... caches that share the same manifest uri share the same cache
state, which can be one of the following: uncached a special value that indicates that an application cache object is not fully initialized.
Cross-Origin Resource Sharing (CORS) - HTTP
code of this sort might be used in javascript deployed on foo.example: const xhr = new xmlhttprequest(); const url = 'https://bar.other/resources/public-data/'; xhr.open('get', url); xhr.onready
statechange = somehandler; xhr.send(); this performs a simple exchange between the client and the server, using cors headers to handle the privileges: let's look at what the browser will send to the server in this case, and let's see how the server responds: get /resources/public-data/ http/1.1 host: bar.other user-agent: mozilla/5.0 (macintosh; intel mac os x 10.14; rv:71.0) gecko/20100101 firef...
... the following is an example of a request that will be preflighted: const xhr = new xmlhttprequest(); xhr.open('post', 'https://bar.other/resources/post-here/'); xhr.setrequestheader('x-pingother', 'pingpong'); xhr.setrequestheader('content-type', 'application/xml'); xhr.onready
statechange = handler; xhr.send('<person><name>arun</name></person>'); the example above creates an xml body to send with the post request.
...content on foo.example might contain javascript like this: const invocation = new xmlhttprequest(); const url = 'http://bar.other/resources/credentialed-content/'; function callotherdomain() { if (invocation) { invocation.open('get', url, true); invocation.withcredentials = true; invocation.onready
statechange = handler; invocation.send(); } } line 7 shows the flag on xmlhttprequest that has to be set in order to make the invocation with cookies, namely the withcredentials boolean value.
HTTP Index - HTTP
http is a
stateless protocol, meaning that the server does not keep any data (
state) between two requests.
... 226 205 reset content http, http status code, reference, status code the http 205 reset content response status tells the client to reset the document view, so for example to clear the content of a form, reset a canvas
state, or to refresh the ui.
... 244 409 conflict client error, http, http status code, reference the http 409 conflict response status code indicates a request conflict with current
state of the server.
JavaScript data types and data structures - JavaScript
false obsolete attributes (as of ecmascript 3, renamed in ecmascript 5) attribute type description read-only boolean reversed
state of the es5 [[writable]] attribute.
... dontenum boolean reversed
state of the es5 [[enumerable]] attribute.
... dontdelete boolean reversed
state of the es5 [[configurable]] attribute.
About the JavaScript reference - JavaScript
statements and declarations javascript applications consist of
statements with an appropriate syntax.
... a single
statement may span multiple lines.
... multiple
statements may occur on a single line if each
statement is separated by a semicolon.
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
the javascript warning "javascript 1.6's for-each-in loops are deprecated; consider using es6 for-of instead" occurs when a for each (variable in obj)
statement is used.
... javascript 1.6's for each (variable in obj)
statement is deprecated, and will be removed in the near future.
... deprecated syntax function func(array) { for each (var x in array) { console.log(x); } } func([10, 20]); // 10 // 20 func(null); // prints nothing func(undefined); // prints nothing alternative standard syntax to rewrite for each...in
statements so that values can be null or undefined with for...of as well, you need to guard around for...of.
SyntaxError: missing = in const declaration - JavaScript
the javascript exception "missing = in const declaration" occurs when a const declaration was not given a value in the same
statement (like const red_flag;).
...an initializer for a constant is required; that is, you must specify its value in the same
statement in which it's declared (which makes sense, given that it can't be changed later).
... adding a constant value specify the constant value in the same
statement in which it's declared: const columns = 80; const, let or var?
Boolean - JavaScript
any object of which the value is not undefined or null, including a boolean object whose value is false, evaluates to true when passed to a conditional
statement.
... for example, the condition in the following if
statement evaluates to true: var x = new boolean(false); if (x) { // this code is executed } this behavior does not apply to boolean primitives.
... for example, the condition in the following if
statement evaluates to false: var x = false; if (x) { // this code is not executed } do not use a boolean object to convert a non-boolean value to a boolean value.
Object.freeze() - JavaScript
.quaxxor = 'the friendly duck'; // in strict mode such attempts will throw typeerrors function fail(){ 'use strict'; obj.foo = 'sparky'; // throws a typeerror delete obj.foo; // throws a typeerror delete obj.quaxxor; // returns true since attribute 'quaxxor' was never added obj.sparky = 'arf'; // throws a typeerror } fail(); // attempted changes through object.defineproperty; // both
statements below throw a typeerror.
... object.defineproperty(obj, 'ohai', { value: 17 }); object.defineproperty(obj, 'foo', { value: 'eit' }); // it's also impossible to change the prototype // both
statements below will throw a typeerror.
...the object being frozen is said to be immutable because the entire object
state (values and references to other objects) within the whole object is fixed.
Promise.all() - JavaScript
= promise.all([1,2,3, promise.resolve(444)]); // this will be counted as if the iterable passed contains only the rejected promise with value "555", so it gets rejected var p3 = promise.all([1,2,3, promise.reject(555)]); // using settimeout we can execute code after the stack is empty settimeout(function() { console.log(p); console.log(p2); console.log(p3); }); // logs // promise { <
state>: "fulfilled", <value>: array[3] } // promise { <
state>: "fulfilled", <value>: array[4] } // promise { <
state>: "rejected", <reason>: 555 } asynchronicity or synchronicity of promise.all this following example demonstrates the asynchronicity (or synchronicity, if the iterable passed is empty) of promise.all: // we are passing as argument an array of promises that are already resolved, // to tr...
...igger promise.all as soon as possible var resolvedpromisesarray = [promise.resolve(33), promise.resolve(44)]; var p = promise.all(resolvedpromisesarray); // immediately logging the value of p console.log(p); // using settimeout we can execute code after the stack is empty settimeout(function() { console.log('the stack is now empty'); console.log(p); }); // logs, in order: // promise { <
state>: "pending" } // the stack is now empty // promise { <
state>: "fulfilled", <value>: array[2] } the same thing happens if promise.all rejects: var mixedpromisesarray = [promise.resolve(33), promise.reject(44)]; var p = promise.all(mixedpromisesarray); console.log(p); settimeout(function() { console.log('the stack is now empty'); console.log(p); }); // logs // promise { <
state>: "pendin...
...g" } // the stack is now empty // promise { <
state>: "rejected", <reason>: 44 } but, promise.all resolves synchronously if and only if the iterable passed is empty: var p = promise.all([]); // will be immediately resolved var p2 = promise.all([1337, "hi"]); // non-promise values will be ignored, but the evaluation will be done asynchronously console.log(p); console.log(p2) settimeout(function() { console.log('the stack is now empty'); console.log(p2); }); // logs // promise { <
state>: "fulfilled", <value>: array[0] } // promise { <
state>: "pending" } // the stack is now empty // promise { <
state>: "fulfilled", <value>: array[2] } promise.all fail-fast behaviour promise.all is rejected if any of the elements are rejected.
Promise.race() - JavaScript
gger promise.race as soon as possible var resolvedpromisesarray = [promise.resolve(33), promise.resolve(44)]; var p = promise.race(resolvedpromisesarray); // immediately logging the value of p console.log(p); // using settimeout we can execute code after the stack is empty settimeout(function(){ console.log('the stack is now empty'); console.log(p); }); // logs, in order: // promise { <
state>: "pending" } // the stack is now empty // promise { <
state>: "fulfilled", <value>: 33 } an empty iterable causes the returned promise to be forever pending: var foreverpendingpromise = promise.race([]); console.log(foreverpendingpromise); settimeout(function(){ console.log('the stack is now empty'); console.log(foreverpendingpromise); }); // logs, in order: // promise { <
state>: "pend...
...ing" } // the stack is now empty // promise { <
state>: "pending" } if the iterable contains one or more non-promise value and/or an already settled promise, then promise.race will resolve to the first of these values found in the array: var foreverpendingpromise = promise.race([]); var alreadyfulfilledprom = promise.resolve(100); var arr = [foreverpendingpromise, alreadyfulfilledprom, "non-promise value"]; var arr2 = [foreverpendingpromise, "non-promise value", promise.resolve(100)]; var p = promise.race(arr); var p2 = promise.race(arr2); console.log(p); console.log(p2); settimeout(function(){ console.log('the stack is now empty'); console.log(p); console.log(p2); }); // logs, in order: // promise { <
state>: "pending" } // promise { <
state>: "pending" } // the stack is now emp...
...ty // promise { <
state>: "fulfilled", <value>: 100 } // promise { <
state>: "fulfilled", <value>: "non-promise value" } using promise.race – examples with settimeout var p1 = new promise(function(resolve, reject) { settimeout(() => resolve('one'), 500); }); var p2 = new promise(function(resolve, reject) { settimeout(() => resolve('two'), 100); }); promise.race([p1, p2]) .then(function(value) { console.log(value); // "two" // both fulfill, but p2 is faster }); var p3 = new promise(function(resolve, reject) { settimeout(() => resolve('three'), 100); }); var p4 = new promise(function(resolve, reject) { settimeout(() => reject(new error('four')), 500); }); promise.race([p3, p4]) .then(function(value) { console.log(value); // "three" // p3 is faster, so it fulfills }, ...
Symbol.unscopables - JavaScript
note that if using strict mode, with
statements are not available and will likely also not need this symbol.
... property attributes of symbol.unscopables writable no enumerable no configurable no examples scoping in with
statements the following code works fine in es5 and below.
...a built-in unscopables setting is implemented as array.prototype[@@unscopables] to prevent that some of the array methods are being scoped into the with
statement.
new operator - JavaScript
for example, the
statement car1.color = "black" adds a property color to car1, and assigns it a value of "black".
...to do this, you would write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } now you can create an object called mycar as follows: var mycar = new car('eagle', 'talon tsi', 1993); this
statement creates mycar and assigns it the specified values for its properties.
...follows: function car(make, model, year, owner) { this.make = make; this.model = model; this.year = year; this.owner = owner; } to instantiate the new objects, you then use the following: var car1 = new car('eagle', 'talon tsi', 1993, rand); var car2 = new car('nissan', '300zx', 1992, ken); instead of passing a literal string or integer value when creating the new objects, the above
statements pass the objects rand and ken as the parameters for the owners.
yield - JavaScript
the next time next() is called, execution resumes with the
statement immediately after the yield.
... a return
statement is reached.
... in this case, execution of the generator ends and an iteratorresult is returned to the caller in which the value is the value specified by the return
statement and done is true.
async function - JavaScript
syntax async function name([param[, param[, ...param]]]) {
statements } parameters name the function’s name.
...
statements the
statements comprising the body of the function.
...turns a promise }) .then(v => { return processdatainworker(v) // returns a promise }) } it can be rewritten with a single async function as follows: async function getprocesseddata(url) { let v try { v = await downloaddata(url) } catch(e) { v = await downloadfallbackdata(url) } return processdatainworker(v) } in the above example, notice there is no await
statement after the return keyword, although that would be valid too: the return value of an async function is implicitly wrapped in promise.resolve - if it's not already a promise itself (as in this example).
var - JavaScript
the var
statement declares a function-scoped or globally-scoped variable, optionally initializing it to a value.
...the value will be indeed assigned when the assignment
statement is reached: function do_something() { console.log(bar); // undefined var bar = 111; console.log(bar); // 111 } // ...is implicitly understood as: function do_something() { var bar; console.log(bar); // undefined bar = 111; console.log(bar); // 111 } examples declaring and initializing two variables var a = 0, b = 0; assigning two variables with single string value var ...
...console.log(x, z); // 3 5 console.log(typeof y); // "undefined", as y is local to function a specifications specification ecmascript (ecma-262)the definition of 'variable
statement' in that specification.
Navigation and resource timings - Web Performance
domloading when the parser started its work, that is when its document.ready
state changes to 'loading' and the corresponding ready
statechange event is thrown.
... dominteractive when the parser finished its work on the main document, that is when its document.ready
state changes to 'interactive' and the corresponding ready
statechange event is thrown.
... domcomplete when the parser finished its work on the main document, that is when its document.ready
state changes to 'complete' and the corresponding ready
statechange event is thrown.
Classes and Inheritance - Archive of obsolete content
data members are properties that allow each instance to have their own
state, whereas member functions are properties that allow instances to have behavior.
... inheritance allows classes to inherit
state and behavior from an existing classes, known as the base class.
Contributor's Guide - Archive of obsolete content
data members are properties that allow each instance to have their own
state, whereas member functions are properties that allow instances to have behavior.
... inheritance allows classes to inherit
state and behavior from an existing classes, known as the base class.
Working with Events - Archive of obsolete content
objects emit events on
state changes that might be of interest to add-on code, such as browser windows opening, pages loading, network requests completing, and mouse clicks.
...nt: var ui = require("sdk/ui"); var panels = require("sdk/panel"); var self = require("sdk/self"); var panel = panels.panel({ contenturl: self.data.url("panel.html") }); panel.on("*", function(e) { console.log("event " + e + " was emitted"); }); var button = ui.actionbutton({ id: "my-button", label: "my button", icon: "./icon-16.png", onclick: handleclick }); function handleclick(
state) { panel.show({ position: button }); } this wildcard feature does not yet work for the tabs or windows modules.
ui - Archive of obsolete content
you give it an icon, a label, and a click handler: var ui = require("sdk/ui"); var action_button = ui.actionbutton({ id: "my-button", label: "action button!", icon: "./icon.png", onclick: function(
state) { console.log("you clicked '" +
state.label + "'"); } }); you can make a button standalone or add it to a toolbar.
... if it's standalone, it appears in the toolbar at the top right of the browser window: togglebutton a toggle button is a special kind of button that's for representing a binary on/off
state, like a checkbox.
widget - Archive of obsolete content
var tabs = require("sdk/tabs"); var windows = require("sdk/windows").browserwindows; var widget = require("sdk/widget").widget({ id: "window-specific-test", label: "widget with content specific to each window", content: " ", width: 50 }); // observe tab switch or document changes in each existing tab: function updatewidget
state(tab) { var view = widget.getview(tab.window); if (!view) return; // update widget displayed text: view.content = tab.url.match(/^https/) ?
... "secured" : "unsafe"; } tabs.on('ready', updatewidget
state); tabs.on('activate', updatewidget
state); methods destroy() removes the widget view from the add-on bar.
test/assert - Archive of obsolete content
you can use this object to make assertions about your program's
state.
... assert an object used to make assertions about a program's
state in order to implement unit tests.
ui/frame - Archive of obsolete content
it's the equivalent of the point where the frame's document.ready
state becomes "interactive": var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("ready", ping); function ping(e) { // message only this frame instance e.source.postmessage("pong", e.origin); } arguments event : this contains two properties: source, which defines a postmessage() function which you can use to send messages back to this particu...
...it's the equivalent of the point where the frame's document.ready
state becomes "complete": var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("load", ping); function ping(e) { e.source.postmessage("ping", "*"); } arguments event : this contains two properties: source, which defines a postmessage() function which you can use to send messages back to this particular frame instance.
ui/toolbar - Archive of obsolete content
a toolbar is a horizontal strip of user interface real e
state.
... hidden
state persists even over create/destroy cycles: if a toolbar is created, then hidden, then destroyed, and another toolbar with the same title is then created, the new toolbar will be in the hidden
state.
Getting Started (jpm) - Archive of obsolete content
open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(
state) { tabs.open("http://www.mozilla.org/"); } note that "entry point" defaults to "index.js" in jpm, meaning that your main file is "index.js", and it is found directly in your add-on's root.
...for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(
state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute jpm run again.
Getting started (cfx) - Archive of obsolete content
open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(
state) { tabs.open("https://www.mozilla.org/"); } save the file.
...for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(
state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute cfx run again.
Extension Etiquette - Archive of obsolete content
make sure your extension's homepage
states the "obvious," including the purpose of your extension.
...for instance, a boolean for the reporter extension's option for hiding the privacy
statement is "extensions.reporter.hideprivacy
statement".
Adding windows and dialogs - Archive of obsolete content
attribute persistence user actions can change the
state of your windows, such as selecting an option in a listbox, or entering text in a textbox.
...you need some way of remembering the user-manipulated attribute values so that the window reloads it last
state when opened.
Appendix F: Monitoring DOM changes - Archive of obsolete content
hashchange and pop
state events most ajax-heavy sites update the url when they significantly change their content, either via a change to the fragment identifier (hash) or more recently via the history.push
state method.
... the former triggers a hashchange event while the latter triggers a pop
state event.
Custom XUL Elements with XBL - Archive of obsolete content
but there is one thing you need to know about moving or cloning your node: all internal
state in the node will be lost.
... with inheritance you could take the richlistbox element and modify it to make a rich item tree, or create a switch button that changes
state everytime it's clicked.
CSS3 - Archive of obsolete content
clarifies: interaction of media-dependent @import
statements and style sheet loading requirements.
... css animations working draft allows the definition of animations effects by adding the css animation, animation-delay,animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-
state, and animation-timing-function properties, as well as the @keyframes at-rule.
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
system and hence use either user or username, but i'm not that fluent in javascript, let me know if you know how...// windows call file $ cat mci-mozilla-web-win.js lockpref("general.config.vendor", "mci-mozilla-web-win"); lockpref("autoadmin.global_config_url","http://corbeau.int-evry.fr/cgi-bin/mci-mozilla-glob-prefs-win.cgi"); windows autoconf.js file to be encoded by moz-byteshift.pl as
stated above...
...beware that in windows, that file is already there, so it must be saved before being replaced by ours, in order to come back to a normal
state in case of problem.
Adding the structure - Archive of obsolete content
class="statusbarpanel-iconic" id="tinderbox-status" status="none"/> <statusbarpanel class="statusbarpanel-iconic" id="offline-status"/> <statusbarpanel class="statusbarpanel-iconic" id="security-button" onclick="browserpageinfo(null, 'securitytab')"/> </statusbar> the statusbar xul element defines a horizontal status bar where informative messages about an application's
state can be displayed.
... the status attribute is not part of the xul definition for the statusbarpanel element, but is used by our extension to store the current tinderbox
state.
Getting Started - Archive of obsolete content
for this reason we suggest that you install a second copy into a second directory (make sure that you use a different profile as
stated in the release notes) extract the chrome the chrome is stored in \mozilla\chrome and the individual modules are stored in jar files.
...this section defines the normal button in its basic
state (there is no mouse over it, it's not disabled, and it's not selected).
In-Depth - Archive of obsolete content
if you look through the rest of this file, you'll also notice that there are regions for the different
states of #back-button.
...each row is a different icon in one of its 4 different
states (normal, hover, mouse down, and disabled).
Layout FAQ - Archive of obsolete content
on the reflow branch you could check the dirty and dirty_children frame
state flags.
... block(body)(1)@035ff490 {120,120,8820,600} [
state=00000010] sc=035ff264(i=2,b=0)< line 035ffc18: count=1
state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:linebr[0x5100] {0,0,330,300} < inline(span)(0)@035ffa04 next=035ffc48 next-continuation=035ffc48 {0,7,330,285} [content=0359ed50] [sc=035ff990]< text(0)@035ffa8c[0,4,t] next=035ffb1c {0,0,330,285} [
state=41600020] sc=035ffa3c pst=:-moz-non-element< "\nabc" > frame(br)(1)@035ffb1c {330,225,0,0} [
state=00000020] [content=035aebf0] > > the linebox is used to contain everything on a single line: exam...
JavaScript Client API - Archive of obsolete content
the next three methods are called by the sync algorithm when it determines that the
state of the local application needs to be changed to keep it up-to-date with the user's remote activities.
...it's up to you to figure out the best way to assign a score based on the current
state of whatever data type you're tracking.
JavaScript crypto - Archive of obsolete content
this also means the ssl client authentication
state will be erased for ssl sites with client authentication, and a client certificate prompt will appear again the next time the user connects to the site.
... note: this function provides a convenient way to erase the ssl session
state at the browser level, but in order to really guarantee that the
state is erased, it is more secure to do it on the server side whenever possible.
Space Manager Detailed Design - Archive of obsolete content
loatdamage() { return !mfloatdamage.isempty(); } void includeindamage(nscoord aintervalbegin, nscoord aintervalend) { mfloatdamage.includeinterval(aintervalbegin + my, aintervalend + my); } prbool intersectsdamage(nscoord aintervalbegin, nscoord aintervalend) { return mfloatdamage.intersects(aintervalbegin + my, aintervalend + my); } #ifdef debug /** * dump the
state of the spacemanager out to a file */ nsresult list(file* out); void sizeof(nsisizeofhandler* ahandler, pruint32* aresult) const; #endif private: // structure that maintains information about the region associated // with a particular frame struct frameinfo { nsiframe* const mframe; nsrect mrect; // rectangular region frameinfo* mnext; frameinfo(...
... */ prbool hasfloatdamage() { return !mfloatdamage.isempty(); } void includeindamage(nscoord aintervalbegin, nscoord aintervalend) { mfloatdamage.includeinterval(aintervalbegin + my, aintervalend + my); } prbool intersectsdamage(nscoord aintervalbegin, nscoord aintervalend) { return mfloatdamage.intersects(aintervalbegin + my, aintervalend + my); } debug only methods /** * dump the
state of the spacemanager out to a file */ nsresult list(file* out); void sizeof(nsisizeofhandler* ahandler, pruint32* aresult) const; unused / obsolete methods /* * get the frame that's associated with the space manager.
autocheck - Archive of obsolete content
« xul reference home autocheck type: boolean if this attribute is true or left out, the checked
state of the button will be switched each time the button is pressed.
... if this attribute is false, the checked
state must be adjusted manually.
Attribute (XUL) - Archive of obsolete content
autofillaftermatch autoscroll beforeselected buttonaccesskeyaccept buttonaccesskeycancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked check
state clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disab...
... preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex seltype setfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src
state statedatasource statusbar statustext style subject sub
state suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var visuallyselected wait-cursor width windowtype wrap wraparound ...
Building accessible custom components in XUL - Archive of obsolete content
further reading table of supported roles and
states in firefox focus issues download stage-3.zip install stage-3.xpi the next step on the road to an accessible spreadsheet is the focus problem.
...<code> <window id="accjax" title="accjax spreadsheet" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:x2="http://www.w3.org/tr/xhtml2" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/guiroletaxonomy#" xmlns:wai
state="http://www.w3.org/2005/01/wai-rdf/gui
statetaxonomy#" onload="install_handlers()" > <script src="accjax.js"/> </code> by adding this javascript code and these css rules, we can tab to the spreadsheet see which cell, row header, or column header has focus click on other cells or headers to change focus within the spreadsheet tab off the spreadsheet by pressing tab once tab back to the sp...
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked check
state child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customt...
... searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src
state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri useraction value valuenumber view webbrowserefind webnavigation webprogress width wizardpages wra...
Building Trees - Archive of obsolete content
note: if you want to have the
state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute.
... these are used to track the current
state of the disclosure triangles.
SQLite Templates - Archive of obsolete content
the query for an sqlite datasource is just an sql select
statement, as text inside the query element.
...note also that the query
statement has a where clause which restricts the rows to those with an age greater or equal to 30.
XML Templates - Archive of obsolete content
note: if you want to have the
state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute.
... these are used to track the current
state of the disclosure triangles.
textbox (Toolkit autocomplete) - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the
state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
Textbox (XPFE autocomplete) - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the
state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
XUL Questions and Answers - Archive of obsolete content
an example of this is this: // associate the progress listener for a "browser" to a listener object browserobject.addprogresslistener( listobj, components.interfaces.nsiwebprogress.notify_
state_window ); // remember to define the object, something like this: listobj = new object(); listobj.wpl = components.interfaces.nsiwebprogresslistener; listobj.queryinterface = function(aiid) { if (aiid.equals(listobj.wpl) || aiid.equals(components.interfaces.nsisupportsweakreference) || aiid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_...
...nointerface; } listobj.on
statechange = function(aprogress, arequest, aflag, astatus) { if (aflag & listobj.wpl.
state_start) { // this fires when the load event is initiated } else { if (aflag & listobj.wpl.
state_stop) { if ( aflag & listobj.wpl.
state_is_window ) { // this fires when all load finish } if ( aflag & listobj.wpl.
state_is_network ) { // fires when all load are really over, // do something "final" here // (my two cents) } else { // this fires when a load finishes } } } return 0; } // this fires when the location bar changes i.e load event is confirmed // or when the user switches tabs listobj.onlocationchange = function(aprogress, arequest, auri) { // do whatever you want to do return ...
checkbox - Archive of obsolete content
the user can switch the
state of the check box by selecting it with the mouse.
... visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
colorpicker - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the
state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
prefpane - Archive of obsolete content
void userchangedvalue(in domelement element); the user changed the value in a widget that the preferences system does not automatically track
state changes for (1) and the preference element associated with the widget should be updated based on the
state held by the widget.
... (1) an example of a widget that has
state changes tracked for it includes the checkbox element, whose
state is tracked automatically when the "command" event fires.
Mozilla release FAQ - Archive of obsolete content
you can find the binaries at mozilla.org's binaries page on win32, it fails to build, with the message '.\win32' unexpected you didn't properly set the environment variables -- you must not include a space at the end of the set
statements (be careful if you are cut'n'pasting).
...this is not meant to
state that the port is not worthwhile, but that it will be difficult.
2006-11-22 - Archive of obsolete content
idispatch support for jaws scripting needed aaron leventhal
stated that currently there is no idispatch support for iaccessible's in mozilla.
... if anyone has experience with these issues, and is comfortable helping out in the mozilla/accessible module, would you please take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=166994 he
stated that he almost had it working a couple of years ago.
Table Reflow Internals - Archive of obsolete content
absolutely positioned elements) reflows reflowee and passes a reflow
state (in) and a reflow metrics (in/out) review of reflow the reflow
state: is a node in a tree structurally equivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved style structs possible request for preferred size and more.
... special height reflow the reflow
state holds an observer and initiator observer is the table cell used as the height basis set by frame without computed height in didreflow gives its block a computed height during 3rd pass doesn't change height during 3rd pass initiator is the table containing the observer starts the 3rd pass reflow and sets a bit in the reflow
state gives its block a computed height during 3rd pass could also be ...
Common Firefox theme issues and solutions - Archive of obsolete content
hover > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 32px, 16px, 16px); } #identity-box:hover:active > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon, #identity-box[open=true] > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 48px, 16px, 32px); } #page-proxy-favicon[pageproxy
state="invalid"] { opacity: 0.5; } for more information about identity boxes please see the identity box section of the amo editors theme review guidelines no visual clue for disabled url bars there needs to be a visual clue when url bar is disabled.
...the color style for the following
statements need to be adjusted: .inspector-breadcrumbs-button { .inspector-breadcrumbs-button[checked] > .inspector-breadcrumbs-tag { .inspector-breadcrumbs-button[checked] > .inspector-breadcrumbs-id { .inspector-breadcrumbs-id, .inspector-breadcrumbs-classes { style inspector breadcrumb button backgrounds are not consistent between pre-ff14 and ff14+ the use of the styling rule fill in -moz-...
E4X for templating - Archive of obsolete content
return _else(cond); } return ''; // empty string allows conditions in attribute as well as element content } for example: {_if(elems.length(), function () <description>{elems[0]}</description>, function _else () <label>no data</label> )} note that the simple xmllist() constructor (<></>) may be useful to still be able to use an expression closure (i.e., without needing return
statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates (to be eval()d at a later time, taking into account security considerations, such as escaping with the above), e4x content using such functions can also be easily serialized inline (and then perhaps converted to the dom) as ...
...inline functions as explained in the tutorial, it is possible to use anonymous functions inline (returning the desired content, including potentially xmllist's) in order to execute more than a single related
statement, keeping this logic together with the resulting xml.
Processing XML with E4X - Archive of obsolete content
we can also use the for each...in
statement introduced in javascript 1.6 as part of javascript's e4x support: for each (var lang in languages.lang) { alert(lang); } for each...in can also be used with regular javascript objects to iterate over the values (as opposed to the keys) contained in the object.
...fied using an expression contained in parentheses: var html = <html> <p id="p1">first paragraph</p> <p id="p2">second paragraph</p> </html>; alert(html.p.(@id == "p1")); // alerts "first paragraph" nodes matching the path before the expression (in this case the paragraph elements) are added to the scope chain before the expression is evaluated, as if they had been specified using the with
statement.
Namespaces - Archive of obsolete content
you can declare the default namespace for your e4x objects by placing the
statement: default xml namespace = "http://www.w3.org/1999/xhtml"; within the same scope as your e4x.
... you can also change namespaces at any time, by repeating the
statement.
Array comprehensions - Archive of obsolete content
multiple for-of iterations or if
statements are allowed.
... examples simple array comprehensions [for (i of [1, 2, 3]) i * i ]; // [1, 4, 9] var abc = ['a', 'b', 'c']; [for (letters of abc) letters.tolowercase()]; // ["a", "b", "c"] array comprehensions with if
statement var years = [1954, 1974, 1990, 2006, 2010, 2014]; [for (year of years) if (year > 2000) year]; // [2006, 2010, 2014] [for (year of years) if (year > 2000) if (year < 2010) year]; // [2006], the same as below: [for (year of years) if (year > 2000 && year < 2010) year]; // [2006] array comprehensions compared to map and filter an easy way to understand array comprehension syntax, is to comp...
Generator comprehensions - Archive of obsolete content
multiple for-of iterations or if
statements are allowed.
... examples simple generator comprehensions (for (i of [1, 2, 3]) i * i ); // generator function which yields 1, 4, and 9 [...(for (i of [1, 2, 3]) i * i )]; // [1, 4, 9] var abc = ['a', 'b', 'c']; (for (letters of abc) letters.tolowercase()); // generator function which yields "a", "b", and "c" generator comprehensions with if
statement var years = [1954, 1974, 1990, 2006, 2010, 2014]; (for (year of years) if (year > 2000) year); // generator function which yields 2006, 2010, and 2014 (for (year of years) if (year > 2000) if (year < 2010) year); // generator function which yields 2006, the same as below: (for (year of years) if (year > 2000 && year < 2010) year); // generator function which yields 2006 generator compre...
New in JavaScript 1.2 - Archive of obsolete content
arguments new properties function.arity new methods array.prototype.concat() array.prototype.slice() string.prototype.charcodeat() string.prototype.concat() string.fromcharcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new
statements labeled
statements switch do...while import export other new features regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions.
... the break and continue
statements can now be used with the new labeled
statement.
New in JavaScript 1.7 - Archive of obsolete content
iterators and generators array comprehensions let
statement (support for let expression was dropped in gecko 41, see bug 1023609).
... const
statement destructuring assignment (support for js1.7 style destructuring for-in was dropped in gecko 40, see bug 1083498).
WebVR — Virtual Reality for the Web - Game development
for example: function setcustomfov(up,right,down,left) { var testfov = new vrfieldofview(up,right,down,left); ghmd.setfieldofview(testfov,testfov,0.01,10000.0); } the gpositionsensor variable holds the positionsensorvrdevice — using this you can get the current position or orientation
state (for example to update the scene view on every frame), or reset the sensor.
... for example, the below code outputs position information on the screen: function setview() { var pos
state = gpositionsensor.get
state(); if(pos
state.hasposition) { pospara.textcontent = 'position: x' + roundtotwo(pos
state.position.x) + " y" + roundtotwo(pos
state.position.y) + " z" + roundtotwo(pos
state.position.z); xpos = -pos
state.position.x * width * 2; ypos = pos
state.position.y * height * 2; if(-pos
state.position.z > 0.01) { zpos = -pos
state.position.z; } else { zpos = 0.01; } } ...
Audio for Web games - Game development
the htmlmediaelement interface comes with lots of properties to help determine whether a track is in a
state to be playable.
...ueryselector('button'); // load file loadfile(anchor.href).then((track) => { // set loading to false el.dataset.loading = 'false'; // hide loading text loadtext.style.display = 'none'; // show button playbutton.style.display = 'inline-block'; // allow play on click playbutton.addeventlistener('click', function() { // check if context is in suspended
state (autoplay policy) if (audioctx.
state === 'suspended') { audioctx.resume(); } playtrack(track); playbutton.dataset.playing = true; }) }) }) note: you can see this demo in action here and view the source code here.
Mobile touch controls - Game development
implementation the easiest way to add an interactive object that will listen for user input is to create a button: var buttonenclave = this.add.button(10, 10, 'logo-enclave', this.clickenclave, this); this one is formed in the mainmenu
state — it will be placed ten pixels from the top left corner of the screen, use the logo-enclave image, and execute the clickenclave() function when it is touched.
...the initialization of virtual joystick looks like this: this.pad = this.game.plugins.add(phaser.virtualjoystick); this.stick = this.pad.addstick(30, 30, 80, 'generic'); in the create() function of the game
state we're creating a virtual pad and a generic stick that has four directional virtual buttons by default.
Unconventional controls - Game development
you can also check this handy cheat sheet seen below if you're working with panasonic tvs running firefox os: you can add moving between
states, starting a new game, controlling the ship and blowing stuff up, pausing and restarting the game.
... we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the
state of our hand's grab status.
Efficient animation for web games - Game development
though javascript animations can be easier to express at times, unless you have a great need to synchronise ui animation
state with game animation
state, you’re unlikely to be able to do a better job than the browser.
...iding its requestanimationframe function with a custom version that makes the request, and appending the game’s drawing function onto the end of the callback like so: animator.requestanimationframe = function(callback) { requestanimationframe(function(t) { callback(t); redraw(); }); }; the game’s redraw function does all drawing, and the animation callbacks just update
state.
Game over - Game development
we'll edit the second if block so it's an if else block that will trigger our "game over"
state upon the ball colliding with the bottom edge of the canvas.
... first, replace where you initially called setinterval() setinterval(draw, 10); with: var interval = setinterval(draw, 10); then replace the second if
statement with the following: if(y + dy < ballradius) { dy = -dy; } else if(y + dy > canvas.height-ballradius) { alert("game over"); document.location.reload(); clearinterval(interval); // needed for chrome to end game } letting the paddle hit the ball the last thing to do in this lesson is to create some kind of collision detection between the ball and the paddle, so it can bounce off it and get back into the play area.
Block - MDN Web Docs Glossary: Definitions of Web-related terms
block (scripting) in javascript, a block is a collection of related
statements enclosed in braces ("{}").
... for example, you can put a block of
statements after an if (condition) block, indicating that the interpreter should run the code inside the block if the condition is true, or skip the whole block if the condition is false.
Boolean - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in javascript, boolean conditionals are often used to decide which sections of code to execute (such as in if
statements) or repeat (such as in for loops).
... /* javascript if
statement */ if (boolean conditional) { // code to execute if the conditional is true } if (boolean conditional) { console.log("boolean conditional resolved to true"); } else { console.log("boolean conditional resolved to false"); } /* javascript for loop */ for (control variable; boolean conditional; counter) { // code to execute repeatedly if the conditional is true } for (var i=0; i < 4; i++) { console.log("i print only when the boolean conditional is true"); } the boolean value is named after english mathematician george boole, who pioneered the field of mathematical logic.
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
// example 1 // only y is hoisted x = 1; // initialize x, and if not already declared, declare it - but no hoisting as there is no var in the
statement.
... a = 'cran'; // initialize a b = 'berry'; // initialize b console.log(a + "" + b); // 'cranberry' technical reference var
statement — mdn function
statement — mdn ...
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
an http method is idempotent if an identical request can be made once or several times in a row with the same effect while leaving the server in the same
state.
... to be idempotent, only the actual back-end
state of the server is considered, the status code returned by each request may differ: the first call of a delete will likely return a 200, while successive ones will likely return a 404.
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
it correctly finds our variable instantiated with our first
statement after finding it, the expression is evaluated, foo is replaced by 5 and the javascript engine passes that value to the functions as an argument before executing the
statements inside the functions' bodies, javascript takes a copy of the originally passed argument (which is a primitive) and creates a local copy.
... these copies, existing only inside the functions' scopes, are accessible via the identifiers we specified in the functions' definitions (num for addtwo, foo for addtwo_v2) then, the functions'
statements are executed: in the first function, a local num variable had been created.
REST - MDN Web Docs Glossary: Definitions of Web-related terms
rest(representational
state transfer) refers to a group of software architecture design constraints that bring about efficient, reliable and scalable distributed systems.
...a document, is transferred with its
state and relationships via well-defined, standarized operations and formats or services call themselves restful when they directly modify type of document as opposed to triggering actions somewhere.
Advanced styling effects - Learn web development
5px rgba(255,255,255,0.5); } button:focus, button:hover { background-image: linear-gradient(to bottom right, #888, #eee); } button:active { box-shadow: inset 2px 2px 1px black, inset 2px 3px 5px rgba(0,0,0,0.3), inset -2px -3px 5px rgba(255,255,255,0.5); } this gives us the following result: here we've set up some button styling along with focus/hover/active
states.
... when the button is pressed in, the active
state causes the first box shadow to be swapped for a very dark inset shadow, giving the appearance of the button being pressed in.
Typesetting a community school homepage - Learn web development
links: give the link, visited, focus, and hover
states some colors that go with the color of the horizontal bars at the top and bottom of the page.
... give the active
state a noticeably different styling so it stands out nicely, but make it still fit in with the overall page design.
What are browser developer tools? - Learn web development
forces element
states to be toggled on, so you can see what their styling would look like.
...in example.js, a breakpoint has been set on the
statement listitems.push(inputnewitem.value); the final two sections only appear when the code is running.
Basic native form controls - Learn web development
checkable items: checkboxes and radio buttons checkable items are controls whose
state you can change by clicking on them or their associated labels.
...if none of them are checked, the whole pool of radio buttons is considered to be in an unknown
state and no value is sent with the form.
How to structure a web form - Learn web development
for example, clicking on the "i like cherry" label text in the example below will toggle the selected
state of the taste_cherry checkbox: <form> <p> <input type="checkbox" id="taste_1" name="taste_cherry" value="cherry"> <label for="taste_1">i like cherry</label> </p> <p> <input type="checkbox" id="taste_2" name="taste_banana" value="banana"> <label for="taste_2">i like banana</label> </p> </form> note: you can find this example in checkbox-label.html (see it live also).
... <label for="username"> <span>name:</span> <input id="username" type="text" name="username"> <abbr title="required" aria-label="required">*</abbr> </label> </div> <!-- but this is probably best: --> <div> <label for="username">name: <abbr title="required" aria-label="required">*</abbr></label> <input id="username" type="text" name="username"> </div> the paragraph at the top
states a rule for required elements.
Images in HTML - Learn web development
string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; annotating images with figures and figure captions speaking of captions, there are a number of ways that you could add a caption to go with y...
...string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; css background images you can also use css to embed images into webpages (and javascript, but that's another story entirely).
Fetching data from the server - Learn web development
the only other difference is that we've had to include a return
statement in front of response.text(), to get it to pass its result on to the next link in the chain.
... about the best equivalent to fetch's response.ok in xhr is to check whether request.status is equal to 200, or if request.ready
state is equal to 4.
Arrays - Learn web development
tring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%...
...tring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; test your skills!
Inheritance in JavaScript - Learn web development
my name is ' + prefix + ' ' + this.name.last + ', and i teach ' + this.subject + '.'); }; this alerts the teacher's greeting, which also uses an appropriate name prefix for their gender, worked out using a conditional
statement.
...bye for now!`); }; } the class
statement indicates that we are creating a new class.
Introduction to the server side - Learn web development
store session/
state information server-side programming allows developers to make use of sessions — basically, a mechanism that allows a server to store information on the current user of a site and send different responses based on that information.
... this allows, for example, a site to know that a user has previously logged in and display links to their emails or order history, or perhaps save the
state of a simple game so that the user can go to a site again and carry on where they left it.
Server-side web frameworks - Learn web development
the model doesn't
state any information about the underlying database as that is a configuration setting that may be changed separately of our code.
...exact, case-insensitive, greater than, etc.), and can support complex
statements (for example, you can specify a search on u11 teams that have a team name that starts with "fr" or ends with "al").
Getting started with Ember - Learn web development
the service side provides long-lived shared
state, behavior, and an interface to integrating with other libraries or systems.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Ember app structure and componentization - Learn web development
note: the header.js file (shown as skipped) is for connection to a backing glimmer component class, which we don't need for now, as they are for adding interactivity and
state manipulation.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Beginning our React todo list - Learn web development
for example: <button type="button" classname="btn toggle-btn" aria-pressed="true"> <span classname="visually-hidden">show </span> <span>all</span> <span classname="visually-hidden"> tasks</span> </button> here, aria-pressed tells assistive technology (like screen readers) that the button can be in one of two
states: pressed or unpressed.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Deployment and next steps - Learn web development
code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app
state, run cd mdn-svelte-tutorial/08-next-steps or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/08-next-steps remember to run npm install && npm run dev to start your app in development mode.
... previous overview: client-side javascript frameworks in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Introduction to automated testing - Learn web development
advanced: the sauce labs api sauce labs has a restful api that allows you to programmatically retrieve details of your account and existing tests, and annotate tests with further details, such as their pass/fail
state which isn't recordable by manual testing alone.
... advanced: the testingbot api testingbot has a restful api that allows you to programmatically retrieve details of your account and existing tests, and annotate tests with further details, such as their pass/fail
state which isn't recordable by manual testing alone.
Introducing a complete toolchain - Learn web development
there might be important decorations or music that help with your mental
state — these are all important to doing your best work possible, and they should also only need to be set up once, if done properly.
... "env": { "es6": true, "browser": true }, "extends": "eslint:recommended", "parseroptions": { "ecmaversion": 6, "sourcetype": "module" }, "rules": { "no-console": 0 } } the above eslint configuration says that we want to use the "recommended" eslint settings, that we're going to allow usage of es6 features (such as map() or set()), that we can use module import
statements, and that using console.log() is allowed.
Mozilla's Section 508 Compliance
the united
states federal rehabilitation act's section 508 is a new standard for defining accessibility requirements for software and other electronic and information technology.
... (d) sufficient information about a user interface element including the identity, operation and
state of the element shall be available to assistive technology.
Multiprocess on Windows
com metadata midl outputs two different types of metadata: "fast format strings" (also known as oicf) and (optionally, if a library
statement is included in the idl) type libraries (also known as typelib).
... we will now further detail each of these items: generating typelibs for all com interfaces you first need to include a library
statement in your idl.
How Mozilla's build system works
these data structures describe the current
state of the system and what the existing build configuration looks like.
... use the print
statement or function.
Gecko Logging
warning 2 a warning often indicates an unexpected
state.
... info 3 an informational message, often indicates the current program
state.
mach
this object holds
state from the mach driver, including the current directory, a handle on the logging manager, the settings object, and information about available mach commands.
...this means that you should avoid global import
statements as much as possible.
mozbrowserscrollviewchange
details the details property returns an anonymous javascript object with the following properties:
state a domstring representing the current
state of scrolling in the viewport — available values are started and stopped.
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscrollviewchange", function( event ) { console.log("scrolling has " + event.details.
state + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
Extending a Protocol
and the inverse is also true, as you will soon see: pecho.idpl will need explicitly
state that pwindowglobal.ipdl is managing it.
... manager pwindowglobal; - we explicitly
state that pwindowglobal is our manager.
Introduction to Layout in Mozilla
reset style context object is a placeholder for partially computed stylistic data style data is computed lazily, as it is asked for reflow recursively compute geometry (x, y, w, h) for frames, views, and widgets given w & h constraints of “root frame” compute (x, y, w, h) for all children constraints propagated “down” via nshtmlreflow
state desired size returned “up” via nshtmlreflowmetrics basic pattern parent frame initializes child reflow
state (available w, h); places child frame (x, y); invokes child’s reflow method child frame computes desired (w, h), returns via reflow metrics parent frame sizes child frame and view based on child’s metrics n.b.
... processed immediately via presshell method incremental reflows targeted at a specific frame dirty, content-changed, style-changed, user-defined nshtmlreflowcommand object encapsulates info queued and processed asynchronously, nsipressshell::appendreflowcommand, processreflowcommands incremental reflow recursively descend to target recovering reflow
state child rs.reason set to incremental incremental reflow process reflow “normally” at target frame child rs.reason set based on rc’s type incremental reflow propagate damage to frames later “in the flow” incremental reflow multiple reflow commands are batched nsreflowpath maintains a tree of target frames amortize
state recove...
Addon
blocklist
state read only integer the current blocklist
state of this add-on; see nsiblocklistservice for possible values.
...operations my be restricted based on system policies (e.g., the system administrator may not allow certain add-ons to be uninstalled), add-on type (e.g., themes may not be disabled), or add-on
state (e.g., an incompatible add-on cannot be enabled).
Widget Wrappers
nb: this property is writable, and will toggle all the widgets' nodes' disabled
states label for api-provided widgets, the label of the widget tooltiptext for api-provided widgets, the tooltip of the widget showinprivatebrowsing for api-provided widgets, whether the widget is visible in private browsing single wrapper properties all of a wrapper's properties are read-only unless otherwise indicated.
...rflow panel of the toolbar isgroup false, will be true for the group widget label for api-provided widgets, convenience getter for the label attribute of the dom node tooltiptext for api-provided widgets, convenience getter for the tooltiptext attribute of the dom node disabled for api-provided widgets, convenience getter and setter for the disabled
state of this single widget.
DownloadTarget
methods refresh() updates the
state of a finished, failed, or canceled download based on the current
state as indicated by the file system.
... promise resolves to undefined when the
state of the download has been updated.
Bootstrapping a new locale
this is done by cloning the en-us (united
states english) files into your localization.
... the "-cd" part is only necessary to differentiate between versions of a language that are subtly different from country to country, such as in "en-us" and "en-gb" for united
states english and british english.
What every Mozilla translator should know
for example: bug 12345, fix typos and resize prefwindow, a=l10n as soon as you have committed, put the bug in fixed
state and write fixed1.8.xxx in the keyword field you have to verify in the next build that the changes have been successful.
... if so, change the
state of the bug to verified and write verified1.8.xxx in the keyword field tinderbox in tinderbox you can see the result of the build process.
Basics
rather, the math fragment will zoom, and if you right-click a second time, you will see the mathml wysiwyg markup of the fragment, and if you right-click again a third time, the fragment will revert to its initial
state.
... this tri-
state mode is aimed at limiting conflicts with other agents that compete for the mouse.
Measuring performance using the PerfMeasurement.jsm code module
now we want to benchmark a function that is pretty fast (but not fast enough), so we run it several thousand times: for (let i = 0; i < 10000; i++) { set_up_some_
state(); monitor.start(); code_to_be_benchmarked(); monitor.stop(); clean_up_afterward(); } we call the perfmeasurement object's start() method when we want to start recording, and stop() when we want to stop recording.
...since we enable monitoring immediately before calling code_to_be_benchmarked(), and disable it as soon as it returns, the code in set_up_some_
state() and clean_up_afterward() is not measured.
NSPR Error Handling
pr_invalid_device_
state_error the device was in an invalid
state to complete the desired operation.
... pr_invalid_
state_error the attempted operation is on an object that was in an improper
state to perform the request.
PR_CNotify
notify a thread waiting on a change in the
state of monitored data.
... description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cnotify notifies single a thread waiting for the monitor's
state to change.
PR_CreateThread
syntax #include <prthread.h> prthread* pr_createthread( prthreadtype type, void (*start)(void *arg), void *arg, prthreadpriority priority, prthreadscope scope, prthread
state state, pruint32 stacksize); parameters pr_createthread has the following parameters: type specifies that the thread is either a user thread (pr_user_thread) or a system thread (pr_system_thread).
...
state specifies whether the thread is joinable (pr_joinable_thread) or unjoinable (pr_unjoinable_thread).
PR_NotifyAll
promotes all threads waiting on a specified monitor to a ready
state.
... description a call to pr_notifyall causes all of the threads waiting on the monitor to be scheduled to be promoted to a ready
state.
PR_NotifyCondVar
notification of a condition variable signals a change of
state in some monitored data.
... when the notification occurs, the runtime promotes a thread that is waiting on the condition variable to a ready
state.
PR_WaitCondVar
after a call to pr_waitcondvar, the lock is released and the thread is blocked in a "waiting on condition"
state until another thread notifies the condition or a caller-specified amount of time expires.
... when the condition variable is notified, a thread waiting on that condition moves from the "waiting on condition"
state to the "ready"
state.
NSS 3.35 release notes
tls servers are able to handle a clienthello
statelessly, if the client supports tls 1.3.
... this better enables
stateless server operation.
NSS Sample Code Sample_1_Hashing
*/ int main(int argc, char **argv) { secoidtag hashoidtag; plopt
state *opt
state; ploptstatus status; secstatus rv; char *hashname = null; char *progname = strrchr(argv[0], '/'); progname = progname ?
... progname + 1 : argv[0]; rv = nss_nodb_init("/tmp"); if (rv != secsuccess) { fprintf(stderr, "%s: nss_init failed in directory %s\n", progname, "/tmp"); return -1; } /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "t:"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 't': require_arg(opt
state->option, opt
state->value); hashname = strdup(opt
state->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hashoidtag = hashnametooidtag(hashname); if (hashoidtag == sec_oid_unknown) { fprintf(stderr, "%s: invalid digest type - %s\n", progname, hashname); ...
NSS Sample Code Sample_2_Initialization of NSS
*/ int main(int argc, char **argv) { plopt
state *opt
state; ploptstatus status; secstatus rv; secstatus rvshutdown; char *slotname = "internal"; pk11slotinfo *slot = null; char *dbdir = null; char *plainpass = null; char *pwfile = null; char * progname = strrchr(argv[0], '/'); progname = progname ?
... progname + 1 : argv[0]; /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "d:p:q:f:g:"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 'd': dbdir = strdup(opt
state->value); break; case 'p': plainpass = strdup(opt
state->value); break; case 'f': pwfile = strdup(opt
state->value); break; default: usage(progname); break; } } pl_destroyopt
state(opt
state); if (!dbdir) usage(progname); pr_init(pr_user_thread, pr_priority_normal, 0); /* create the database */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(...
Hashing - sample 1
*/ int main(int argc, char **argv) { secoidtag hashoidtag; plopt
state *opt
state; ploptstatus status; secstatus rv; char *hashname = null; char *progname = strrchr(argv[0], '/'); progname = progname ?
... progname + 1 : argv[0]; rv = nss_nodb_init("/tmp"); if (rv != secsuccess) { fprintf(stderr, "%s: nss_init failed in directory %s\n", progname, "/tmp"); return -1; } /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "t:"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 't': require_arg(opt
state->option, opt
state->value); hashname = strdup(opt
state->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hashoidtag = hashnametooidtag(hashname); if (hashoidtag == sec_oid_unknown) { fprintf(stderr, "%s: invalid digest type - %s\n", progname, hashname); ...
Initialize NSS database - sample 2
*/ int main(int argc, char **argv) { plopt
state *opt
state; ploptstatus status; secstatus rv; secstatus rvshutdown; char *slotname = "internal"; pk11slotinfo *slot = null; char *dbdir = null; char *plainpass = null; char *pwfile = null; char * progname = strrchr(argv[0], '/'); progname = progname ?
... progname + 1 : argv[0]; /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "d:p:q:f:g:"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 'd': dbdir = strdup(opt
state->value); break; case 'p': plainpass = strdup(opt
state->value); break; case 'f': pwfile = strdup(opt
state->value); break; default: usage(progname); break; } } pl_destroyopt
state(opt
state); if (!dbdir) usage(progname); pr_init(pr_user_thread, pr_priority_normal, 0); /* create the database */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(...
EncDecMAC using token object - sample 3
*/ int main(int argc, char **argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; plopt
state *opt
state; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype cmd = unknown; const char *command = null; const char *dbdir = null; const char *infilename = null; const char *outfilename = null; const char *noisefilename = null; secupwdata pwdata = { pw_none, 0 }; char * progname = strrchr(argv[0], ...
...progname + 1 : argv[0]; /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "c:d:i:o:f:p:z:a"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 'a': ascii = pr_true; break; case 'c': command = strdup(opt
state->value); break; case 'd': dbdir = strdup(opt
state->value); break; case 'f': pwdata.source = pw_fromfile; pwdata.data = strdup(opt
state->value); break; case 'p': pwdata.source = pw_plaintext; pwdata.data = strdup(opt
state->value); break; case 'i': infilename = strdup(opt
state->value); break; case 'o': outfilename = strdup(opt
state->value); break; case 'z': noisefilename = strdup(opt
state->value); break; default: usage(progname); break; } } pl_destroyopt
state(opt
state); if (!command || !dbdir || !i...
sample1
*/ int main(int argc, char **argv) { secoidtag hashoidtag; plopt
state *opt
state; ploptstatus status; secstatus rv; char *hashname = null; char *progname = strrchr(argv[0], '/'); progname = progname ?
... progname + 1 : argv[0]; rv = nss_nodb_init("/tmp"); if (rv != secsuccess) { fprintf(stderr, "%s: nss_init failed in directory %s\n", progname, "/tmp"); return -1; } /* parse command line arguments */ opt
state = pl_createopt
state(argc, argv, "t:"); while ((status = pl_getnextopt(opt
state)) == pl_opt_ok) { switch (opt
state->option) { case 't': require_arg(opt
state->option, opt
state->value); hashname = strdup(opt
state->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hashoidtag = hashnametooidtag(hashname); if (hashoidtag == sec_oid_unknown) { fprintf(stderr, "%s: invalid digest type - %s\n", progname, has...
Python binding for NSS
fix pty import
statement in test/setup_certs.py deprecated functionality networkaddress initialized via a string paramter is now deprecated.
... generalname.type_name generalname.type_string secitem.der_to_hex() secitem.get_oid_sequence() secitem.to_hex() signedcrl.delete_permanently() ava.oid ava.oid_tag ava.value ava.value_str dn.cert_uid dn.common_name dn.country_name dn.dc_name dn.email_address dn.locality_name dn.org_name dn.org_unit_name dn.
state_name dn.add_rdn() dn.has_key() rdn.has_key() the following module functions were removed: note: use nss.nss.oid_tag() instead nss.nss.sec_oid_tag_from_name() nss.nss.sec_oid_tag_name() nss.nss.sec_oid_tag_str() the following files were added: doc/examples/cert_dump.py test/test_cert_components.py release 0...
FC_GetSessionInfo
if the nss cryptographic module is in the error
state, fc_getsessioninfo returns ckr_device_error.
... otherwise, it fills in the ck_session_info structure with the following information:
state: the
state of the session, i.e., no role is assumed, the user role is assumed, or the crypto officer role is assumed flags: bit flags that define the type of session ckf_rw_session (0x00000002): true if the session is read/write; false if the session is read-only.
FC_InitPIN
fc_initpin() must be called when the pkcs #11 security officer (so) is logged into the token and the session is read/write, that is, the session must be in the "r/w so functions"
state (cks_rw_so_functions).
... ckr_user_not_logged_in: the session is not in the "r/w so functions"
state.
sslerr.html
spec record." ssl_error_rx_malformed_alert -12250 "ssl received a malformed alert record." ssl_error_rx_malformed_handshake -12249 "ssl received a malformed handshake record." ssl_error_rx_malformed_application_data -12248 "ssl received a malformed application data record." received an ssl handshake that was inappropriate for the current
state: all the error codes in the following block indicate that the local socket received an ssl3 handshake message from the remote peer at a time when it was inappropriate for the peer to have sent this message.
... -12239 "ssl received an unexpected client key exchange handshake message." ssl_error_rx_unexpected_finished -12238 "ssl received an unexpected finished handshake message." ssl_error_rx_unexpected_new_session_ticket -12179 "ssl received an unexpected new session ticket handshake message." received an ssl record that was inappropriate for the current
state: all the error codes in the following block indicate that the local socket received an ssl3 record from the remote peer at a time when it was inappropriate for the peer to have sent this message.
Performance Hints
var
statements use var
statements when possible.
... with using the with
statement prevents the compiler from generating code for fast access to local variables.
Scripting Java
java exceptions exceptions thrown by java methods can be caught by javascript code using try...catch
statement.
...tion thrown by the java method rhinoexception: the exception wrapped by the rhino runtime the instanceof operator can be used to query the type of an exception: try { java.lang.class.forname("nonexistingclass"); } catch (e) { if (e.javaexception instanceof java.lang.classnotfoundexception) { print("class not found"); } } rhino also supports an extension to the try...catch
statement that allows to define conditional catching of exceptions: function classforname(name) { try { return java.lang.class.forname(name); } catch (e if e.javaexception instanceof java.lang.classnotfoundexception) { print("class " + name + " not found"); } catch (e if e.javaexception instanceof java.lang.nullpointerexception) { print("class name is null"); } ...
JSTraceOp
jstraceop implementation can assume that no other threads mutates object
state.
... it must not change
state of the object or corresponding native structures.
JSXDRObjectOp
syntax typedef jsbool (* jsxdrobjectop)(jsxdr
state *xdr, jsobject **objp); name type description xdr jsxdr
state * the xdr reader or writer.
... description serialize or deserialize an object, given an xdr
state record representing external data.
JS_EvaluateScriptForPrincipals
on success, *rval receives the value from the last-executed expression
statement in the script.
... if the script compiles and executes successfully, *rval receives the value from the last-executed expression
statement processed in the script, and js_evaluatescriptforprincipals or js_evaluateucscriptforprincipals returns js_true.
JS_ExecuteScript
on success, rval receives the value from the last executed expression
statement processed in the script.
... if the script executes successfully, rval receives the value from the last executed expression
statement processed in the script, and js_executescript returns true.
JS_ExecuteScriptPart
on success, *rval receives the value from the last executed expression
statement in the script.
...if the script executes successfully, js_executescriptpart stores the value of the last-executed expression
statement in the script in *rval and returns js_true.
JS_ExecuteScriptVersion
on success, *rval receives the value from the last executed expression
statement processed in the script.
... if the script executes successfully, *rval receives the value from the last executed expression
statement processed in the script, and js_executescript returns true.
JSAPI reference
ed in spidermonkey 17 js_decompilefunction js_decompilefunctionbody js_compilefunction obsolete since jsapi 36 js_compilefunctionforprincipals obsolete since jsapi 28 js_compileucfunction obsolete since jsapi 36 js_compileucfunctionforprincipals obsolete since jsapi 28 error handling struct jserrorformatstring added in spidermonkey 17 class jserrorreport class js::autosaveexception
state added in spidermonkey 31 enum jsexntype added in spidermonkey 17 js_reporterror js_reportwarning js_reporterrornumber js_reporterrornumberuc js_reporterrorflagsandnumber js_reporterrorflagsandnumberuc js_reporterrornumberucarray added in spidermonkey 24 js_reportoutofmemory js_reportallocationoverflow added in spidermonkey 1.8 js_geterrorreporter js_seterrorreporterobsolete since jsap...
... jsreport_is_warning jsreport_is_strict_mode_error the following functions allow c/c++ functions to throw and catch javascript exceptions: js::createerror added in spidermonkey 38 js_isexceptionpending js_getpendingexception js_setpendingexception js_clearpendingexception js_throwstopiteration added in spidermonkey 1.8 js_isstopiteration added in spidermonkey 31 typedef jsexception
state js_saveexception
state js_restoreexception
state js_dropexception
state these functions translate errors into exceptions and vice versa: js_reportpendingexception js_errorfromexception js_throwreportederror obsolete since jsapi 29 values and types typedef jsval js::value js::value constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey...
SpiderMonkey 1.8
now this
statement stores the string "7" in x.
... two new context options can be used with js_setoptions: jsoption_relimit, which causes extremely long-running regular expression searches to fail with an error, and jsoption_anonfunfix, which bans anonymous functions from appearing anyplace where a
statement could appear, such as in the argument to eval().
Split object
circa firefox 1.5, the decision was made to cache layout information and javascript
state across navigation.
...but then the page that called window.open could use a with
statement to inject that window into its scope chain, gaining access to that window's privileges.
WebReplayRoadmap
dom/css integration (partially implemented) when paused, the inspector panel can be used to inspect the dom and css
state of the page.
... while the supported features will grow over time, the ui needs to be improved so that features which aren't supported are not shown or are shown in a disabled
state.
Mozilla Projects
firefox sync firefox sync synchronizes
state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your devices.
... web replay web replay allows firefox content processes to record their behavior, replay it later, and rewind to earlier
states.
Secure Development Guidelines
ey affect a product how to avoid making them how to mitigate them everything is oriented toward c/c++ introduction: gaining control specifics about the underlying architecture, using x86 as an example 6 basic registers (eax, ebx, ecx, edx, edi, esi) 2 stack-related registers (esp, ebp) mark top and bottom of current stack frame status register (eflags) contains various
state information instruction pointer (eip) points to register being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the e...
...i/o: file descriptors and handles good solution: dynamically allocate fd_set structs int main(void) { int i, fd; fd_set fdset; for( i = 0; i < 2000; i++) { fd = open("/dev/null", o_rdwr); } fd_set(fd, &fdset); } file i/o: race conditions operating on files can often lead to race conditions since the file system is shared with other processes you check the
state of a file at one point in time and immediately after the
state might have changed most file name operations suffer from these race conditions, but not when performed on file descriptors file i/o: race conditions consider the following example int main(int argc, char **argv) { char *file = argv[1]; int fd; struct stat statbuf; stat(file, &statbuf); if (s_islink(statbuf.
Gecko Roles
role_statusbar represents a status bar, which is an area at the bottom of a window that displays information about the current operation,
state of the application, or selected object.
...a specialized push button that can be checked or unchecked, but does not provide a separate indicator for the current
state.
Implementation Details
supported features interfaces refer to specific pages to get information of supported interfaces for interested at api: core: gecko interfaces windows: msaa, ia2, ienumvariant and isimpledom* interfaces linux: at-spi roles refer to specific pages to get information of supported roles for interested at api: gecko msaa ia2 at-spi
states refer to specific pages to get information of supported
states for interested at api: gecko msaa ia2 at-spi relations refer to specific pages to get information of supported relations for interested at api: gecko msaa ia2 at-spi attributes object attributes refer to specific pages to get information of supported object attributes for interested at api: gecko msaa ia2 at-spi text attributes...
...in addition,
state_defunct is set on objects that should be released by the assistive technology.
XForms Accessibility
state it is formed as well from model item properties (mips) of instance node that xforms element is bound to as from valid/invalid or in-range/out-of-range
states of instance node.
... instance node
states are mapped to accessibility
state constants declared in nsiaccessible
states interface like it shown below: relevant -
state_unavailable readonly -
state_readonly required -
state_required invalid -
state_invalid out of range -
state_invalid attributes redefines datatype aria attribute.
Embedded Dialog API
posing gecko dialogs in embedding applications problem
statement an application embedding gecko cannot tightly control its own windows and still allow gecko to be a fully functional web browser.
...re
stated, in order for a piece of code's dialogs to be overrideable, they can't be implemented directly in the code.
Places Developer Guide
components.interfaces.nspiplacesdatabase).dbconnection; } and then to get the a redirected visit_id from another visit_id: function getfromvisit(visit_id) { var sql = <cdata><![cdata[ select from_visit from moz_places, moz_historyvisits where moz_historyvisits.id = :visit_id and moz_places.id = moz_historyvisits.place_id; ]]></cdata>.tostring(); var sql_stmt = getplacesdbconn.create
statement(sql); sql_stmt.params.visit_id = visit_id; var from_visit; try { // here we can't use the "executeasync" method since have to return a // result right-away.
...this is very useful when writing long sql
statements.
Using the Places annotation service
for example, "my_extension/page_
state".
... lifetime of annotations annotation expiration can be explicitly
stated when the annotation is created.
XPCOM glue
n -wl,-executable_path,/path/to/xulrunner-bin -lxpcomglue_s -lxpcom -lnspr4 where 'xulrunner-bin' is either /library/frameworks/xul.framework/versions/current/ or /path/to/xulrunner-build/[platform]/dist/bin -l/path/to/sdk/lib -lxpcomglue linux -l/path/to/sdk/lib -l/path/to/sdk/bin -wl,-rpath-link,/path/to/sdk/bin -lxpcomglue_s -lxpcom -lnspr4 write it exactly as
stated, see notes.
... linux and mac: write the linker options exactly as
stated (just replacing the /path/to/sdk/), otherwise you get an undefined symbol: ...ns_tabledrivenqi...qitableentry...
Mozilla internal string guide
you must not access the string except via the handle until you call finish() on the handle in the success case or you let the handle go out of scope without calling finish() in the failure case, in which case the destructor of the handle puts the string in a mostly harmless but consistent
state (containing a single replacement character if a capacity greater than 0 was requested, or in the char case if the three-byte utf-8 representation of the replacement character doesn't fit, an ascii substitute).
...for example, in the
statement printf("hello world\n"); the value "hello world\n" is a literal string.
Components.utils.importGlobalProperties
therefore ready
state must be checked, if it is not complete, then a load listener must be attached.
... once ready
state is complete then the objects can be used.
imgIContainer
exceptions thrown ns_error_not_available if the animated
state cannot be determined.
...exceptions thrown missing exception missing description violates the xpcom interface guidelines requestrefresh() indicates that this imgicontainer has been triggered to update its internal animation
state.
mozIStorageProgressHandler
see also storage mozstorage introduction and how-to article mozistorageconnection database connection to a specific file or in-memory data storage mozistorage
statement create and execute sql
statements on a sqlite database.
...mozistorage
statementwrapper storage
statement wrapper ...
mozIStorageResultSet
the mozistorageresultset interface represents a set of results from a storage
statement.
...see also storage mozistorageconnection mozistorage
statement ...
nsIAccessibleEvent
event_
state_change 0x800a 0x0009 0x0006 an object's
state has changed.
... event_hyperlink_selected_link_changed 0x0053 0x004f the hyperlink selected
state changed from selected to unselected or from unselected to selected.
nsIAccessibleRole
role_statusbar 23 represents a status bar, which is an area at the bottom of a window that displays information about the current operation,
state of the application, or selected object.
...a specialized push button that can be checked or unchecked, but does not provide a separate indicator for the current
state.
nsICommandController
to create an instance, use: var commandcontroller = components.classes["@mozilla.org/embedcomp/base-command-controller;1"] .createinstance(components.interfaces.nsicommandcontroller); method overview void docommandwithparams(in string command, in nsicommandparams acommandparams); void getcommand
statewithparams( in string command, in nsicommandparams acommandparams); methods docommandwithparams() executes the specified command with a set of parameters contained in an nsicommandparams object.
... getcommand
statewithparams() void getcommand
statewithparams( in string command, in nsicommandparams acommandparams ); parameters command the command whose
state is to be determined.
nsIDBChangeListener
onreadchanged() called when the read
state of news messages changes.
... void onreadchanged(in nsidbchangelistener ainstigator); parameters ainstigator the caller who changed the read
state.
nsIDOMOfflineResourceList
status unsigned short one of the application cache
state constants indicating the status of the application cache.
... constants application cache
state constants constant value description uncached 0 the object isn't associated with an application cache.
nsIDownload
completed
states are nsidownloadmanager::download_finished, nsidownloadmanager::download_failed, and nsidownloadmanager::download_canceled.
...
state short the downloads current
state.
nsIDynamicContainer
this only happens when the container itself goes from the open
state to the closed
state.
...note: all result nodes implement a property bag if you need to store
state.
nsIFocusManager
flag_showring 0x100000 always show the focus ring or other indicator of focus, regardless of other
state.
...updating the widget focus
state is the responsibility of the caller.
nsIMsgDBHdr
headers are backed by the database: a call to these functions directly modifies the
state of the database, although it is not saved until the database is committed.
...this property does not change the
state of any thread objects, so only internal database code should set this attribute.
nsIPrintingPrompt
defaults for platform service: showprintdialog - displays a native dialog showpagesetup() - displays a xul dialog showprogress() - displays a xul dialog summary for windows embedders:
stated once again: there is no "fallback" native platform support in gfx for the displaying of the native print dialog.
... printprogressparams parameter object for passing progress
state.
nsIPrivateBrowsingService
netwerk/base/public/nsiprivatebrowsingservice.idlscriptable provides access to information about the
state of the private browsing service.
... the nsiprivatebrowsingservice interface provides access to information about the
state of the private browsing feature offered in firefox 3.5 and later.
nsITransportSecurityInfo
netwerk/socket/nsitransportsecurityinfo.idlscriptable this interface provides information about transport security, including the security
state and any error message for the connection.
... security
state unsigned long a flag detailing the security
state of the connection.
nsIWebNavigation
when a page is loaded from session history, all content is loaded from the cache (if available) and page
state (such as form values and scroll position) is restored.
...when a page is loaded from session history, all content is loaded from the cache (if available) and page
state (such as form values and scroll position) is restored.
nsIXULTemplateQueryProcessor
done() called when the template builder is being destroyed so that the query processor can clean up any
state.
... the query processor should remove as much
state as possible, such as results or references to the builder.
nsPIPromptService
echeckbox
state the value is 1.
... this is the default checkbox
state and the result of it.
XPCOM Interface Reference
iwebinstallpromptamiwebinstallerimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasync
statementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorageerrormozistoragefunctionmozistoragepending
statementmozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageservicemozistorage
statementmozistorage
statementcallbackmozistorage
statementparamsmozistorage
statementrowmozistorage
statementwrappermozistoragevacuumparticipantm...
...actworkernsiaccelerometerupdatensiaccessnodensiaccessibilityservicensiaccessiblensiaccessiblecaretmoveeventnsiaccessiblecoordinatetypensiaccessibledocumentnsiaccessibleeditabletextnsiaccessibleeventnsiaccessiblehyperlinknsiaccessiblehypertextnsiaccessibleimagensiaccessibleprovidernsiaccessiblerelationnsiaccessibleretrievalnsiaccessiblerolensiaccessiblescrolltypensiaccessibleselectablensiaccessible
statechangeeventnsiaccessible
statesnsiaccessibletablensiaccessibletablecellnsiaccessibletablechangeeventnsiaccessibletextnsiaccessibletextchangeeventnsiaccessibletreecachensiaccessiblevaluensiaccessiblewin32objectnsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecont...
Setting HTTP request headers
var observerservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); observerservice.addobserver(httprequestobserver, "http-on-modify-request", false); the first
statement gets the object that will let us register with topics that we want to get notified about.
... the second
statement does the actual registering.
Xray vision
like dom objects, most javascript built-in objects have an underlying c++
state that is separate from their javascript representation, so the xray implementation can go straight to the c++
state and guarantee that the object will behave as its specification defines: // chrome code var sandboxscript = 'date.prototype.getfullyear = function() {return 1000};' + 'var date = new date(); '; var sandbox = components.utils.sandbox("https://example.org/"); comp...
... xray semantics for object and array the exceptions are object and array: their interesting
state is in javascript, not c++.
Mail client architecture overview
mail window management - each mail window maintains a certain amount of
state to aid in view navigation, progress display, etc.
... url display and dispatching - in order to perform network operations such as downloading new mail, copying and moving messages, and displaying messages from a remote server, the url system interacts with necko and reflects it's
state to the mail window.
Activity Manager examples
will be used process.contexttype = "account"; // group this activity by account process.contextobj = folder.server; // account in question gactivitymanager.addactivity(process); // step 2: showing some progress let percent = 50; process.setprogress(percent, "junk processing 25 of 50 messages", 25, 50); // step 3: removing the process and adding an event using process' attributes process.
state = components.interfaces.nsiactivityprocess.
state_completed; gactivitymanager.removeactivity(process.id); let event = components.classes["@mozilla.org/activity-event;1"].createinstance(nsiae); // localization is omitted, initiator is omitted event.init(folder.prettiestname + " is processed", null, "no junk found", process.starttime, // start time date...
... // assuming that the initiator has some way to cancel // the junk processing for given folder if (initiator.cancelfolderop(folder)) { aactivity.
state = components.interfaces.nsiactivityprocess.
state_canceled; gactivitymanager.removeactivity(aactivity.id); return cr.ns_success; } } return cr.ns_failure; } } // step 2: modify the previous sample to add initiator, subject // and associate a nsiactivitycancelhandler component ...
ctypes
so we look up on msdn what the tb_button structures is (msdn :: tb_button structure) and it says it is: typedef struct { int ibitmap; int idcommand; byte fs
state; byte fsstyle; #ifdef _win64 byte breserved[6]; #else #if defined(_win32) byte breserved[2]; #endif #endif dword_ptr dwdata; int_ptr istring; } tbbutton, *ptbbutton, *lptbbutton; so now notice that if it's 64-bit process it's different than if it's 32-bit process.
...this is what the final looks like: var struct_tbbutton; if (ctypes.voidptr_t.size == 4 /* 32-bit */) { struct_tbbutton = ctypes.structtype('tbbutton', [ {'ibitmap': ctypes.int}, {'idcommand': ctypes.int}, {'fb
state': ctypes.unsigned_char}, {'fsstyle': ctypes.unsigned_char}, {'breserved': ctypes.unsigned_char}, {'breserved2': ctypes.unsigned_char}, {'dwdata': ctypes.uintptr_t}, {'istring': ctypes.intptr_t} ]); } else if (ctypes.voidptr_t.size == 8 /* 64-bit */) { struct_tbbutton = ctypes.structtype('tbbutton', [ {'ibitmap': ctypes.int}, {'idcommand': ctypes.int}, {'fb
state': ctypes.unsigned_char}, {'fsstyle': ctypes.unsigned_char}, {'breserved': ctypes.unsigned_char}, ...
Drawing and Event Handling - Plugins
this structure contains information about coordinate position, size, the
state of the plug-in (windowed or windowless), and some platform-specific information.
... note: when a plug-in is drawn to a window, the plug-in is responsible for preserving
state information and ensuring that the original
state is restored.
Debugger.Environment - Firefox Developer Tools
(note that with
statements have their own environment type.) “with”, indicating that the environment was introduced by a with
statement.
... this is not an invocation function; if this call would cause debuggee code to run (say, because the environment is a "with" environment, andname refers to an accessor property of the with
statement’s operand), this call throws a debugger.debuggeewouldrun exception.
Debugger.Frame - Firefox Developer Tools
in frames returning or throwing an exception, the location is often a return or a throw
statement.
...(this is not like a with
statement:code may access, assign to, and delete the introduced bindings without having any effect on thebindings object.) this method allows debugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment.
Debugger.Object - Firefox Developer Tools
while most debugger.object instances are created by spidermonkey in the process of exposing debuggee's behavior and
state to the debugger, the debugger can use debugger.object.prototype.makedebuggeevalue to create debugger.object instances for given debuggee objects, or use debugger.object.prototype.copy and debugger.object.prototype.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals.
...(this is not like a with
statement:code may access, assign to, and delete the introduced bindings without having any effect on thebindings object.) this method allows debugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment.
DevTools API - Firefox Developer Tools
togglesplitconsole() toggles the
state of the split console.
... return this.destroysomethingasynchronosly() .then(() => console.log("destroyed")); }, handleclick: function(event) { console.log("clicked", event.originaltarget); }, }; eventemitter eventemitter is an interface many developer tool classes and objects implement and use to notify others about changes in their internal
state.
Examine and edit CSS - Firefox Developer Tools
the color scheme simulator has four
states, which you can cycle through by clicking the button repeatedly: icon value description null the prefers-color-scheme media feature is not defined.
... note that the first three
states of the button may be difficult to distinguish visually.
Flame Chart - Firefox Developer Tools
the flame chart shows you the
state of the javascript stack for your code at every millisecond during the performance profile.
...essentially it shows you the
state of the call stack at any given point during the recording.
Web Console remoting - Firefox Developer Tools
when page navigation starts the following packet is sent from the tab actor: { "from": tabactor, "type": "tabnavigated", "
state": "start", "url": newurl, "nativeconsoleapi": true } the nativeconsoleapi property tells if the window.console object is native or not for the top level window object for the given tab - this is always true when navigation starts.
... when navigation stops the following packet is sent: { "from": tabactor, "type": "tabnavigated", "
state": "stop", "url": newurl, "title": newtitle, "nativeconsoleapi": true|false } getcachedmessages(types, onresponse) the webconsoleclient.getcachedmessages(types, onresponse) method sends the following packet to the server: { "to": "conn0.console9", "type": "getcachedmessages", "messagetypes": [ "pageerror", "consoleapi" ] } the getcachedmessages packet allows one to retrieve the cached messages from before the web console was open.
Animation.commitStyles() - Web APIs
the commitstyles() method of the web animations api's animation interface commits the end styling
state of an animation to the element being animated, even after that animation has been removed.
... it will cause the end styling
state to be written to the element being animated, in the form of properties inside a style attribute.
Animation.onfinish - Web APIs
the "paused" play
state supersedes the "finished" play
state; if the animation is both paused and finished, the "paused"
state is the one that will be reported.
... you can force the animation into the "finished"
state by setting its starttime to document.timeline.currenttime - (animation.currenttime * animation.playbackrate).
Animation.onremove - Web APIs
this event is sent when the animation is removed (i.e., put into an active replace
state).
...ng code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replace
state); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves.
Animation.pause() - Web APIs
exceptions invalid
stateerror the animation's currenttime is unresolved (for example, if it's never been played or isn't currently playing) and the end time of the animation is positive infinity.
... throws an invalid
stateerror if the animation's currenttime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity.
Animation.persist() - Web APIs
ng code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replace
state); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves.
... you can see the replace
state of the animation being logged at the end of the handler.
BatteryManager.onlevelchange - Web APIs
example html <div id="level">(battery level unknown)</div> <div id="
statebaterry">(charging
state unknown)</div> javascript navigator.getbattery().then(function(battery) { battery.onlevelchange = function(){ document.queryselector('#level').textcontent = battery.level; if(battery.charging) { document.queryselector('#
statebaterry').textcontent = "charging time: " + (battery.chargingtime / 60); } else { document.queryselector('...
...#
statebaterry').textcontent = "discharging time: " + (battery.dischargingtime / 60); } }; }); specifications specification status comment battery status api candidate recommendation initial definition ...
Basic animations - Web APIs
save the canvas
state if you're changing any setting (such as styles, transformations, etc.) which affect the canvas
state and you want to make sure the original
state is used each time a frame is drawn, you need to save that original
state.
... restore the canvas
state if you've saved the
state, restore it before drawing a new frame.
Compositing and clipping - Web APIs
clipping paths are also part of the canvas save
state.
... if we wanted to keep the original clipping path we could have saved the canvas
state before creating the new one.
Drawing shapes with canvas - Web APIs
the
statement for the clockwise parameter results in the first and third row being drawn as clockwise arcs and the second and fourth row as counterclockwise arcs.
... finally, the if
statement makes the top half stroked arcs and the bottom half filled arcs.
Using images - Web APIs
so you need to be sure to use the load event so you don't try this before the image has loaded: var img = new image(); // create new img element img.addeventlistener('load', function() { // execute drawimage
statements here }, false); img.src = 'myimage.png'; // set source path if you're only using one external image this can be a good approach, but once you need to track more than one we need to resort to something more clever.
...in this example, we're only using one image, so i use the image object's load event handler to execute the drawing
statements.
DOMException - Web APIs
(legacy code value: 9 and legacy constant name: not_supported_err) invalid
stateerror the object is in an invalid
state.
... (legacy code value: 11 and legacy constant name: invalid_
state_err) syntaxerror the string did not match the expected pattern.
Document: DOMContentLoaded event - Web APIs
function dosomething() { console.info('dom loaded'); } if (document.ready
state === 'loading') { // loading hasn't finished yet document.addeventlistener('domcontentloaded', dosomething); } else { // `domcontentloaded` has already fired dosomething(); } 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=...
...em; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('ready
statechange', (event) => { log.textcontent = log.textcontent + `ready
state: ${document.ready
state}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment html living standardthe definition of 'domcontentloaded' in that specification.
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 visibility
state property.
... document.addeventlistener("visibilitychange", function() { if (document.visibility
state === 'visible') { backgroundmusic.play(); } else { backgroundmusic.pause(); } }); specifications specification status comment page visibility (second edition)the definition of 'visibilitychange' in that specification.
Element.animate() - Web APIs
document.getelementbyid("tunnel").animate([ // keyframes { transform: 'translatey(0px)' }, { transform: 'translatey(-300px)' } ], { // timing options duration: 1000, iterations: infinity }); implicit to/from keyframes in newer browser versions, you are able to set a beginning or end
state for an animation only (i.e.
...for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end
state of the animation, and the beginning
state is implied.
EventSource - Web APIs
eventsource.ready
state read only a number representing the
state of the connection.
... eventsource.close() closes the connection, if any, and sets the ready
state attribute to closed.
ExtendableEvent - Web APIs
if waituntil() is called outside of the extendableevent handler, the browser should throw an invalid
stateerror; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises.
... note: in chrome, logging
statements are visible via the "inspect" interface for the relevant service worker accessed via chrome://serviceworker-internals.
Using files from web applications - Web APIs
ctype html> <html> <head> <title>dnd binary upload</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="application/javascript"> function sendfile(file) { const uri = "/index.php"; const xhr = new xmlhttprequest(); const fd = new formdata(); xhr.open("post", uri, true); xhr.onready
statechange = function() { if (xhr.ready
state == 4 && xhr.status == 200) { alert(xhr.responsetext); // handle response.
...here is how to preview uploaded video: const video = document.getelementbyid('video'); const obj_url = url.createobjecturl(blob); video.src = obj_url; video.play(); url.revokeobjecturl(obj_url); specifications specification status comment html living standardthe definition of 'file upload
state' in that specification.
FileReader.abort() - Web APIs
upon return, the ready
state will be done.
... syntax instanceoffilereader.abort(); exceptions dom_file_abort_err thrown when abort is called while no read operation is in progress (that is, the
state isn't loading).
FileReader - Web APIs
filereader.ready
state read only a number indicating the
state of the filereader.
...upon return, the ready
state will be done.
FileSystemEntry.getParent() - Web APIs
errors fileerror.invalid_
state_err the operation failed because the file system's
state doesn't permit it.
... this can happen, for example, if the file system's cached
state differs from the actual
state of the file system.
FileSystemEntry.remove() - Web APIs
fileerror.invalid_
state_err the file system's cached
state is inconsistent with its
state on disk, so the file could not be deleted for safety reasons.
... fileerror.no_modification_allowed_err the file system's
state doesn't permit removing the file or directory.
GamepadButton - Web APIs
the gamepadbutton interface defines an individual button of a gamepad or other controller, allowing access to the current
state of different types of buttons available on the control device.
... properties gamepadbutton.value read only a double value used to represent the current
state of analog buttons, such as the triggers on many modern gamepads.
HTMLCanvasElement - Web APIs
when called, the callback is passed a "print
state" object that implements the mozcanvasprint
state interface.
... the callback can get the context to draw to from the print
state object and must then call done() on it when finished.
HTMLDetailsElement: toggle event - Web APIs
the toggle event fires when the open/closed
state of a <details> element is toggled.
... bubbles no cancelable no interface event event handler property none default action toggles the open
state of the <details> element.
HTMLInputElement.stepDown() - Web APIs
if the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalid
stateerror exception is thrown.
...throws an invalid_
state_err exception: if the method is not applicable to for the current type value, if the element has no step value, if the value cannot be converted to a number, if the resulting value is above the max or below the min.
HTMLMediaElement.currentSrc - Web APIs
the value is an empty string if the network
state property is empty.
... syntax var mediaurl = audioobject.currentsrc; value a domstring object containing the absolute url of the chosen media source; this may be an empty string if network
state is empty; otherwise, it will be one of the resources listed by the htmlsourceelement contained within the media element, or the value or src if no <source> element is provided.
HTMLMediaElement: loadeddata event - Web APIs
the ready
state just increased to ' + 'have_current_data or greater for the first time.'); }); using the onloadeddata event handler property: const video = document.queryselector('video'); video.onloadeddata = (event) => { console.log('yay!
... the ready
state just increased to ' + 'have_current_data or greater for the first time.'); }; specifications specification status html living standardthe definition of 'loadeddata media event' in that specification.
HTMLObjectElement.validity - Web APIs
the validity read-only property of the htmlobjectelement interface returns a validity
state with the validity
states that this element is in.
... syntax var validity
state = htmlobjectelement.validity; value a validity
state object.
HTMLTrackElement - Web APIs
htmltrackelement.ready
state read only returns an unsigned short that show the readiness
state of the track: constant value description none 0 indicates that the text track's cues have not been obtained.
... usage notes loading of the track's text resource the webvtt or ttml data describing the actual cues for the text track isn't loaded if the track's mode is initially in the disabled
state.
HTMLVideoElement.videoHeight - Web APIs
if the element's ready
state is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available.
... if at any time the intrinsic size of the media changes and the element's ready
state isn't have_nothing, a resize event will be sent to the <video> element.
HTMLVideoElement.videoWidth - Web APIs
if the element's ready
state is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available.
... if at any time the intrinsic size of the media changes and the element's ready
state isn't have_nothing, a resize event will be sent to the <video> element.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
ensuring ordering on conditional use of promises one situation in which microtasks can be used to ensure that the ordering of execution is always consistent is when promises are used in one clause of an if...else
statement (or other conditional
statement), but not in the other clause.
...ype.getdata = url => { if (this.cache[url]) { this.data = this.cache[url]; this.dispatchevent(new event("load")); } else { fetch(url).then(result => result.arraybuffer()).then(data => { this.cache[url] = data; this.data = data; this.dispatchevent(new event("load")); }); } }; the problem introduced here is that by using a task in one branch of the if...else
statement (in the case in which the image is available in the cache) but having promises involved in the else clause, we have a situation in which the order of operations can vary; for example, as seen below.
HTML Drag and Drop API - Web APIs
datatransfer objects include the drag event's
state, such as the type of drag being done (like copy or move), the drag's data (one or more items), and the mime type of each drag item.
...additionally, application semantics may differ depending on the value of the dropeffect and/or the
state of modifier keys.
History.go() - Web APIs
add a listener for the pop
state event in order to determine when the navigation has completed.
... examples to move back one page (the equivalent of calling back()): history.go(-1) to move forward a page, just like calling forward(): history.go(1) to move forward two pages: history.go(2); to move backwards by two pages: history.go(-2); and, finally either of the following
statements will reload the current page: history.go(); history.go(0); specifications specification status comment html living standardthe definition of 'history.go()' in that specification.
IDBCursor.continuePrimaryKey() - Web APIs
calling this method more than once before new cursor data has been loaded - for example, calling continueprimarykey() twice from the same onsuccess handler - results in an invalid
stateerror being thrown on the second call because the cursor’s got value flag has been unset.
... invalid
stateerror the cursor is currently being iterated or has iterated past its end.
IDBDatabase.createObjectStore() - Web APIs
exceptions this method may raise a domexception with a domerror of one of the following types: exception description invalid
stateerror occurs if the method was not called from a versionchange transaction callback.
...has been deleted or removed.) in firefox previous to version 41, an invalid
stateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database.
IDBDatabase.deleteObjectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalid
stateerror occurs if the method was not called from a versionchange transaction callback.
...has been deleted or removed.) in firefox previous to version 41, an invalid
stateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror you are trying to delete an object store that does not exist.
IDBObjectStore.createIndex() - Web APIs
invalid
stateerror occurs if either: the method was not called from a versionchange transaction mode callback, i.e.
...has been deleted or removed.) in firefox previous to version 41, an invalid
stateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded.
IDBObjectStore.deleteIndex() - Web APIs
return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalid
stateerror occurs if the method was not called from a versionchange transaction mode callback.
...has been deleted or removed.) in firefox previous to version 41, an invalid
stateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror occurs if there is no index with the given name (case-sensitive) in the database.
IDBTransaction.commit() - Web APIs
if it is called on a transaction that is not active, it throws an invalid
stateerror domexception.
... exceptions exception description invalid
stateerror the transaction
state is not active.
IntersectionObserverEntry.isIntersecting - Web APIs
if this is true, then, the intersectionobserverentry describes a transition into a
state of intersection; if it's false, then you know the transition is from intersecting to not-intersecting.
... syntax var isintersecting = intersectionobserverentry.isintersecting; value a boolean value which indicates whether the target element has transitioned into a
state of intersection (true) or out of a
state of intersection (false).
KeyboardEvent - Web APIs
keyboardevent.getmodifier
state() returns a boolean indicating if a modifier key such as alt, shift, ctrl, or meta, was pressed when the event was created.
... special cases some keys toggle the
state of an indicator light; these include keys such as caps lock, num lock, and scroll lock.
Keyboard API - Web APIs
the key value takes into account the keyboard's locale (for example, 'en-us'), layout (for example, 'qwerty'), and modifier-key
state (shift, control, etc.).
...assuming a standard united
states qwerty layout, registering keyw ensures that "w", shift+"w", control+"w", control+shift+"w", and all other key modifier combinations with "w" are sent to the app.
MIDIAccess - Web APIs
event handlers midiaccess.on
statechange called whenever a new midi port is added or an existing port changes
state.
... examples navigator.requestmidiaccess() .then(function(access) { // get lists of available midi controllers const inputs = access.inputs.values(); const outputs = access.outputs.values(); access.on
statechange = function(e) { // print information about the (dis)connected midi controller console.log(e.port.name, e.port.manufacturer, e.port.
state); }; }); specifications specification status comment web midi api working draft initial definition.
MediaQueryList - Web APIs
a mediaquerylist object stores information on a media query applied to a document, with support for both immediate and event-driven matching against the
state of the document.
...the resulting object handles sending notifications to listeners when the media query
state changes (i.e.
MediaRecorder - Web APIs
mediarecorder.
state read only returns the current
state of the mediarecorder object (inactive, recording, or paused.) mediarecorder.stream read only returns the stream that was passed into the constructor when the mediarecorder was created.
... example if (navigator.mediadevices) { console.log('getusermedia supported.'); var constraints = { audio: true }; var chunks = []; navigator.mediadevices.getusermedia(constraints) .then(function(stream) { var mediarecorder = new mediarecorder(stream); visualize(stream); record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.
state); console.log("recorder started"); record.style.background = "red"; record.style.color = "black"; } stop.onclick = function() { mediarecorder.stop(); console.log(mediarecorder.
state); console.log("recorder stopped"); record.style.background = ""; record.style.color = ""; } mediarecorder.onstop = function(e) { console.log("dat...
MediaSource.activeSourceBuffers - Web APIs
example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.activesourcebuffers); // will contain the source buffer that was added above, // as it is selected for playing in the video play...
...er video.play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); }; ...
MediaSource.duration - Web APIs
invalid
stateerror mediasource.ready
state is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e.
... their sourcebuffer.updating property is true.) example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); mediasource.duration = 120; video.play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); }; ...
MediaSource.isTypeSupported() - Web APIs
e full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.ready
state); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuf...
...fer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'istypesupported()' in that specification.
MediaStreamTrack.onunmute - Web APIs
example this example creates an unmute event handler which changes the
state of a visual indicator to display the emoji character representing a "speaker" icon.
... mytrack.onunmute = function(evt) { play
stateicon.innerhtml = "🔈"; }; specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.onunmute' in that specification.
Recording a media element - Web APIs
starting media recording the startrecording() function handles starting the recording process: function startrecording(stream, lengthinms) { let recorder = new mediarecorder(stream); let data = []; recorder.ondataavailable = event => data.push(event.data); recorder.start(); log(recorder.
state + " for " + (lengthinms/1000) + " seconds..."); let stopped = new promise((resolve, reject) => { recorder.onstop = resolve; recorder.onerror = event => reject(event.name); }); let recorded = wait(lengthinms).then( () => recorder.
state == "recording" && recorder.stop() ); return promise.all([ stopped, recorded ]) .then(() => data); } startrecording() takes tw...
... lines 6-7 starts the recording process by calling recorder.start(), and outputs a message to the log with the updated
state of the recorder and the number of seconds it will be recording.
Media Session API - Web APIs
for example, to set the current
state of the media session to playing: navigator.mediasession.playback
state = "playing"; interfaces mediametadata allows a web page to provide rich media metadata, for display in a platform ui.
... mediaposition
state used to contain information about the current playback position, playback speed, and overall media duration when calling the mediasession method setposition
state() to establish the media's length, playback position, and playback speed.
NavigationPreloadManager - Web APIs
navigationpreloadmanager.get
state() returns a promise that resolves to an object with properties indicating whether preload is enabled and the contents of the service-worker-navigation-preload.
... samsung internet android full support 8.0get
state experimentalchrome full support 62edge full support 18firefox no support nonotes no support nonotes notes implementation tracked in bug 1290958ie ?
Navigator.getBattery() - Web APIs
syntax var batterypromise = navigator.getbattery(); return value a promise which, when resolved, calls its fulfillment handler with a single parameter: a batterymanager object which you can use to get information about the battery's
state.
... example this example fetches the current charging
state of the battery and establishes a handler for the chargingchange event, so that the charging
state is recorded whenever it changes.
Navigator.onLine - Web APIs
you can see changes in the network
state by listening for the events on window.ononline and window.onoffline.
... to see changes in the network
state, use addeventlistener to listen for the events on window.online and window.offline, as in the following example: window.addeventlistener('offline', function(e) { console.log('offline'); }); window.addeventlistener('online', function(e) { console.log('online'); }); specifications specification status comment html living standardthe definition of 'navigator.online' ...
Using the Notifications API - Web APIs
var n = new notification('my great song'); document.addeventlistener('visibilitychange', function() { if (document.visibility
state === 'visible') { // the tab has become visible so clear the now-stale notification.
...this is in line with the specification, which
states: "when a notification is closed, either by the underlying notifications platform or by the user, the close steps for it must be run." notification events there are four events that are triggered on the notification instance: click triggered when the user clicks on the notification.
OfflineAudioContext.resume() - Web APIs
if the context is not currently suspended or the rendering has not started, the promise is rejected with invalid
stateerror.
... invalid
stateerror if the context is not currently suspended or the rendering has not started.
PaymentAddress.postalCode - Web APIs
the postalcode read-only property of the paymentaddress interface returns a string containing a code used by a jurisdiction for mail routing, for example, the zip code in the united
states or the postal index number (pin code) in india.
...in most of the world, it's known as the "post code" or "postal code." in the united
states, the zip code is used.
PaymentAddress.region - Web APIs
for example, this may be a
state, province, oblast, or prefecture.
...this region has different names in different countries, such as:
state, province, oblast, prefecture, or county.
PaymentAddress - Web APIs
paymentaddress.postalcode read only a domstring specifying a code used by a jurisdiction for mail routing, for example, the zip code in the united
states or the pin code in india.
... paymentaddress.region read only a domstring containing the top level administrative subdivision of the country, for example a
state, province, oblast, or prefecture.
PerformanceEventTiming - Web APIs
// keep track of whether (and when) the page was first hidden, see: // https://github.com/w3c/page-visibility/issues/29 // note: ideally this check would be performed in the document <head> // to avoid cases where the visibility
state changes before this code runs.
... let firsthiddentime = document.visibility
state === 'hidden' ?
PermissionStatus.onchange - Web APIs
the onchange event handler of the permissionstatus interface is called whenever the permissionstatus.
state property changes.
...}) example navigator.permissions.query({name:'geolocation'}).then(function(permissionstatus) { console.log('geolocation permission
state is ', permissionstatus.
state); permissionstatus.onchange = function() { console.log('geolocation permission
state has changed to ', this.
state); }; }); specification specification status comment permissionsthe definition of 'onchange' in that specification.
Permissions.query() - Web APIs
the permissions.query() method of the permissions interface returns the
state of a user permission on the global scope.
... example navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.
state == 'granted') { showlocalnewswithgeolocation(); } else if (result.
state == 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permission was denied.
Permissions.revoke() - Web APIs
the permissions.revoke() method of the permissions interface reverts a currently set permission back to its default
state, which is usually prompt.
... function revokepermission() { navigator.permissions.revoke({name:'geolocation'}).then(function(result) { report(result.
state); }); } ...
PushManager - Web APIs
pushmanager.permission
state() returns a promise that resolves to the permission
state of the current pushmanager, which will be one of 'granted', 'denied', or 'prompt'.
...replaced by pushmanager.permission
state().
RTCDataChannel.close() - Web APIs
the sequence of events which occurs in response to this method being called: rtcdatachannel.ready
state is set to "closing".
... the rtcdatachannel.ready
state property is set to "closed".
RTCDataChannel - Web APIs
if no protocol was specified when the data channel was created, then this property's value is "" (the empty string).ready
state read only the read-only rtcdatachannel property ready
state returns an enum of type rtcdatachannel
state which indicates the
state of the data channel's underlying data connection.reliable read only the read-only rtcdatachannel property reliable indicates whether or not the data channel is reliable.stream read only the deprecated (and never part of the official specification) read-only rt...
...this is a simple event which indicates that the data channel is being closed, that is, rtcdatachannel transitions to "closing"
state.
RTCIceCandidatePairStats - Web APIs
state optional a rtcstatsicecandidatepair
state object which indicates the
state of the connection between the two candidates.
... any candidate pair that isn't the active pair of candidates for a transport gets deleted if the rtcicetransport performs an ice restart, at which point the
state of the ice transport returns to new and negotiation starts once again.
RTCPeerConnection.addIceCandidate() - Web APIs
this adds this new remote candidate to the rtcpeerconnection's remote description, which describes the
state of the remote end of the connection.
... invalid
stateerror the rtcpeerconnection currently has no remote peer established (remotedescription is null).
RTCPeerConnection.addStream() - Web APIs
if the signaling
state is set to closed, an invalid
stateerror is raised.
... if the signaling
state is set to stable, the event negotiationneeded is sent on the rtcpeerconnection to indicate that ice negotiation must be repeated to consider the new stream.
RTCPeerConnection.canTrickleIceCandidates - Web APIs
if trickling isn't supported, or you aren't able to tell, you can check for a falsy value for this property and then wait until the value of icegathering
state changes to "completed" before creating and sending the initial offer.
...pc.setremotedescription(remoteoffer) .then(_ => pc.createanswer()) .then(answer => pc.setlocaldescription(answer)) .then(_ => if (pc.cantrickleicecandidates) { return pc.localdescription; } return new promise(r => { pc.addeventlistener('icegathering
statechange', e => { if (e.target.icegathering
state === 'complete') { r(pc.localdescription); } }); }); }) .then(answer => sendanswertopeer(answer)) // signaling message .catch(e => handleerror(e)); pc.addeventlistener('icecandidate', e => { if (pc.cantrickleicecandidates) { sendcandidatetopeer(e.candidate); // signaling message } }); specifications ...
RTCPeerConnection.createOffer() - Web APIs
invalid
stateerror the rtcpeerconnection is closed.
... operationerror examining the
state of the system to determine resource availability in order to generate the offer failed for some reason.
RTCPeerConnection.onicecandidate - Web APIs
when this happens, the connection's icegathering
state has also changed to complete.
... you don't need to watch for this explicitly; instead, if you need to sense the end of signaling, you should watch for a icegathering
statechange event indicating that the ice negotiation has transitioned to the complete
state.
RTCPeerConnection.removeStream() - Web APIs
if the signaling
state is set to "closed", an invalid
stateerror is raised.
... if the signaling
state is set to "stable", the event negotiationneeded is sent on the rtcpeerconnection.
RTCPeerConnection.removeTrack() - Web APIs
if the connection has already been negotiated (signaling
state is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs.
... exceptions invalid
stateerror the connection is not open.
RTCPeerConnection.setLocalDescription() - Web APIs
if the signaling
state is one of stable, have-local-offer, or have-remote-pranswer, the webrtc runtime automatically creates a new offer and sets that as the new local description.
... deprecated exceptions when using the deprecated callback-based version of setlocaldescription(), the following exceptions may occur: invalid
stateerror the connection's signaling
state is "closed", indicating that the connection is not currently open, so negotiation cannot take place.
RTCRtpSender.replaceTrack() - Web APIs
invalid
stateerror the track on which this method was called is stopped rather than running.
... the new track is a video track and its raw or pre-encoded
state differs from that of the original track.
RTCRtpTransceiver.direction - Web APIs
exceptions when setting the value of direction, the following exceptions can occur: invalid
stateerror either the receiver's rtcpeerconnection is closed or the rtcrtpreceiver is stopped.
... usage notes setting the direction when you change the value of direction, an invalid
stateerror exception will occur if the connection is closed or the receiver is stopped.
RTCRtpTransceiver - Web APIs
the webrtc interface rtcrtptransceiver describes a permanent pairing of an rtcrtpsender and an rtcrtpreceiver, along with some shared
state.
...this pairing of send and receive srtp streams is significant for some applications, so rtcrtptransceiver is used to represent this pairing, along with other important
state from the media section.
RTCSctpTransport - Web APIs
rtcsctptransport.
stateread only a domstring enumerated value indicating the
state of the sctp transport.
... event handlers rtcsctptransport.on
statechange fired when the rtcsctptransport.
state changes.
RTCSessionDescription() - Web APIs
a string which is a member of the rtcsdptype enum; it must have one of the following values: this enum defines strings that describe the current
state of the session description, as used in the type property.
... rollback this special type with an empty session description is used to roll back to the previous stable
state.
RTCSessionDescription - Web APIs
constants rtcsdptype this enum defines strings that describe the current
state of the session description, as used in the type property.
... rollback this special type with an empty session description is used to roll back to the previous stable
state.
Screen Wake Lock API - Web APIs
document.addeventlistener('visibilitychange', () => { if (wakelock !== null && document.visibility
state === 'visible') { wakelock = await navigator.wakelock.request('screen'); } }); putting it all together you can find the complete code on github here.
...there's a checkbox which when checked, will automatically reacquire the wake lock if the document's visibility
state changes and becomes visible again.
Sensor APIs - Web APIs
} defensive programming as
stated in feature detection, checking for a particular sensor api is insufficient for feature detection.
... navigator.permissions.query({ name: 'accelerometer' }) .then(result => { if (result.
state === 'denied') { console.log('permission to use accelerometer sensor is denied.'); return; } // use the sensor.
ServiceWorkerContainer - Web APIs
the serviceworkercontainer interface of the service worker api provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the
state of service workers and their registrations.
... properties serviceworkercontainer.controller read only returns a serviceworker object if its
state is activated (the same object returned by serviceworkerregistration.active).
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
example while self.skipwaiting() can be called at any point during the service worker's execution, it will only have an effect if there's a newly installed service worker that might otherwise remain in the waiting
state.
... the following example causes a newly installed service worker to progress into the activating
state, regardless of whether there is already an active service worker.
ServiceWorkerGlobalScope - Web APIs
developers should keep in mind that the serviceworker
state is not persisted across the termination/restart cycle, so each event handler should assume it's being invoked with a bare, default global
state.
... methods serviceworkerglobalscope.skipwaiting() allows the current service worker registration to progress from waiting to active
state while service worker clients are using it.
ServiceWorkerRegistration.active - Web APIs
the active property of the serviceworkerregistration interface returns a service worker whose serviceworker.
state is activated.
... syntax var serviceworker = serviceworkerregistration.active; value a serviceworker object's property, if it is currently in an activated
state.
ServiceWorkerRegistration.installing - Web APIs
the installing property of the serviceworkerregistration interface returns a service worker whose serviceworker.
state is installing.
... syntax var serviceworker = serviceworkerregistration.installing; value a serviceworker object, if it is currently in an installing
state.
ServiceWorkerRegistration.waiting - Web APIs
the waiting property of the serviceworkerregistration interface returns a service worker whose serviceworker.
state is installed.
... syntax var serviceworker = serviceworkerregistration.waiting; value a serviceworker object, if it is currently in an installed
state.
Service Worker API - Web APIs
serviceworkercontainer provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister, and update service workers, and access the
state of service workers and their registrations.
... serviceworker
state associated with its serviceworker's
state.
SourceBuffer.changeType() - Web APIs
invalid
stateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still being processed.
... usage notes if the parent mediasource is in its "ended" ready
state, calling changetype() will transition the media source to the "open" ready
state and fire a simple event named sourceopen at the parent media source.
SourceBuffer - Web APIs
ther investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.ready
state); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuf...
...fer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.ready
state); // ended }); sourcebuffer.appendbuffer(buf); }); } function fetchab (url, cb) { console.log(url); var xhr = new xmlhttprequest; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); } specifications specification status comment media source extensionsthe definition of 'sourcebuffer' in that specification.
Storage API - Web APIs
site storage—the data stored for a web site which is managed by the storage standard—includes: indexeddb databases cache api data service worker registrations web storage api data managed using window.localstorage history
state information saved using history.push
state() application caches notification data other kinds of site-accessible, site-specific data that may be maintained site storage units the site storage system described by the storage standard and interacted with using the storage api consists of a single site storage unit for each origin.
...the "persistent-storage" feature's permission-related flags, algorithms, and types are all set to the standard defaults for a permission, except that the permission
state must be the same across the entire origin, and that if the permission
state isn't "granted" (meaning that for whatever reason, access to the persistent storage feature was denied), the origin's site storage unit's box mode is always "best-effort".
Using writable streams - Web APIs
abort(reason) — a method that will be called if the app signals that it wishes to abruptly close the stream and put it in an errored
state.
... when abort is called, any previously enqueued chunks are just thrown away immediately and then the stream is moved to an errored
state.
TouchEvent.altKey - Web APIs
in following code snippet, the touchstart event handler logs the
state of the event's modifier keys.
... someelement.addeventlistener('touchstart', function(e) { // log the
state of this event's modifier keys console.log("altkey = " + e.altkey); console.log("ctrlkey = " + e.ctrlkey); console.log("metakey = " + e.metakey); console.log("shiftkey = " + e.shiftkey); }, false); specifications specification status comment touch events – level 2 draft non-stable version.
TouchEvent - Web APIs
the touchevent interface represents an uievent which is sent when the
state of contacts with a touch-sensitive surface changes.
... touchevent.changedtouches read only a touchlist of all the touch objects representing individual points of contact whose
states changed between the previous touch event and this one.
WebGL2RenderingContext - Web APIs
state information webgl2renderingcontext.getindexedparameter() returns the indexed value for the given target.
... webgl2renderingcontext.bindtransformfeedback() binds a passed webgltransformfeedback object to the current gl
state.
Basic scissoring - Web APIs
we first tweak webgl
state.
...only when the webgl
state has been satisfactorily tweaked, we execute the drawing command (in this case, clear()) that starts the processing of fragments down the graphics pipeline.
Detect WebGL - Web APIs
the webgl rendering context is an interface, through which you can set and query the
state of the graphics machine, send data to the webgl, and execute draw commands.
... saving the
state of the graphics machine within a single context interface is not unique to webgl.
Raining rectangles - Web APIs
in this example, we use an object-oriented approach for the displayed rectangles, which helps to keep the
state of the rectangle (its position, color, and so on) organized in one place, and the overall code more compact and reusable.
...it is a preview of a full graphical application that manipulates various phases of the webgl graphics pipeline and
state machine.
Scissor animation - Web APIs
this is a nice demonstration of webgl as a
state machine.
...the clear color
state of webgl remains at the set value, until we change it again when a new square is created.
Using bounded reference spaces - Web APIs
etype = null; function onsessionstarted(session) { xrsession = session; spacetype = "bounded-floor"; xrsession.requestreferencespace(spacetype) .then(onrefspacecreated) .catch(() => { spacetype = "local-floor"; xrsession.requestreferencespace(spacetype) .then(onrefspacecreated) .catch(handleerror); }); } function onrefspacecreated(refspace) { xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl) }); // now set up matrices, create a secondary reference space to // transform the viewer's pose, and so forth.
... this would change the onrefspacecreated() method from the above snippet to: function onrefspacecreated(refspace) { xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl) }); let startposition = vec3.fromvalues(0, 1.5, 0); const startorientation = vec3.fromvalues(0, 0, 1.0); xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(startposition, startorientation)); xrsession.requestanimationframe(ondrawframe); } in this code, executed after the reference space has bee...
Lighting a WebXR setting - Web APIs
decoupling orientation from lighting in an ar application that uses geolocation to determine orientation and potentially position information, avoiding having that information directly correlate to the
state of the lighting is another way browsers can protect users from fingerprinting attacks.
... by simply ensuring that the compass direction and the light directionality aren't identical on every device that's near (or claims to be near) the user's location, the ability to find users based on the
state of the lighting around them is removed.
Controlling multiple parameters with ConstantSourceNode - Web APIs
toggling the oscillators on and off because oscillatornode doesn't support the notion of being in a paused
state, we have to simulate it by terminating the oscillators and starting them again when the play button is clicked again to toggle them back on.
... stopping the oscillators stopping the oscillators when the user toggles the play
state to pause the tones is as simple as stopping each node.
Using the Web Speech API - Web APIs
the first line — #jsgf v1.0; —
states the format and version used.
...with chrome however, you have to wait for the event to fire before populating the list, hence the if
statement seen below.
Window.updateCommands() - Web APIs
summary updates the
state of commands of the current chrome window (ui).
... notes this enables or disables items (setting or clearing the "disabled" attribute on the command node as appropriate), or ensures that the command
state reflects the
state of the selection by setting current
state information in the "
state" attribute of the xul command nodes.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
example this example examines the headers in the request's ready
statechange event handler, xmlhttprequest.onready
statechange.
... var request = new xmlhttprequest(); request.open("get", "foo.txt", true); request.send(); request.onready
statechange = function() { if(this.ready
state == this.headers_received) { // get the raw header string var headers = request.getallresponseheaders(); // convert the header string into an array // of individual headers var arr = headers.trim().split(/[\r\n]+/); // create a map of header names to values var headermap = {}; arr.foreach(function (line) { var parts = line.split(': '); var header = parts.shift(); var value = parts.join(': ')...
XMLHttpRequest.getResponseHeader() - Web APIs
example in this example, a request is created and sent, and a ready
statechange handler is established to look for the ready
state to indicate that the headers have been received; when that is the case, the value of the content-type header is fetched.
... var client = new xmlhttprequest(); client.open("get", "unicorns-are-teh-awesome.txt", true); client.send(); client.onready
statechange = function() { if(this.ready
state == this.headers_received) { var contenttype = client.getresponseheader("content-type"); if (contenttype != my_expected_type) { client.abort(); } } } specifications specification status comment xmlhttprequestthe definition of 'getresponseheader()' in that specification.
XMLHttpRequest.responseXML - Web APIs
exceptions invalid
stateerror the responsetype isn't either "document" or an empty string.
... example var xhr = new xmlhttprequest; xhr.open('get', '/server'); // if specified, responsetype must be empty string or "document" xhr.responsetype = 'document'; // force the response to be parsed as xml xhr.overridemimetype('text/xml'); xhr.onload = function () { if (xhr.ready
state === xhr.done && xhr.status === 200) { console.log(xhr.response, xhr.responsexml); } }; xhr.send(); specifications specification status comment xmlhttprequestthe definition of 'responsexml' in that specification.
XREnvironmentBlendMode - Web APIs
the alpha values specified in the xrsession's render
state property's baselayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque).
... in this mode, the xrsession's render
state.baselayer property provides relative weights of the artificial layer during the compositing process.
XRPermissionDescriptor - Web APIs
and for any other returned
state—which is almost certainly denied, which is the only other option as of this article's writing—we do nothing, since we can't use webxr.
... let xrpermissiondesc = { name: "xr", mode: "immersive-vr", requiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({
state}) => { switch(
state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermis...
XRViewerPose - Web APIs
usage notes the xrviewerpose object is used to describe the
state of a viewer of a webxr scene as it's tracked by the user's xr hardware.
... let pose = frame.getviewerpose(xrreferencespace); if (pose) { let gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0, 0, 0, 1); gl.cleardepth(1); gl.clear(gl.color_buffer_bit, gl.depth_buffer_bit); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene for the eye view.eye */ } } passing each v...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
fer at the device's native resolution, regardless of any performance concerns: function requestnativescalewebgllayer(gl, xrsession) { return gl.makexrcompatible().then(() => { let scalefactor = xrwebgllayer.getnativeframebufferscalefactor(xrsession); let gllayer = new xrwebgllayer(xrsession, gl, { framebufferscalefactor: scalefactor }); xrsession.updaterender
state({ baselayer: gllayer }); }); }; this starts by calling the webgl rendering context function makexrcompatible().
... that gets us a new xrwebgllayer object representing a rendering surface we can use for the xrsession; we set it as the rendering surface for xrsession by calling its updaterender
state() method, passing the new gllayer in using the xrrender
state dictionary's xrrender
state.baselayer property.
XRWebGLLayer.getViewport() - Web APIs
exceptions invalid
stateerror either the specified view is not in an active xrframe or that xrframe and the xrwebgllayer are not part of the same webxr session.
... <<<--- add link to appropriate section in the cameras and views article --->>> function drawframe(time, frame) { let session = frame.session; let pose = frame.getviewerpose(mainreferencespace); if (pose) { let gllayer = session.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit, gl.depth_color_bit); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene now */ } } specificatio...
XRWebGLLayerInit.antialias - Web APIs
usage notes the
state of anti-aliasing for the context after being created can be read from the xrwebgllayer property antialias.
... let options = { antialias: getpreferencevalue("antialiasing") }; let gllayer = new xrwebgllayer(xrsession, gl, options); if (gllayer) { xrsession.updaterender
state({ baselayer: gllayer }); } offering the user features such as the ability to enable or disable things like anti-aliasing can provide them with optiions to try when your app isn't performing as well as they'd like.
XRWebGLLayerInit.ignoreDepthValues - Web APIs
each entry in the depth buffer corresponds to the depth of the fragment whose color is at the same location in the color buffer, and must have a value between 0.0 and 1.0, where 0.0 corresponds to the distance specified in the xrsession object's render
state record's depthnear and 1.0 represents the distance given by depthfar.
... xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false, ignoredepthvalues: true }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.ignoredepthvalues' in that specification.
msCachingEnabled - Web APIs
the mscachingenabled method gets the current caching
state for an xmlhttprequest.
... syntax var cache
state = xmlhttprequest.mscachingenabled(); parameters cache
state[out, retval] type = boolean.
ARIA: document role - Accessibility
associated wai-aria roles,
states, and properties aria-expanded include with a value of true or false if the document element is collapsible, to indicate if the document is currently expanded or collapsed.
...for example, if the document is collapsible, then the
state and the value of aria-expanded must be maintained.
ARIA: rowgroup role - Accessibility
associated wai-aria roles,
states, and properties context roles role="table" one of the three possible contexts (along with grid and treegrid) in which you'll find a row.
... the first rule of aria use is if you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role,
state or property to make it accessible, then do so.
Web Accessibility: Understanding Colors and Luminance - Accessibility
here is the definition of relative luminance as defined by the w3c: "the relative brightness of any point in a colorspace, normalized to 0 for darkest black and 1 for lightest white" this
statement is of course accurate, but may be confusing when used in reference to the rgb color space, which is an integer between 0 and 255.
...for example, it has been demonstrated that some colors are more likely to cause epileptic fits than others; there is an interesting observation in a discussion thread, "what is the “grayscale” setting for in accessibility options?" in which one of the participants
states: "i have photo-triggered ocular migraines and wish everything had a greyscale option.
:indeterminate - CSS: Cascading Style Sheets
the :indeterminate css pseudo-class represents any form element whose
state is indeterminate, such as checkboxes which have their html indeterminate attribute set to true, radio buttons which are members of a group in which all radio buttons are unchecked, and indeterminate <progress> elements.
... /* selects any <input> whose
state is indeterminate */ input:indeterminate { background: lime; } elements targeted by this selector are: <input type="checkbox"> elements whose indeterminate property is set to true by javascript <input type="radio"> elements, when all radio buttons with the same name value in the form are unchecked <progress> elements in an indeterminate
state syntax :indeterminate examples checkbox & radio button this example applies special styles to the labels associated with indeterminate form fields.
@keyframes - CSS: Cascading Style Sheets
valid keyframe lists if a keyframe rule doesn't specify the start or end
states of the animation (that is, 0%/from and 100%/to), browsers will use the element's existing styles for the start/end
states.
... this can be used to animate an element from its initial
state and back.
@media - CSS: Cascading Style Sheets
a browser might also offer additional measures in this area; for example, if firefox's "resist fingerprinting" setting is enabled, many media queries report default values rather than values representing the actual device
state.
... rein
states light-level, inverted-colors and custom media queries, which were removed from level 4.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
there's no magic resetanimation() method on elements, and you can't even just set the element's animation-play-
state to "running" again.
... of course, we also need to add an event handler to our "run" button so it'll actually do something: document.queryselector(".runbutton").addeventlistener("click", play, false); result stopping an animation simply removing the animation-name applied to an element will make it jump or cut to its next
state.
CSS selectors - CSS: Cascading Style Sheets
pseudo pseudo classes the : pseudo allow the selection of elements based on
state information that is not contained in the document tree.
... specifications specification status comment selectors level 4 working draft added the || column combinator, grid structural selectors, logical combinators, location, time-demensional, resource
state, linguistic and ui pseudo-classes, modifier for ascii case-sensitive and case-insensitive attribute value selection.
Pseudo-classes - CSS: Cascading Style Sheets
a css pseudo-class is a keyword added to a selector that specifies a special
state of the selected element(s).
...t() :host-context() :hover :indeterminate :in-range :invalid :is() :lang() :last-child :last-of-type :left :link :local-link :not() :nth-child() :nth-col() :nth-last-child() :nth-last-col() :nth-last-of-type() :nth-of-type() :only-child :only-of-type :optional :out-of-range :past :placeholder-shown :read-only :read-write :required :right :root :scope :
state() :target :target-within :user-invalid :valid :visited :where() specifications specification status comment fullscreen api living standard defined :fullscreen.
Pseudo-elements - CSS: Cascading Style Sheets
*/ p::first-line { color: blue; text-transform: uppercase; } note: in contrast to pseudo-elements, pseudo-classes can be used to style an element based on its
state.
...it must appear after the simple selectors in the
statement.
CSS reference - CSS: Cascading Style Sheets
--webkit-line-clampa:activeadditive-symbols (@counter-style)::after (:after)align-contentalign-itemsalign-selfall<an-plus-b><angle><angle-percentage>animationanimation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-nameanimation-play-
stateanimation-timing-function@annotationannotation()attr()b::backdropbackdrop-filterbackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-size<basic-shape>::before (:before)bleed (@page)<blend-mode>block-sizeblur()borderborder-blockborder-block-colorborder-block-endborder-blo...
... pseudo pseudo classes : specifies a special
state of the selected element(s).
WebKit CSS extensions - CSS: Cascading Style Sheets
a -webkit-align-content -webkit-align-items -webkit-align-self -webkit-animation -webkit-animation-delay -webkit-animation-direction -webkit-animation-duration -webkit-animation-fill-mode -webkit-animation-iteration-count -webkit-animation-name -webkit-animation-play-
state -webkit-animation-timing-function b -webkit-backface-visibility -webkit-background-clip -webkit-background-origin -webkit-background-size -webkit-border-bottom-left-radius -webkit-border-bottom-right-radius -webkit-border-image -webkit-border-radius -webkit-border-top-left-radius -webkit-border-top-right-radius -webkit-box-decoration-break -webkit-box-shadow -webkit-box-sizing ...
... a -webkit-align-content -webkit-align-items -webkit-align-self -webkit-animation -webkit-animation-delay -webkit-animation-direction -webkit-animation-duration -webkit-animation-fill-mode -webkit-animation-iteration-count -webkit-animation-name -webkit-animation-play-
state -webkit-animation-timing-function -webkit-appearance* b -webkit-backface-visibility -webkit-background-clip -webkit-background-origin -webkit-background-size -webkit-border-bottom-left-radius -webkit-border-bottom-right-radius -webkit-border-image -webkit-border-radius -webkit-box-align**, *** -webkit-box-direction**, *** -webkit-box-flex**, *** -webkit-box-orient**, *** -webki...
animation-direction - CSS: Cascading Style Sheets
in other words, each time the animation cycles, the animation will reset to the beginning
state and start over again.
...in other words, each time the animation cycles, the animation will reset to the end
state and start over again.
initial - CSS: Cascading Style Sheets
this includes the css shorthand all, with which initial can be used to restore all css properties to their initial
state.
... the all property lets you reset all properties to their initial, inherited, reverted, or unset
state at once.
<transform-function> - CSS: Cascading Style Sheets
choose one, and the transform is applied to the cube; after 2 seconds, the cube reverts back to its starting
state.
... the cube's starting
state is slightly rotated using transform3d(), to allow you to see the effect of all the transforms.
transition - CSS: Cascading Style Sheets
transitions enable you to define the transition between two
states of an element.
... different
states may be defined using pseudo-classes like :hover or :active or dynamically set using javascript.
Creating a cross-browser video player - Developer guides
another user defined function — setfullscreendata() — is also called, which simply sets the value of a data-fullscreen attribute on the videocontainer (this makes use of data-
states).
... var setfullscreendata = function(
state) { videocontainer.setattribute('data-fullscreen', !!
state); } this is used simply to set some basic css to improve the styling of the custom controls when they are in fullscreen (see the sample code for further details).
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
for more information about color blindness, see the following articles: medline plus: color blindness (united
states national institute of health) american academy of ophthamology: what is color blindness?
... color blindness & web design (usability.gov: united
states department of health and human services) palette design example let's consider a quick example of selecting an appropriate color palette for a site.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
clicking the <summary> element toggles the
state of the parent <details> element open and closed.
...when the user clicks on the summary, the parent <details> element is toggled open or closed, and then a toggle event is sent to the <details> element, which can be used to let you know when this
state change occurs.
HTML documentation index - HTML: Hypertext Markup Language
if a non-null value doesn't conform to the constraints set by the pattern value, the validity
state object's read-only patternmismatch property will be true.
... 89 <details>: the details disclosure element disclosure box, disclosure widget, element, html, html interactive elements, reference, web, details the html details element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open"
state.
Using HTTP cookies - HTTP
it remembers
stateful information for the
stateless http protocol.
... for more information about cookie prefixes and the current
state of browser support, see the prefixes section of the set-cookie reference article.
HTTP response status codes - HTTP
409 conflict this response is sent when a request conflicts with the current
state of the server.
...this response is intended to prevent the 'lost update' problem, where a client gets a resource's
state, modifies it, and puts it back to the server, when meanwhile a third party has modified the
state on the server, leading to a conflict.
Closures - JavaScript
a closure is the combination of a function bundled together (enclosed) with references to its surrounding
state (the lexical environment).
... run the code using this jsfiddle link and notice that the alert()
statement within the displayname() function successfully displays the value of the name variable, which is declared in its parent function.
Introduction - JavaScript
once you have a firm grasp of the fundamentals, you can use the javascript reference to get more details on individual objects and
statements.
... javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and
statements.
Using Promises - JavaScript
nesting is a control structure to limit the scope of catch
statements.
... the inner neutralizing catch
statement only catches failures from dosomethingoptional() and dosomethingextranice(), after which the code resumes with morecriticalstuff().
Warning: expression closures are deprecated - JavaScript
examples deprecated syntax expression closures omit curly braces or return
statements from function declarations or from method definitions in objects.
... var x = function() 1; var obj = { count: function() 1 }; standard syntax to convert the non-standard expression closures syntax to standard ecmascript syntax, you can add curly braces and return
statements.
JavaScript error reference - JavaScript
use //# insteadsyntaxerror: a declaration in the head of a for-of loop can't have an initializersyntaxerror: applying the "delete" operator to an unqualified name is deprecatedsyntaxerror: for-in loop head declarations may not have initializerssyntaxerror: function
statement requires a namesyntaxerror: identifier starts immediately after numeric literalsyntaxerror: illegal charactersyntaxerror: invalid regular expression flag "x"syntaxerror: missing ) after argument listsyntaxerror: missing ) after conditionsyntaxerror: missing : after property idsyntaxerror: missing ; before
statementsyntaxerror: missing = in const declarationsyntaxerror: missing ] after element...
...ed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return
statement ...
Array.prototype[@@unscopables] - JavaScript
these properties are excluded from with
statement bindings.
...this is where now the built-in @@unscopables array.prototype[@@unscopables] symbol property comes into play and prevents that some of the array methods are being scoped into the with
statement.
Function() constructor - JavaScript
functionbody a string containing the javascript
statements comprising the function definition.
...this is less efficient than declaring a function with a function expression or function
statement and calling it within your code because such functions are parsed with the rest of the code.
WebAssembly - JavaScript
webassembly.instance() is a
stateful, executable instance of a webassembly.module webassembly.linkerror() indicates an error during module instantiation (besides traps from the start function).
... webassembly.module() contains
stateless webassembly code that has already been compiled by the browser and can be efficiently shared with workers, and instantiated multiple times.
this - JavaScript
* * // if the function has a return
statement that * // returns an object, that object will be the * // result of the |new| expression.
...(this essentially makes the
statement "this.a = 37;" dead code.
const - JavaScript
you must specify its value in the same
statement in which it's declared.
...my_object = {'other_key': 'value'}; // however, object keys are not protected, // so the following
statement is executed without problem my_object.key = 'othervalue'; // use object.freeze() to make object immutable // the same applies to arrays const my_array = []; // it's possible to push items into the array my_array.push('a'); // ["a"] // however, assigning a new array to the variable throws an error // uncaught typeerror: assignment to constant variable.
export - JavaScript
the export
statement is used when creating javascript modules to export live bindings to functions, objects, or primitive values from the module so they can be used by other programs with the import
statement.
...the export
statement cannot be used in embedded scripts.
JavaScript
javascript building blocks continues our coverage of javascript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional
statements, loops, functions, and events.
...
statements and declarations learn how do-while, for-in, for-of, try-catch, let, var, const, if-else, switch, and more javascript
statements and keywords work.
Codecs used by WebRTC - Web media technologies
if the connection is in the process of starting up, you can use the icegathering
statechange event to watch for the completion of ice candidate gathering, then fetch the list.
... let codeclist = null; peerconnection.addeventlistener("icegathering
statechange", (event) => { if (peerconnection.icegathering
state === "complete") { const senders = peerconnection.getsenders(); senders.foreach((sender) => { if (sender.track.kind === "video") { codeclist = sender.getparameters().codecs; return; } }); } codeclist = null; }); the event handler for icegathering
statechange is established; in it, we look to see if the ice gathering
state is complete, indicating that no further candidates will be collected.
Caching compiled WebAssembly modules - WebAssembly
it is ideal for persisting assets locally for the saved
state of an application, including text, blobs, and any other type of cloneable object.
...embly.instantiatestreaming(fetch(url)).then(results => { storeindatabase(db, results.module); return results.instance; }); }) }, note: it is for this kind of usage that webassembly.instantiate() returns both a module and an instance: the module represents the compiled code and can be stored/retrieved in idb or shared between workers via postmessage(); the instance is
stateful and contains the callable javascript functions, therefore it cannot be stored/shared.
WebAssembly Concepts - WebAssembly
a module is
stateless and thus, like a blob, can be explicitly shared between windows and workers (via postmessage()).
... instance: a module paired with all the
state it uses at runtime including a memory, table, and set of imported values.
Compiling from Rust to WebAssembly - WebAssembly
calling external functions in javascript from rust the next part looks like this: #[wasm_bindgen] extern { pub fn alert(s: &str); } the bit inside the #[ ] is called an "attribute", and it modifies the next
statement somehow.
... in this case, that
statement is an extern, which tells rust that we want to call some externally defined functions.
WebAssembly
webassembly.module() a webassembly.module object contains
stateless webassembly code that has already been compiled by the browser and can be efficiently shared with workers, and instantiated multiple times.
... webassembly.instance() a webassembly.instance object is a
stateful, executable instance of a module.
Content Processes - Archive of obsolete content
a few notes on security as we
stated earlier, the sdk was designed with multiprocess support in mind, despite the fact that work on implementing this in firefox has currently been suspended.
Porting the Library Detector - Archive of obsolete content
however, instead of maintaining its own
state by listening for gbrowser events and updating the user interface, the content script will just run when it's loaded, collect the array of library names, and post it back to main.js: function testlibraries() { var win = unsafewindow; var librarylist = []; for(var i in ld_tests) { var passed = ld_tests[i].test(win); if (passed) { var libraryinfo = { name: i, ver...
XUL Migration Guide - Archive of obsolete content
finally, if none of the above techniques work for you, you can use the require("chrome")
statement to get direct access to the components object, which you can then use to load and access any xpcom object.
page-mod - Archive of obsolete content
communicating with content scripts your add-on's "main.js" can't directly access the
state of content scripts you load, but you can communicate between your add-on and its content scripts by exchanging messages.
simple-prefs - Archive of obsolete content
a boolint is presented to the user as a checkbox, but instead of storing true or false, the "on" or "off" checkbox
states are mapped to integers using "on" or "off" properties in the specification.
lang/functional - Archive of obsolete content
let { compose } = require("sdk/lang/functional"); let welcome = compose(exclaim, greet); welcome('moe'); // "hi: moe!"; function greet (name) { return "hi: " + name; } function exclaim (
statement) { return
statement + "!"; } parameters fn...
places/favicon - Archive of obsolete content
onsole.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); // tab example require("sdk/tabs").open({ url: "http://mozilla.org", onready: function (tab) { getfavicon(tab).then(function (url) { console.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); } }); // an optional callback can be provided to handle // the promise's resolve and reject
states getfavicon("http://mozilla.org", function (url) { console.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); parameters object : string|tab a value that represents the url of the page to get the favicon url from.
places/history - Archive of obsolete content
usage this module exports a single function, search(), which synchronously returns a placesemitter object which then asynchronously emits data and end or error events that contain information about the
state of the operation.
remote/parent - Archive of obsolete content
loading modules into the child process to load a module into the child process, use remoterequire(): const { remoterequire } = require("sdk/remote/parent"); remoterequire("./my-module.js", module); inter-process communication a module loaded into a different process cannot directly communicate or share
state with the module that loaded it.
cfx to jpm - Archive of obsolete content
requiring modules from test code similarly, suppose you've written some tests for your add-on: my-addon lib my-addon.js test test-my-addon-js with cfx, code inside "test-my-addon.js" can import "my-addon.js" using a
statement like this: var my_addon = require("my-addon"); // this will not work with jpm!
Creating annotations - Archive of obsolete content
at the top of the file import the page-mod module and declare an array for the workers: var pagemod = require('sdk/page-mod'); var selectors = []; add detachworker(): function detachworker(worker, workerarray) { var index = workerarray.indexof(worker); if(index != -1) { workerarray.splice(index, 1); } } edit toggleactivation() to notify the workers of a change in activation
state: function activateselectors() { selectors.foreach( function (selector) { selector.postmessage(annotatorison); }); } function toggleactivation() { annotatorison = !annotatorison; activateselectors(); return annotatorison; } we'll be using this url in all our screenshots.
Display a Popup - Archive of obsolete content
function handleclick(
state) { text_entry.show(); } // when the panel is displayed it generated an event called // "show": we will listen for that event and when it happens, // send our own "show" event to the panel's script, so the // script can prepare the panel for display.
Listening for Load and Unload - Archive of obsolete content
if your add-on exports a function called main(), that function will be called immediately after the overall main.js is evaluated, and after all top-level require()
statements have run (so generally after all dependent modules have been loaded).
Downloading Files - Archive of obsolete content
ndow(aurlsourcewindow); var progresselement = document.getelementbyid("progress_element"); persist.progresslistener = { onprogresschange: function(awebprogress, arequest, acurselfprogress, amaxselfprogress, acurtotalprogress, amaxtotalprogress) { var percentcomplete = math.round((acurtotalprogress / amaxtotalprogress) * 100); progresselement.textcontent = percentcomplete +"%"; }, on
statechange: function(awebprogress, arequest, a
stateflags, astatus) { // do something } } persist.saveuri(obj_uri, null, null, null, "", targetfile, privacy); downloading files that require credentials before calling nsiwebbrowserpersist.saveuri(), you need to set the progresslistener property of the nsiwebbrowserpersist instance to an object that implements nsiauthprompt.
Tree - Archive of obsolete content
expanding/collapsing all tree nodes to expand all tree nodes: var treeview = tree.treeboxobject.view; for (var i = 0; i < treeview.rowcount; i++) { if (treeview.iscontainer(i) && !treeview.iscontaineropen(i)) treeview.toggleopen
state(i); } to collapse all tree nodes just change the condition: var treeview = tree.treeboxobject.view; for (var i = 0; i < treeview.rowcount; i++) { if (treeview.iscontainer(i) && treeview.iscontaineropen(i)) treeview.toggleopen
state(i); } getting the text from the selected row assuming the given <tree>: <tree id="my-tree" seltype="single" onselect="ontreeselected()"> use the following javascript: function ontreeselected(){ var tree = document.getelementbyid("my-tree"); var cellindex = 0; var celltext = tree.
Windows - Archive of obsolete content
re-using and focusing named windows while specifying the name parameter to window.open or window.opendialog will prevent multiple windows of that name from opening, each call will actually re-initialize the window and thus lose whatever
state the user has put it in.
Appendix D: Loading Scripts - Archive of obsolete content
disadvantages namespacing: as modules always execute with their own namespace, they have no direct access to the dom or window properties of windows or documents, and therefore must often pass around references to these objects and any document-specific
state data that they require.
Signing an XPI - Archive of obsolete content
certificate common name: xpi test organization: tjworld organization unit: software
state or province: nottingham country (must be exactly 2 characters): gb username: tj email address: certificates@lan.tjworld.net generated public/private key pair certificate request generated certificate has been signed certificate "mytestcert" added to database exported certificate to x509.raw and x509.cacert.
Tabbed browser - Archive of obsolete content
var url = "https://developer.mozilla.org"; var tab = gbrowser.addtab(null, {relatedtocurrent: true}); gsessionstore.settab
state(tab, json.stringify({ entries: [ { title: url } ], usertypedvalue: url, usertypedclear: 2, lastaccessed: tab.lastaccessed, index: 1, hidden: false, attributes: {}, image: null })); reusing tabs rather than open a new browser or new tab each and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired url--if one is ...
Promises - Archive of obsolete content
yield db.executetransaction(function* () { for (let node of nodes) // insert the node's data, using an automatically-cached, // pre-compiled
statement, and parameter placeholders.
Index of archived content - Archive of obsolete content
bedding mozilla in a java application using javaxpcom error console exception logging in javascript existing content extension frequently asked questions external cvs snapshots in mozilla-central fast graphics performance with html firefox block and line layout cheat sheet content
states and the style system disabling interruptible reflow document loading - from load start to finding a handler documentation for bidi mozilla downloading nightly or trunk builds jss build instructions for osx 10.6 layout faq layout system overview multiple firefox profiles repackaging firefox...
Install.js - Archive of obsolete content
path); } // perform install var err = install.performinstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && this.extpostinstallmessage) { install.alert(this.extpostinstallmessage); } } else { this.handleerror(err); return; } }, parsearguments: function() { // can't use string handling in install, so use if
statement instead var args = install.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 co...
Dehydra Function Reference - Archive of obsolete content
decl is a variable type object representing the function being processed body is an array of {loc:,
statements:array of variable types} representing an outline of the function stripped down to variables, function calls and assignments.
Hidden prefs - Archive of obsolete content
address book "get map" button pref ("mail.addr_book.mapit_url.format" ) the format for this pref is: @a1 == address, part 1 @a2 == address, part 2 @ci == city @st ==
state @zi == zip code @co == country if the pref is set to "", no "get map" button will appear in the addressbook card preview pane.
Java in Firefox Extensions - Archive of obsolete content
liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation
states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions.").
Meta - Archive of obsolete content
first run control over the content and experience of your jetpack's initial use me introspection of your jetpack's dynamic
state settings interface for defining and accessing user settings with built-in ui ...
Clipboard - Archive of obsolete content
jetpack.import.future("clipboard");var mycontent = "<i>this is some italic text</i>";jetpack.clipboard.set( mycontent, "html" ); getcurrentflavors()returns an array of available jetpack clipboard flavors, for the current system clipboard
state.
Clipboard Test - Archive of obsolete content
jetpack.import.future("clipboard");var mycontent = "<i>this is some italic text</i>";jetpack.clipboard.set( mycontent, "html" ); getcurrentflavors()returns an array of available jetpack clipboard flavors, for the current system clipboard
state.
How to implement a custom XUL query processor component - Archive of obsolete content
parse the adatasources variable // for now, ignore everything and let's just signal that we have data return this._data; }, initializeforbuilding: function(adatasource, abuilder, arootnode) { // perform any initialization that can be delayed until the content builder // is ready for us to start }, done: function() { // called when the builder is destroyed to clean up
state }, compilequery: function(abuilder, aquery, arefvariable, amembervariable) { // outputs a query object.
Actions - Archive of obsolete content
however, you may use ids on the other parts of the template, such as within the query
statements, if you wish to change the
statements and rebuild the template.
Introduction - Archive of obsolete content
the local store is a datasource which is usually used to hold
state information such as window sizes, which columns in a tree are showing, and which tree items are open.
Recursive Generation - Archive of obsolete content
to begin, b is evaluated and seeded with the right value: (?start = http://www.xulplanet.com/rdf/b) the <triple>
statement is then examined, however, item b doesn't have a relateditem arc out of it, so the result is rejected.
Simple Query Syntax - Archive of obsolete content
after the default query
statements are evaluated, the data network will look something like this: (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/palace.jpg) (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) the numbers a...
broadcaster - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a broadcaster is used when you want multiple elements to share one or more attribute values, or when you want elements to respond to a
state change.
command - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
datepicker - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
description - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
key - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
keyset - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
label - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
listcell - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
listhead - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
listheader - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
listitem - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
menu - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
menulist - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
progressmeter - Archive of obsolete content
ode, value properties accessibletype, max, mode, value examples <progressmeter mode="determined" value="82"/> <progressmeter mode="undetermined"/> <!-- switching modes while the mouse is over a button --> <progressmeter mode="determined" id="myprogress"/> <button label="example" onmouseover="setloading(true)" onmouseout="setloading(false)"/> function setloading(
state){ document.getelementbyid('myprogress').mode = (
state) ?
radio - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
radiogroup - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
richlistitem - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
scale - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
tab - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
tabs - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
textbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
timepicker - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional
state.
Debugging a XULRunner Application - Archive of obsolete content
note the "new in firefox 3" attribute "contentaccessible" on https://developer.mozilla.org/en/chrome_registration so as per http://markmail.org/message/ezbomhkw3bgqjllv#query:x-jsd+page:1+mid:xvlr7odilbyhn6v7+
state:results change the manifest to have this line: content venkman jar:venkman.jar!/content/venkman/ contentaccessible=yes i get errors about not being able to open contentareautils.js, contentareadd.js, findutils.js, or contentareautils.js...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
setrequestheader("method", "post"); < req.setrequestheader("content-length", soapclient.contentlength); < req.setrequestheader("soapserver", soapclient.soapserver); < req.setrequestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroundrequest = true; > xhr.open('post', soapclient.proxy, true); > xhr.onready
statechange = function() { > if (4 != xhr.ready
state) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + '; charset="' + > soapclient.charset + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in headers...
calICalendarView - Archive of obsolete content
this explains the need for the fairly large list off attributes and methods that must be implemented, so that outside code can be able to gain a decent picture of the current
state of those nodes.
Archived Mozilla and build documentation - Archive of obsolete content
liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation
states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions.").
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
firefox 2 on windows vista discussion about the "
state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-10-06 - Archive of obsolete content
other links of interest: roadmap for accessible rich internet applications (wai-aria roadmap) roles for accessible rich internet applications (wai-aria roles)
states and properties module for accessible rich internet applications (wai-aria
states and properties) making ajax work with screen readers meetings accessibility hackfest 2006 - october 10-12 in cambridge, ma (more details) participants include the mozilla foundation, ibm, sun and novell to name a few.
2006-09-29 - Archive of obsolete content
firefox 2 on windows vista discussion about the "
state of affairs" of firefox 2 on windows vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-10-06 - Archive of obsolete content
engineering student project - industry coach paul betts from ohio
state university is looking for someone from mozilla to be his "industry coach" for engineering 494 - how great ideas turn into great products.
2006-11-10 - Archive of obsolete content
discussions violation of smtp protocol in thunderbird hector reports two bugs: thunderbird ignores the smtp protocol
state machine by ignoring the 501 response codes.
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.builds - september 30th to october 6th 2006 tb mozilla_1_8_branch build problem on mac os x (10.4.7, universal build) ludwig hügelschäfer
stated that he has been encountering an error when he executes a "make export" operation on thunderbird (part of the mozilla_1_8_branch) since september 15th.
2006-11-24 - Archive of obsolete content
approval queue for fx 2.0.0.1 closing closing the approval queue for firefox 2.0.0.1 discussions quality of localized builds and process requirements quality of localized builds and process requirements the translate toolkit mdnto po: its current
state and how to use it discussion on clarifications on translate toolkit to avoid confusion.
2006-12-01 - Archive of obsolete content
he
states that javascript is powerful server-side scripting but it lacks in popularity since its only supported by netscape, lacks a wide range of libraries, minimal marketing support.
Browser-side plug-in API - Archive of obsolete content
npn_destroystream npn_forceredraw npn_getauthenticationinfo npn_geturl npn_geturlnotify npn_getvalue npn_getvalueforurl npn_invalidaterect npn_invalidateregion npn_memalloc npn_memflush npn_memfree npn_newstream npn_pluginthreadasynccall npn_poppopupsenabled
state npn_posturl npn_posturlnotify npn_pushpopupsenabled
state npn_reloadplugins npn_requestread npn_setvalue npn_setvalueforurl npn_status npn_useragent npn_version npn_write ...
.htaccess ( hypertext access ) - Archive of obsolete content
deny from 146.0.74.205 # blocks all access from 146.0.74.205 to the directory ssi or server side include : include external files to each file requested by the user without the need to write include
statements in the file; you can have them automatically attached to all the files, whether at top or bottom, automatically through your .htaccess file.
Theme changes in Firefox 3.5 - Archive of obsolete content
to do this only for 3.5 use a css selector that is only supported in 3.5, like so: window:not([active="true"]) menubar>menu:nth-child(1n) { color:threedshadow } private browsing: show private browsing
state by coloring the url bar, or by adding an icon to the toolbox/tabbrowserbar.
Theme changes in Firefox 3 - Archive of obsolete content
the rule that's needed to show and hide the go button and other location bar icons is: #urlbar[pageproxy
state="invalid"] > #urlbar-icons > :not(#go-button) , #urlbar[pageproxy
state="valid"] > #urlbar-icons > #go-button { visibility: collapse; } images to add add the following images: chrome://global/skin/icons/information-16.png used when presenting information notices.
E4X - Archive of obsolete content
the difference between the two modes is that without the "e4x=1" mime type, any
statement-level xml/html comment literals (<!--...-->) are ignored for backwards compatibility with the comment hiding trick, and cdata sections (<![cdata[...]]>) are not parsed as cdata literals (which leads to a js syntax error in html since html's <script> element produces an implicit cdata section, and therefore cannot contain explicit cdata sections).
Introduction - Archive of obsolete content
use of inline functions in content although the brackets are restricted to single
statements for evaluation, one might provide an anonymous function to perform some extra processing inline: var a = 'foo'; var b = <bar>{function () {var c = a.touppercase(); var d = 5 * 5; return c + d;}()}</bar>; where the above produces: <bar>foo25</bar>.
Iterator - Archive of obsolete content
examples iterating over properties of an object var a = { x: 10, y: 20, }; var iter = iterator(a); console.log(iter.next()); // ["x", 10] console.log(iter.next()); // ["y", 20] console.log(iter.next()); // throws stopiteration iterating over properties of an object with legacy destructuring for-in
statement var a = { x: 10, y: 20, }; for (var [name, value] in iterator(a)) { console.log(name, value); // x 10 // y 20 } iterating with for-of var a = { x: 10, y: 20, }; for (var [name, value] of iterator(a)) { // @@iterator is used console.log(name, value); // x 10 // y 20 } iterates over property name var a = { x...
Microsoft JavaScript extensions - Archive of obsolete content
objects activexobject debug enumerator vbarray functions getobject scriptengine scriptenginebuildversion scriptenginemajorversion scriptengineminorversion
statements @cc-on @if @set other date.getvardate() error.description error.number error.stacktracelimit ...
New in JavaScript 1.3 - Archive of obsolete content
statements label switch do...while export import built-in objects regexp methods of built-in objects tosource() object.prototype.watch() object.prototype.unwatch() function.arity function.prototype.apply() function.prototype.call() array.prototype.concat() array.prototype.pop() array.prototype.push() array.prototype.shift() array.prototype.slice() array.prototype.splice() s...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
use symbol.iterator property (firefox 36) spread operator for function calls (firefox 27) use symbol.iterator property (firefox 36) const (js 1.5, firefox 1.0) (es2015 compliance bug 950547 implemented in firefox 51) let (js 1.7, firefox 2) (es2015 compliance bug 950547 implemented in firefox 51) destructuring assignment (js 1.7, firefox 2) (es2015 compliance bug 1055984)
statements for...of (firefox 13) works in terms of .iterator() and .next() (firefox 17) use "@@iterator" property (firefox 27) use symbol.iterator property (firefox 36) functions rest parameters (firefox 15) default parameters (firefox 15) parameters without defaults after default parameters (firefox 26) destructured parameters with default value assignment (firefox ...
JavaPackage - Archive of obsolete content
although the packages and classes contained in a javapackage are its properties, you cannot use a for...in
statement to enumerate them as you can enumerate the properties of other objects.
XForms API Reference - Archive of obsolete content
:-) naming convention the xforms interfaces has the following naming convention: nsixforms...element interfaces implemented by the c++ part of a control nsixformsns...element interfaces extending xforms specification interfaces nsixforms...uielement interfaces implemented by the js part of a control nsixforms...accessors interface exposing
states about the bound instance node for a given control frozen interfaces nsixformsmodelelement the model interface experimental interfaces nsixformsdelegate the delegate interface for xforms:custom_controls nsixformsaccessors the accessors interface for xforms:custom_controls nsixformsnsmodelelement custom extension(s) to the nsixformsmo...
RFE to the Custom Controls Interfaces - Archive of obsolete content
in short, we have the following interfaces: nsixformsaccessors - serves to get/set the value of the instance data node that the xforms element is bound to as well as getting the various
states of that node nsixformsdelegate - used to obtain the nsixformsaccessors interface nsixformsuiwidget - used by the xforms processor to update the value/
state of an xforms element when its bound node's value/
state is changed our current mechanism that allows authors to build custom controls assumes that the controls will be bound to instance nodes of simple content type.
RFE to the XForms API - Archive of obsolete content
as an example, the nsixformsaccessors interface which allows a user to get/set the value of an instance node and get the
state of an instance node, is exposed by the nsixformsdelegate interface using the accessors property.
RDF in Fifty Words or Less - Archive of obsolete content
m:received-by> <sm:subject>great recipe for yam soup!</sm:subject> <sm:body> http://www.mozilla.org/smart-mail/get-body.cgi?id=4025293 </sm:body> </sm:message> <sm:message id="4025294"> <sm:recipient> chris waterson "waterson@netscape.com" </sm:recipient> <sm:sender> sarah waterson "waterson.2@postbox.acs.ohio-
state.edu" </sm:sender> <sm:received-by>x-wing.mcom.com</sm:received-by> <sm:subject>we won our ultimate game</sm:subject> <sm:body> http://www.mozilla.org/smart-mail/get-body.cgi?id=4025294 </sm:body> </sm:message> </rdf:description> </rdf:rdf> upon receipt of the above monstrosity, the rdf engine folds the rdf into the graph at the appropri...
XUL Parser in Python - Archive of obsolete content
v.00001 to celebrate active
state's recent announcement about support for perl and python in mozilla, i have put together this little python script that parses your local xul and builds a list of all the xul elements and their attributes in an html page.
Desktop mouse and keyboard controls - Game development
to skip the how to play screen, we can listen for any key being pressed and move on: this.input.keyboard.ondowncallback = function() { if(this.
statestatus == 'intro') { this.hideintro(); } }; this hides the intro and starts the actual game, without us having to set up another new key control just for this.
Collision detection - Game development
for the center of the ball to be inside the brick, all four of the following
statements need to be true: the x position of the ball is greater than the x position of the brick.
Mouse controls - Game development
compare your code this is the latest
state of the code to compare against: exercise: adjust the boundaries of the paddle movement, so the whole paddle will be visible on both edges of the canvas instead of only half of it.
2D breakout game using Phaser - Game development
you will learn the basics of using the phaser framework to implement fundamental game mechanics like rendering and moving images, collision detection, control mechanisms, framework-specific helper functions, animations and tweens, and winning and losing
states.
Tutorials - Game development
along the way you will learn the basics of using the <canvas> element to implement fundamental game mechanics like rendering and moving images, collision detection, control machanisms, and winning and losing
states.
Visual typescript game engine - Game development
��── email/ | | | ├── templates/ | | | | ├── confirmation.html.js | | | ├── nocommit.js (no commited for now) | | └── data/ (ignored - db system folder) | ├── rtc/ | | ├── server.ts | | ├── connector.ts | | ├── self-cert/ server part installed database: mongodb@3.1.8 -no typescript here, we need to keep
state clear no.
MDN Web Docs Glossary: Definitions of Web-related terms
site map sld sloppy mode slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing speed index sql sql injection sri stacking context
state machine
statement static method static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error synthetic monitoring t tag tcp tcp handshake...
Assessment: Accessibility troubleshooting - Learn web development
the finished assessment site should look like so: you will see some differences/issues with the display of the starting
state of the assessment — this is mainly due to the differences in the markup, which in turn cause some styling issues as the css is not applied properly.
CSS selectors - Learn web development
e { } attribute selectors this group of selectors gives you different ways to select elements based on the presence of a certain attribute on an element: a[title] { } or even make a selection based on the presence of an attribute with a particular value: a[href="https://example.com"] { } pseudo-classes and pseudo-elements this group of selectors includes pseudo-classes, which style certain
states of an element.
Flexbox - Learn web development
try updating your existing article rules like so: article { flex: 1 200px; } article:nth-of-type(3) { flex: 2 200px; } this basically
states "each flex item will first be given 200px of the available space.
Styling text - Learn web development
styling links when styling links, it is important to understand how to make use of pseudo-classes to style link
states effectively, and how to style links for use in common varied interface features such as navigation menus and tabs.
What is a Domain Name? - Learn web development
(r37-lror) sponsoring registrar iana id: 292 whois server: referral url: domain status: clientdeleteprohibited domain status: clienttransferprohibited domain status: clientupdateprohibited registrant id:mmr-33684 registrant name:dns admin registrant organization:mozilla foundation registrant street: 650 castro st ste 300 registrant city:mountain view registrant
state/province:ca registrant postal code:94041 registrant country:us registrant phone:+1.6509030800 as you can see, i can't register mozilla.org because the mozilla foundation has already registered it.
Example 3 - Learn web development
change
states html content <form class="no-widget"> <select name="myfruit" tabindex="-1"> <option>cherry</option> <option>lemon</option> <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select" tabindex="0"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* -----...
Example 4 - Learn web development
change
states html content <form class="no-widget"> <select name="myfruit"> <option>cherry</option> <option>lemon</option> <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ ...
Example 5 - Learn web development
change
states html content <form class="no-widget"> <select name="myfruit"> <option>cherry</option> <option>lemon</option> <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select" role="listbox"> <span class="value">cherry</span> <ul class="optlist hidden" role="presentation"> <li class="option" role="option" aria-selected="true">cherry</li> <li class="option" role="option">lemon</li> <li class="option" role="option">banana</li> <li class="option" role="option">strawberry</li> <li class="option" role="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { pos...
Sending forms through JavaScript - Learn web development
file.dom.addeventlistener( "change", function () { if( reader.ready
state === filereader.loading ) { reader.abort(); } reader.readasbinarystring( file.dom.files[0] ); } ); // senddata is our main function function senddata() { // if there is a selected file, wait it is read // if there is not, delay the execution of the function if( !file.binary && file.dom.files.length > 0 ) { settimeout( senddata, 10 ); return; } ...
Styling web forms - Learn web development
as well as the basic css tools covered above, we've also been provided with several selectors — ui pseudo-classes — that enable styling based on the current
state of the ui.
CSS basics - Learn web development
img[src] selects <img src="myimage.png"> but not <img> pseudo-class selector the specified element(s), but only when in the specified
state.
Debugging HTML - Learn web development
browsers have built-in rules to
state how to interpret incorrectly written markup, so you'll get something running, even if it is not what you expected.
Document and website structure - Learn web development
scared, but determined to protect his friends, he raised his wand and prepared to do battle, hoping that his distress call had made it through.</p> <hr> <p>meanwhile, harry was sitting at home, staring at his royalty
statement and pondering when the next spin off series would come out, when an enchanted distress letter flew through his window and landed in his lap.
Adding vector graphics to the Web - Learn web development
tring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; summary this article has provided you with a quick tour of what vector graphics and svg are, why they are useful to know about, and how to in...
From object to iframe — other embedding technologies - Learn web development
string(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the
state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; iframes in detail so, that was easy and fun, right?
Responsive images - Learn web development
in this case, before each comma we write: a media condition ((max-width:600px)) — you'll learn more about these in the css topic, but for now let's just say that a media condition describes a possible
state that the screen can be in.
Functions — reusable blocks of code - Learn web development
pretty much anytime you make use of a javascript structure that features a pair of parentheses — () — and you're not using a common built-in language structure like a for loop, while or do...while loop, or if...else
statement, you are making use of a function.
JavaScript building blocks - Learn web development
in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional
statements, loops, functions, and events.
Using Vue computed properties - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Focus management with Vue refs - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Rendering a list of Vue components - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Vue resources - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Styling Vue components with CSS - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and
state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and
state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue gettin...
Handling common HTML and CSS problems - Learn web development
handling css prefixes another set of problems comes with css prefixes — these are a mechanism originally used to allow browser vendors to implement their own version of a css (or javascript) feature while the technology is in an experimental
state, so they can play with it and get it right without conflicting with other browser's implementations, or the final unprefixed implementations.
Setting up your own test automation environment - Learn web development
in addition, we should mention test results/reporting — we've been reporting results in our above examples using simple console.log()
statements, but this is all done in javascript, so you can use whatever test running and reporting system you want, be it mocha, chai, or some other tool.
CSUN Firefox Materials
for more information general information: http://www.mozilla.com/firefox/ online support and community forums are located: http://forums.mozillazine.org/ accessibility compliance
statement (section 508): http://www.mozilla.com/firefox/vpat.html ...
Accessibility and Mozilla
they also define a list of possible object
states, such as focused, read-only, checked, etc.accessibility features in firefoxfirefox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 5.5.
Adding a new event
you need to modify test_all_synthetic_events.html which tests if calling getmodifier
state() doesn't cause crash.
A bird's-eye view of the Mozilla framework
tiner last updated date: 11/23/05
statement of purpose the purpose of this article is to provide a high-level technical overview of the architecture of the extensible, object-based mozilla application framework.
Continuous Integration
the sheriffs' role is to "keep the tree green", or in other words, to keep the code in our respositories in a good
state, to the extent that the
state is reflected in the output shown on treeherder.
Creating a Login Manager storage module
the category registration looks like this: nscomptr<nsicategorymanager> cat = do_getservice(ns_categorymanager_contractid); ns_ensure_
state(cat); cat->addcategoryentry("login-manager-storage", "nsiloginmanagerstorage", kyourcontractid, pr_true, pr_true, nsnull); don't forget to unregister the category on unload.
Creating reftest-based unit tests
invalidation tests check both that the internal
state of the document has been updated correctly, and that the browser then correctly invalidates and repaints the appropriate parts of the screen.
Capturing a minidump
minidumps are files created by various windows tools which record the complete
state of a program as it's running, or as it was at the moment of a crash.
Debugging Table Reflow
ax-element-size space-manager verify-lines damage-repair lame-paint-metrics lame-reflow-metrics disable-resize-opt these options can be combined with a comma separated list messages generated by the reflow switch: block(div)(1)@00be5ac4: reflowing dirty lines computedwidth=9000 computedheight=1500 this message is generated inside of nsresult nsblockframe::reflowdirtylines(nsblockreflow
state& a
state) it first shows the block id and address and then the computed width and height from the htmlreflow
state.
HTTP logging
launch the browser and get it into whatever
state you need to be in just before your bug occurs.
Makefiles - Best practices and suggestions
####################### ## extra dep needed to synchronize parallel execution ##################################################### $(ts): $(ts)/.done $(ts)/.done: $(mkdir) -p $(dir $@) touch $@ # "clean" target garbage_dirs += $(ts) maintain clean targets - makefiles should be able to remove all content that is generated so "make clean" will return the sandbox/directory back to a clean
state.
The Firefox codebase: CSS Guidelines
if this isn't possible, you can also try introducing a :not() to prevent the other rule from applying, this is especially relevant for different element
states (:hover, :active, [checked] or [disabled]).
SVG Guidelines
note, however that some of the rules
stated above can be hard to detect with automated tools since they require too much context-awareness.
Error codes returned by Mozilla APIs
ns_error_dom_inuse_attribute_err (0x8053000a) ns_error_dom_invalid_
state_err (0x8053000b) an attempt was made to use an object which is no longer usable.
Limitations of frame scripts
javascript code modules (jsms) in multiprocess firefox, a jsm loaded into the content process does not share any
state with the same jsm loaded into the chrome process.
Limitations of frame scripts
javascript code modules (jsms) in multiprocess firefox, a jsm loaded into the content process does not share any
state with the same jsm loaded into the chrome process.
Process scripts
e chrome side, and to send messages to the chrome side: // process-script.js if (services.appinfo.processtype == services.appinfo.process_type_content) { dump("welcome to the process script in a content process"); } else { dump("welcome to the process script in the main process"); } // message is sent using contentprocessmessagemanager sendasyncmessage("hello"); in this example, the dump()
statement will run once in each content process as well as in the main process.
Using the Browser API
api extensions: the api includes several new methods and events to manipulate and listen for changes to the embedded content's
state, interited by the htmliframeelement interface.
mozbrowservisibilitychange
the mozbrowservisibilitychange event is fired when the visibility
state of the current browser iframe <iframe> changes, for example due to a call to setvisible().
Embedding Mozilla
embedding the editor this document describes the current
state of editor embeddability, problems with the existing implementation, some possible embedding scenarios that we need to deal with, and an embedding solution that will fulfil them.
How to get a process dump with Windows Task Manager
(to get a process dump for thunderbird or some other product, substitute the product name where ever you see firefox in these instructions.) caution the memory dump that will be created through this process is a complete snapshot of the
state of firefox when you create the file, so it contains urls of active tabs, history information, and possibly even passwords depending on what you are doing when the snapshot is taken.
Glossary
actor bridge channel child compressed message message nullable parent protocol
state ...
JavaScript Tips
requires a helper class: var weakobserver = { queryinterface: function queryinterface(aiid) { if (aiid.equals(components.interfaces.nsiobserver) || aiid.equals(components.interfaces.nsisupportsweakreference) || aiid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_nointerface; }, observe: function observe(asubject, atopic, a
state) { } } when declaring xpcom methods, try to use the same names for method parameters as are used in the interface definition.
Assert.jsm
this
statement is equivalent to assert.equal(true, !!guard, message_opt);.
AsyncShutdown.jsm
info optionally, a function returning information about the current
state of the blocker as an object.
DeferredTask.jsm
methods ispending obsolete since gecko 28 check the current task
state.
Downloads.jsm
you can use download objects as keys in a set or map to associate your own
state to them for the session.
OS.File for the main thread
use with extreme caution: this api may be useful for application developers but must not be used by add-ons, as it changes the
state of the complete application.
PromiseUtils.jsm
return value a new object, containing the new promise in the promise property, and the methods to change its
state in the resolve and reject properties.
Task.jsm
; throw new task.result("value"); } note: if you want to exit early from a generator function, without returning a value for the task, you can just use the return
statement without any arguments.
Using JavaScript code modules
o/files/ for example, if the xpi for your foo extension includes a top-level modules/directory containing the bar.js module (that is, the modules/directory is a sibling to chrome.manifest and install.rdf), you could create an alias to that directory via the instruction: resource foo modules/ (don't forget the trailing slash!) you could then import the module into your javascript code via the
statement: components.utils.import("resource://foo/bar.js"); programmatically adding aliases custom aliases to paths that can be represented as an nsilocalfile can be programmatically added as well.
Webapps.jsm
alidbymanifesturl: function(amanifesturl) getcoreappsbasepath: function() getwebappsbasepath: function() _islaunchable: function(aapp) _notifycategoryandobservers: function(subject, topic, data, msg) registerbrowserelementparentforapp: function(amsg, amn) receiveappmessage: function(appid, message) _clearprivatedata: function(appid, browseronly, msg) _sendprogressevent: function() update
statechanged: function appobs_update(aupdate, a
state) applicationcacheavailable: function appobs_cacheavail(aapplicationcache) ...
Application Translation with Mercurial
this can be done in a text editor or word processor or any other tool in which you can attach different kind of
states to the individual texts to translate.
Mozilla Content Localized in Your Language
ex: most asian countries start from big to small: [country] [postal code][
state/province][city][district][street number and name][building and suite numbers][addressee] countries of european languages start from small to big: [addressee][street number and name][building and suite numbers][district][city][
state/province][postal code][country] name convention what are the order of family name and given name in your language.
SVN for Localizers
go back to the root of your working directory and execute this command: svn revert * this is a really helpful command because it reverts all of your changes to your working directory's last updated
state.
Uplifting a localization from Central to Aurora
la-aurora/ab-cd searching for changes no changes found # push to central hg push ../l10n-central/ab-cd # push to aurora hg push ../releases/l10n/mozilla-aurora/ab-cd # push l10n-central upstream cd ../l10n-central/ab-cd hg push # push aurora upstream cd ../../releases/l10n/mozilla-aurora/ab-cd hg push keep in mind that at this point, aurora and beta correspond to different
states of l10n, and thus you don't want to push the aurora
state to beta.
Mozilla Development Strategies
you might find a problem, or find that you left in some dump() or printf()
statements, or have messed up the whitespace.
Mozilla Style System Documentation
as
stated above, each style struct contains only features that are inherited by default or those that are set to their initial value ("reset") by default.
JS::PerfMeasurement
perfmeasurement::~perfmeasurement() take care not to leak profiling objects, as they may be holding down expensive os-level
state.
powermetrics
other measurements powermetrics can also report measurements of backlight usage, network activity, disk activity, interrupt distribution, device power
states, c-
state residency, p-
state residency, quality of service classes, and thermal pressure.
Performance
turbostat (linux-only) turbostat is a command-line utility that gathers and displays various power-related measurements, with a focus on per-cpu measurements such as frequencies and c-
states.
Profile Manager
ability to reset a profile (return it to a default
state excluding bookmarks and passwords).
Firefox Sync
firefox sync synchronizes
state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your devices.
L20n Javascript API
a 404 error when fetching a resource file, or recursive import
statements in resource files), context.translationerror, when there is a missing translation in one of supported locales; the context instance will try to retrieve a fallback translation from the next locale in the fallback chain, compiler.error, when l20n is unable to evaluate an entity to a string; there are two types of errors in this category: compiler.valueerror, when l20n ...
AsyncTestUtils extended framework
thanks to javascript enhancements available on the mozilla platform, it is possible for a function to yield control in such a way that the function stops running at the line where you use a yield
statement and resumes execution on the next line when resumed.
Optimizing Applications For NSPR
os/2 the os/2 port is not functional in its current
state due to the requirement to remove some files that could not be shipped under the npl.
Condition Variables
a call to pr_waitcondvar causes a thread to block until a specified condition variable receives notification of a change of
state in its associated monitored data.
Locks
lock type lock functions in nspr, a mutex of type prlock controls locking, and associated condition variables communicate changes in
state among threads.
Monitors
unlike a mutex of type prlock, a mutex of type prmonitor has a single, implicitly associated condition variable that may be used to facilitate synchronization of threads with the change in
state of monitored data.
PLHashEnumerator
in the current implementation, it will leave the hash table in an inconsistent
state.
PR_DELETE
must be an lvalue (an expression that can appear on the left side of an assignment
statement).
PR_FindSymbolAndLibrary
the identity returned from this function must be the target of a pr_unloadlibrary in order to return the runtime to its original
state.
PR_InitializeNetAddr
description pr_initializenetaddr allows the assignment of special network address values and the port number, while also setting the
state that indicates the version of the address being used.
PR_Interrupt
the interrupt request remains in the thread's
state until it is delivered exactly once or explicitly canceled.
PR_JoinThread
the function is synchronous in that it blocks the calling thread until the target thread is in a joinable
state.
PR_LOG_TEST
use it as an expression in a conditional execution
statement to control logging.
PR_LoadLibrary
each call to pr_loadlibrary must be paired with a corresponding call to pr_unloadlibrary in order to return the runtime to its original
state.
PR_NOT_REACHED
syntax #include <prlog.h> void pr_not_reached(const char *_reasonstr); parameters the macro has this parameter: reasonstr a string that describes why you should not have reached this
statement.
PR_NotifyAllCondVar
a call to pr_notifyallcondvar causes all of the threads waiting on the specified condition variable to be promoted to a ready
state.
PR_SetThreadPriority
it is difficult to ensure that the
state of the target thread permits a priority adjustment without ill effects.
Threads
threading types and constants prthread prthreadtype prthreadscope prthread
state prthreadpriority prthreadprivatedtor threading functions most of the functions described here accept a pointer to the thread as an argument.
Certificate functions
3.2 and later cert_getocspauthorityinfoaccesslocation mxr 3.4 and later cert_getpkixverifynistrevocationpolicy mxr 3.12 and later cert_getprevgeneralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_get
statename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnspatternsfromcert mxr 3.12 and later cert_gentime2formattedascii mxr 3.2 and later cert_hexify mxr 3.2 and later cert_importcachain mxr 3.2 and later cert_importcerts mxr 3.2 and later cert_isrootdercert mx...
NSS FAQ
is nss available outside the united
states?
FIPS Mode - an explanation
the united
states government defines many (several hundred) "federal information processing standard" (fips) documents.
NSS_3.12.2_release_notes.html
bug 459359: forwardbuilder
state object is leaked when aia path incorrect bug 459481: nss build problem with gcc 3.4.6 on os/2 documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation.
NSS 3.12.4 release notes
currently nss 3.12.4 is in the "review pending"
state in the fips 140-2 pre-validation list at http://csrc.nist.gov/groups/stm/cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h).
NSS_3.12_release_notes.html
system clock is off by more than two days, oscp check fails, can result in crash if user tries to view certificate [[@ secitem_compareitem_util] [[@ memcmp] bug 396256: certutil and pp do not print all the generalnames in a crldp extension bug 398019: correct confusing and erroneous comments in der_asciitotime bug 422866: vfychain -pp command crashes in nss_shutdown bug 345779: useless assignment
statements in ec_gf2m_pt_mul_mont bug 349011: please stop exporting these crmf_ symbols bug 397178: crash when entering chrome://pippki/content/resetpassword.xul in url bar bug 403822: pkix_pl_ocsprequest_create can leave some members uninitialized bug 403910: cert_findusercertbyusage() returns wrong certificate if multiple certs with same subject available bug 404919: memory leak in sftkdb_readsecmodd...
NSS 3.18.1 release notes
notable changes in nss 3.18.1 the following ca certificate had the websites and code signing trust bits restored to their original
state to allow more time to develop a better transition strategy for affected sites.
NSS 3.21 release notes
- parameters {or pointer} for ckm_tls12_key_and_mac_derive ck_tls_kdf_params{_ptr} - parameters {or pointer} for ckm_tls_kdf ck_tls_mac_params{_ptr} - parameters {or pointer} for ckm_tls_mac in sslt.h sslhashtype - identifies a hash function sslsignatureandhashalg - identifies a signature and hash function sslpreliminarychannelinfo - provides information about the session
state prior to handshake completion new macros in nss.h nss_rsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum rsa key size nss_dh_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum dh key size nss_dsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum dsa key size in pkcs11t...
NSS 3.47 release notes
- allow per-socket run-time ordering of the cipher suites presented in clienthello bug 1570501 - add cmac to freebl and pkcs #11 libraries bugs fixed in nss 3.47 bug 1459141 - make softoken cbc padding removal constant time bug 1589120 - more cbc padding tests bug 1465613 - add ability to distrust certificates issued after a certain date for a specified root cert bug 1588557 - bad debug
statement in tls13con.c bug 1579060 - mozilla::pkix tag definitions for issueruniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec ...
NSS Config Options
ssl-default-lock: turn off the ability for applications to change cipher suite
states with ssl_enablecipher, ssl_disablecipher.
NSS Developer Tutorial
when a block of code consists of a single
statement, nss doesn’t require curly braces, so both of these examples are fine: if (condition) { action(); } or: if (condition) action(); although the use of curly braces is more common.
nss tech note4
cert->keyusage (unsigned int) to break the issuer and subject names into components pass &(cert->issuer) or &(cert->subject) to the following functions char *cert_getcommonname(certname *name); char *cert_getcertemailaddress(certname *name); char *cert_getcountryname(certname *name); char *cert_getlocalityname(certname *name); char *cert_get
statename(certname *name); char *cert_getorgname(certname *name); char *cert_getorgunitname(certname *name); char *cert_getdomaincomponentname(certname *name); char *cert_getcertuid(certname *name); example code to illustrate access to the info is given below.
PKCS #11 Module Specs
valid values are: configdir configuration directory where nss can store persistant
state information (typically databases).
NSS PKCS11 Functions
arg a pointer supplied by the application that can be used to pass
state information.
PKCS11 Implement
c_login the nss calls c_login on a token's initial session whenever ckf_login_required is true and the user
state indicates that the user isn't logged in.
FC_Initialize
the nss cryptographic module is in a fatal error
state.
FC_Login
ckr_device_error: the token is in the error
state.
NSC_Login
ckr_device_error: the token is in the error
state.
FIPS mode of operation
general-purpose functions fc_getfunctionlist fc_initialize fc_finalize fc_getinfo slot and token management functions fc_getslotlist fc_getslotinfo fc_gettokeninfo fc_waitforslotevent fc_getmechanismlist fc_getmechanisminfo fc_inittoken fc_initpin fc_setpin session management functions fc_opensession fc_closesession fc_closeallsessions fc_getsessioninfo fc_getoperation
state fc_setoperation
state fc_login fc_logout object management functions these functions manage certificates and keys.
NSS functions
3.2 and later cert_getocspauthorityinfoaccesslocation mxr 3.4 and later cert_getpkixverifynistrevocationpolicy mxr 3.12 and later cert_getprevgeneralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_get
statename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnspatternsfromcert mxr 3.12 and later cert_gentime2formattedascii mxr 3.2 and later cert_hexify mxr 3.2 and later cert_importcachain mxr 3.2 and later cert_importcerts mxr 3.2 and later cert_isrootdercert mx...
NSS tools : certutil
certificate request generated by netscape phone: 650-555-0123 common name: john smith email: (not ed) organization: example corp
state: california country: us -----begin new certificate request----- miibidcbywibadbmmqswcqydvqqgewjvuzetmbega1uecbmkq2fsawzvcm5pytew mbqga1uebxmntw91bnrhaw4gvmlldzevmbmga1uechmmrxhhbxbszsbdb3jwmrmw eqydvqqdewpkb2huifntaxromfwwdqyjkozihvcnaqebbqadswawsajbamvupdoz kmhnox7rep8cc0lk+ffweuyidx9w5k/bioqokvejxyqzhit9athzbvmosf1y1s8j czdubcg1+ibnxaecaweaaaaama0gcsqgsib3dqebbquaa0earyqzvpyrutq486ny ...
pkfnc.html
arg a pointer supplied by the application that can be used to pass
state information.
sslintro.html
you can pass this function a model file descriptor to create the new ssl socket with the same configuration
state as the model.
NSS_3.12.3_release_notes.html
seed support: (see blapit.h) seedcontextstr seedcontext new functions in the nss shared library: cert_rfc1485_escapeandquote (see cert.h) cert_comparecerts (see cert.h) cert_registeralternateocspaiainfocallback (see ocsp.h) pk11_getsymkeyhandle (see pk11pqg.h) util_setfork
state (see secoid.h) nss_getalgorithmpolicy (see secoid.h) nss_setalgorithmpolicy (see secoid.h) for the 2 functions above see also (in secoidt.h): nss_use_alg_in_cert_signature nss_use_alg_in_cms_signature nss_use_alg_reserved support for the watcom c compiler is removed the file w...
certutil
certificate request generated by netscape phone: 650-555-0123 common name: john smith email: (not ed) organization: example corp
state: california country: us -----begin new certificate request----- miibidcbywibadbmmqswcqydvqqgewjvuzetmbega1uecbmkq2fsawzvcm5pytew mbqga1uebxmntw91bnrhaw4gvmlldzevmbmga1uechmmrxhhbxbszsbdb3jwmrmw eqydvqqdewpkb2huifntaxromfwwdqyjkozihvcnaqebbqadswawsajbamvupdoz kmhnox7rep8cc0lk+ffweuyidx9w5k/bioqokvejxyqzhit9athzbvmosf1y1s8j czdubcg1+ibnxaecaweaaaaama0gcsqgsib3dqebbquaa0earyqzvpyrutq486ny q...
NSS tools : signtool
organization unit: server products division
state or province: california country (must be exactly 2 characters): us username: someuser email address: someuser@netscape.com enter password or pin for "communicator certificate db": [password will not echo] generated public/private key pair certificate request generated certificate has been signed certificate "mytestcert" added to database exported certificate to x509.raw and x509.cacert.
Necko walkthrough
back on the main thread: nsinputstreampump::oninputstreamready this function in turn calls nsinputstreampump::on
statestart, nsinputstreampump::on
statetransfer and nsinputstreampump::on
statestop.
Necko
browse our code in its latest
state at netwerk/ documents a necko code walkthrough necko architecture necko multithreading necko faq necko interfaces overview the necko http module proxies in necko pac files community view mozilla forums...
Rhino scopes and contexts
when the
statement x = v + a; is executed, the scope chain is traversed looking for a 'x' property.
Rhino serialization
serialization provides a way to save the
state of an object and write it out to a file or send it across a network connection.
SpiderMonkey Build Documentation
refer the release notes under command line tools -> new features the release notes also
states that this compatibility package will no longer be provided in the near future, so the build system on macos will have to be adapted to look for headers in the sdk until then, the following should help, open /library/developer/commandlinetools/packages/macos_sdk_headers_for_macos_10.14.pk this builds an executable named js in the directory build-release/dist/bin.
Creating JavaScript jstest reftests
it is easy to make a test silently pass; anyone who has written js code for the web has written this kind of if-
statement: if (typeof gc === 'function') { var arr = []; arr[10000] = 'item'; gc(); asserteq(arr[10000], 'item', 'gc must not wipe out sparse array elements'); } else { print('test skipped: no gc function'); } reportcompare(0, 0, 'ok'); handling abnormal test terminations some tests can terminate abnormally even though the test has technically passed.
Future directions
it can be read as something like an "ideal future
state" for the engine.
GC Rooting Guide
what will happen is that the return
statement will pull the bare jsobject* out of the rooted obj variable and either put it in the stack or store it in the return value register.
Invariants
a general rule about the
state of all threads at a given time: either exactly one thread is "in gc" and no threads are in requests; or no thread is doing gc, in which case any number of threads may be in requests; or the gc lock is held.
INT_FITS_IN_JSVAL
example the following code snippet illustrates how a c variable, item, is conditionally tested in an if
statement to see if it is a legal jsval integer value.
JS::CompileOptions
this allows an attack by which a malicious website loads a sensitive file (say, a bank
statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its contents.
JS::Evaluate
more generally, the result value is the value of the last-executed expression
statement in the script that isn't in a function.
JS::SetOutOfMemoryCallback
added in spidermonkey 38 description unlike the error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding to capture the current
state of heap allocation before anything is freed.
JSClass.flags
if this class has a finalizer that makes use of
state shared with the main thread then this option must be specified.
JSEnumerateOp
description jsenumerateop is called just before an object is enumerated (via a for...in
statement, an array comprehension, or a call to js_enumerate).
JSErrorReport
this allows an attack by which a malicious website loads a sensitive file (say, a bank
statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its contents.
JSNewResolveOp
jsresolve_with obsolete since javascript 1.8.8 the lookup is occurring for a name evaluated inside a with
statement.
JSPrincipalsTranscoder
callback syntax typedef jsbool (*jsprincipalstranscoder)(jsxdr
state *xdr, jsprincipals **principalsp); name type description xdr jsxdr
state * the xdr reader/writer.
JSVAL_IS_DOUBLE
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if
statement to see if it is a js double data type.
JSVAL_IS_INT
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if
statement to see if it is a js integer data type.
JSVAL_IS_NULL
(note: jsval_is_object(jsval_null) is also true.) example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if
statement to see if it contains a null value.
JSVAL_IS_NUMBER
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if
statement to see if it is a js integer or double value.
JSVAL_IS_STRING
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if
statement to see if it is a string.
JSVAL_IS_VOID
example the following code snippet illustrates how a javascript variable, myitem, is conditionally tested in an if
statement to see if it is void.
JS_BufferIsCompilableUnit
description given a buffer, return false if the buffer might become a valid javascript
statement with the addition of more lines.
JS_CallFunction
js_callfunctionvalue(cx, obj, fval, args, rval) is analogous to the javascript
statement rval = fval.apply(obj, args);.
JS_ConvertArguments
it saves you from having to write separate tests and elaborate if...else
statements in your function code to retrieve and translate multiple js values for use with your own functions.
JS_EvaluateScript
more generally, the result value is the value of the last-executed expression
statement in the script that isn't in a function.
JS_GetParent
if there is no enclosing function, with
statement, or block scope, then the function's parent is the global object.
JS_GetScopeChain
these objects represent the lexical scope of the currently executing
statement or expression, not the call stack, so they include: the variable objects of any enclosing functions or let
statements or expressions, and any objects selected by enclosing with
statements, in order from the most-nested scope outward; lastly the global object against which the function was created.
JS_NewRuntime
if parentruntime is specified, the resulting runtime shares significant amounts of read-only
state (the self-hosting and initial atoms compartments).
JS_PreventExtensions
this might also occur if the object is a proxy, and some internal
state of the proxy means that no coherent behavior is possible.
JS_SetOptions
mxr id search for jsoption_relimit jsoption_anonfunfix added in spidermonkey 1.8 disallow function () {} in
statement context, per ecma-262 edition 3.
SpiderMonkey 1.8.5
this change to a struct means that certain tricks, such as writing switch
statements in c with jsval cases are no longer legal.
SpiderMonkey 1.8.7
this change to a struct means that certain tricks, such as writing switch
statements in c with jsval cases are no longer legal.
Zest
zest topics usecases reporting security vulnerabilities to developers reporting security vulnerabilities to companies defining active and passive scanner rules deep integration with security tools runtimes the runtime environments that support zest tools the tools that include support zest implementation the
state of zest development videos simon demoed zest at appsec usa in november 2013, and the full video of my talk is available on youtube.
AT APIs Support
there you will find information how at api interfaces, roles,
states and etc are mapped into gecko accessibility api and visa versa.
Querying Places
this corresponds to the open and closed
state in a tree view, and can also be mapped to showing and hiding menus.
XPCOM array guide
these enumerators maintain
state about the current position in the array.
Creating the Component Code
the many faces of the xpcom component manager the three core component management interfaces, nsicomponentmanager, nsiservicemanager, and nsicomponentregistrar, are described below: nsicomponentmanager - creates objects and gets implementation details about objects nsiservicemanager - provides access to singleton objects and discovers singleton
state nsicomponentregistrar - registers and unregisters factories and components; handles autoregistration and the discovery and enumeration of registered components.
Finishing the Component
an interface reaches this
state when a group of module owners and peers are actively engaged in discussion about how best to expose it.
Components.classes
often, this is
stated in the documentation of the component you want to use.
Components.returnCode
components.returncode is a property which can hold an xpcom return code additionally to the value returned by the return
statement.
Community
active
state python xpcom bindings mailing list discussion of the bindings between the python language and the xpcom (cross-platform com) technology from the mozilla project.
Using components
commonly, we start our scripts like so: var cc = components.classes; var ci = components.interfaces; if we want to get a hold of a component, we then do something like: var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); see also: xpcshell -- how to get a command line interface to javascript more info as was already
stated, it is common to start addon scripts like: var cc = components.classes; var ci = components.interfaces; there is also another way to start, which is exactly equivalent to the above.
HOWTO
both success and error callbacks, put: gscriptdone = true; if you forget some condition where your script should exit but you don't add this
statement, your script will hang (busy wait).
xpcshell
it should be executed under the window command prompt source_directory/obj-xxxxx/dist/bin> xpcshell.exe using the latest version of javascript at present, xpcshell doesn't use the latest version of javascript, so newer language features, such as the let
statement introduced in javascript 1.7, are not available.
Language bindings
pyxpcom is actively used in active
state komodo products, for example.rbxpcomrbxpcom (ruby cross-platform com) provides bindings between the popular ruby programming language and xpcom.
imgIRequest
regardless, there's no reason for this flag to be public, and it should either go away or become a private
state flag within imgrequest.
mozIStorageBindingParams
the mozistoragebindingparams interface is used to bind values to parameters prior to calling mozistorage
statement.executeasync().
mozIStorageRow
see also storage mozistorageresultset mozistorageconnection mozistorage
statement ...
mozIStorageVacuumParticipant
the vacuum manager will try to restore wal mode, but this will only work reliably if the participant properly resets
statements.
nsIAbCard
pagernumber astring cellularnumber astring workphonetype astring homephonetype astring faxnumbertype astring pagernumbertype astring cellularnumbertype astring homeaddress astring homeaddress2 astring homecity astring home
state astring homezipcode astring homecountry astring workaddress astring workaddress2 astring workcity astring work
state astring workzipcode astring workcountry astring jobtitle astring department astring company a...
TakeFocus
void takefocus(); remarks the
state state_focusable indicates whether this node is normally focusable.
nsIAccessibleSelectable
constants constant value description eselection_add 0 eselection_remove 1 eselection_get
state 2 methods addchildtoselection() adds the specified accessible child of the object to the object's selection.
nsIDOMHTMLAudioElement
exceptions thrown ns_error_dom_invalid_
state_err the stream has not been initialized for writing by a call to mozsetup().
nsIDOMXPathResult
invaliditerator
state boolean true if the iterator
state has become invalid.
nsIDragSession
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current
state of the drag, whether it can be dropped or not.
nsIEditor
ddeditorobserver(in nsieditorobserver observer);obsolete since gecko 18 void seteditorobserver(in editactionlistener observer); void removeeditorobserver(in nsieditorobserver observer obsolete since gecko 18); void addeditactionlistener(in nsieditactionlistener listener); void removeeditactionlistener(in nsieditactionlistener listener); void adddocument
statelistener(in nsidocument
statelistener listener); void removedocument
statelistener(in nsidocument
statelistener listener); debug methods void dumpcontenttree(); void debugdumpcontent() ; void debugunittests(out long outnumtests, out long outnumtestsfailed); [notxpcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags ...
nsIFaviconDataCallback
it's up to the invoking method to
state if the callback is always invoked, or called on success only.
nsIFeedProgressListener
void handlestartfeed( in nsifeedresult result ); parameters result an nsifeedresult describing the current
state of the feed at the moment parsing begins.
nsITaskbarWindowPreview
note: this interface will never invoke the controller's nsitaskbarpreviewcontroller.onclose() or nsitaskbarpreviewcontroller.onactivate() methods, since handling them may conflict with other internal gecko
state management.
nsIThreadInternal
calls to pusheventqueue() may be nested, and must each be paired with a corresponding call to popeventqueue() to restore the original
state of the thread.
nsITreeSelection
toggleselect() toggle the selection
state of the row at the specified index.
nsIWebNavigationInfo
you may specify null to check for compatibility with nsiwebnavigation objects that are in their default
state; otherwise, the result is determined based on the configuration of the specified object (that is, how it is configured by using nsiwebbrowsersetup).
nsIWebProgressListener2
progress totals are reset to zero when all requests in awebprogress complete (corresponding to on
statechange being called with a
stateflags including the
state_stop and
state_is_window flags).
nsIWindowMediator
note this method is advisory only: it changes nothing either in windowmediator's internal
state or with the window.
nsIXMLHttpRequest
the 'onload', 'onerror', and 'onready
statechange' attributes moved to nsijsxmlhttprequest, but if you're coding in c++ you should avoid using those.
nsIXPConnect
this should be used only when restoring an old scope into a
state close to where it was prior to being reinitialized.
nsMsgRuleActionType
l typedef long nsmsgruleactiontype; [scriptable, uuid(59af7696-1e28-4642-a400-fa327ae0b8d8)] interface nsmsgfilteraction { /* if you change these, you need to update filter.properties, look for filteractionx */ /* these longs are all actually of type nsmsgfilteractiontype */ const long custom=-1; /* see nsmsgfilteraction */ const long none=0; /* uninitialized
state */ const long movetofolder=1; const long changepriority=2; const long delete=3; const long markread=4; const long killthread=5; const long watchthread=6; const long markflagged=7; const long label=8; const long reply=9; const long forward=10; const long stopexecution=11; const long deletefrompop3server=12; const long leaveonpop3server=13; co...
XPCOM Interface Reference by grouping
ce nsidragsession html nsiaccessibilityservice nsiaccessiblecoordinatetype nsiaccessibledocument nsiaccessibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink nsiaccessiblehypertext nsiaccessibleimage nsiaccessibleprovider nsiaccessibleretrieval nsiaccessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessible
states nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator n...
nsIAbCard/Thunderbird3
properties currently supported on the card: names: firstname, lastname phoneticfirstname, phoneticlastname displayname, nickname spousename, familyname primaryemail, secondemail home contact: homeaddress, homeaddress2, homecity, home
state, homezipcode, homecountry homephone, homephonetype work contact.
XPCOM reference
for example to move forward a message, you would call:nsmsgsearchopvaluedefined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl nsmsgviewcommandcheck
statethe nsmsgviewcommandcheck
state interface contains constants used for command status in thunderbird.
Warnings
sort operations this warning message will say something about the number of sort operations that have occurred for a sql
statement.
Frequently Asked Questions
{ // i only need the |nsifoo| interface for a short time // so i control its lifetime by declaring it inside // a block
statement.
Getting Started Guide
as
stated above, with no directives, the nscomptr will release its old referent, if any, and addref the new.
Status, Recent Changes, and Plans
recent changes to this document removed the
statement that == and != between an nscomptr and a raw pointer or literal 0 does not work on some compilers since it is no longer true.
Weak reference
after all, the observable must send messages to each observer, notifying it of the appropriate
state changes.
Creating a gloda message query
you should not need to use this unless you are dealing with other old-school code or you need to manipulate the
state of a message.
Index
29 gloda debugging the gloda code has log4moz logging
statements spread throughout.
LDAP Support
homephone faxnumber fax faxnumber facsimiletelephonenumber pagernumber pager pagernumber pagerphone cellularnumber mobile cellularnumber cellphone cellularnumber carphone workaddress postofficebox workaddress streetaddress workcity l workcity locality work
state st work
state region workzipcode postalcode workzipcode zip workcountry countryname jobtitle title department ou department orgunit department department department departmentnumber company o company company workcountry countryname _aimscreenna...
Spam filtering
initial
state user action table changes unknown (user can't see this, looks like "not junk") mark as junk add tokens to bad unknown (user can't see this, looks like "not junk") mark as not junk add tokens to good not junk mark as junk remove tokens from good, add tokens to bad not junk mark as not junk no op junk mark as junk no o...
Styling the Folder Pane
biff
state-biff
state afolder.biff
state == nsimsgfolder.nsmsgbiff
state_<name> indicates whether or not the folder has new messages.
Using tab-modal prompts
ndow = gbrowser.contentwindow; var promptfact = components.classes['@mozilla.org/prompter;1'].getservice(components.interfaces.nsipromptfactory); var prompt = promptfact.getprompt(window, components.interfaces.nsiprompt); var promptbag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); promptbag.setpropertyasbool('allowtabmodal', true); var check = {value: false}; //initial
state of checkbox, however if no text is supplied the checkbox is not shown var input = {value: 'pre filled value'}; var ok = prompt.prompt.apply(null, ['title - but not shown in tab modal', 'text goes here', input, 'check text, if no text, checkbox is not shown', check]); //this here is just an alert, showing the values of the prompt prompt.alert.apply(null, ['title not shown in modal', 'user clicked...
Working with windows in chrome code
this can be done using the following
statement: var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.i...
Add to iPhoto
when the user right-clicks an image, our handler gets called: onpopup: function() { var node = iphoto.getcurrentnode(); var item = document.getelementbyid("add-to-iphoto_menuitem"); if (item) { item.hidden = (node == null); // hide it if we're not on an image } } this code finds the image node the user right-clicked in by calling our getcurrentnode() method, then sets the hidden
state of the "add image to iphoto" menu item based on whether or not an image node was found.
Mozilla
for example, this popup notification is displayed when a web site requests geolocation information: using raii classes in mozilla raii classes are useful when two operations (e.g., lock/unlock, addref/release, push
state/pop
state) must be paired.
Constants - Plugins
npvers_has_popups_enabled_
state 16 the npn_pushpopupsenabled
state() and npn_poppopupsenabled
state() functions are supported.
Plug-in Basics - Plugins
the installed plug-ins page lists each installed plug-in along with its mime type or types, description, file extensions, and the current
state (enabled or disabled) of the plug-in for each mime type assigned to it.
Examine, modify, and watch variables - Firefox Developer Tools
examine variables when the code has stopped at a breakpoint, you can examine its
state in the variables pane of the debugger: variables are grouped by scope: in function scope you'll see the built-in arguments and this variables as well as local variables defined by the function like user and greeting.
UI Tour - Firefox Developer Tools
the ui is split vertically into three panels source list pane source pane the contents of the third pane depend on the current
state of the debugger and may include the following sections: toolbar watch expressions breakpoints call stack scopes xhr breakpoints event listener breakpoints dom mutation breakpoints source list pane the source list pane lists all the javascript source files loaded into the page, and enables you to select one to debug.
Debugger-API - Firefox Developer Tools
debugger instances and shadow objects debugger reflects every aspect of the debuggee’s
state as a javascript value—not just actual javascript values like objects and primitives, but also stack frames, environments, scripts, and compilation units, which are not normally accessible as objects in their own right.
Network request details - Firefox Developer Tools
request information the following information is shown only when the section is expanded: scheme: the scheme used in the url host: the server involved in the request filename: the full path to the file requested address: the ip address of the host the following information is shown in both the collapsed and the expanded
states: status: the http response code for the request.
UI Tour - Firefox Developer Tools
it periodically samples the
state of the javascript engine, and records the stack for the code executing at the time the sample was taken.
AbsoluteOrientationSensor - Web APIs
const sensor = new absoluteorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "magnetometer" }), navigator.permissions.query({ name: "gyroscope" })]) .then(results => { if (results.every(result => result.
state === "granted")) { sensor.start(); ...
Animation.cancel() - Web APIs
exceptions this method doesn't directly throw exceptions; however, if the animation's play
state is anything but "idle" when cancelled, the current finished promise is rejected with a domexception named aborterror.
Animation.finished - Web APIs
every time the animation leaves the finished play
state (that is, when it starts playing again), a new promise is created for this property.
Animation.oncancel - Web APIs
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.
Animation.playbackRate - Web APIs
setting an animation’s playbackrate to 0 effectively pauses the animation (however, its play
state does not necessarily become paused).
AudioScheduledSourceNode.start() - Web APIs
if no value is passed then the duration will be equal to the length of the audio buffer minus the offset value return value undefined exceptions invalid
statenode the node has already been started.
AudioScheduledSourceNode - Web APIs
unless
stated otherwise, nodes based upon audioscheduledsourcenode output silence when not playing (that is, before start() is called and after stop() is called).
AuthenticatorAssertionResponse.authenticatorData - Web APIs
this is a sequence of bytes with the following format: aaguid (16 bytes) - authenticator attestation globally unique identifier, a unique number that identifies the model of the authenticator (not the specific instance of the authenticator) so that a relying party can understand the characteristics of the authenticator by looking up its metadata
statement.
AuthenticatorAttestationResponse - Web APIs
authenticatorattestationresponse.attestationobject secure contextread only an arraybuffer containing authenticator data and an attestation
statement for a newly-created key pair.
Background Tasks API - Web APIs
}; enqueuetask(logtaskhandler, taskdata); } } document.getelementbyid("startbutton").addeventlistener("click", decodetechnostuff, false); decodetechnostuff() starts by zeroing the values of totaltaskcount (the number of tasks added to the queue so far) and currenttasknumber (the task currently being run), and then calls updatedisplay() to reset the display to its "nothing's happened yet"
state.
BatteryManager.charging - Web APIs
example html content <div id="charging">(charging
state unknown)</div> javascript content navigator.getbattery().then(function(battery) { var charging = battery.charging; document.queryselector('#charging').textcontent = charging ; }); specifications specification status comment battery status api candidate recommendation initial definition ...
BatteryManager - Web APIs
event handlers batterymanager.onchargingchange a handler for the chargingchange event; this event is sent when the battery charging
state is updated.
Using the Beacon API - Web APIs
window.onload = window.onunload = function analytics(event) { if (!navigator.sendbeacon) return; var url = "https://example.com/analytics"; // create the data to send var data = "
state=" + event.type + "&location=" + location.href; // send the beacon var status = navigator.sendbeacon(url, data); // log the data and result console.log("sendbeacon: url = ", url, "; data = ", data, "; status = ", status); }; the following example creates a submit handler and when that event is fired, the handler calls sendbeacon().
BudgetService - Web APIs
budgetservice.getbudget() returns a promise that resolves to an array of budget
state objects, indicating the expected
state of the budget at times in the future.
CSSConditionRule - Web APIs
an object implementing the cssconditionrule interface represents a single condition css at-rule, which consists of a condition and a
statement block.
CSSStyleSheet.insertRule() - Web APIs
if rule is @namespace and the rule-list has more than just @import at-rules and/or @namespace at-rules, the method aborts with an invalid
stateerror.
Cache - Web APIs
note: in chrome, visit chrome://inspect/#service-workers and click on the "inspect" link below the registered service worker to view logging
statements for the various actions the service-worker.js script is performing.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
example // find the canvas element to capture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.capturestream(25); // 25 fps // send the current
state of the canvas as a frame to the stream stream.getvideotracks()[0].requestframe(); specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastream.requestframe()' in that specification.
ChildNode.after() - Web APIs
); // "<div><p></p>text</div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.after(span, "text"); console.log(parent.outerhtml); // "<div><p></p><span></span>text</div>" childnode.after() is unscopable the after() method is not scoped into the with
statement.
ChildNode.before() - Web APIs
// "<div>text<p></p></div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.before(span, "text"); console.log(parent.outerhtml); // "<div><span></span>text<p></p></div>" childnode.before() is unscopable the before() method is not scoped into the with
statement.
ChildNode.remove() - Web APIs
syntax node.remove(); example using remove() <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <div id="div-03">here is div-03</div> var el = document.getelementbyid('div-02'); el.remove(); // removes the div with the 'div-02' id childnode.remove() is unscopable the remove() method is not scoped into the with
statement.
ChildNode.replaceWith() - Web APIs
examples using replacewith() var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.replacewith(span); console.log(parent.outerhtml); // "<div><span></span></div>" childnode.replacewith() is unscopable the replacewith() method is not scoped into the with
statement.
Clipboard.read() - Web APIs
if (result.
state == "granted" || result.
state == "prompt") { navigator.clipboard.read().then(data => { for (let i=0; i<data.items.length; i++) { if (data.items[i].type != "image/png") { alert("clipboard contains non-image data.
ConvolverNode.buffer - Web APIs
at the time when this attribute is set, the buffer and the
state of the attribute will be used to configure the convolvernode with this impulse response having the given normalization.
DOMError - Web APIs
notsupportederror the operation is not supported invalid
stateerror the object is in an invalid
state.
DOMMatrixReadOnly - Web APIs
throws an invalid
stateerror exception if any of the elements in the matrix are non-finite (even if, in the case of a 2d matrix, the non-finite values are in elements not used by the 2d matrix representation).
Document.evaluate() - Web APIs
modifying the document doesn't invalidate the snapshot; however, if the document is changed, the snapshot may not correspond to the current
state of the document, since nodes may have moved, been changed, added, or removed.
Document.exitFullscreen() - Web APIs
the document method exitfullscreen() requests that the element on this document which is currently being presented in full-screen mode be taken out of full-screen mode, restoring the previous
state of the screen.
Document.querySelectorAll() - Web APIs
you can use any common looping
statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results.
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.
EffectTiming.easing - Web APIs
frames(<integer>) specifies a frames timing function, which breaks the animation down into a number of equal time intervals but also displays the start (0%) and end (100%)
states for an equal amount of time to the other intervals.
Element.classList - Web APIs
examples const div = document.createelement('div'); div.classname = 'foo'; // our starting
state: <div class="foo"></div> console.log(div.outerhtml); // use the classlist api to remove and add classes div.classlist.remove("foo"); div.classlist.add("anotherclass"); // <div class="anotherclass"></div> console.log(div.outerhtml); // if visible is set remove it, otherwise add it div.classlist.toggle("visible"); // add/remove visible, depending on test conditional, i less than 10 div.classlis...
Element.getElementsByClassName() - Web APIs
usage notes as always, the returned collection is live, meaning that it always reflects the current
state of the dom tree rooted at the element on which the function was called.
Element: overflow event - Web APIs
the overflow event is fired when an element has been overflowed by its content or has been rendered for the first time in this
state (only works for elements styled with overflow != visible).
Element.querySelectorAll() - Web APIs
you can use any common looping
statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); note: nodelist is not a genuine array, that is to say it doesn't have the array methods like slice, some, map etc.
ElementCSSInlineStyle.style - Web APIs
examples // set multiple styles in a single
statement elt.style.csstext = "color: blue; border: 1px solid black"; // or elt.setattribute("style", "color:red; border: 1px solid blue;"); // set specific style while leaving other inline style values untouched elt.style.color = "blue"; getting style information the style property is not useful for completely learning about the styles applied on the element, since it represents only the css decla...
Event.currentTarget - Web APIs
instead, you can either directly console.log(event.currenttarget) to be able to view it in the console or use the debugger
statement, which will pause the execution of your code thus showing you the value of event.currenttarget.
Event - Web APIs
ent deviceorientationevent deviceproximityevent domtransactionevent dragevent editingbeforeinputevent errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent inputevent keyboardevent mediastreamevent messageevent mouseevent mutationevent offlineaudiocompletionevent overconstrainederror pagetransitionevent paymentrequestupdateevent pointerevent pop
stateevent progressevent relatedevent rtcdatachannelevent rtcidentityerrorevent rtcidentityevent rtcpeerconnectioniceevent sensorevent storageevent svgevent svgzoomevent timeevent touchevent trackevent transitionevent uievent userproximityevent webglcontextevent wheelevent constructor event() creates an event object, returning it to the caller.
EventSource.close() - Web APIs
the close() method of the eventsource interface closes the connection, if one is made, and sets the eventsource.ready
state attribute to 2 (closed).
Fetch API - Web APIs
if you are targetting older versions of these browsers, be sure to include credentials: 'same-origin' init option on all api requests that may be affected by cookies/user login
state.
FileReader.readAsText() - Web APIs
when the read operation is complete, the ready
state is changed to done, the loadend event is triggered, and the result property contains the contents of the file as a text string.
FileHandle API - Web APIs
it's possible to get a file object representing the current
state of the file handled by the filehandle object by using the getfile method.
Using the Frame Timing API - Web APIs
the call tree shows where the application is spending most of its time, whereas the flame chart shows the
state of the javascript stack for the code at every millisecond during the performance profile.
Guide to the Fullscreen API - Web APIs
document.fullscreenenabled the fullscreenenabled property tells you whether or not the document is currently in a
state that would allow fullscreen mode to be requested.
GamepadButton.value - Web APIs
the gamepadbutton.value property of the gamepadbutton interface returns a double value used to represent the current
state of analog buttons on many modern gamepads, such as the triggers.
GlobalEventHandlers.oncontextmenu - Web APIs
use.</p> css @keyframes spin { from { transform: rotate(0); } to { transform: rotate(1turn); } } .shape { width: 8em; height: 8em; display: flex; align-items: center; justify-content: center; animation: spin 18s linear infinite; background: lightsalmon; border-radius: 42%; margin: 1em; } .paused { background-color: #ddd; } .paused .shape { animation-play-
state: paused; } javascript function pause(e) { body.classlist.add('paused'); note.removeattribute('hidden'); } function play(e) { body.classlist.remove('paused'); note.setattribute('hidden', ''); } const body = document.queryselector('body'); const note = document.queryselector('.note'); window.oncontextmenu = pause; window.onpointerdown = play; result specifications specifi...
HTMLAnchorElement - Web APIs
note: currently the w3c html 5.2 spec
states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete.
Audio() - Web APIs
determining when playback can begin there are three ways you can tell when enough of the audio file has loaded to allow playback to begin: check the value of the ready
state property.
HTMLButtonElement - Web APIs
htmlbuttonelement.validity read only is a validity
state representing the validity
states that this button is in.
HTMLDialogElement.open - Web APIs
syntax dialoginstance.open = true; var myopenvalue = dialoginstance.open; value a boolean representing the
state of the open html attribute.
HTMLElement: pointermove event - Web APIs
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: 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.
HTMLFrameSetElement - Web APIs
windoweventhandlers.onpop
state is an eventhandler representing the code to be called when the pop
state event is raised.
HTMLImageElement.crossOrigin - Web APIs
example in this example, a new <img> element is created and added to the document, loading the image with the anonymous
state; the image will be loaded using cors and credentials will be used for all cross-origin loads.
HTMLImageElement.sizes - Web APIs
this provides the ability to automatically select among different images—even images of different orientations or aspect ratios—as the document
state changes to match different media conditions.
HTMLImageElement.srcset - Web APIs
as an example, to
state that the corresponding image should be used when the pixel density is double the standard density, you can give the pixel density descriptor 2x or 2.0x.
HTMLInputElement.stepUp() - Web APIs
if the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalid
stateerror exception is thrown.
HTMLLinkElement - Web APIs
note: currently the w3c html 5.2 spec
states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete.
HTMLMediaElement.load() - Web APIs
the htmlmediaelement method load() resets the media element to its initial
state and begins the process of selecting a media source and loading the media in preparation for playback to begin at the beginning.
HTMLMediaElement.pause() - Web APIs
the htmlmediaelement.pause() method will pause playback of the media, if the media is already in a paused
state this method will have no effect.
HTMLMediaElement: pause event - Web APIs
the pause event is sent when a request to pause an activity is handled and the activity has entered its paused
state, most commonly after the media has been paused through a call to the element's pause() method.
HTMLMediaElement.play() - Web APIs
this ensures that the play button matches the actual
state of playback by watching for the resolution or rejection of the promise returned by play().
HTMLObjectElement.setCustomValidity - Web APIs
function validate(inputid) { var input = document.getelementbyid(inputid); var validity
state_object = input.validity; if (validity
state_object.valuemissing) { input.setcustomvalidity('you gotta fill this out, yo!'); input.reportvalidity(); } else if (input.rangeunderflow) { input.setcustomvalidity('we need a higher number!'); input.reportvalidity(); } else if (input.rangeoverflow) { input.setcustomvalidity('thats too high!'); input.reportvalidity(); } else { inp...
Option() - Web APIs
selected optional a boolean that sets the option's selected
state; the default is false (not selected).
Drag Operations - Web APIs
note: you must cancel the dragenter event for this pseudoclass to apply, as this
state is not checked for the dragover event.
IDBTransaction.abort() - Web APIs
syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception description invalid
stateerror the transaction has already been committed or aborted.
Basic concepts - Web APIs
they also have ready
state, result, and errorcode properties that tell you the status of the request.
Using IndexedDB - Web APIs
first, you should take care to always leave your database in a consistent
state at the end of every transaction.
InstallEvent - Web APIs
note: logging
statements are visible in google chrome via the "inspect" interface for the relevant service worker accessed via chrome://serviceworker-internals.
IntersectionObserverEntry - Web APIs
if this is true, then, the intersectionobserverentry describes a transition into a
state of intersection; if it's false, then you know the transition is from intersecting to not-intersecting.
KeyboardEvent.code - Web APIs
in other words, this property returns a value that isn't altered by keyboard layout or the
state of the modifier keys.
KeyboardEvent.key - Web APIs
the keyboardevent interface's key read-only property returns the value of the key pressed by the user, taking into consideration the
state of modifier keys such as shift as well as the keyboard locale and layout.
LargestContentfulPaint - Web APIs
addeventlistener('visibilitychange', function fn() { if (lcp && document.visibility
state === 'hidden') { console.log('lcp:', lcp); removeeventlistener('visibilitychange', fn, true); } }, true); } catch (e) { // do nothing if the browser doesn't support this api.
LayoutShift - Web APIs
if (!entry.hadrecentinput) { cumulativelayoutshiftscore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); document.addeventlistener('visibilitychange', () => { if (document.visibility
state === 'hidden') { // force any pending records to be dispatched.
LockManager.query() - Web APIs
example const
state = await navigator.locks.query(); for (const lock of
state.held) { console.log(`held lock: name ${lock.name}, mode ${lock.mode}`); } for (const request of
state.pending) { console.log(`requested lock: name ${request.name}, mode ${request.mode}`); } specifications specification status comment web locks apithe definition of 'query()' in that specification.
MIDIConnectionEvent - Web APIs
the midiconnectionevent interface of the web midi api is the event passed to the on
statechange event handler of the midiaccess interface and the on
statechange event of the midiports interface.
MediaRecorder.onpause - Web APIs
pause.onclick = function() { if(mediarecorder.
state === "recording") { mediarecorder.pause(); // recording paused } else if(mediarecorder.
state === "paused") { mediarecorder.resume(); // resume recording } } mediarecorder.onpause = function() { // do something in response to // recording being paused } mediarecorder.onresume = function() { // do something in response to // recording being r...
MediaRecorder.onresume - Web APIs
pause.onclick = function() { if(mediarecorder.
state === "recording") { mediarecorder.pause(); // recording paused } else if(mediarecorder.
state === "paused") { mediarecorder.resume(); // resume recording } } mediarecorder.onpause = function() { // do something in response to // recording being paused } mediarecorder.onresume = function() { // do something in response to // recording being r...
MediaSource.MediaSource() - Web APIs
urther investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.ready
state); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } ...
MediaSource.sourceBuffers - Web APIs
example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.ready
state); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.sourcebuffers); // will contain the source buffer that was added above video.play(); //console.log(mediasource.ready
state); // e...
active - Web APIs
a stream is considered active if at least one of its mediastreamtracks is not in the mediastreamtrack.ended
state.
MediaStream.ended - Web APIs
this property has been removed from the specification; you should instead rely on the ended event or check the value of mediastreamtrack.ready
state to see if its value is "ended" for the track or tracks you want to ensure have finished playing.
MediaStream - Web APIs
this has been removed from the specification; you should instead check the value of mediastreamtrack.ready
state to see if its value is ended for the track or tracks you want to ensure have finished playing.
MediaStreamTrack.onmute - Web APIs
mytrack.onmute = function(evt) { play
stateicon.innerhtml = "f507;"; }; specifications specification status comment media capture and streamsthe definition of 'mediastreamtrack.onmute' in that specification.
MediaStreamTrackAudioSourceNode - Web APIs
this interface is similar to mediastreamaudiosourcenode, except it lets you specifically
state the track to use, rather than assuming the first audio track on a stream.
MediaStream Recording API - Web APIs
); document.body.appendchild(a); a.style = "display: none"; a.href = url; a.download = "test.webm"; a.click(); window.url.revokeobjecturl(url); } // demo: to download after 9sec settimeout(event => { console.log("stopping"); mediarecorder.stop(); }, 9000); examining and controlling the recorder status you can also use the properties of the mediarecorder object to determine the
state of the recording process, and its pause() and resume() methods to pause and resume recording of the source media.
Media Source API - Web APIs
mse allows us to replace the usual single track src value fed to media elements with a reference to a mediasource object, which is a container for information like the ready
state of the media for being played, and references to multiple sourcebuffer objects that represent the different chunks of media that make up the entire stream.
MerchantValidationEvent.complete() - Web APIs
exceptions this exception may be passed into the rejection handler for the promise: invalid
stateerror the event did not come directly from the user agent, but was instead dispatched by other code.
Microsoft API extensions - Web APIs
touch apis element.mszoomto() mscontentzoom msmanipulationevent msmanipulation
statechanged msmanipulationviewsenabled mspointerhover media apis htmlvideoelement.msframestep() htmlvideoelement.mshorizontalmirror htmlvideoelement.msinsertvideoeffect() htmlvideoelement.msislayoutoptimalforplayback htmlvideoelement.msisstereo3d htmlvideoelement.mszoom htmlaudioelement.msaudiocategory htmlaudioelement.msaudiodevicetype htmlmediaelement.mscleareffects() htmlmediaelement.msinse...
MouseEvent.button - Web APIs
syntax var buttonpressed = instanceofmouseevent.button return value a number representing a given button: 0: main button pressed, usually the left button or the un-initialized
state 1: auxiliary button pressed, usually the wheel button or the middle button (if present) 2: secondary button pressed, usually the right button 3: fourth button, typically the browser back button 4: fifth button, typically the browser forward button as noted above, buttons may be configured differently to the standard "left to right" layout.
MouseEvent.buttons - Web APIs
the mouseevent.buttons property indicates the
state of buttons pressed during any kind of mouse event, while the mouseevent.button property only guarantees the correct value for mouse events caused by pressing or releasing one or multiple buttons.
MutationObserver.observe() - Web APIs
theoretically, this means that if you keep track of the mutationrecord objects describing the changes that occur, you should be able to "undo" the changes, rewinding the dom back to its initial
state.
MutationObserverInit.characterDataOldValue - Web APIs
if you set the mutationobserverinit.characterdata property to true but don't set characterdataoldvalue to true as well, the mutationrecord will not include information describing the prior
state of the text node's contents.
Navigator.mediaSession - Web APIs
the read-only navigator property mediasession returns a mediasession object that can be used to share with the browser metadata and other information about the current playback
state of media being handled by a document.
Navigator.permissions - Web APIs
examples navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.
state === 'granted') { showmap(); } else if (result.
state === 'prompt') { showbuttontoenablemap(); } // don't do anything if the permission was denied.
Navigator - Web APIs
the navigator interface represents the
state and the identity of the user agent.
Network Information API - Web APIs
a real-world use case would likely use a switch
statement or some other method to check all of the possible values of networkinformation.type.
NodeIterator.nextNode() - Web APIs
in old browsers, as specified in old versions of the specifications, the method may throws the invalid_
state_err domexception if this method is called after the nodeiterator.detach()method.
NodeIterator.previousNode() - Web APIs
in old browsers, as specified in old versions of the specifications, the method may throws the invalid_
state_err domexception if this method is called after the nodeiterator.detach()method.
Notification.close() - Web APIs
function spawnnotification(thebody, theicon, thetitle) { var options = { body: thebody, icon: theicon }; var n = new notification(thetitle,options); document.addeventlistener('visibilitychange', function() { if (document.visibility
state === 'visible') { // the tab has become visible so clear the now-stale notification.
OES_vertex_array_object - Web APIs
the oes_vertex_array_object extension is part of the webgl api and provides vertex array objects (vaos) which encapsulate vertex array
states.
OVR_multiview2 - Web APIs
calling checkframebufferstatus for a framebuffer in this
state returns framebuffer_incomplete_view_targets_ovr.
OfflineAudioContext.suspend() - Web APIs
invalid
stateerror if the quantized frame number is one of the following: a negative number is less than or equal to the current time is greater than or equal to the total render duration is scheduled by another suspend for the same time specifications specification status comment web audio apithe definition of 'suspend()' in that specification.
OrientationSensor - Web APIs
const sensor = new absoluteorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "magnetometer" }), navigator.permissions.query({ name: "gyroscope" })]) .then(results => { if (results.every(result => result.
state === "granted")) { sensor.start(); ...
ParentNode.append() - Web APIs
ocument.createelement("div") parent.append("some text") console.log(parent.textcontent) // "some text" appending an element and text let parent = document.createelement("div") let p = document.createelement("p") parent.append("some text", p) console.log(parent.childnodes) // nodelist [ #text "some text", <p> ] parentnode.append() is unscopable the append() method is not scoped into the with
statement.
ParentNode.prepend() - Web APIs
text"); parent.prepend("headline: "); console.log(parent.textcontent); // "headline: some text" appending an element and text var parent = document.createelement("div"); var p = document.createelement("p"); parent.prepend("some text", p); console.log(parent.childnodes); // nodelist [ #text "some text", <p> ] parentnode.prepend() is unscopable the prepend() method is not scoped into the with
statement.
PaymentAddress.regionCode - Web APIs
the code is derived from the iso 3166-2 standard, which defines codes for identifying the subdivisions (e.g.,
states, provinces, autonomous regions, etc.) of all countries in the world.
PaymentRequest.show() - Web APIs
invalid
stateerror the promise rejects with an invalid
stateerror if the same payment has already been shown for this request (its
state is interactive because it is being shown already).
PerformanceTiming.domComplete - Web APIs
the legacy performancetiming.domcomplete read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser finished its work on the main document, that is when its document.ready
state changes to 'complete' and the corresponding ready
statechange event is thrown.
PerformanceTiming.domInteractive - Web APIs
the legacy performancetiming.dominteractive read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser finished its work on the main document, that is when its document.ready
state changes to 'interactive' and the corresponding ready
statechange event is thrown.
PerformanceTiming.domLoading - Web APIs
the legacy performancetiming.domloading read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser started its work, that is when its document.ready
state changes to 'loading' and the corresponding ready
statechange event is thrown.
Permissions - Web APIs
example navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.
state === 'granted') { showlocalnewswithgeolocation(); } else if (result.
state === 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permission was denied.
PointerEvent.pressure - Web APIs
for hardware that does not support pressure, such as a mouse, the value is 0.5 when the pointer is active buttons
state and 0 otherwise.
PointerEvent - Web APIs
the pointerevent interface represents the
state of a dom event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc.
PublicKeyCredential - Web APIs
with the current
state of implementation, this method only resolves to true when windows hello is available on the system.
RTCDTMFSender.insertDTMF() - Web APIs
return value undefined exceptions invalid
stateerror the dtmf tones couldn't be sent because the track has been stopped, or is in a read-only or inactive
state.
RTCDTMFToneChangeEvent - Web APIs
it takes two parameters, the first being a domstring representing the type of the event (always "tonechange"); the second a dictionary containing the initial
state of the properties of the event.
RTCDataChannel.onclose - Web APIs
example in this sample from a hypothetical instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the
state of the channel.
RTCDataChannel.send() - Web APIs
exceptions invalid
stateerror since the data channel uses a separate transport channel from the media content, it must establish its own connection; if it hasn't finished doing so (that is, its ready
state is "connecting"), this error occurs without sending or buffering the data.
SpeechSynthesis.paused - Web APIs
the paused read-only property of the speechsynthesis interface is a boolean that returns true if the speechsynthesis object is in a paused
state, or false if not.
SpeechSynthesis.resume() - Web APIs
the resume() method of the speechsynthesis interface puts the speechsynthesis object into a non-paused
state: resumes it if it was already paused.
SpeechSynthesis.speaking - Web APIs
the speaking read-only property of the speechsynthesis interface is a boolean that returns true if an utterance is currently in the process of being spoken — even if speechsynthesis is in a paused
state.
SpeechSynthesisEvent - Web APIs
the speechsynthesisevent interface of the web speech api contains information about the current
state of speechsynthesisutterance objects that have been processed in the speech service.
TextTrack.mode - Web APIs
when a text track is loaded in the disabled
state, the corresponding webvtt file is not loaded until the
state changes to either showing or hidden.
TextTrack - Web APIs
for example, this can be "en-us" for united
states english or "pt-br" for brazilian portuguese.
TextTrackList.onchange - Web APIs
syntax texttracklist.onchange = eventhandler; example this snippet establishes a handler for the change event that looks at each of the tracks in the list, calling a function to update the
state of a user interface control that indicates the current
state of the track.
Multi-touch interaction - Web APIs
<style> div { margin: 0em; padding: 2em; } #target1 { background: white; border: 1px solid black; } #target2 { background: white; border: 1px solid black; } #target3 { background: white; border: 1px solid black; } #target4 { background: white; border: 1px solid black; } </style> global
state tpcache is used to cache touch points for processing outside of the event where they were fired.
Touch events - Web APIs
interfaces touchevent represents an event that occurs when the
state of touches on the surface changes.
WEBGL_depth_texture - Web APIs
incorrectly
stated as the target parameter in the specification, see https://www.khronos.org/bugzilla/show_bug.cgi?id=674.
WakeLock.request() - Web APIs
the request() method is wrapped in a try...catch
statement to account for if the browser refuses the request for any reason.
WakeLock - Web APIs
the wakelock.request method is wrapped in a try...catch
statement to account for if the browser refuses the request for any reason.
Geometry and reference spaces in WebXR - Web APIs
selecting the reference space type straight off, let's
state the simplest step in the process of deciding which reference type to use: the reference spaces you're most likely to use are local, local-floor, unbounded, or bounded-floor.
Inputs and input sources - Web APIs
input sources each source of webxr input data is represented by an xrinputsource object which describes the input source and its current
state.
Web Animations API Concepts - Web APIs
this means we can use it to create and manipulate css-like animations that go from one pre-defined
state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing inputs.
Advanced techniques: Creating and sequencing audio - Web APIs
playing]'); let isplaying = false; setupsample() .then((sample) => { loadingel.style.display = 'none'; // remove loading screen dtmf = sample; // to be used in our playsample function playbutton.addeventlistener('click', function() { isplaying = !isplaying; if (isplaying) { // start playing // check if context is in suspended
state (autoplay policy) if (audioctx.
state === 'suspended') { audioctx.resume(); } currentnote = 0; nextnotetime = audioctx.currenttime; scheduler(); // kick off scheduling requestanimationframe(draw); // start the drawing loop.
Using the Web Audio API - Web APIs
// select our play button const playbutton = document.queryselector('button'); playbutton.addeventlistener('click', function() { // check if context is in suspended
state (autoplay policy) if (audiocontext.
state === 'suspended') { audiocontext.resume(); } // play or pause track depending on
state if (this.dataset.playing === 'false') { audioelement.play(); this.dataset.playing = 'true'; } else if (this.dataset.playing === 'true') { audioelement.pause(); this.dataset.playing = 'false'; } }, false); ...
Web Speech API - Web APIs
speechsynthesisevent contains information about the current
state of speechsynthesisutterance objects that have been processed in the speech service.
Web Workers API - Web APIs
workernavigator represents the identity and
state of the user agent (the client): examples we have created a couple of simple demos to show basic usage: basic dedicated worker example (run dedicated worker).
Window.history - Web APIs
in particular, that article explains security features of the push
state() and replace
state() methods that you should be aware of before using them.
Window: load event - Web APIs
rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('ready
statechange', (event) => { log.textcontent = log.textcontent + `ready
state: ${document.ready
state}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment ui eventsthe definition of 'load' in that specification.
Window.personalbar - Web APIs
<!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar
states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.personalbar.visible = !window.personalbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or en...
window.postMessage() - Web APIs
this cannot be over
stated: failure to check the origin and possibly source properties enables cross-site scripting attacks.
Window.statusbar - Web APIs
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> // changing bar
states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.statusbar.visible=!window.statusbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or enable t...
Window.toolbar - Web APIs
<!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar
states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.toolbar.visible=!window.toolbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars, you must either sign your scripts or enable the a...
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.
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).
WindowEventHandlers - Web APIs
windoweventhandlers.onpop
state is an eventhandler representing the code to be called when the pop
state event is raised.
WorkerNavigator.permissions - Web APIs
examples self.navigator.permissions.query({name:'notifications'}).then(function(result) { if (result.
state === 'granted') { shownotification(); } else if (result.
state === 'prompt') { requestnotificationpermission() } }); specification specification status comment permissions working draft initial definition.
WritableStream.WritableStream() - Web APIs
abort(reason) optional this method, also defined by the developer, will be called if the app signals that it wishes to abruptly close the stream and put it in an errored
state.
WritableStream.abort() - Web APIs
the abort() method of the writablestream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error
state, with any queued writes discarded.
WritableStream - Web APIs
methods writablestream.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error
state, with any queued writes discarded.
WritableStreamDefaultWriter.abort() - Web APIs
the abort() method of the writablestreamdefaultwriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error
state, with any queued writes discarded.
WritableStreamDefaultWriter - Web APIs
methods writablestreamdefaultwriter.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error
state, with any queued writes discarded.
HTML in XMLHttpRequest - Web APIs
his test file is small and is not well-formed xml: <title>&&<</title> if the file is named detect.html, the following function can be used for detecting html parsing support: function detecthtmlinxhr(callback) { if (!window.xmlhttprequest) { window.settimeout(function() { callback(false); }, 0); return; } var done = false; var xhr = new window.xmlhttprequest(); xhr.onready
statechange = function() { if (this.ready
state == 4 && !done) { done = true; callback(!!(this.responsexml && this.responsexml.title && this.responsexml.title == "&&<")); } } xhr.onabort = xhr.onerror = function() { if (!done) { done = true; callback(false); } } try { xhr.open("get", "detect.html"); xhr.responsetype = "document"; xhr.send(); ...
Using XMLHttpRequest - Web APIs
the actual events you can monitor to determine the
state of an ongoing transfer are: progress the amount of data that has been retrieved has changed.
XPathResult - Web APIs
xpathresult.invaliditerator
stateread only signifies that the iterator has become invalid.
XRFrame.getViewerPose() - Web APIs
exceptions invalid
stateerror a domexception indicating that getviewerpose() was not called within the context of a callback to a session's xrsession.requestanimationframe().
XRFrame - Web APIs
events which communicate the tracking
state of objects also provide an xrframe reference as part of their structure.
XRInputSource - Web APIs
properties gamepad read only a gamepad object describing the
state of the buttons and axes on the xr input source, if it is a gamepad or comparable device.
XRInputSourceEvent() - Web APIs
the xrinputsourceevent() constructor creates and returns a new xrinputsourceevent object describing an event (
state change) which has occurred on a webxr user input device represented by an xrinputsource.
XRInputSourcesChangeEventInit - Web APIs
the xrinputsourceschangeeventinit dictionary is used to provide options to the xrinputsourceschangeevent() constructor in order to set the initial
state of the new xrinputsourceschangeevent object.
XRPermissionDescriptor.mode - Web APIs
let xrpermissiondesc = { name: "xr", mode: "immersive-vr" }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({
state}) => { switch(
state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermis...
XRPermissionDescriptor.optionalFeatures - Web APIs
xrreferencespace usage notes examples let xrpermissiondesc = { name: "xr", mode: "immersive-vr", optionalfeatures: [ "bounded-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({
state}) => { switch(
state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermis...
XRPermissionDescriptor.requiredFeatures - Web APIs
let xrpermissiondesc = { name: "xr", mode: "immersive-ar", requiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({
state}) => { switch(
state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermis...
XRReferenceSpaceEvent() - Web APIs
the xrreferencespaceevent() constructor is used to create a new xrreferencespaceevent object, which represents an event regarding the
state of a webxr reference space object, xrreferencespace.
XRRigidTransform.position - Web APIs
example to create a reference space which can be used to place an object at eye level (assuming eye level is 1.5 meters): function onsessionstarted(xrsession) { xrsession.addeventlistener("end", onsessionended); gl = initgraphics(xrsession); let gllayer = new xrwebgllayer(xrsession, gl); xrsession.updaterender
state({ baselayer: gllayer }); if (immersivesession) { xrsession.requestreferencespace("bounded-floor").then((refspace) => { refspacecreated(refspace); }).catch(() => { session.requestreferencespace("local-floor").then(refspacecreated); }); } else { session.requestreferencespace("viewer").then(refspacecreated); } } function refspacecreated(refspace) { if (immersive...
XRSessionEvent.session - Web APIs
xrsession.addeventlistener("visibilitychange", e => { switch(e.session.visibility
state) { case "hidden": myenablerendering(true); break; case "visible": case "visible-blurred": myenablerendering(false); break; } }); this calls a function that reacts to the session's visibility
state change.
XRSystem: requestSession() - Web APIs
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: invalid
stateerror the requested session mode is immersive-vr but there is already an immersive vr session either currently active or in the process of being set up.
XRView.eye - Web APIs
gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0,0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit, gl.depth_buffer_bit); for (let view of xrpose.views) { let skipview = false; if (view.eye == "left" && body.lefteye.injured) || skipview = updateinjury(body.lefteye); } else if (view.eye == "right" && body.righteye.injured) { skipview = ...
XRViewerPose.views - Web APIs
let pose = frame.getviewerpose(xrreferencespace); if (pose) { let gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0, 0, 0, 1); gl.cleardepth(1); gl.clear(gl.color_buffer_bit, gl.depth_buffer_bit); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the scene for the eye view.eye */ } } passing each v...
XRWebGLLayer() - Web APIs
exceptions invalid
stateerror the new xrwebgllayer could not be created due to one of a number of possible
state errors: the xrsession specified by session has already been stopped.
XRWebGLLayer.framebuffer - Web APIs
let gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); specifications specification status comment webxr device apithe definition of 'xrwebgllayer.framebuffer' in that specification.
XRWebGLLayer.framebufferHeight - Web APIs
let gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); framewidth = gllayer.framebufferheight; frameheight = gllayer.framebufferheight; specifications specification status comment webxr device apithe definition of 'xrwebgllayer.framebufferheight' in that specification.
XRWebGLLayer.framebufferWidth - Web APIs
let gllayer = xrsession.render
state.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); framewidth = gllayer.framebufferwidth; frameheight = gllayer.framebufferheight; specifications specification status comment webxr device apithe definition of 'xrwebgllayer.framebufferwidth' in that specification.
XRWebGLLayerInit.alpha - Web APIs
xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.alpha' in that specification.
XRWebGLLayerInit.depth - Web APIs
xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl, { depth: false }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.depth' in that specification.
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl, { framebufferscalefactor: 0.5 }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.framebufferscalefactor' in that specification.
XRWebGLLayerInit.stencil - Web APIs
xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl, { stencil: false }); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.stencil' in that specification.
XRWebGLLayerInit - Web APIs
const layeroptions = { ignoredepthvalues: true }; xrsession.updaterender
state({ baselayer: new xrwebgllayer(xrsession, gl, layeroptions); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit' in that specification.
msCaching - Web APIs
syntax cache
state = object.mscaching values type: domstring property value description auto disables caching for stream or ms-stream data.
ARIA: tabpanel role - Accessibility
the first rule of aria use is you can use a native feature with the semantics and behavior you require already built in, instead of re-purposing an element and adding an aria role,
state or property to make it accessible, then do so.
ARIA: application role - Accessibility
associated wai-aria roles,
states, and properties document, article used to indicate parts of the application that should be treated as normal web content aria-activedescendant used to manage focus inside the application.
ARIA: article role - Accessibility
associated wai-aria roles,
states, and properties aria-posinset in the context of a feed, indicates the position of this particular article within that feed, based on a count starting at 1.
ARIA: banner role - Accessibility
associated aria roles,
states, and properties none keyboard interactions none required javascript features none examples here's a fake simple banner with a skip to navigation link, a logo, a title and a subtitle.
ARIA: contentinfo role - Accessibility
the contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, navigation links, and privacy
statements.
ARIA: feed role - Accessibility
wai-aria roles,
states, and properties aria-labelled if the feed has no visible title, the feed element has a label specified with aria-label.
ARIA: figure role - Accessibility
associated wai-aria roles,
states, and properties aria-describedby the id of an element containing reference text serving as a caption.
ARIA: form role - Accessibility
even if you are using the form landmark instead of <form>, you are encouraged to use native html form controls like button, input, select, and textarea associated wai-aria roles,
states, and properties no role specific
states or properties.
ARIA: Navigation Role - Accessibility
associated wai-aria roles,
states, and properties aria-label a brief description of the purpose of the navigation, omitting the term "navigation", as the screen reader will read both the role and the contents of the label.
ARIA: img role - Accessibility
another example where this might be suitable is when using ascii emoji combinations, like the legendary "table flip": <div role="img" aria-label="table flip"> <p> (╯°□°)╯︵ ┻━┻ </p> </div> associated wai-aria roles,
states, and properties aria-label an accessible name is required.
ARIA: heading role - Accessibility
associated wai-aria roles,
states, and properties aria-level the aria-level attribute specifies the heading level in the document structure.
ARIA: textbox role - Accessibility
javascript features all features associated with any and all properties and
states must be maintained, and forms submission on enter or return on a single line textbox needs to be handled.
Basic form hints - Accessibility
the aria-invalid
state can be programmatically applied, to indicate to an at which data fields have incorrect data, so that the user knows they have entered invalid data.
overview - Accessibility
general resources dhtml style guide provides keyboard interaction recommendations wai-aria authoring practices guide checkbox aria toggle button and tri-
state checkbox examples (from "the paciello group blog") aria example checkbox widgets from the university of illinois menu using wai-aria roles and
states with the yui menu control slider from the paciello group blog: aria slider, part one, part two, part threet (example) creating an accessible, internationalized dojo rating widget tabs enhancing tabview accessibility with wai-aria roles and
states, from the yui blog enhancing the jquery ui tabs accordingly to wcag 2.0 and ar...
Keyboard - Accessibility
in such a case, focusing the nested document is the only way of returning assistive technology to a non-interactive
state (often called "browse mode").
Robust - Accessibility
robust
states that content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.
Text labels and names - Accessibility
examples the title for the reference article about the <title> element is as follows: <title><title>: the document title element - html: hypertext markup language</title> another example might look like so: <title>fill in your details to register — mygov services</title> to help the user, you can update the page title value to reflect significant page
state changes (such as form validation problems): <title>2 errors — fill in your details to register — mygov services</title> see also <title> embedded content must be labeled make sure that elements that embed content have a title attribute that describes the embedded content.
::marker - CSS: Cascading Style Sheets
::marker { color: blue; font-size: 1.2em; } allowable properties only certain css properties can be used in a rule with ::marker as a selector: all font properties the white-space property color text-combine-upright, unicode-bidi and direction properties the content property all animation and transition properties the specification
states that additional css properties may be supported in future.
:invalid - CSS: Cascading Style Sheets
people who have certain types of color blindness will be unable to determine the input's
state unless it is accompanied by an additional indicator that does not rely on color to convey meaning.
:valid - CSS: Cascading Style Sheets
people who have certain types of color blindness will be unable to determine the input's
state unless it is accompanied by an additional indicator that does not rely on color to convey meaning.
@charset - CSS: Cascading Style Sheets
it must be the first element in the style sheet and not be preceded by any character; as it is not a nested
statement, it cannot be used inside conditional group at-rules.
font-stretch - CSS: Cascading Style Sheets
l syntax <font-stretch-absolute>{1,2}where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting a percentage range for font-stretch the following find a local open sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded
states.
@import - CSS: Cascading Style Sheets
description imported rules must precede all other types of rules, except @charset rules; as it is not a nested
statement, @import cannot be used inside conditional group at-rules.
CSS Animations - CSS: Cascading Style Sheets
reference css properties animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-
state animation-timing-function css at-rules @keyframes guides detecting css animation support describes a technique for detecting if a browser supports css animations.
Border-radius generator - CSS: Cascading Style Sheets
init : init, setmax : setmax, setmin : setmin, setunit : setunit, getnode : getnode, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe } })(); /** * ui-buttonmanager */ var buttonmanager = (function checkboxmanager() { var subscribers = []; var buttons = []; var checkbox = function checkbox(node) { var topic = node.getattribute('data-topic'); var
state = node.getattribute('data-
state'); var name = node.getattribute('data-label'); var align = node.getattribute('data-text-on');
state = (
state === "true"); var checkbox = document.createelement("input"); var label = document.createelement("label"); var id = 'checkbox-' + topic; checkbox.id = id; checkbox.setattribute('type', 'checkbox'); checkbox.checked =
state; label.setat...
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
.wrapper { display: grid; grid-gap: 20px; grid-template-areas: "header" "nav" "content" "sidebar" "ad" "footer"; } after setting up a mobile layout we will get this single column at all screen sizes, we can now add a media query and redefine our layout for the circumstance of having enough screen real e
state to show two columns.
Mozilla CSS extensions - CSS: Cascading Style Sheets
accepted] -moz-animation-delay [prefixed version still accepted] -moz-animation-direction [prefixed version still accepted] -moz-animation-duration [prefixed version still accepted] -moz-animation-fill-mode [prefixed version still accepted] -moz-animation-iteration-count [prefixed version still accepted] -moz-animation-name [prefixed version still accepted] -moz-animation-play-
state [prefixed version still accepted] -moz-animation-timing-function [prefixed version still accepted] -moz-appearance b -moz-backface-visibility [prefixed version still accepted] -moz-background-clipobsolete since gecko 2 -moz-background-originobsolete since gecko 2 -moz-background-inline-policyobsolete since gecko 32 [superseded by the standard version box-decoration-break] -mo...
Cubic Bezier Generator - CSS: Cascading Style Sheets
'x2').value; var y2 = document.getelementbyid('y2').value; drawbeziercurve(x1, y1, x2, y2); } const radius = 4; // place needed to draw the rulers const rulers = 30.5; const margin = 10.5; const basic_scale_size = 5; // size of 0.1 tick on the rulers var scaling; //limitation: scaling is computed once: if canvas.height/canvas.width change it won't be recalculated var dragsm = 0; // drag
state machine: 0 = nodrag, others = object being dragged function initcanvas() { // get the canvas element using the dom var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); scaling = math.min(canvas.h...
Viewport concepts - CSS: Cascading Style Sheets
@media screen and (min-width: 500px) { p { color: red; } } if the above css is included in the iframe, the paragraphs will become red when the user has zoomed in, but this style does not apply in the non-zoomed-in
state.
<color> - CSS: Cascading Style Sheets
compatibility note: to prevent unexpected behavior, such as in a <gradient>, the current css spec
states that transparent should be calculated in the alpha-premultiplied color space.
text-overflow - CSS: Cascading Style Sheets
as some not-listed-at-risk features needed to be removed, the spec was demoted to the working draft level, explaining why browsers implemented this property unprefixed, though not at the cr
state.
vertical-align - CSS: Cascading Style Sheets
derline overline; margin-left: auto; margin-right: auto; width: 80%; } to vertically align the content of a cell in a table: <table> <tr> <td style="vertical-align: baseline">baseline</td> <td style="vertical-align: top">top</td> <td style="vertical-align: middle">middle</td> <td style="vertical-align: bottom">bottom</td> <td> <p>there is a theory which
states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.</p> <p>there is another theory which
states that this has already happened.</p> </td> </tr> </table> table { margin-left: auto; margin-right: auto; width: 80%; } table, th, td { border: 1px solid black; }...
CSS: Cascading Style Sheets
instead of versioning the css specification, w3c now periodically takes a snapshot of the latest stable
state of the css specification.
Live streaming web audio and video - Developer guides
see also http live streaming hls browser support http live streaming javascript player the basics of http live streaming dash adaptive streaming for html 5 video dynamic adaptive streaming over http (mpeg-dash) mpeg-dash media source demo dash reference client dynamic streaming over http the
state of mpeg-dash deployment look, no plugins: live streaming to the browser using media source extensions and mpeg-dash media source extensions (w3c) icecast shoutcast gstreamer streaming gstreamer pipelines via http streaming media using gstreamer on the web gstreamer and raspberry pi acceptance of media source extensions as w3c candidate recommendation will accelerate adoption of dash.js ...
Overview of events and handlers - Developer guides
en object, such as due to changes in device orientation, the document object, including the loading, modification, user interaction, and unloading of the page, the objects in the dom (document object model) tree including user interactions or modifications, the xmlhttprequest objects used for network requests, and the media objects such as audio and video, when the media stream players change
state.
Content categories - Developer guides
some elements belong to this category only under specific conditions: <audio>, if the controls attribute is present <img>, if the usemap attribute is present <input>, if the type attribute is not in the hidden
state <menu>, if the type attribute is in the toolbar
state <object>, if the usemap attribute is present <video>, if the controls attribute is present palpable content content is palpable when it's neither empty or hidden; it is content that is rendered and is substantive.
HTML5 - Developer guides
animating your style using css transitions to animate between different
states or using css animations to animate parts of the page without a triggering event, you can now control mobile elements on your page.
HTML attribute: maxlength - HTML: Hypertext Markup Language
constraint validation while the browser will generally prevent user from entering more text than the maxlength attribute allows, should the length be longer than the maxlength allows, the read-only toolong property of a validity
state object will be true.
<cite>: The Citation element - HTML: Hypertext Markup Language
f the following: a book a research paper an essay a poem a musical score a song a play or film script a film a television show a game a sculpture a painting a theatrical production a play an opera a musical an exhibition a legal case report a computer program a web site a web page a blog post or comment a forum post or comment a tweet a facebook post a written or oral
statement and so forth.
<keygen> - HTML: Hypertext Markup Language
here is an example form submission as it would be delivered to a cgi program by the http server: commonname=john+doe&email=doe@foo.com&org=foobar+computing+corp.& orgunit=bureau+of+bureaucracy&locality=anytown&
state=california&country=us& key=mihfmhewxdanbgkqhkig9w0baqefaanladbiakeanx0tiljromuue%2bptwbre6xfv%0awtkqbsshxk5zhcuwcwyvcniq9b82qhjdoacdd34rqfcaind46fxkqunb0mvkzqid%0aaqabfhfnb3ppbgxhsxnneuzyawvuzdanbgkqhkig9w0baqqfaanbaakv2eex2n%2fs%0ar%2f7ijnrowlszsmttiqteb%2badwhgj9u1xruroilq%2fo2cuqxifzcnzkyakwp4dubqw%0ai0%2f%2frgbvmco%3d specifications specification status comment ...
spellcheck - HTML: Hypertext Markup Language
this default value may also be inherited, which means that the element content will be checked for spelling errors only if its nearest ancestor has a spellcheck
state of true.
Cookie - HTTP
examples cookie: phpsessid=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1 specifications specification title rfc 6265, section 5.4: cookie http
state management mechanism ...
Cookie2 - HTTP
header type request header forbidden header name yes examples cookie2: $version="1" specifications specification title rfc 2965: cookie2 historic specification of http
state management mechanism, obsoleted by rfc 6265 ...
Feature-Policy - HTTP
this header is still in an experimental
state, and is subject to change at any time.
SameSite cookies - HTTP
;samesite=none;secure] rewriterule "^(.*)\.html$" "index.php?nav=$1 [nc,l,qsa,co=rewriterule;03;https://www.example.org;30/;samesite=none;secure] [...] rewriterule "^admin/(.*)\.html$" "admin/index.php?nav=$1 [nc,l,qsa,co=rewriterule;09;https://www.example.org:30/;samesite=strict;secure] specifications specification title rfc 6265, section 4.1: set-cookie http
state management mechanism draft-ietf-httpbis-rfc6265bis-05 cookie prefixes, same-site cookies, and strict secure cookies ...
Set-Cookie - HTTP
com set-cookie: __host-id=123; secure; path=/ // rejected due to missing secure attribute set-cookie: __secure-id=1 // rejected due to the missing path=/ attribute set-cookie: __host-id=1; secure // rejected due to setting a domain set-cookie: __host-id=1; secure; path=/; domain=example.com specifications specification title rfc 6265, section 4.1: set-cookie http
state management mechanism draft-ietf-httpbis-rfc6265bis-05 cookie prefixes, same-site cookies, and strict secure cookies ...
Set-Cookie2 - HTTP
specifications specification title rfc 2965: set-cookie2 historic specification of http
state management mechanism, obsoleted by rfc 6265 ...
PATCH - HTTP
the word "idempotent" means that any number of repeated, identical requests will leave the resource in the same
state.
PUT - HTTP
http/1.1 201 created content-location: /new.html if the target resource does have a current representation and that representation is successfully modified in accordance with the
state of the enclosed representation, then the origin server must send either a 200 (ok) or a 204 (no content) response to indicate successful completion of the request.
HTTP request methods - HTTP
post the post method is used to submit an entity to the specified resource, often causing a change in
state or side effects on the server.
Redirections in HTTP - HTTP
temporary responses to unsafe requests unsafe requests modify the
state of the server and the user shouldn't resend them unintentionally.
HTTP resources and specifications - HTTP
nge requests proposed standard rfc 7234 hypertext transfer protocol (http/1.1): caching proposed standard rfc 5861 http cache-control extensions for stale content informational rfc 8246 http immutable responses proposed standard rfc 7235 hypertext transfer protocol (http/1.1): authentication proposed standard rfc 6265 http
state management mechanism defines cookies proposed standard draft spec cookie prefixes ietf draft draft spec same-site cookies ietf draft draft spec deprecate modification of 'secure' cookies from non-secure origins ietf draft rfc 2145 use and interpretation of http version numbers informational rfc 6585 additional http sta...
205 Reset Content - HTTP
the http 205 reset content response status tells the client to reset the document view, so for example to clear the content of a form, reset a canvas
state, or to refresh the ui.
409 Conflict - HTTP
the http 409 conflict response status code indicates a request conflict with current
state of the server.
HTTP
http is a
stateless protocol, meaning that the server does not keep any data (
state) between two requests.
Indexed collections - JavaScript
creating an array the following
statements create equivalent arrays: let arr = new array(element0, element1, ..., elementn) let arr = array(element0, element1, ..., elementn) let arr = [element0, element1, ..., elementn] element0, element1, ..., elementn is a list of values for the array's elements.
Regular expressions - JavaScript
e you have this script: var myre = /d(b+)d/g; var myarray = myre.exec('cdbbdbsbz'); console.log('the value of lastindex is ' + myre.lastindex); // "the value of lastindex is 5" however, if you have this script: var myarray = /d(b+)d/g.exec('cdbbdbsbz'); console.log('the value of lastindex is ' + /d(b+)d/g.lastindex); // "the value of lastindex is 0" the occurrences of /d(b+)d/g in the two
statements are different regular expression objects and hence have different values for their lastindex property.
Memory Management - JavaScript
garbage collection as
stated above, the general problem of automatically finding whether some memory "is not needed anymore" is undecidable.
ReferenceError: invalid assignment left-hand side - JavaScript
examples typical invalid assignments if (math.pi = 3 || math.pi = 4) { console.log('no way!'); } // referenceerror: invalid assignment left-hand side var str = 'hello, ' += 'is it me ' += 'you\'re looking for?'; // referenceerror: invalid assignment left-hand side in the if
statement, you want to use a comparison operator ("=="), and for the string concatenation, the plus ("+") operator is needed.
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
examples function
statement in this case, the function sum has default parameters a=1 and b=2: function sum(a = 1, b = 2) { // syntaxerror: "use strict" not allowed in function with default parameter 'use strict'; return a + b; } if the function should be in strict mode, and the entire script or enclosing function is also okay to be in strict mode, you can move the "use strict" directive outside of the functio...
SyntaxError: Unexpected token - JavaScript
for (let i = 0; i < 5,; ++i) { console.log(i); } // syntaxerror: expected expression, got ')' correct would be omitting the comma or adding another expression: for (let i = 0; i < 5; ++i) { console.log(i); } not enough brackets sometimes, you leave out brackets around if
statements: function round(n, upperbound, lowerbound){ if(n > upperbound) || (n < lowerbound){ throw 'number ' + string(n) + ' is more than ' + string(upperbound) + ' or less than ' + string(lowerbound); }else if(n < ((upperbound + lowerbound)/2)){ return lowerbound; }else{ return upperbound; } } // syntaxerror: expected expression, got '||' the brackets may look correct at first,...
Default parameters - JavaScript
syntax function [name]([param1[ = defaultvalue1 ][, ..., paramn[ = defaultvaluen ]]]) {
statements } description in javascript, function parameters default to undefined.
BigInt - JavaScript
ating equality when the same object instance is compared: 0n === object(0n) // false object(0n) === object(0n) // false const o = object(0n) o === o // true conditionals a bigint behaves like a number in cases where: it is converted to a boolean: via the boolean function; when used with logical operators ||, &&, and !; or within a conditional test like an if
statement.
Date.UTC() - JavaScript
examples using date.utc() the following
statement creates a date object with the arguments treated as utc instead of local: let utcdate = new date(date.utc(2018, 11, 1, 0, 0, 0)); specifications specification ecmascript (ecma-262)the definition of 'date.utc' in that specification.
Date.parse() - JavaScript
the ecmascript specification
states: if the string does not conform to the standard format the function may fall back to any implementation–specific heuristics or implementation–specific parsing algorithm.
Generator.prototype.return() - JavaScript
function* gen() { yield 1; yield 2; yield 3; } const g = gen(); g.next(); // { value: 1, done: false } g.return('foo'); // { value: "foo", done: true } g.next(); // { value: undefined, done: true } if return(value) is called on a generator that is already in "completed"
state, the generator will remain in "completed"
state.
Intl.DisplayNames - JavaScript
// get display names of region in english let regionnames = new intl.displaynames(['en'], {type: 'region'}); regionnames.of('419'); // "latin america" regionnames.of('bz'); // "belize" regionnames.of('us'); // "united
states" regionnames.of('ba'); // "bosnia & herzegovina" regionnames.of('mm'); // "myanmar (burma)" // get display names of region in traditional chinese regionnames = new intl.displaynames(['zh-hant'], {type: 'region'}); regionnames.of('419'; // "拉丁美洲" regionnames.of('bz'); // "貝里斯" regionnames.of('us'); // "美國" regionnames.of('ba'); // "波士尼亞與赫塞哥維納" regionnames.
Intl.Locale.prototype.maximize() - JavaScript
for instance, given the language id "en", the algorithm would return "en-latn-us", since english can only be written in the latin script, and is most likely to be used in the united
states, as it is the largest english-speaking country in the world.
Intl.Locale.prototype.region - JavaScript
for example, english is spoken in the united kingdom and the united
states of america, but there are differences in spelling and other language conventions between those two countries.
JSON.stringify() - JavaScript
cause a cache miss when encountering the same object like above example of using json.stringify() with localstorage in a case where you want to store an object created by your user and allowing it to be restored even after the browser has been closed, the following example is a model for the applicability of json.stringify(): // creating an example of json var session = { 'screens': [], '
state': true }; session.screens.push({ 'name': 'screena', 'width': 450, 'height': 250 }); session.screens.push({ 'name': 'screenb', 'width': 650, 'height': 350 }); session.screens.push({ 'name': 'screenc', 'width': 750, 'height': 120 }); session.screens.push({ 'name': 'screend', 'width': 250, 'height': 60 }); session.screens.push({ 'name': 'screene', 'width': 390, 'height': 120 }); session.screens.push...
Math.imul() - JavaScript
we can remove an integer coersion from the
statement above because: // 0x1fffff7fc00001 + 0xffc00000 = 0x1fffffff800001 // 0x1fffffff800001 < number.max_safe_integer /*0x1fffffffffffff*/ if (opa & 0xffc00000 /*!== 0*/) result += (opa & 0xffc00000) * opb |0; return result |0; }; examples using math.imul() math.imul(2, 4); // 8 math.imul(-1, 8); // -8 math.imul(-2, -2); // 4 math.imul(0xffffffff, 5); // -...
Object.setPrototypeOf() - JavaScript
in addition, the effects of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in the object.setprototypeof(...)
statement, but may extend to any code that has access to any object whose [[prototype]] has been altered.
Object - JavaScript
when modifying prototypes with hooks, pass this and the arguments (the call
state) to the current behavior by calling apply() on the function.
Promise.resolve() - JavaScript
has a "then" method), the returned promise will "follow" that thenable, adopting its eventual
state; otherwise the returned promise will be fulfilled with the value.
Promise.prototype.then() - JavaScript
if the promise that then is called on adopts a
state (fulfillment or rejection) for which then has no handler, the returned promise simply adopts the final
state of the original promise on which then was called.
RegExp - JavaScript
�зыке' let regex = /[\u0400-\u04ff]+/g let match = regex.exec(text) console.log(match[0]) // logs 'Образец' console.log(regex.lastindex) // logs '7' let match2 = regex.exec(text) console.log(match2[0]) // logs 'на' [did not log 'text'] console.log(regex.lastindex) // logs '15' // and so on the unicode property escapes feature introduces a solution, by allowing for a
statement as simple as \p{scx=cyrl}.
WeakMap - JavaScript
if they were, the list would depend on the
state of garbage collection, introducing non-determinism.
WebAssembly.Module() constructor - JavaScript
a webassembly.module() constructor creates a new module object containing
stateless webassembly code that has already been compiled by the browser and can be efficiently shared with workers, and instantiated multiple times.
WebAssembly.Module - JavaScript
a webassembly.module object contains
stateless webassembly code that has already been compiled by the browser — this can be efficiently shared with workers, and instantiated multiple times.
escape() - JavaScript
warning: although escape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction
states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
parseInt() - JavaScript
ecmascript 5
states: the parseint function produces an integer value dictated by interpretation of the contents of the string argument according to the specified radix.
unescape() - JavaScript
warning: although unescape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction
states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
Iteration protocols - JavaScript
bj = {}; new weakmap([ [{}, 'a'], [myobj, 'b'], [{}, 'c'] ]).get(myobj); // "b" new set([1, 2, 3]).has(3); // true new set('123').has('2'); // true new weakset(function* () { yield {} yield myobj yield {} }()).has(myobj); // true see also promise.all(iterable) promise.race(iterable) array.from(iterable) syntaxes expecting iterables some
statements and expressions expect iterables, for example the for...of loops, the spread operator), yield*, and destructuring assignment: for (let value of ['a', 'b', 'c']) { console.log(value); } // "a" // "b" // "c" console.log([...'abc']); // ["a", "b", "c"] function* gen() { yield* ['a', 'b', 'c']; } console.log(gen().next()); // { value: "a", done: false } [a, b, c] = new set(['a', 'b'...
Optional chaining (?.) - JavaScript
with the optional chaining operator (?.), however, you don't have to explicitly test and short-circuit based on the
state of obj.first before trying to access obj.first.second: let nestedprop = obj.first?.second; by using the ?.
typeof - JavaScript
but with the addition of block-scoped let and
statements/const using typeof on let and const variables (or using typeof on a class) in a block before they are declared will throw a referenceerror.
yield* - JavaScript
()); // {value: 2, done: false} console.log(iterator.next()); // {value: "3", done: false} console.log(iterator.next()); // {value: "4", done: false} console.log(iterator.next()); // {value: 5, done: false} console.log(iterator.next()); // {value: 6, done: false} console.log(iterator.next()); // {value: undefined, done: true} the value of yield* expression itself yield* is an expression, not a
statement—so it evaluates to a value.
Transitioning to strict mode - JavaScript
differences from non-strict to strict syntax errors when adding 'use strict';, the following cases will throw a syntaxerror before the script is executing: octal syntax var n = 023; with
statement using delete on a variable name delete myvariable; using eval or arguments as variable or function argument name using one of the newly reserved keywords (in prevision for ecmascript 2015): implements, interface, let, package, private, protected, public, static, and yield declaring function in blocks if (a < b) { function f() {} } obvious errors declaring twice the same name for a ...
JavaScript reference - JavaScript
internationalization intl intl.collator intl.datetimeformat intl.displaynames intl.listformat intl.locale intl.numberformat intl.pluralrules intl.relativetimeformat webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compileerror webassembly.linkerror webassembly.runtimeerror
statements javascript
statements and declarations control flowblock break continue empty if...else switch throw try...catch declarations var let const functions and classes function function* async function return class iterations do...while for for each...in for...in for...of for await...of while other debugger import la...
Proving the Pythagorean theorem - MathML
we will now prove the pythagorean theorem:
statement: in a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.
Web audio codec guide - Web media technologies
re chrome edge firefox internet explorer opera safari mp3 support yes yes yes[1] 9 yes 3.1 container support mpeg-1, mpeg-2, mp4, adts, 3gp rtp / webrtc compatible no licensing patent-free in the eu as of 2012; patent-free in the united
states as of april 16, 2017; now free to use [1] for patent reasons, firefox did not directly support mp3 prior to version 71; instead, platform-native libraries were used to support mp3.
The "codecs" parameter in common media types - Web media technologies
02 image characteristics are unknown, or are to be determined by the application 03 reserved for future use by itu or iso/iec 04 bt.470 system m, ntsc (standard definition television in the united
states) 05 bt.470 system b, g; bt.601; bt.1358 625; bt.1700 625 pal and 625 secam 06 bt.601 525; bt.1358 525 or 625; bt.1700 ntsc; smpte 170m.
Lazy loading - Web Performance
entry point splitting: separates code by entry point(s) in the app dynamic splitting: separates code where dynamic import()
statements are used javascript script type module any script tag with type="module" is treated like a javascript module and is deferred by default.
Performance budgets - Web Performance
the sooner that you can identify a potential addition pushing the budget, the better you can analyze the current
state of your site, and pinpoint optimizations or unnecessary code.
Web Performance
in this guide we'll talk about the dynamic import()
statement, which is a feature in modern browsers that loads a javascript module on demand.
Privacy, permissions, and information security
while specifications for these technologies either
state or recommend tactics for handling situations like this, browsers may offer different solutions to improve security even further or to try new features, or try to reduce complexity for users, among other possible reasons.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
made <tspan> and <textpath> graphics elements implementation status unknown allow x, y, width, and height on <symbol> implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown role mapping of <a> element depending on whether it is a valid link implementation status unknown aria
state and property attributes animatable implementation status unknown styling change notes contentstyletype attribute removed implementation status unknown linkstyle on svgstyleelement implemented (bug 1239128 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43)) inner <svg>s and <foreignobjects>s not overflow: hidden; in ua style sheet impl...
Tutorials
javascript building blocks in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code block such as conditional
statements, loops, functions, and events.
Introduction to using XPath in JavaScript - XPath
note however, that if the document is mutated (the document tree is modified) between iterations that will invalidate the iteration and the invaliditerator
state property of xpathresult is set to true, and a ns_error_dom_invalid_
state_err exception is thrown.
XPath snippets - XPath
sample usage assume we have the following xml document (see also how to create a dom tree and parsing and serializing xml): example: an xml document to use with the custom evaluatexpath() utility function <?xml version="1.0"?> <people> <person first-name="eric" middle-initial="h" last-name="jung"> <address street="321 south st" city="denver"
state="co" country="usa"/> <address street="123 main st" city="arlington"
state="ma" country="usa"/> </person> <person first-name="jed" last-name="brown"> <address street="321 north st" city="atlanta"
state="ga" country="usa"/> <address street="123 west st" city="seattle"
state="wa" country="usa"/> <address street="321 south avenue" city="denver"
state="co" country="usa"/> </pers...
Using the WebAssembly JavaScript API - WebAssembly
you can create one using the webassembly.memory() constructor, which takes as arguments an initial size and (optionally) a maximum size and a shared property that
states whether it is a shared memory or not.