Search completed in 0.90 seconds.
Inputs and input sources - Web APIs
s, as well as selection if outfitted with buttons or other sources of selection actions. single-button click devices. gaze tracking (following the movements of the eye to choose targets). input sources each source of webxr input data is represented by an xrinputsource object which describes the input source and its current state. the information for each input source includes which hand it's
held in (if applicable), what targeting method it uses, xrspaces that can be used to draw the targeting ray and to find the targeted object or location as well as to draw objects in the user's hands, and profile strings specifying the preferred way to represent the controller in the user's viewing area as well as how the input operates. the fundamental capabilities of an input source are: targetin...
...operties that describe the input's available axes and buttons, which hand the user's holding it in, and how the input source is used to handle targeting within the 3d space. handedness handedness, indicated by the xrinputsource property handedness, is a string which indicates which of the viewer's hands the controller is in: left or right. it can also be set to none if the controller isn't hand-
held, or if it's unknown which hand the controller is in. handedness can be used for various things, including selecting an appropriate mesh to use to represent the controller in the view and to help present it in the correct hand if drawing hands on the display. it can also be useful if your app uses the notion of "main hand" and "off hand" for determining the functionality of a controller; in a gam...
...rly simple, and doesn't need any special controls, as it will be based on the facing direction reported by the headset or whatever device is used to determine what direction the viewer's face is pointing in. the target ray should extend outward from between the eyes in a direction perpendicular to the viewer's face. more flexible is the tracked-pointer mode, in which the ray's origin is at a hand
held controller or hand tracking system's origin and extends outward in the direction in which the controller is pointing. the ray extends outward in a direction defined by whatever platform and controller are being used, if that's defined; otherwise, the ray extends in the same direction the user is pointing in with their index finger, if it were currently outstretched. the third and final target ra...
...And 15 more matches
Index - Web APIs
tion report (the return value of its report.body property). 826 detecting device orientation api, device orientation, intermediate, mobile, motion, orientation, reference increasingly, web-enabled devices are capable of determining their orientation; that is, they can report data indicating changes to their orientation with relation to the pull of gravity. in particular, hand-
held devices such as mobile phones can use this information to automatically rotate the display to remain upright, presenting a wide-screen view of the web content when the device is rotated so that its width is greater than its height. 827 device memory api device memory api capabilities of the client devices largely depend on the amount of available ram. traditionally, developrs...
... property, reference, référence(2) the gamepad.connected property of the gamepad interface returns a boolean indicating whether the gamepad is still connected to the system. 1441 gamepad.hand api, experimental, gamepad, gamepad api, property, reference, hand the hand read-only property of the gamepad interface returns an enum defining what hand the controller is being
held in, or is most likely to be
held in. 1442 gamepad.hapticactuators api, experimental, gamepad, gamepad api, property, reference, hapticactuators the hapticactuators read-only property of the gamepad interface returns an array containing gamepadhapticactuator objects, each of which represents haptic feedback hardware available on the controller. 1443 gamepad.id a...
...eturning a boolean that indicates if the meta key was pressed (true) or not (false) when the event occurred. some operating systems may intercept the key so it is never detected. 2220 keyboardevent.repeat api, dom, keyboardevent, property, read-only, reference the repeat read-only property of the keyboardevent interface returns a boolean that is true if the given key is being
held down such that it is automatically repeating. 2221 keyboardevent.shiftkey api, dom, keyboardevent, property, read-only, reference the keyboardevent.shiftkey read-only property is a boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred. 2222 keyboardevent.which api, dom, deprecated, keyboardevent, property, read-only, ...
...And 5 more matches
Screen.lockOrientation() - Web APIs
reen. this is either a string or an array of strings. passing several strings lets the screen rotate only in the selected orientations. the following strings represent the possible orientation requirements you may specify: portrait-primary it represents the orientation of the screen when it is in its primary portrait mode. ...
...s. the following strings represent the possible orientation requirements you may specify: portrait-primary it represents the orientation of the screen when it is in its primary portrait mode. a screen is considered in its primary portrait mode if the device is
held in its normal position and that position is in portrait, or if the normal position of the device is in landscape and the device
held turned by 90° clockwise. the normal position is device dependant. ...
...f the device is
held in its normal position and that position is in portrait, or if the normal position of the device is in landscape and the device
held turned by 90° clockwise. the normal position is device dependant. portrait-secondary it represents the orientation of the screen when it is in its secondary portrait mode. a screen is considered in its secondary portrait mode if the device is
held 180° from its normal position and that position is in portrait, or if the normal position of the device is in landscape and the device
held is turned by 90° anticlockwise. the normal position is device dependant. landscape-primary it represents the orientation of the screen when it is in its primary landscape mode. ...
...And 3 more matches
LockManager.request() - Web APIs
the request() method of the lockmanager interface requests a lock object with parameters specifying its name and characteristics. the requested lock is passed to a callback, while the function itself returns a promise that resolves with undefined. the mode property of the options parameter may be either "exclusive" or "shared". ...
...hile the function itself returns a promise that resolves with undefined. the mode property of the options parameter may be either "exclusive" or "shared". request an "exclusive" lock when it should only be
held by one code instance at a time. this applies to code in both tabs and workers. use this to represent mutually exclusive access to a resource. when an "exclusive" lock for a given name is
held, no other lock with the same name can be
held. request a "shared" lock when multiple instances of the code can share access to a resource. when a "shared" lock for a given name is
held, other "shared" locks for the same name can be granted, but no "exclusive" locks with that name can be
held or granted. this shared/exclusive lock pattern is common in database transaction architecture, for examp...
...uest(var promise = name[, {options}], callback) parameters name an identifier for the lock you want to request. options optional an object describing characteristics of the lock you want to create. valid values are: mode optional: either "exclusive" or "shared". the default value is "exclusive". ifavailable optional: if true, the lock request will only be granted if it is not already
held. if it cannot be granted, the callback will be invoked with null instead of a lock instance. the default value is false. steal optional: if true, then any
held locks with the same name will be released, and the request will be granted, preempting any queued requests for it. the default value is false. signal optional: an abortsignal (the signal property of an abortcontroller); if specified an...
... same lock but in 'exclusive' mode which will delay invocation of the request() call in do_read() until the write operation has completed. this applies across event handlers, tabs, or workers. function do_write() { await navigator.locks.request('my_resource', {mode: 'exclusive'}, async lock => { // write code here. }); } ifavailable example to grab a lock only if it isn't already being
held, use the ifavailable option. in this function await means the method will not return until the callback is complete. since the lock is only granted if it was available, this call avoids needing to wait on the lock being released elsehwere. await navigator.locks.request('my_resource', {ifavailable: true}, async lock => { if (!lock) { // the lock was not granted - get out fast. return; ...
Web Locks API - Web APIs
web locks concepts and usage a lock is an abstract concept representing some potentially shared resource, identified by a name chosen by the web app. ...
...r election pattern.) the api is used as follows: the lock is requested. work is done while holding the lock in an asynchronous task. the lock is automatically released when the task completes. navigator.locks.request('my_resource', async lock => { // the lock has been acquired. await do_something(); await do_something_else(); // now the lock will be released. }); while a lock is
held, requests for the same lock from this execution context, or from other tabs/workers, will be queued. the first queued request will be granted only when the lock is released. 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...
...ill fail if the lock cannot be granted immediately without waiting. the callback is invoked with null. monitoring the navigator.locks.query() method can be used by scripts to introspect the state of the lock manager for the origin. this can be useful when debugging, for example, identifying why a lock could not be acquired. the results are a snapshot of the lock manager state, which identifies
held and requested locks and some additional data (e.g. mode) about each, at the time the snapshot was taken. advanced use for more complicated cases, such as holding the lock for an arbitrary amount of time, the callback can return a promise explicitly resolved by the script: // capture promise control functions: let resolve, reject; const p = new promise((res, rej) => { resolve = res; reject = re...
...cated cases, such as holding the lock for an arbitrary amount of time, the callback can return a promise explicitly resolved by the script: // capture promise control functions: let resolve, reject; const p = new promise((res, rej) => { resolve = res; reject = rej; }); // request the lock: navigator.locks.request('my_resource', lock => { // lock is acquired. return p; // now lock will be
held until either resolve() or reject() is called. }); deadlocks a deadlock occurs when a process can no longer make progress because each part is waiting on a request that cannot be satisfied. this can occur with this api in complex use-cases, for example, if multiple locks are requested out-of-order. if tab 1 holds lock a and tab 2 holds lock b, then tab 1 attempts to also acquire lock b and tab...
XRInputSource.handedness - Web APIs
the read-only xrinputsource property handedness indicates which of the user's hands the webxr input source is associated with, or if it's not associated with a hand at all. syntax let hand = xrinputsource.handedness; value a domstring indicating whether the input controller is
held in one of the user's hands, and if it is, which hand. the value, which comes from the xrhandedness enumerated type, is one of the following: none the input controller is not associated with one of the user's hands. ...
...ssociated with a hand at all. syntax let hand = xrinputsource.handedness; value a domstring indicating whether the input controller is
held in one of the user's hands, and if it is, which hand. the value, which comes from the xrhandedness enumerated type, is one of the following: none the input controller is not associated with one of the user's hands. left the input controller is being
held in, worn on, or is attached to the user's left hand. right the input controller is being
held in, worn on, or is attached to the user's right hand. ...
...type, is one of the following: none the input controller is not associated with one of the user's hands. left the input controller is being
held in, worn on, or is attached to the user's left hand. right the input controller is being
held in, worn on, or is attached to the user's right hand. usage notes if the input source is not a device associated with a user's hand (whether by being
held, attached, or worn), the value of handedness is none. this may indicate, for example, an input source which isn't hand-
held, such as controls built into a headset or an input device attached to the head or body. examples one important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controllin...
...renderhandobject(grippose, inputsource.handedness); } } } } this function, which would be called every animation frame (or possibly just periodically, depending on the degree of smoothness required and any performance constraints), scans the list of input sources looking for any which have a gripspace which isn't null. if a gripspace is present, that means the input source is a hand-
held device of some sort, so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace transformed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw t...
FinalizationRegistry.prototype.register() - JavaScript
this cannot be the target object. unregistertoken optional a token that may be used with the unregister method later to unregister the target object. if provided (and not undefined), this must be an object. ...
...this cannot be the target object. unregistertoken optional a token that may be used with the unregister method later to unregister the target object. if provided (and not undefined), this must be an object. ...
...ister the target object. if provided (and not undefined), this must be an object. if not provided, the target cannot be unregistered. return value undefined. notes see the avoid where possible and notes on cleanup callbacks sections of the finalizationregistry page for important caveats. ...
...f the finalizationregistry page for important caveats. examples using register the following registers the target object referenced by target, passing in the
held value "some value" and passing the target object itself as the unregistration token: registry.register(target, "some value", target); the following registers the target object referenced by target, passing in another object as the
held value, and not passing in any unregistration token (which means target can't be unregistered): registry.register(target, {"useful": "info about target"}); specifications specification weakrefsthe definition of 'finalizationregistry.prototype.register' in that specification. ...
FinalizationRegistry.prototype.unregister() - JavaScript
is no need to all unregister in your cleanup callback. only call unregister if you haven't received a cleanup callback and no longer need to receive one. examples using unregister this example shows registering a target object using that same object as the unregister token, then later unregistering it via unregister: class thingy { #cleanup = label => { // ^^^^^−−−−−
held value console.error( `the \`release\` method was never called for the object with the label "${label}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance. be sure to call `release` when you're done with it. * * @param label a label for the `thingy`. */ constructor(label) { ...
...ase\` method was never called for the object with the label "${label}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance. be sure to call `release` when you're done with it. * * @param label a label for the `thingy`. */ constructor(label) { // vvvvv−−−−−
held value this.#registry.register(this, label, this); // target −−−−−^^^^ ^^^^−−−−− unregister token } /** * releases resources
held by this `thingy` instance. */ release() { this.#registry.unregister(this); // ^^^^−−−−− unregister token } } this example shows registering...
... ^^^^−−−−− unregister token } /** * releases resources
held by this `thingy` instance. */ release() { this.#registry.unregister(this); // ^^^^−−−−− unregister token } } this example shows registering a target object using a different object as its unregister token: { // ^^^^−−−−−
held value console.error( `the \`release\` method was never called for the \`thingy\` for the file "${file.name}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance for the given file. be sure to call `release` when you're done with it. * * @param filename the name of the file. */ constr...
...ile.name}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance for the given file. be sure to call `release` when you're done with it. * * @param filename the name of the file. */ constructor(filename) { this.#file = file.open(filename); // vvvvv−−−−−
held value this.#registry.register(this, label, this.#file); // target −−−−−^^^^ ^^^^^^^^^^−−−−− unregister token } /** * releases resources
held by this `thingy` instance. */ release() { if (this.#file) { this.#registry.unregister(this.#file); // ^^^^^^^^^^−−−−−...
FinalizationRegistry - JavaScript
t that a cleanup callback get called at some point when an object registered with the registry has been reclaimed (garbage-collected). (cleanup callbacks are sometimes called finalizers.) note: cleanup callbacks should not be used for essential program logic. see notes on cleanup callbacks for details. you create the registry passing in the callback: const registry = new finalizationregistry(
heldvalue => { // .... }); then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a *
held value* for it: registry.register(theobject, "some value"); the registry does not keep a strong reference to the object, as that would defeat the purpose (if the registry
held it strongly, the object would never be reclaimed). if theobject ...
...up callback for by calling the `register` method, passing in the object and a *
held value* for it: registry.register(theobject, "some value"); the registry does not keep a strong reference to the object, as that would defeat the purpose (if the registry
held it strongly, the object would never be reclaimed). if theobject is reclaimed, your cleanup callback may be called at some point with the
held value you provided for it ("some value" in the above). the
held value can be any value you like: a primitive or an object, even undefined. if the
held value is an object, the registry keeps a strong reference to it (so it can pass it to your cleanup callback later). if you might want to unregister an object later, you pass a third value, which is the unregistration token you'll use later when ca...
...oncurrent techniques. various runtime heuristics can be used to balance memory usage, responsiveness. the javascript engine may hold references to things which look like they are unreachable (e.g., in closures, or inline caches). different javascript engines may do these things differently, or the same engine may change its algorithms across versions. complex factors may lead to objects being
held alive for unexpected amounts of time, such as use with certain apis. notes on cleanup callbacks some notes on cleanup callbacks: developers shouldn't rely on cleanup callbacks for essential program logic. cleanup callbacks may be useful for reducing memory usage across the course of a program, but are unlikely to be useful otherwise. a conforming javascript implementation, even one that d...
...ementations that normally call cleanup callbacks are unlikely to call them: when the javascript program shuts down entirely (for instance, closing a tab in a browser). when the finalizationregistry instance itself is no longer reachable by javascript code. examples creating a new registry you create the registry passing in the callback: const registry = new finalizationregistry(
heldvalue => { // .... }); registering objects for cleanup then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a *
held value* for it: registry.register(theobject, "some value"); specifications specification weakrefsthe definition of 'finalizationregistry' in that specification. ...
Desktop gamepad controls - Game development
f(!hold) { for(var j=0,p=gamepadapi.buttons.cache.length; j<p; j++) { if(gamepadapi.buttons.cache[j] == button) { newpress = false; } } } } } return newpress; }, it loops through pressed buttons and if the button we're looking for is pressed, then the corresponding boolean variable is set to true. if we want to check the button is not
held already (so it's a new press), then looping through the cached states from the previous frame does the job — if the button was already pressed, then we ignore the new press and set it to false. implementation we now know what the gamepadapi object looks like and what variables and functions it contain, so let's learn how all this is actually used in the game. to indicate that the gamepad cont...
...visible) { this.screengamepadhelp.visible = false; } } } } when pressing the start button the relevant function will be called to begin the game, and the same approach is used for turning the audio on and off. there's an option wired up to show screengamepadhelp, which holds an image with all the button controls explained — if the y button is pressed and
held, the help becomes visible; when it is released the help diappears. on-screen instructions when the game is started, some introductory text is shown that shows you available controls — we are already detecting if the game is launched on desktop or mobile then showing a relevant message for the device, but we can go even further, to allow for the presence of a gamepad: create() { // ... ...
... screen by using the dpad buttons, or the left stick axes. have you noticed that the current value of the axes is evaluated against 0.5? it's because axes are having floating point values while buttons are booleans. after a certain threshold is reached we can assume the input is done deliberately by the user and can act accordingly. ...
nsIXPConnect
constants constant value description init_js_standard_classes 1 << 0 flag_system_global_object 1 << 1 omit_components_object 1 << 2 xpc_xow_clearscope 1 tells updatexows() to clear the scope of all of the xows it finds. obsolete since gecko 2.0 methods native code only!addjsholder root js objects
held by aholder. void addjsholder( in voidptr aholder, in nsscriptobjecttracerptr atracer ); parameters aholder the object that hold the js objects that should be rooted. atracer missing description exceptions thrown missing exception missing description clearallwrappednativesecuritypolicies() void clearallwrappednativesecuritypolicies(); parameters none. exceptions thrown ...
...back. return value missing description exceptions thrown missing exception missing description releasejscontext() void releasejscontext( in jscontextptr ajscontext, in prbool nogc ); parameters ajscontext missing description nogc missing description exceptions thrown missing exception missing description native code only!removejsholder stop rooting the js objects
held by aholder. void removejsholder( in voidptr aholder ); parameters aholder the object that hold the rooted js objects. exceptions thrown missing exception missing description reparentscopeawarewrappers() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it...
...eters aouter missing description ajscontext missing description ajsobj missing description aiid missing description result missing description exceptions thrown missing exception missing description wrapnative() wrapnative() will create a new jsobject or return an existing one. the jsobject is returned inside a refcounted nsixpconnectjsobjectholder. as long as this holder is
held the jsobject will be protected from collection by javascript's garbage collector. it is a good idea to transfer the jsobject to some equally protected place before releasing the holder (i.e., use js_setproperty to make this object a property of some other jsobject). this method now correctly deals with cases where the passed in xpcom object already has an associated jsobject for the cases: 1) th...
Fundamentals of WebXR - Web APIs
nted reality features. this includes both managing the process of rendering the views needed to simulate the 3d experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to let you update the imagery shown to the user based on that movement. webxr additionally provides support for accepting inputs from control devices such as hand
held vr controllers or specialized mixed reality gamepads. webxr is not a rendering technology, and provides no features for actually managing 3d data or rendering it to the display. this is an important fact to keep in mind; while webxr manages the timing, scheduling, and the various points of view relevant when drawing the scene, it does not actually know how to load and manage models, render and t...
...o create augmented reality experiences, see augmented reality with webxr. types of webxr hardware the simplest xr presentation involves rendering the scene directly to the user's screen, either in the context of a web document, or in full screen mode. this is most common when the user either doesn't have a dedicated xr device, or when the user is viewing the ar or vr app on a phone or other hand
held device. simpler and lower-priced xr devices typically use an integrated computer or connect to a smartphone, essentially using the mobile cpu and gpu to run apps, render images, and display them to the user. higher-powered solutions typically offload application execution and graphics processing to an external device such as a desktop computer, and are either tethered to the computer using a cab...
... on the walls (as well as possibly the ceiling and/or floor), thus completely surrounding the user with the simulation and allowing them to be immersed in the scene. the user wears 3d glasses that both add the 3d effect to the projected image, but provide a means for the system to render foreground objects into the world. the user's activity may be monitored using motion sensors that are worn or
held by the user, or, increasingly commonly, using infrared cameras that detect the user's movements. speakers placed around the chamber provide immersive sound as well. these are not common among everyday users; they're mostly either experimental, used for demonstration purposes, or used by larger organizations. one drawback is that the cave can't simulate anything closer than the wall. importan...
XRSession.onsqueezeend - Web APIs
lerfunction; value a function to be invoked whenever the xrsession receives a squeezestart event, indicating the ending of a primary squeeze action. examples this snippet of code adds a simple handler for the squeezeend event, which responds only to events on the user's dominant hand. in response to the end of the squeeze operation, this code looks to see if there is an object currently being
held by the user by checking to see if the variable user.
heldobject contains a reference to an object representing the
held item. if
heldobject has an object reference, that object is passed to a function called cancelobjectdrag(), which would be written to return the object to its original position. this takes care of the situation in which the drag is aborted or canceled. xrsession.onsqueezeend = ...
...bject is passed to a function called cancelobjectdrag(), which would be written to return the object to its original position. this takes care of the situation in which the drag is aborted or canceled. ...
...objectdrag(), which would be written to return the object to its original position. this takes care of the situation in which the drag is aborted or canceled. xrsession.onsqueezeend = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace; if (user.
heldobject) { cancelobjectdrag(user.
heldobject); } } }; this code presumes that if the user actually intentionally completed the drag, user.
heldobject will be null here. that's because (in this example, at least) the handler for the squeeze event has already dropped the object into its new location and then cleared the value of
heldobject to indicate that the user is no longer holding anything. specifications specific...
Enhanced Extension Installation - Archive of obsolete content
the directories for all the extensions and themes at the location (used by the component manager, preferences system, chrome registry etc to locate files during the startup process). in the profile directory, the file compatibility.ini stores information about the version of the application (build info) that last started this profile - during startup this file is checked and if the version info
held by the running app disagrees with the info
held by this file, a compatibility check is run on all installed items. when changes are made to the extensions datasource - new items are installed, old items uninstalled, enabled or disabled, a .autoreg file is written to the profile directory as well, which tells the startup code that the system has been modified, so that it destroys the component re...
...start. a copy of the xpi file the item was installed from is set aside since the xpinstall system cleans up the temporary file it hands to the extension system. if the item is not compatible, the extension system asks the appropriate update service (either the one specified by the item, or the default one) if there is remote compatibility information that supercedes the compatibility information
held by the item. if there is, and this remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). finalization for themes, the item is immediately installed fully, rather than awaiting the next restart, since themes do not supply xpcom components, preferences...
Mozilla Crypto FAQ - Archive of obsolete content
the mozilla code base will include a complete open source cryptographic library, and mozilla will include ssl support as a standard feature. after the u.s. government relaxed u.s. export regulations in january 2000 to allow export of source code for open source software implementing encryption, the major remaining legal obstacle to mozilla crypto development was the fact that rsa security, inc.,
held a u.s. patent on the rsa public key algorithm. in february 2000 iplanet e-commerce solutions (a sun-netscape alliance) released source code through mozilla.org for the personal security manager and network security services software; this source code included support for the ssl protocol, but due to the rsa patent and related legal issues it did not originally contain code for rsa or other crypto...
...lations. on august 25, 1997, the u.s. district court for the northern district of california issued a final ruling (written by judge marilyn hall patel) that "the [u.s. government] encryption regulations are an unconstitutional prior restraint in violation of the first amendment." the u.s. government appealed this decision to the u.s. 9th circuit court of appeals, and on may 6, 1999, the court up
held the district court's ruling in a 2-1 decision, with judge betty fletcher writing for the majority that the itar and ear export restrictions against encryption are an unconstitutional prior restraint of free expression, impermissible under the first amendment to the u.s. constitution. however this ruling did not settle the issue of the constitutionality of u.s. export control regulations. the u.s...
Implementing controls using the Gamepad API - Game development
press of a button or not. next, we loop through the array of pressed buttons — if the given button is the same as the one we're looking for, the newpress variable is set to true. to check if the press is a new one, so the player is not holding the key, we loop through the cached states of the buttons from the previous frame of the game loop. ...
...in this case, pressing or holding a will fire the bullet and pressing b will pause the game. axis threshold the buttons have only two states: 0 or 1, but the analog sticks can have many different values — they have a float range between -1 and 1 along both the x and y axes. ...
HTML parser threading
ningutf16buffer objects are then passed to the tokenizer in sequence by the parseavailabledata() method. the tokenizer calls into the tree builder which outputs nshtml5treeoperation objects (tree ops) into a queue. each tree op represents a small operation, such as element creation or appending a node into another, that can later be performed on the main thread. note that mtokenizermutex is being
held by the parser thread for the entire time that the tokenizer runs. parseavailabledata() checks for parser termination or interruption from time to time. the termination and interruption indicators are guarded by a more narrowly scoped mterminatedmutex, so parseavailabledata() has the opportunity to receive an order to terminate or interrupt even while the parser thread is holding mterminatedmutex.
...e staging queue is protected by a mutex. this way, the queues into which tree ops are produced and the queues from which they are consumed don't need to involve a mutex on each modification. it's more efficient to obtain a mutex only every once in a while when a whole bunch of tree ops is moved to or from the staging queue. after some tree ops have been moved to the staging queue, the nsirunnable
held in mexecutorflusher is dispatched to the main thread. (the same runnable is used repeatedly in order to avoid cross-thread refcounting issues.) memory management when crossing the thread boundary the tree ops hold various heap-allocated objects that end up crossing the thread boundary. these objects are memory managed as follows: attribute holders (nshtml5htmlattributes objects) are allocated usi...
Investigating leaks using DMD heap scan mode
roots.py, that we used at an earlier step. that gave a result that contained this: 0x7f0882fe3230 [fragmentorelement (xhtml) script [...] --[mnodeinfo]--> 0x7f0897431f00 [nodeinfo (xhtml) script] [...] --[mloadingasyncrequests]--> 0x7f0892f29630 [scriptloadrequest] this confirms that this block is actually a scriptloadrequest. secondly, notice that the load request is being
held alive by the very same script element that is causing the window leak! this strongly suggests that there is a cycle of strong references between the script element and the load request. i then added the missing field to the traverse and unlink methods of scriptloadrequest, and confirmed that i couldn’t reproduce the leak. keep in mind that you may need to run block_analyzer.py multiple times. ...
... causing the window leak! this strongly suggests that there is a cycle of strong references between the script element and the load request. i then added the missing field to the traverse and unlink methods of scriptloadrequest, and confirmed that i couldn’t reproduce the leak. keep in mind that you may need to run block_analyzer.py multiple times. for instance, if the script element was being
held alive by some container being
held alive by a runnable, we’d first need to figure out that the container was holding the element. if it isn’t possible to figure out what is holding that alive, you’d have to run block_analyzer again. this isn’t too bad, because unlike ref count logging, we have the full state of memory in our existing log, so we don’t need to run the browser again. ...
PR_WaitCondVar
function returns one of the following values: if successful, pr_success. if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable or the thread was interrupted with pr_interrupt), pr_failure. the details can be determined with pr_geterror. description before the call to pr_waitcondvar, the lock associated with the condition variable must be
held by the calling thread. 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. when scheduled, the thread att...
... 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. when scheduled, the thread attempts to reacquire the lock that it
held when pr_waitcondvar was called. any value other than pr_interval_no_timeout or pr_interval_no_wait for the timeout parameter will cause the thread to be rescheduled due to either explicit notification or the expiration of the specified interval. the latter must be determined by treating time as one part of the monitored data being protected by the lock and tested explicitly for an expired interv...
Tracing JIT
lir, which is used as input to nanojit. lir is a conventional three-address, linear ssa code. a single instruction of lir is called a lins, short for "lir instruction". lins values are depicted in blue in the schematic diagram. in contrast, a single native instruction is called a nins, and is depicted in red in the schematic diagram. the recorder in jstracer inserts lins values into a lir buffer
held in a page, itself contained within a logical fragment, and the nanojit compilation pipeline and assembler transform the lins values into nins values. nanojit/fragmento.* the nanojit/fragment.cpp and nanojit/fragmento.cpp files define the fragment and fragmento classes. a fragmento is a resource-management object that allocates and stores a set of fragments and pages, and manages their lifecycle...
...bytes of machine-code into memory. spidermonkey-specific high level component: jstracer.* the files jstracer.cpp and jstracer.h contain a the mechanisms of monitoring and recording the activity of the interpreter. each spidermonkey jscontext holds a trace monitor of type jstracemonitor. the trace monitor maintains some book-keeping information, as well as the collection of recorded fragments,
held in a hashtable keyed by the interpreter's program counter and global object shape at the time of recording. 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. this means that ...
Index
2d interface. see that page for details. 470 nsidomchromewindow dom, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference on some operating systems, we must allow the window manager to handle window dragging. this method tells the window manager to start dragging the window. this method will fail unless called while the left mouse button is
held down, callers must check this. 471 nsidomclientrect interfaces, interfaces:scriptable, xpcom, xpcom interface reference this object was renamed a few times: initial name was textrectangle, then clientrect, then domrect. 472 nsidomdesktopnotification interfaces, interfaces:scriptable, xpcom, xpcom interface reference the nsidomdesktopnotification interface...
...g class declaration 1180 nsadoptingstring class declaration 1181 nsautoref nsautoref<t> is a template class implementing an object that holds a handle to a resource that must be released, typically on destruction of the object.</t> 1182 nsautoreftraits nsautoreftraits<t> is a template class describing traits of resources
held by objects of class nsautoref<t> and/or nscountedref<t>.</t> 1183 nsautostring class declaration 1184 nsautostring (external) needscontent, reference, référence(2), strings class declaration 1185 nscautostring class declaration 1186 nscautostring (external) needscontent, reference, référence(2), strings clas...
KeyboardEvent.key - Web APIs
ual key codes" for windows, even though they aren't actually key codes. if the key cannot be identified, the returned value is unidentified. keyboardevent sequence every keyboardevent is fired in a pre-determined sequence. for a given key press, the sequence of keyboardevents fired is as follows assuming that event.preventdefault is not called: a keydown event is first fired. if the key is
held down further and the key produces a character key, then the event continues to be emitted in a platform implementation dependent interval and the keyboardevent.repeat read only property is set to true. if the key produces a character key that would result in a character being inserted into possibly an <input>, <textarea> or an element with htmlelement.contenteditable set to true, the beforeinput...
...y property is set to true. if the key produces a character key that would result in a character being inserted into possibly an <input>, <textarea> or an element with htmlelement.contenteditable set to true, the beforeinput and input event types are fired in that order. note that some other implementations may fire keypress event if supported. the events will be fired repeatedly while the key is
held down. a keyup event is fired once the key is released. this completes the process. in sequence 1 & 3, the keyboardevent.key attribute is defined and is set appropriately to a value according to the rules defined ealier. keyboardevent sequence example consider the event sequence generated when we interact with the shift and the 2 key using a u.s keyboard layout as compared to when we do so us...
KeyboardEvent - Web APIs
input device. a list of the constants identifying the locations is shown above in keyboard locations. keyboardevent.metakey read only returns a boolean that is true if the meta key (on mac keyboards, the ⌘ command key; on windows keyboards, the windows key (⊞)) was active when the key event was generated. keyboardevent.repeat read only returns a boolean that is true if the key is being
held down such that it is automatically repeating. keyboardevent.shiftkey read only returns a boolean that is true if the shift key was active when the key event was generated. methods this interface also inherits methods of its parents, uievent and event. keyboardevent.getmodifierstate() returns a boolean indicating if a modifier key such as alt, shift, ctrl, or meta, was pressed when the e...
...hasn't supported num lock even on external keyboards. on older macbooks with a num lock key, that key doesn't generate any key events. gecko does support the scroll lock key if an external keyboard which has an f14 key is connected. in certain older versions of firefox, this key generated a keypress event; this inconsistent behavior was bug 602812. auto-repeat handling when a key is pressed and
held down, it begins to auto-repeat. this results in a sequence of events similar to the following being dispatched: keydown keypress keydown keypress <<repeating until the user releases the key>> keyup this is what the dom level 3 specification says should happen. there are some caveats, however, as described below. auto-repeat on some gtk environments such as ubuntu 9.4 in some gtk-based...
LockManager.query() - Web APIs
the query() method of the lockmanager interface returns a promise which resolves with an object containing information about
held and pending locks. syntax var promise<lockmanagersnapshot> = lockmanager.query() parameters none. return value a promise that resolves with a lockmanagersnapshot containing the following properties.
held: an array of lock objects for
held locks. pending: an array of lock objects for pending lock requests. ...
... and pending locks. syntax var promise<lockmanagersnapshot> = lockmanager.query() parameters none. return value a promise that resolves with a lockmanagersnapshot containing the following properties.
held: an array of lock objects for
held locks. pending: an array of lock objects for pending lock requests. 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. draft initial definition. ...
XRHandedness - Web APIs
the webxr enumerated type xrhandedness provides values which identify which of a user's hands is being used to operate a particular input controller attached to the xr input device being used. xrhandedness is used as the value of the the xrinputsource property handedness. values none the input controller is not associated with one of the user's hands. left the input controller is being
held in, worn on, or is attached to the user's left hand. right the input controller is being
held in, worn on, or is attached to the user's right hand. examples one important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the device that hand is controlling) in virtual space. function updateinputsources(session, frame,...
...renderhandobject(grippose, inputsource.handedness); } } } } this function, which would be called every animation frame (or possibly just periodically, depending on the degree of smoothness required and any performance constraints), scans the list of input sources looking for any which have a gripspace which isn't null. if a gripspace is present, that means the input source is a hand-
held device of some sort, so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace transformed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw t...
XRInputSource.gripSpace - Web APIs
the read-only xrinputsource property gripspace returns an xrspace whose native origin tracks the pose used to render virtual objects so they appear to be
held in (or part of) the user's hand. for example, if a user were holding a virtual straight rod, the native origin of this xrspace would be located at the approximate center of mass of the user's fist. syntax var xrspace = xrinputsource.gripspace; value an xrspace object representing the position and orientation of the input device in virtual space, suitable for rendering an image of the device into the scene. ...
...nputsource.gripspace; value an xrspace object representing the position and orientation of the input device in virtual space, suitable for rendering an image of the device into the scene. gripspace is null if the input source is inherently untrackable. for example, only inputs whose targetraymode is tracked-pointer provide a gripspace. imagine that the controller is shaped like a straight rod,
held in the user's fist. the native origin of the grip space is located at the centroid—the center of mass—of the user's fist, tracking the position of the user's hand. the coordinate system for the left hand's grip space. the coordinate system for the right hand's grip space. as shown in the diagram above, the coordinate system is oriented as follows: the x-axis is perpendicul...
XRInputSource - Web APIs
e device. if the device isn't a gamepad-like device, this property's value is null. note: while xrinputsource uses the gamepad interface from the gamepad api, this input device is strictly associated with the webxr hardware and is not a general-purpose gaming device. gripspaceread only an xrspace whose origin tracks the pose which is used to render objects which should appear as if they're
held in the hand indicated by handedness. the orientation of this space indicates the angle at which the hand is gripping the object. read on in the main article on gripspace for more details on how to use this space. handednessread only a domstring that indicates which hand the device represented by this xrinputsource is being used in, if any. the value will be left, right, or none. profilesread ...
...ecific fashion or if the input device is disconnected before the action is completed. local coordinate system each input source has its own local coordinate system, which is described by the gripspace property, which is an xrspace used to map the input's coordinate system into the world coordinate system. the grip space's coordinate system can then be used to render objects so they appear to be
held in the user's hand. for more details on the input source's coordinate system, see the article that covers the gripspace property in detail. specifications specification status comment webxr device apithe definition of 'xrinputsource' in that specification. working draft initial definition. ...
XRSession.onsqueeze - Web APIs
oing squeeze action this example exapnds somewhat on the previous example by demonstrating a way to implement the ability for the user to drop an object that was previously picked up by the user.. this is just a snippet of code, but should establish the general idea. after checking that the event occurred on the user's dominant hand, the pose's target ray is obtained. then we pass the currently
held object and the target ray's transform matrix into a function we call dropobjectusingray() to drop the object, using the target ray to determine the surface upon which the object should be placed. this also clears the value of
heldobject so we know that there's no longer an object in hand. xrsession.onsqueeze = event => { if (event.inputsource.handedness == user.handedness) { let targetrayp...
...y() to drop the object, using the target ray to determine the surface upon which the object should be placed. this also clears the value of
heldobject so we know that there's no longer an object in hand. xrsession.onsqueeze = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (user.
heldobject && targetraypose) { dropobjectusingray(user.
heldobject, targetraypose.transform.matrix): } } }; see the examples in the onsqueezestart and onsqueezeend event handlers for the reset of the event handling related to this approach. specifications specification status comment webxr device apithe definition of 'xrsession.onsqueeze' in that specificatio...
XRSession.onsqueezestart - Web APIs
andlerfunction; value a function to be invoked whenever the xrsession receives a squeezestart event. examples this snippet of code adds a simple handler for the squeezestart event, which responds only to events on the user's dominant hand by getting the target ray, then calling a function findobjectusingray() to identify the object that the user is pointing at. ...
...singray() to identify the object that the user is pointing at. this object is then stored in a
heldobject variable in the user object we're using to represent user information. xrsession.onsqueezestart = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace; if (targetraypose) { user.
heldobject = findobjectusingray(targetraypose.transform); } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onsqueezestart' in that specification. working draft initial definition. ...
A typical HTTP session - HTTP
with an empty line. the final block is a data block, which contains the optional data. ...
...(contains a site-customized page helping the user to find the missing resource) response status codes http response status codes indicate if a specific http request has been succes...
Keyed collections - JavaScript
re primitive values as keys because object treats each key as a string whether it's a number value, boolean value or any other primitive value. use objects when there is logic that operates on individual elements. weakmap object the weakmap object is a collection of key/value pairs in which the keys are objects only and the values can be arbitrary values. the object references in the keys are
held weakly, meaning that they are a target of garbage collection (gc) if there is no other reference to the object anymore. the weakmap api is the same as the map api. one difference to map objects is that weakmap keys are not enumerable (i.e., there is no method giving you a list of the keys). if they were, the list would depend on the state of garbage collection, introducing non-determinism. for ...
... weakset object weakset objects are collections of objects. an object in the weakset may only occur once. it is unique in the weakset's collection, and objects are not enumerable. the main differences to the set object are: in contrast to sets, weaksets are collections of objects only, and not of arbitrary values of any type. the weakset is weak: references to objects in the collection are
held weakly. if there is no other reference to an object stored in the weakset, they can be garbage collected. that also means that there is no list of current objects stored in the collection. weaksets are not enumerable. the use cases of weakset objects are limited. they will not leak memory, so it can be safe to use dom elements as a key and mark them for tracking purposes, for example. key and ...
WeakSet - JavaScript
if no other references to an object stored in the weakset exist, those objects can be garbage collected. note: this also means that there is no list of current objects stored in the collection. weaksets are not enumerable. ...
...on. description weakset objects are collections of objects. just as with sets, each object in a weakset may occur only once; all objects in a weakset's collection are unique. the main differences to the set object are: weaksets are collections of objects only. they cannot contain arbitrary values of any type, as sets can. the weakset is weak, meaning references to objects in a weakset are
held weakly. if no other references to an object stored in the weakset exist, those objects can be garbage collected. note: this also means that there is no list of current objects stored in the collection. weaksets are not enumerable. use case: detecting circular references functions that call themselves recursively need a way of guarding against circular data structu...
Default Preferences - Archive of obsolete content
one with user supplied prefs, another with default prefs. user supplied prefs are set using the gui and also by modifying a profile's prefs.js file (which uses the user_pref() function). default preferences are set similarly but inside an extension and use the pref() function. ...
Listening to events in Firefox extensions - Archive of obsolete content
first it creates a browser-status-filter and adds it as a web progress listener for the browser. next it creates an internal object to receive all web progress events from the browser. this is created by the method mtabprogresslistener(). this receives events from the browser-status-filter. the filter acts to reduce the number of status and progress events to improve performance. the filters are
held in the array mfilters, the internal listeners in the array mtablisteners. the internal listeners are used to send out progress events to listeners registered with addprogresslistener() (which receives events from the browser that is currently visible) and addtabsprogresslistener() (which receives events from all browsers). ...
Tabbed browser - Archive of obsolete content
t in background if default is to select new tabs, and vice versa "window" new window "save" save to disk (with no filename hint!) openuilink( url, e, ignorebutton, ignorealt, allowkeywordfixup, postdata, referrerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being
held. the code given is for a menuitem, but will work equally well for other xul elements. this will only work in an overlay of browser.xul. xul: <menuitem oncommand="myextension.foo(event)" onclick="checkformiddleclick(this, event)" label="click me"/> js: var myextension = { foo: function(event) { openuilink("http://www.example.com", event, false, true); } } opening a url in an on deman...
CSS3 - Archive of obsolete content
e box or grid layouts. experimental parts are vendor-prefixed and should either be avoided in production environments, or used with extreme caution as both their syntax and semantics can change in the future. modules and the standardization process css level 2 needed 9 years, from august 2002 to june 2011 to reach the recommendation status. this was due to the fact that a few secondary features
held back the whole specification. in order to accelerate the standardization of non-problematic features, the css working group of the w3c, in a decision referred as the beijing doctrine, divided css in smaller components called modules . each of these modules is now an independent part of the language and moves towards standardization at its own pace. while some modules are already w3c recommendatio...
Index - Archive of obsolete content
the number of 8-bit units in the utf-8 string. 3699 nputf8 npapi, plugins nputf8 is a byte representing an 8-bit unit of a utf-8 character. this is not the same thing as an entire utf-8 character, which may be comprised of multiple nputf8 bytes. 3700 npvariant npapi, plugins npvariant is a struct that holds a value and the type of that value. the value is
held in a union, and the type is one of types defined in the npvarianttype enumeration. 3701 npvarianttype npapi, plugins npvarianttype is an enumeration that is used to identify the data type of an npvariant structure. 3702 npwindow npapi, plugins contains information about the target into which the plug-in instance can draw. 3703 np_getmimedescrip...
Layout System Overview - Archive of obsolete content
root of the style system, the style set. in many cases the presentation shell provides pass-through methods to the style set, and generally uses the style set to do style resolution and style sheet management. one of the critical aspects of the presentation shell is the handling of frame formatting, or reflow. the presentation shell owns and maintains a reflow queue where requests for reflow are
held until it is time to perform a reflow, and then pulled out and executed. it is also important to see the presentation shell as an observer of many kinds of events in the system. for example, the presentation shell receives notifications of document load events, which are used to trigger updates to the formatting of the frames in some cases. the presentation shell also receives notifications about ...
How to Write and Land Nanojit Patches - Archive of obsolete content
xisting mercurial "backout" command in your target repository. if you do so, the next time you copy revisions from nanojit-central to your target repository, the script will re-copy the backed-out revisions, as well as those that occurred after. you can explicitly manipulate the revision from which the copying process begins by writing a nanojit-central revision id to the file nanojit-import-rev,
held in your target repository. if you are at all confused about this, ask in #nanojit irc. scenario 4: if you break something if you land a patch that breaks nanojit-central, and then land a follow-up fix, it's a good idea to ensure the follow-up fix gets merged to tm and tr as soon as possible. otherwise, it might be possible that the broken patch gets pulled into tm/tr but the fix doesn't for qu...
reloadWithFlags - Archive of obsolete content
listed below may be used, which are all constants of the webnavigation property (or the nsiwebnavigation interface). you may combine flags using a or symbol ( | ). load_flags_none: no special flags. the document is loaded normally. load_flags_bypass_cache: reload the page, ignoring if it is already in the cache. this is the flag used when the reload button is pressed while the shift key is
held down. load_flags_bypass_proxy: reload the page, ignoring the proxy server. load_flags_charset_change: this flag is used if the document needs to be reloaded because the character set changed. ...
Simple Query Syntax - Archive of obsolete content
/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 are used here for the variable names, but they are really just randomly generated so you can't refer to them in any way. the member data, or results, are
held in the variable represented here by '?2'. three matches have been found so the content will be duplicated three times. there are several attributes in the example xul content above that have values prefixed with 'rdf:'. since you can't declare variables in the simple syntax, a different way is used to grab rdf data. the 'rdf:' prefix means look up a predicate pointing out of the node for that res...
Focus and Selection - Archive of obsolete content
stracting for the user and is poor user interface design. you can also add event handlers dynamically using the dom function addeventlistener. you can use it for any element and event type. it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether to capture or not. getting the currently focused element the currently focused element is
held by an object called a command dispatcher, of which there is only one for the window. the command dispatcher is responsible for keeping track of the focused element as the user uses the interface. the command dispatcher has other roles, which will be discussed in a later section on commands. for now, we'll look at some of the focus related features of the command dispatcher. you can retrieve the c...
browser - Archive of obsolete content
listed below may be used, which are all constants of the webnavigation property (or the nsiwebnavigation interface). you may combine flags using a or symbol ( | ). load_flags_none: no special flags. the document is loaded normally. load_flags_bypass_cache: reload the page, ignoring if it is already in the cache. this is the flag used when the reload button is pressed while the shift key is
held down. load_flags_bypass_proxy: reload the page, ignoring the proxy server. load_flags_charset_change: this flag is used if the document needs to be reloaded because the character set changed. removeprogresslistener( listener ) return type: no return value remove a nsiwebprogresslistener from the browser. stop() return type: no return value equivalent to pressin...
button - Archive of obsolete content
may be invoked when the main part of the button is pressed. panel similar to the menu type, this opens a popup. place a panel element inside the button. panel elements are popups that support any type of content. radio the button acts like a radio button. only one button in the group can be on a once. repeat this button will fire its command event repeatedly while the mouse button is
held down. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating the type of accessibility object for the element. autocheck type: boolean gets and sets the value of the autocheck attribute. checkstate type: integer, values 0, 1, or 2 ...
prefpane - Archive of obsolete content
ent ) return type: preference element returns the preference element to which a user interface element is attached. 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. for example, if you are using a listbox and the user changes the contents of the listbox (such as adding or removing an item) and you want to sync the changes back to a preference, you must write an onsynctopreference handler for your listbox that returns the value to be written to the preference element, and then call the userchangedvalue function every time you edit the list in a...
tabbox - Archive of obsolete content
. tab navigation will occur as long as any element in the window is focused. document keyboard navigation is captured at the document level. tab navigation will occur as long as any element in the document is focused. handlectrltab type: boolean if set to true or omitted, the tabbox will switch to the next tab when the control and tab keys are pressed. if the shift key is also
held down, the previous tab will be displayed. if this attribute is set to false, these keys do not navigate between tabs. properties accessibletype type: integer a value indicating the type of accessibility object for the element. eventnode type: eventtarget indicates the node where keyboard navigation events listener is set up. the initial value for this property ...
tabbrowser - Archive of obsolete content
listed below may be used, which are all constants of the webnavigation property (or the nsiwebnavigation interface). you may combine flags using a or symbol ( | ). load_flags_none: no special flags. the document is loaded normally. load_flags_bypass_cache: reload the page, ignoring if it is already in the cache. this is the flag used when the reload button is pressed while the shift key is
held down. load_flags_bypass_proxy: reload the page, ignoring the proxy server. load_flags_charset_change: this flag is used if the document needs to be reloaded because the character set changed. removealltabsbut( tabelement ) return type: no return value removes all of the tab panels except for the one corresponding to the specified tab. if only one tab page is displayed, this method doe...
2006-10-13 - Archive of obsolete content
ing out the new tinderbox and bonsai servers. sunbird and lighting 0.3 sunbird and lighting 0.3 were released on october 11 discussions release process discussion discussion from last week regarding speeding up and automation of the release process continued. firefox feature brainstorming you can help suggest features for firefox 3 here meetings project meeting a project meeting was
held on oct. 9. (meeting notes) bon echo status meeting a bon echo status meeting was
held on oct. 10 (meeting notes) gecko 1.9/gran paradiso status meeting a gecko 1.9/gran paradiso status meeting was
held on oct. 11 (notes) ...
2006-12-01 - Archive of obsolete content
on of a server side javascript. it supports a apache2 module and stand alone version. http://www.juicescript.org/ discussions deleting objects in spidermonkey a user asks if there's a method of manually deleting an object in spidermonkey before garbage collector deletes it. peter wilson's reply was to add a method that does the deleting with a native implementation that releases the resources
held by the object as seen in this database interface: var mydbase = new pgsqlconnection; mydbase.connect("database"); mydbase.exec("select * from mytable where ..."); // use the result data - (native implementation function) mydbase.close() spidermonkey for server side inquiry about why javascript hasn't caught on for general server-side scripting. peter wilson lists some important comparisons b...
NPVariant - Archive of obsolete content
syntax typedef struct _npvariant { npvarianttype type; union { bool boolvalue; int32_t intvalue; double_t doublevalue; npstring stringvalue; npobject *objectvalue; } value; } npvariant; fields the data structure has the following fields: type a member of the npvarianttype enumeration specifying the data type contained in the npvariant. ...
NPAPI plugin reference - Archive of obsolete content
a pointer to a sequence of 8-bit units (nputf8) making up a utf-8 string, and the number of 8-bit units in the utf-8 string. nputf8 nputf8 is a byte representing an 8-bit unit of a utf-8 character. this is not the same thing as an entire utf-8 character, which may be comprised of multiple nputf8 bytes. npvariant npvariant is a struct that holds a value and the type of that value. the value is
held in a union, and the type is one of types defined in the npvarianttype enumeration. npvarianttype npvarianttype is an enumeration that is used to identify the data type of an npvariant structure. npwindow contains information about the target into which the plug-in instance can draw. ...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
ndle structure toolkit bundles can be used for all add-ons including extensions, themes and plugins. plugin packages should only need to package a small set of files in the following structure in the xpi file: install.rdf plugins/ pluginlib.dll plugintypes.xpt the install.rdf file contains an install manifest that describes the plugin to the user. the library and scripting interfaces are
held in the plugins directory. platform-specific files gecko 1.9.2 (firefox 3.6) and earlier prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), it was possible to package multiple plugin libraries for different operating systems into a single xpi bundle. in the xpi you can use the following structure: platform/ linux_x86-gcc3/ plugins/ libplugin.so darwin_ppc...
Using SSH to connect to CVS - Archive of obsolete content
eckout and build mozilla. assuming you use a shell script or batch file to set things up, just add the commands below to the end of your file. posix shell eval `ssh-agent -s` ssh-add ~/.ssh/id_dsa $shell ssh-agent -k exit x windows in "~/.xinitrc" add "ssh-add". this will bring up a graphic box just after login, and before the desktop loads, asking for your passphrase. the passphrase will be
held for the length of the x session, and be passed on to all child shells. ms-dos command prompt cygwin for /f "tokens=1,2,3* delims=; " %%a in ('ssh-agent -c') do if "%%a"=="setenv" set %%b=%%c set home=/cygdrive/c/path/to/your/cygwin/home/directory ssh-add ~/.ssh/id_dsa start /b /wait cmd.exe ssh-agent -k exit essentially both sets of commands do the same thing. first ssh-agent is called and i...
Browser Detection and Cross Browser Support - Archive of obsolete content
lities to name just a few reasons. targeting your web content to particular vendors ignores the possibility that other browsers which support the same standards may be introduced in the future. a common problem on the web today is the assumption that the only browsers in the world are netscape navigator and microsoft internet explorer. this ignores the existence of opera as well as the newer hand
held devices which are being used to access the web today and in the future. mozilla-based browsers (such as firefox), internet explorer 6 on windows, and internet explorer 5 for macintosh all support doctype switching. this is a technique where these browsers can be switched from "quirks" mode (which emulates buggy implementations in earlier generation browsers) to standards mode (which more strictl...
XForms Custom Controls - Archive of obsolete content
illa xforms extension cannot anticipate all of the possible use cases that will evolve in web applications and web pages as xforms matures and the user base grows. and with these new uses, more and more flexibility will be desired from the controls. introducing custom controls into your environment may be just the solution you are looking for. for example, you might want to render images that are
held inside an instance document or you would like to show a disabled trigger when its bound node becomes irrelevant rather than having it not display (the current default behavior). every xforms control's presentation has its own xbl binding. in many cases different values provided for the appearance or mediatype attributes will determine which xbl binding will be used for a particular xforms control...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
ticular product, they must have a positive experience with consistent, reliable, and predictable behavior. as users become more sophisticated, and as additional devices become more affordable, they will be accessing the same information across a variety of devices – and expect them to look and act the same – regardless of whether they are accessing a web site from their desktop, phone, or hand
held. consequently, if an organization offers a suite of products they must ensure that the user experience is consistent and predictable across the product line. consistency to be successful, organizations need to understand this user expectation and provide a consistent experience across their product offerings. when usability alters too much across products, users complain. apple and microsoft h...
Visual-js game engine - Game development
commercial licence). 3) please read the following terms and conditions before using this application: disclaimer of warranty 'visual js' is provided "as-is" and without warranty of any kind, express, implied or otherwise, including without limitation, any warranty of merchantability or fitness for a particular purpose. in no event shall the author of this software be
held liable for data loss, damages, loss of profits or any other kind of loss while using or misusing this software. external licences in this project : webcam nui control is under : created by romuald quantin. http://creativecommons.org/licenses/by-nc-sa/3.0/ download from : https://www.adobe.com/devnet/archive/html5/articles/javascript-motion-detection.html webrtc - webcam co...
Gecko info for Windows accessibility vendors
iid_isimpledomnode, (void**)&psimpledomnode); if (succeeded(hresult) && psimpledomnode != null) { /* this is a mozilla node! use special isimpledomnode methods described in isimpledomnode.idl. */ } } the get_nodeinfo method is used to get basic information about a node such as the tag name and namespace id, node type (see isimpledomnode.idl for definitions), node value (text
held in the node), a unique id for use in tracking where events occur, and the number of children. the namespace id is meaningless until you get the namespace uri for it, through the isimpledomdocument interface (see below). hresult get_nodeinfo( /* [out] */ bstr *nodename, // for elements, this is the tag name /* [out] */ short *namespaceid, /* [out] */ b...
A bird's-eye view of the Mozilla framework
l] out nsqiresult result); [noscript, notxpcom] nsrefcnt addref(); [noscript, notxpcom] nsrefcnt release(); }; the uuid parameter to queryinterface() is the iid uniqely identifying the interface. if nsirdfnode doesn't support nsirdfliteral, it returns null and it's up to the client to choose an alternate course of action. the xpcom component keeps track of all interface pointers currently
held by its clients using an internal reference count it increments via client calls to addref(). it is up to the client to call release() when it no longer needs the interface. release() decrements the reference count and then the object becomes a candidate for destruction. javascript handles its own garbage collection, so it doesn’t need to call addref() and release(). inside an xpcom component ...
Experimental features in Firefox
ease 31 no preference name layout.css.convertfromnode.enable payment request api primary payment handling the payment request api provides support for handling web-based payments within web content or apps. due to a bug that came up during testing of the user interface, we have decided to postpone shipping this api while discussions over potential changes to the api are
held. work is ongoing. see bug 1318984 for more details on the state of this api. release channel version added enabled by default? nightly 55 no developer edition 55 no beta 55 no release 55 no preference name dom.payments.request.enabled and dom.payments.request.supportedregions basic card api ext...
HTTP Cache
mandatory argument to *storage methods of nsicachestorageservice. //github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a helper interface wrapping following four arguments into a ...
BloatView
the first line tells you the pid of the leaking process, along with the type of process. here's how you interpret the columns. the first, numerical column is the index of the leaking class. class - the name of the class in question (truncated to 20 characters). bytes per-inst - the number of bytes returned if you were to write sizeof(class). note that this number does not reflect any memory
held onto by the class, such as internal buffers, etc. (e.g. for nsstring you'll see the size of the header struct, not the size of the string contents!) bytes leaked - the number of bytes per instance times the number of objects leaked: (bytes per-inst) x (objects rem). use this number to look for the worst offenders. (should be zero!) objects total - the total count of objects allocated of a given...
GC and CC logs
manually or automatically generated, and they can be generated in both debug and non-debug builds. this logs the contents of the javascript heap to a file named gc-edges-nnnn.log. it also creates a file named cc-edges-nnnn.log to which it dumps the parts of the heap visible to the cycle collector, which includes native c++ objects that participate in cycle collection, as well as js objects being
held alive by those c++ objects. generating logs from within firefox to manually generate gc and cc logs, navigate to about:memory and use the buttons under "save gc & cc logs." "save concise" will generate a smaller cc log, "save verbose" will provide a more detailed cc log. (the gc log will be the same size in either case.) with multiprocess firefox, you can't record logs from the content proces...
AsyncTestUtils extended framework
also tracks what folders they were injected into as well as what folders you move them to. this allows you to get at the nsimsgdbhdr instances directly. keep in mind that the class is not magic and will lose track of the message headers if you manipulate them without referencing the message set. accessing synthetic messages and headers synmessages [attribute] the js list of syntheticmessages
held in the set. while you should not modify this list, you can get its length and read from it. getmsghdr(aindex) [function] retrieve the nsimsgdbhdr at the given index. getmsguri(aindex) [function] retrieve the uri of the message header at the given index. msghdrlist [getter] return a js list with all the nsimsgdbhdrs for the messages that have been injected into folders. xpcomhdrarray [gette...
Introduction to NSPR
seful to implement the expression during development and test it where appropriate. the thread makes an absolute assertion of the expression's evaluation both on entering and on exiting the monitor. acquiring a lock is a synchronous operation. once the lock primitive is called, the thread returns only when it has acquired the lock. should another thread (or the same thread) already have the lock
held, the calling thread blocks, waiting for the situation to improve. that blocked state is not interruptible, nor is it timed. condition variables condition variables facilitate communication between threads. the communication available is a semantic-free notification whose context must be supplied by the programmer. conditions are closely associated with a single monitor. the association between...
PR_CWait
ly if the object is notified. returns the function returns one of the following values: pr_success indicates either that the monitored object has been notified or that the interval specified in the timeout parameter has been exceeded. pr_failure indicates either that the monitor could not be located in the cache or that the monitor was located and the calling thread was not the thread that
held the monitor's mutex. 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. while the thread is waiting, it exits the monitor (just as if it had called pr_cexitmonitor as many times as it had called pr_centermonitor). when the wait has finished, the thread regains control of ...
PR_EnterMonitor
enters the lock associated with a specified monitor. syntax #include <prmon.h> void pr_entermonitor(prmonitor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor. description when the calling thread returns, it will have acquired the monitor's lock. attempts to acquire the lock for a monitor that is
held by some other thread will result in the caller blocking. the operation is neither timed nor interruptible. if the monitor's entry count is greater than zero and the calling thread is recognized as the holder of the lock, pr_entermonitor increments the entry count by one and returns. if the entry count is greater than zero and the calling thread is not recognized as the holder of the lock, the thread is blocked unt...
Rhino history
hat are interned as a result of loading a class file. so in fall of 1998, rhino added an interpretive mode. the classfile generation code was moved to an optional, dynamically-loaded package. compilation is faster and when scripts are no longer in use they can be collected like any other java object. rhino was released to mozilla.org in april 1998. originally rhino classfile generation had been
held back from release. however the licensees of rhino have now agreed to release all of rhino to open source, including class file generation. since its release to open source, rhino has found a variety of uses and an increasing number of people have contributed to the code. ...
GCIntegration - SpiderMonkey Redirect 1
onnect pointers are also traced in this way. see xpcjsruntime::traceblackjs and xpcjsruntime::tracegrayjs. if a pointer doesn't fit one of these categories, then it probably requires a write barrier. before the pointer is modified (except initializing writes, which don't need a barrier), you should call incrementalreferencebarrier() or incrementalvaluebarrier(), passing it the value the pointer
held before the write. there are several examples of this usage in xpconnect. the js::objectptr class is intended to serve as a drop-in replacement for jsobject *. it has an assignment operator that automatically invokes a write barrier. so far, though, there hasn't been much use for this class—there aren't many places outside of spidermonkey where a write barrier is required. read barriers "weak...
Exact Stack Rooting
pt program memory. gcthing - storage allocated by spidermonkey's allocator. gcpointer - a raw pointer type or tagged pointer type that may refer to a gcthing (jsobject *, jsstring *, value, jsid, etc.) gcheap - the graph of gcthings allocated by spidermonkey's allocator. the goal of spidermonkey's gc is to partition this heap into regions reachable from the rootset and not. root - a gcpointer
held live because it is a member of the rootset. rootset - this is a set of gcpointers that are de-facto alive, regardless of the gcthing's reachability. gcpointers must be explicitly added to and removed from the rootset. liveset - the set of all gcthings that are reachable from roots. deadset - the set of all gcthings that are not reachable from roots. cheap - the c/c++ program heap: e.g., memor...
Invariants
, we know statically that we must be in a request on cx there. locks "are we holding the runtime-wide gc lock?" is a static yes or no for almost every line of code. 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. a thread that holds the gc lock never does anything that blocks. a thread that is in a request never does anything that blocks. there are the usual invariants regarding locks: we do not reenter them (it would be nice to check this as there might be an exception or two); we do not wait on a condition variable unless the corresponding lock is
held. there are the usual invariants regarding vari...
JS::Rooted
const description js::rooted<t> declares a local variable of type t whose value is always rooted. this is typically used for local variables, or for non-rooted values being passed to a function that requires a handle, e.g. foo(js::rooted<t>(cx, x)). js::rooted<t> may be automatically coerced to a js::handle<t>. js::rooted<t> should be used whenever a local variable's value may be
held live across a call which can trigger a gc. if you want to add additional methods to rooted for a specific specialization, define a js::rootedbase<t> specialization containing them. there are typedefs available for the main types: namespace js { typedef rooted<jsobject*> rootedobject; typedef rooted<jsfunction*> rootedfunction; typedef rooted<jsscript*> rootedscript; typedef roo...
JSPrincipalsTranscoder
s, which poses a problem for xdr. the application provides the jsprincipals objects, so it must also provide a jsprincipalstranscoder if it intends to serialize or deserialize principals. the callback xdr-encodes or -decodes a principals instance, based on whether xdr->mode is jsxdr_encode, in which case *principalsp should be encoded; or jsxdr_decode, in which case implementations must return a
held (via jsprincipals_hold), non-null *principalsp out parameter. return js_true on success, js_false on any error, which the implementation must have reported. mxr id search for jsprincipalstranscoder ...
Web Replay
as not been destroyed yet during the replay, it will never be used again because at this point in the recording it has been finalized. similarly, gc behavior can cause values read from weak pointers to differ between recording and replay. if this difference can affect the recording, the weak pointer must be instrumented so that during replay it holds onto its target for the same duration it was
held while recording. recording a recording content process differs from a normal content process in the following ways: calls to certain functions are intercepted by hooking them (rewriting the machine code at their entry points to call a different function with the same signature), including the function used to dispatch mach messages. when a call or message is intercepted, the wrapped call/m...
Using RAII classes in Mozilla
aii classes are useful when two operations (e.g., lock/unlock, addref/release, pushstate/popstate) must be paired. ensuring raii classes are not used as temporaries a common mistake when using raii classes is to accidentally forget to name object, which causes its scope to be different from what is intended. 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. we have two techniques for avoiding this problem: static analysis and runtime assertions. static analysis static analysis passes are run on our testing infrastructure using our clang plugin, you can also run them locally marking a raii class for the ...
Handling Mozilla Security Bugs
aving the "security-sensitive" flag removed, in which case the access control restrictions will no longer be in effect. full information about security bugs will be restricted to a known group of people, using the bugzilla access control restrictions described above. however, that group can and will be expanded as necessary and appropriate. as noted above, information about security bugs can be
held confidential for some period of time; there is no pre-determined lmit on how long that time period might be. however, this is offset by the fact that the person reporting a bug has visibility into the activities (if any) being taken to address the bug, and has the power to open the bug report for public scrutiny. the remaining sections of this document describe in more detail how these general ...
An Overview of XPCOM
ctory for the object should return the same object. though there are tools and better ways to handle singletons (which we'll discuss when we talk about the nsiservicemanager), a developer may want to use this information to ensure that only one singleton object can exist despite what the callers do. the requirements of a factory class can be handled in a strictly functional way, with state being
held by global variables, but there are benefits to using classes for factories. when you use a class to implement the functionality of a factory, for example, you derive from the nsisupports interface, which allows you to manage the lifetime of the factory objects themselves. this is important when you want to group sets of factories together and determine if they can be unloaded. another benefit of ...
Finishing the Component
weblock on every page load, and this prevents pages from displaying by returning the proper value when the load method is called. the web locking policy that we are going to put into place is quite simple: for every load request that comes through, we will ensure that the uri is in the list of "good" urls on the white list. if you care to extend this implementation so that the list of urls is
held remotely on a server somewhere - as might be the case when the weblock component is used in a corporate intranet, for example - there are networking apis in gecko that will support this. or you could implement the web lock so that instead of blocking any site, the component would simply log all urls that are loaded. in any case, the process to make the xpcom component is the same. the method th...
Using XPCOM Utilities to Make Things Easier
ed to exist in this context. you can call a .get() method on the nscomptr and have it returned for use as a raw pointer. this raw pointer can then be assigned to a variable and have its reference updated by ns_if_addref. be very careful with the result of .get(), however. you should never call release on this result because it may result in a crash. instead, to explicitly release the object being
held by a nscomptr, you can assign zero to that pointer. another nice feature of smart pointers - the part that makes them smart - is that you can queryinterface them quite easily. for example, there are two interfaces for representing a file on a file system, the nsifile and nsilocalfile, and they are both implemented by an object. although we haven't formally introduced these two interfaces, the ne...
Interfacing with the XPCOM cycle collector
on_unlink(msomemember) these macros should handle a variety of cases, such as reference counted pointers to cycle collected nsisupports or non-nsisupports objects, as well as arrays of these pointers. handling jsobjects fields if your class needs to store a pointer to a jsobject then you need to tell the cycle collector about it. the approach you should take is as follows. firstly it must be
held in a js::heap<jsobject *> field. for example, suppose your class nsfoo has field msomeobj: private: ... js::heap<jsobject*> msomeobj; ... when you have something in the js object pointer you need to use mozilla::holdjsobjects to tell the gc to trace it and keep the object alive: ... msomeobj = ... ; mozilla::holdjsobjects(this); ... in the unlink method (or destructor) you need to set...
Components.utils.getWeakReference
o verify the object is truly what you want. syntax weakref = components.utils.getweakreference(obj); parameters obj the object for which to obtain a weak reference. note: in gecko 11.0, this method was changed to throw an exception if obj is null. in gecko 12.0, the previous behavior of silently failing has been restored. example in this example here, a weak reference to a window is
held. and then later on it is matched in the array and used. var arr = []; arr.push(cu.getweakreference(window)); //now lets say this code runs in another block: for (var i=0; i<arr.length; i++) { if (arr[i].get() == window) { //found the window break; } } ...
nsAutoRef
ically on destruction of the object. nsautoref has a role similar to nsautoptr and nsrefptr but does not require that the handle is a pointer to an object that was created with new or has addref() and release() methods. nsautoref is therefore useful for managing a reference to a foreign object. no copy constructor nor copy assignment operators are available, so the handle to the resource will be
held until released on destruction of the nsautoref or until explicitly reset() or transferred through provided methods. in order to use nsautoref<t> for a class t associated with a particular resource type, the type of the handle to the resource and the method for releasing the resource must be provided for class t. this is usually done by providing a specialization of nsautoreftraits<t>. nsautoref ...
nsAutoRefTraits
when the handle to the resource is a pointer to t the specialization may be derived from nspointerreftraits<t>, so that only definitions of the release(t*) static method and possibly the addref(t*) static method need to be added. addref(t*) is necessary for nscountedref<t> but not for nsautoref<t>. ...
nsICachingChannel
d to a file. this may fail if the disk cache is not present. the value of this attribute is usually only settable during the processing of a channel's onstartrequest. the default value of this attribute depends on the particular implementation of nsicachingchannel. cachefile nsifile get the "file" where the cached data can be found. this is valid for as long as a reference to the cache token is
held. this may return an error if cacheasfile is false. read only. cacheforofflineuse boolean specifies whether or not the data should be placed in the offline cache, in addition to normal memory/disk caching. this may fail if the offline cache is not present. the value of this attribute should be set before opening the channel. cachekey nsisupports uniquely identifies the data in the cache for ...
nsIDOMChromeWindow
ximized. state_minimized 2 the window is minimized. state_normal 3 the window is normal. state_fullscreen 4 the window is in full screen mode. methods beginwindowmove() on some operating systems, we must allow the window manager to handle window dragging. this method tells the window manager to start dragging the window. this method will fail unless called while the left mouse button is
held down, callers must check this. void beginwindowmove( in nsidomevent mousedownevent ); parameters mousedownevent exceptions thrown ns_error_not_implemented if the operating system does not support this method. getattention() void getattention(); parameters none. getattentionwithcyclecount() same as getattention method excepting that this can specify the maximum number of times to animate ...
nsIObserverService
in nsiobserver anobserver, in string atopic, in boolean ownsweak ); parameters anobserver the nsiobserver object which will receive notifications. atopic the notification topic or subject. ownsweak if set to false, the nsiobserverservice will hold a strong reference to anobserver. if set to true and anobserver supports the nsisupportsweakreference interface, a weak reference will be
held. otherwise an error will be returned. (in most cases, you should use false.) enumerateobservers() called to enumerate all observers registered for a particular topic. nsisimpleenumerator enumerateobservers( in string atopic ); parameters atopic the notification topic or subject. return value returns an enumeration of all registered listeners. see nsisimpleenumerator. notifyobserve...
Component; nsIPrefBranch
an attempt to avoid these situations: the nsprefbranch object supports nsisupportsweakreference. any consumer may hold a weak reference to it instead of a strong one. the nsprefbranch object listens for xpcom-shutdown and frees all of the objects currently in its observer list. this ensures that long lived objects (services for example) will be freed correctly. the observer can request to be
held as a weak reference when it is registered. this insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap. the list of registered observers may be changed during the dispatch of nspref:changed notification. however, the observers are not guaranteed to be notified in any particular order, so you can't be sure whether the added/removed obse...
nsIPrefBranch2
an attempt to avoid these situations: the nsprefbranch object supports nsisupportsweakreference. any consumer may hold a weak reference to it instead of a strong one. the nsprefbranch object listens for xpcom-shutdown and frees all of the objects currently in its observer list. this ensures that long lived objects (services for example) will be freed correctly. the observer can request to be
held as a weak reference when it is registered. this insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap. the list of registered observers may be changed during the dispatch of nspref:changed notification. however, the observers are not guaranteed to be notified in any particular order, so you can't be sure whether the added/removed obse...
nsIRadioInterfaceLayer
ription currentstate jsval read only. obsolete since gecko 13.0 microphonemuted bool radiostate jsval read only. ...
nsISupports
al] out nsqiresult result ); parameters uuid the uuid of the requested interface result the resulting interface pointer. exceptions thrown ns_error_no_interface the requested interface is not available. violates the xpcom interface guidelines release() notifies the object that an interface pointer has been destroyed and any resources the object
held on behalf of the client can be released. nsrefcnt release(); parameters none. return value an integer value that is generally ignored. remarks the method descriptions above were taken from essential com by don box. the point of those descriptions is to highlight the fact that addref() and release() do not necessarily correspond to incrementing and decrementing a counter, respectively, even thoug...
nsITransaction
void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type description istransient boolean the transaction's transient state. this attribute is checked by the transaction manager after the transaction's execute() method is called. 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. transient transactions cannot be undone or redone by the transaction manager. read only. methods ...
Address book sync client design
sync protocol encoding sync protocol decoding http "post" api mozilla networking client side sync logic the client synchronization logic defers to the server peforming some intelligence in handling duplicate entries for the sync process. the static information that is
held on the client for address book sync operations is stored in a file called absync.dat which is located in the root directory of the users profile information. // // the client keeps a sync mapping table which holds the following: // // serverrecordid - unique id for a record provided by the // uab server. // localrecordid - local unique id, for mobile devices this ...
Using the Multiple Accounts API
look like this: alecf on imap.mywork.com +- inbox +- trash +- (etc) alecf on pop.myisp.com +- inbox +- trash +- (etc) news.myisp.com +- comp.os.linux.announce +- etc.. news.mozilla.org +- netscape.public.mozilla.announce +- netscape.public.mozilla.mail-news relevant api calls: nsimsgaccount.incomingserver nsimsgaccountmanager.allservers: a list of all servers
held by all accounts. identities identities are used in the compose window. if identities are shared between accounts, you will only see that identity once in the list. in the above example, the list of identities would be as follows: alec flett <alecf@mywork.com>) alec flett <alecf@myisp.com>) alec flett <alecfnospam@myisp.com>) relevant api calls: nsimsgaccount.identities nsimsga...
Debugger.Frame - Firefox Developer Tools
in the environment in whichcode is evaluated namedname, whose value isvalue. eachvalue must be a debuggee value. (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. note that, like eval, declarations in thecode passed to evalwithbindings affect the environment of this frame, even as that environment is extended by bindings visible withincode. (in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the variableenvi...
Debugger.Object - Firefox Developer Tools
exical environment in whichcode is evaluated namedname, whose value isvalue. eachvalue must be a debuggee value. (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. note that, like executeinglobal, any declarations it contains affect the referent global object, even ascode is evaluated in an environment extended according tobindings. (in the terms used by the ecmascript specification, the variableenvironment of the execution context forcode is the referent, and thebindings appea...
Debugger.Object - Firefox Developer Tools
exical environment in whichcode is evaluated namedname, whose value isvalue. eachvalue must be a debuggee value. (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. note that, like evalinglobal, if the code passed to evalinglobalwithbindings is not strict mode code, then any declarations it contains affect the referent global object, even ascode is evaluated in an environment extended according tobindings. (in the terms used by the ecmascript specification, the variableenvironme...
Gamepad.hand - Web APIs
the hand read-only property of the gamepad interface returns an enum defining what hand the controller is being
held in, or is most likely to be
held in. syntax var myhand = gamepadinstance.hand; value a gamepadhand enum; possible values are: left — the left hand. right — the right hand. empty string ("") — this value is returned if the other values are not applicable, e.g. the controller is
held in both hands, or would be fine in either. examples tbc specifications specification status comment gamepad extensionsthe definition of 'hand' in that specification. editor's draft initial definition ...
Gamepad - Web APIs
read only a domhighrestimestamp representing the last time the data for this gamepad was updated. experimental extensions to gamepad the following interfaces are defined in the gamepad extensions specification, and provide access to experimental features like haptic feedback and webvr controller pose information. gamepad.hand read only an enum defining what hand the controller is being
held in, or is most likely to be
held in. gamepad.hapticactuators read only an array containing gamepadhapticactuator objects, each of which represents haptic feedback hardware available on the controller. example window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.
Using the Gamepad API - Web APIs
querying the gamepad object as you can see, the gamepad events discussed above include a gamepad property on the event object, which returns a gamepad object. we can use this in order to determine which gamepad (i.e., its id) had caused the event, since multiple gamepads might be connected at once. we can...
The HTML DOM API - Web APIs
orth. there are elements that share commonalities and thus have an additional intermediary type. for example, the <audio> and <video> elements both present audiovisual media. the corresponding types, htmlaudioelement and htmlvideoelement, are both based upon the common type htmlmediaelement, which in turn is based upon htmlelement and so forth. htmlmediaelement defines the methods and properties
held in common between audio and video elements. these element-specific interfaces make up the majority of the html dom api, and are the focus of this article. to learn more about the actual structure of the dom, see introduction to the dom. html dom target audience the features exposed by the html dom are among the most commonly-used apis in the web developer's arsenal. all but the most simple web...
KeyboardEvent.charCode - Web APIs
de(e.charcode)}\ncharcode: ${e.charcode}`; }); result notes in a keypress event, the unicode value of the key pressed is stored in either the keycode or charcode property, but never both. if the key pressed generates a character (e.g., 'a'), charcode is set to the code of that character; charcode respects the letter case (in other words, charcode takes into account whether the shift key is
held down). otherwise, the code of the pressed key is stored in keycode. when one or more modifier keys are pressed, there are some complex rules for charcode. see gecko keypress event for details. charcode is never set in the keydown and keyup events. in these cases, keycode is set instead. to get the code of the key regardless of whether it was stored in keycode or charcode, query the which prope...
KeyboardEvent.repeat - Web APIs
the repeat read-only property of the keyboardevent interface returns a boolean that is true if the given key is being
held down such that it is automatically repeating. syntax var repeat = event.repeat; return value boolean specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.repeat' in that specification. obsolete initial definition. ...
LockManager - Web APIs
the the web locks api provides methods for requesting a new lock object and querying for an existing lock object. to get an instance of lockmanager, call navigator.locks. methods lockmanager.request() requests a lock object with parameters specifying its name and characteristics. lockmanager.query() returns a promise that resolves with a lockmanagersnapshot which contains information about
held and pending locks. specifications specification status comment web locks apithe definition of 'lockmanager' in that specification. draft initial definition. ...
MediaDevices.getUserMedia() - Web APIs
so using feature policy. otherwise, the user will never even be asked for permission to use the input devices. for additional details on these requirements and rules, how they are reflected in the context in which your code is running, and about how browsers manage user privacy and security issues, read on. user privacy as an api that may involve significant privacy concerns, getusermedia() is
held by the specification to very specific requirements for user notification and permission management. first, getusermedia() must always get user permission before opening any media gathering input such as a webcam or microphone. browsers may offer a once-per-domain permission feature, but they must ask at least the first time, and the user must specifically grant ongoing permission if they choose t...
Pointer Lock API - Web APIs
of the parameters are the same as the difference between the values of mouseevent properties, screenx and screeny, which are stored in two subsequent mousemove events, enow and eprevious. in other words, the pointer lock parameter movementx = enow.screenx - eprevious.screenx. 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. the movementx and movementy properties continue to provide the mouse's change in position. there is no limit to movementx and movementy values if the mouse is continuously moving in a single direction. the concept of the mouse cursor does not exist and the cursor cannot move off the window or be clamped by a screen edge. unlocked state the parameters mov...
StyleSheet.media - Web APIs
dia="screen, print"> body { background-color: snow; } </style> </head> <body> <script> for (var isheetindex = 0; isheetindex < document.stylesheets.length; isheetindex++) { console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheetindex].media)); if (isheetindex === 0) document.stylesheets[isheetindex].media.appendmedium('hand
held'); if (isheetindex === 1) document.stylesheets[isheetindex].media.deletemedium('print'); console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheetindex].media)); } /* will log: document.stylesheets[0].media: {"0":"screen"} document.stylesheets[0].media: {"0":"screen","1":"hand
held"} document.stylesheets[1].media: {"0":"screen"...
WEBGL_compressed_texture_atc - Web APIs
compressed textures reduce the amount of memory needed to store a texture on the gpu, allowing for higher resolution textures or more of the same resolution textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. ...
Movement, orientation, and motion: A WebXR example - Web APIs
ensures that the context is configured for use as a source for webxr rendering. next, we add event handlers for the mousemove and element.contextmenu_event, but only if the allowmouserotation constant is true. the mousemove handler will deal with the pitching and yawing of the view based upon the movement of the mouse. since the "mouselook" feature functions only while the right mouse button is
held down, and clicking using the right mouse button triggers the context menu, we add a handler for the contextmenu event to the canvas to prevent the context menu fom appearing when the user initially begins their drag of the mouse. next, we compile the shader programs; get references to its variables; initialize the buffers that store the array of each position; the indexes into the position table...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
. the player, avatar, or camera; the origin of this space is used as the camera position for rendering the scene to be displayed to the user. the hand and/or hand controller; each of these represents one of the user's hands, either in the form of the hand itself or a controller (or both). the origin is generally the center of the user's fisted hand. the target ray; each controller or other hand
held device may have a targeting ray associated with it, which is represented by a space whose origin is at the point on the controller at which the ray is emitted, and is oriented so that -z extends in the direction of the target it's pointing at. because each of these is defined using a reference space as its foundation, the webxr device api can easily be used to convert among the coordinate syste...
Starting up and shutting down a WebXR session - Web APIs
ry as specified by the xrboundedreferencespace's property boundsgeometry change. for more common causes of reference space resets and more details and sample code, see the documentation for the reset event. detecting when the available set of webxr input controls changes webxr maintains a list of input controls which is specific to the webxr system. these devices include things such as the hand
held controllers, motion-sensing cameras, motion-sensitive gloves and other feedback devices. when the user connects or disconnects a webxr controller device, the inputsourceschange event is dispatched to the xrsession. this is an opportunity to notify the user of the device's availability, begin to monitor it for inputs, offer configuration options, or whatever you need to do with it. ending the web...
WebXR Device API - Web APIs
core of the webxr feature set, managing the selection of output devices, render the 3d scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers. webxr-compatible devices include fully-immersive 3d headsets with motion and orientation tracking, eyeglasses which overlay graphics atop the real world scene passing through the frames, and hand
held mobile phones which augment reality by capturing the world with a camera and augment that scene with computer-generated imagery. to accomplish these things, the webxr device api provides the following key capabilities: find compatible vr or ar output devices render a 3d scene to the device at an appropriate frame rate (optionally) mirror the output to a 2d display create vectors representi...
Advanced techniques: Creating and sequencing audio - Web APIs
avetable. we can use the baseaudiocontext.createperiodicwave method to use this custom wave with an oscillator. the periodic wave first of all, we'll create our periodic wave. to do so, we need to pass real and imaginary values into the baseaudiocontext.createperiodicwave() method.: let wave = audioctx.createperiodicwave(wavetable.real, wavetable.imag); note: in our example the wavetable is
held in a separate javascript file (wavetable.js), because there are so many values. it is taken from a repository of wavetables, which can be found in the web audio api examples from google chrome labs. the oscillator now we can create an oscillatornode and set its wave to the one we've created: function playsweep() { let osc = audioctx.createoscillator(); osc.setperiodicwave(wave); ...
Using the Web Audio API - Web APIs
eeds some sound to play through it. there are a few ways to do this with the api. let's begin with a simple method — as we have a boombox, we most likely want to play a full song track. also, for accessibility, it's nice to expose that track in the dom. we'll expose the song on the page using an <audio> element. <audio src="mycooltrack.mp3"></audio> note: if the sound file you're loading is
held on a different domain you will need to use the crossorigin attribute; see cross origin resource sharing (cors) for more information. to use all the nice things we get with the web audio api, we need to grab the source from this element and pipe it into the context we have created. lucky for us there's a method that allows us to do just that — audiocontext.createmediaelementsource: // get the...
WritableStream.WritableStream() - Web APIs
ed only after all queued-up writes have succeeded. the controller parameter passed to this method is a writablestreamdefaultcontroller, which can be used to control the stream at the end of writing. 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. it can clean up any
held resources, much like close(), but abort() will be called even if writes are queued up — those chunks will be thrown away. if this process is asynchronous, it can return a promise to signal success or failure. the reason parameter contains a domstring describing why the stream was aborted. queuingstrategy optional an object that optionally defines a queuing strategy for the stream. this ta...
XMLHttpRequest.getAllResponseHeaders() - Web APIs
testring representing all of the response's headers (except those whose field name is set-cookie or set-cookie2) separated by crlf, or null if no response has been received. if a network error happened, an empty string is returned. an example of what a raw header string looks like: date: fri, 08 dec 2017 21:04:30 gmt\r\n content-encoding: gzip\r\n x-content-type-options: nosniff\r\n server: mein
held/0.6.1\r\n x-frame-options: deny\r\n content-type: text/html; charset=utf-8\r\n connection: keep-alive\r\n strict-transport-security: max-age=63072000\r\n vary: cookie, accept-encoding\r\n content-length: 6502\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n). these are essentially delimiters separating each of the headers. n...
XRInputSource.targetRayMode - Web APIs
ng a gaze-tracking system (or gaze input) which detects the direction in which the user is looking. the target ray will be drawn originating at the viewer's eyes and will follow the direction in which they're looking. screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device. tracked-pointer targeting is being performed using a hand
held device or hand-tracking system which the user points in the direction of the target. the target ray extends from the hand (or the object in the hand) in the targeted direction. the direction is determined using platform-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their index finger straight out from their hand. usage notes the input s...
XRSession.inputSources - Web APIs
keyboards, gamepads, and mice are not considered webxr input sources. note: traditional gamepad controllers are supported using the gamepad api. ...
XRSession.onselect - Web APIs
ts and input sources. syntax xrsession.onselect = selecthandlerfunction; value an event handler function to be invoked when the xrsession receives a select event. example this example handles select event which occur on the user's main hand (as given by a user object's handedness property); if that value matches the value of the xrinputsource property handedness, we know that the device is
held in the user's main hand. xrsession.onselect = event => { let source = event.inputsource; if (source.handedness == user.handedness) { if (source.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose); } } } }; specifications spe...
XRSession: select event - Web APIs
the webxr event select is sent to an xrsession when one of the session's input sources has completed a primary action. examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or hand
held controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the select event. the handler fetches the pose representing the ...
XRSession: selectend event - Web APIs
xrsession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action. primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or hand
held controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to estab...
XRSession: selectstart event - Web APIs
the webxr event selectstart is sent to an xrsession when the user begins a primary action on one of its input sources. primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or hand
held controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to establish handlers for the selection events: selectstart, selectend, and select. this snip...
XRSession: squeeze event - Web APIs
the webxr event squeeze is sent to an xrsession when one of the session's input sources has completed a primary squeeze action. examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or hand
held controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the squeeze event. the handler fetches the ...
XRSession: squeezeend event - Web APIs
on when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action. primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or hand
held controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addeventlistene...
XRTargetRayMode - Web APIs
ng a gaze-tracking system (or gaze input) which detects the direction in which the user is looking. the target ray will be drawn originating at the viewer's eyes and will follow the direction in which they're looking. screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device. tracked-pointer targeting is being performed using a hand
held device or hand-tracking system which the user points in the direction of the target. the target ray extends from the hand (or the object in the hand) in the targeted direction. the direction is determined using platform-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their index finger straight out from their hand. examples this fragment ...
ARIA: listbox role - Accessibility
ccession: focus moves to the next item with a name that starts with the string of characters typed. multiple selection: authors may implement either of two interaction models to support multiple selection: a recommended model that does not require the user to hold a modifier key, such as shift or control, while navigating the list or an alternative model that does require modifier keys to be
held while navigating in order to avoid losing selection states. recommended selection model -- holding modifier keys is not necessary: space: changes the selection state of the focused option . shift + down arrow (optional): moves focus to and toggles the selected state of the next option. shift + up arrow (optional): moves focus to and toggles the selected state of the previous optio...
-webkit-touch-callout - CSS: Cascading Style Sheets
this property allows disabling that behavior. /* keyword values */ -webkit-touch-callout: default; -webkit-touch-callout: none; /* global values */ -webkit-touch-callout: initial; -webkit-touch-callout: inherit; -webkit-touch-callout: unset; syntax values default the default callout is displayed. none the callout is disabled. ...
@media - CSS: Cascading Style Sheets
ces. print intended for paged material and documents viewed on a screen in print preview mode. (please see paged media for information about formatting issues that are specific to these formats.) screen intended primarily for screens. speech intended for speech synthesizers. deprecated media types: css2.1 and media queries 3 defined several additional media types (tty, tv, projection, hand
held, braille, embossed, and aural), but they were deprecated in media queries 4 and shouldn't be used. the aural type has been replaced by speech, which is similar. media features media features describe specific characteristics of the user agent, output device, or environment. media feature expressions test for their presence or value, and are entirely optional. each media feature expression must ...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
of the box alignment specification. this specification details how alignment works in all layout — not just flexbox. box alignment deals with alignment and justification, and also distribution of space along an axis. the reason that the box alignment properties remain detailed in the flexbox specification as well as being in box alignment is to ensure that completion of the flexbox spec is not
held up by box alignment, which has to detail these methods for all layout types. there is a note in the flexbox spec stating that in the future, once it is completed, the definitions in box alignment level 3 will supersede those of flexbox: "note: while the alignment properties are defined in css box alignment [css-align-3], flexible box layout reproduces the definitions of the relevant ones here s...
Using media queries - CSS: Cascading Style Sheets
ces. print intended for paged material and documents viewed on a screen in print preview mode. (please see paged media for information about formatting issues that are specific to these formats.) screen intended primarily for screens. speech intended for speech synthesizers. deprecated media types: css2.1 and media queries 3 defined several additional media types (tty, tv, projection, hand
held, braille, embossed, and aural), but they were deprecated in media queries 4 and shouldn't be used. the aural type has been replaced by speech, which is similar. media features media features describe specific characteristics of the user agent, output device, or environment. media feature expressions test for their presence or value, and are entirely optional. each media feature expression must ...
Event reference
fterscriptexecute 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 cfstatechange 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 cardstatechange sms and ussd events delivered received sent ussdreceived frame events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbro...
Index - Developer guides
e and desktop web users. this approach has positive and negative aspects. 36 optimization and performance landing, optimization, performance, web when building modern web apps and sites, it's important to make your content perform well. that is, to make it work quickly and efficiently. this lets it work effectively both for users of powerful desktop systems as well as for hand
held devices with less power. there are several tools available to check the performance of a website or blog. the most notable tools are listed below. 37 parsing and serializing xml ajax, add-ons, dom, dom parsing, document, extensions, guide, htmldocument, json, parsing, parsing xml, serializing, serializing xml, xml, xmldocument, xmlhttprequest in this article, we'll look at t...
Developer guides
apps work everywhere and provide several features that give them the same user experience advantages as native apps. this set of guides tells you all you need to know about pwas. optimization and performance when building modern web apps and sites, it's important to make your content work quickly and efficiently. this lets it perform effectively for both powerful desktop systems and weaker hand
held devices. parsing and serializing xml the web platform provides different methods of parsing and serializing xml, each with its pros and cons. the web open font format (woff) woff (web open font format) is a font file format that is free for anyone to use on the web. unicode bidirectional text algorithm (bidi) the unicode® bidi algorithm is part of the unicode text standard. it describes ho...
Link types - HTML: Hypertext Markup Language
link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string. if the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed. the first one defined on the page is the default. otherwise, the link defines an alternative page, of one of these types: for another medium, like a hand
held device (if the media attribute is set) in another language (if the hreflang attribute is set), in another format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <form> archives defines a hyperlink to a document that contains an archive link to this one. for example, a blog entry could link to a...
Connection management in HTTP/1.x - HTTP
ved connections, persistent connections, and http pipelining. http mostly relies on tcp for its transport protocol, providing a connection between the client and the server. in its infancy, http used a single model to handle such connections. these connections were short-lived: a new one created each time a request needed sending, and closed once the answer had been received. this simple model
held an innate limitation on performance: opening each tcp connection is a resource-consuming operation. several messages must be exchanged between the client and the server. network latency and bandwidth affect performance when a request needs sending. modern web pages require many requests (a dozen or more) to serve the amount of information needed, proving this earlier model inefficient. two newer...
Set-Cookie - HTTP
or fetch(). this mitigates attacks against cross-site scripting (xss). samesite=<samesite-value> optional strict: the browser sends the cookie only for same-site requests (that is, requests originating from the same site that set the cookie). if the request originated from a different url than the current one, no cookies with the samesite=strict attribute are sent. lax: the cookie is with
held on cross-site subrequests, such as calls to load images or frames, but is sent when a user navigates to the url from an external site, such as by following a link. none: the browser sends the cookie with both cross-site and same-site requests. asserts that a cookie must not be sent with cross-origin requests, providing some protection against cross-site request forgery attacks (csrf). bro...
FinalizationRegistry() constructor - JavaScript
e finalizationregistry constructor creates a finalizationregistry object that uses the given callback. syntax new finalizationregistry([callback]); parameters callback optional the callback function this registry should use. if provided, this must be a function. examples creating a new registry you create the registry passing in the callback: const registry = new finalizationregistry(
heldvalue => { // .... }); specifications specification weakrefsthe definition of 'finalizationregistry constructor' in that specification. ...
Object - JavaScript
= new object(boolean()) object prototypes when altering the behavior of existing object.prototype methods, consider injecting code by wrapping your extension before or after the existing logic. for example, this (untested) code will pre-conditionally execute custom logic before the built-in logic or someone else's extension is executed. when a function is called, the arguments to the call are
held in the array-like "variable" arguments. for example, in the call myfn(a, b, c), the arguments within myfn's body will contain 3 array-like elements corresponding to (a, b, c). when modifying prototypes with hooks, pass this and the arguments (the call state) to the current behavior by calling apply() on the function. this pattern can be used for any prototype, such as node.prototype, function.pr...
TypedArray - JavaScript
d at construction time and thus read only. typedarray.prototype.bytelength returns the length (in bytes) of the typed array. fixed at construction time and thus read only. typedarray.prototype.byteoffset returns the offset (in bytes) of the typed array from the start of its arraybuffer. fixed at construction time and thus read only. typedarray.prototype.length returns the number of elements
held in the typed array. fixed at construction time and thus read only. instance methods typedarray.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). typedarray.prototype.entries() returns a new array iterator object that contains the key/value pairs for each index in the array. see also array.prototype.entries(). typedarray.pr...
Uint8Array - JavaScript
xed at construction time and thus read only. uint8array.prototype.bytelength returns the length (in bytes) of the uint8array. fixed at construction time and thus read only. uint8array.prototype.byteoffset returns the offset (in bytes) of the uint8array from the start of its arraybuffer. fixed at construction time and thus read only. uint8array.prototype.length returns the number of elements
held in the uint8array. fixed at construction time and thus read only. instance methods uint8array.prototype.copywithin() copies a sequence of array elements within the array. see also array.prototype.copywithin(). uint8array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each index in the array. see also array.prototype.entries(). uint8array.pro...
WeakRef - JavaScript
oncurrent techniques. various runtime heuristics can be used to balance memory usage, responsiveness. the javascript engine may hold references to things which look like they are unreachable (e.g., in closures, or inline caches). different javascript engines may do these things differently, or the same engine may change its algorithms across versions. complex factors may lead to objects being
held alive for unexpected amounts of time, such as use with certain apis. notes on weakrefs some notes on weakrefs: if your code has just created a weakref for a target object, or has gotten a target object from a weakref's deref method, that target object will not be reclaimed until the end of the current javascript job (including any promise reaction jobs that run at the end of a script job).
WeakSet() constructor - JavaScript
syntax new weakset([iterable]); parameters iterable if an iterable object is passed, all of its elements will be added to the new weakset. null is treated as undefined. examples using the weakset object var ws = new weakset(); var foo = {}; var bar = {}; ws.add(foo); ws.add(bar); ws.has(foo); // true ws.has(bar); // true ws.delete(foo); // removes foo from the set ws.has(foo); // false, foo has been removed ws.has(bar); // true, bar is retained note that foo !== bar. while they are similar objects, they are not the same object. and so they are both added to the set. ...