Search completed in 1.02 seconds.
Common causes of memory leaks in extensions - Extensions
ved. while bug 695480 should prevent most of these compartment leaks, add-ons still need to be aware of the practices that caused these leaks, as the fix causes many add-ons which would have otherwise caused a leak to instead throw errors when attempting to access nodes from documents which no longer exist. storing references to window objects and dom nodes the most common problem is extensions
holding onto references to content windows for too long. for example, in xul overlay code: var contentwindows = []; function inbrowserxuloverlay(contentwindow) { // forgetting or failing to pop the content window thing again contentwindows.push(contentwindow); } this will keep the content window compartments alive until the browser window is closed. users often only open a single browser window p...
...uloverlay(contentwindow) { // forgetting or failing to pop the content window thing again contentwindows.push(contentwindow); } this will keep the content window compartments alive until the browser window is closed. users often only open a single browser window per session and use tabs, in which case the leaked compartments will live for the whole life of the session. a similar problem is
holding onto window objects or dom nodes (such as window.document) for too long by storing them in a javascript module. for example: var windows = []; function injavascriptcodemodule(window) { // forgetting or failing to pop the window again windows.push(window); } both of these cases can happen if you forget to declare local variables with var or let, which means they end up belonging to the glo...
...mple: var windows = []; function injavascriptcodemodule(window) { // forgetting or failing to pop the window again windows.push(window); } both of these cases can happen if you forget to declare local variables with var or let, which means they end up belonging to the global scope. for example: function implicitdeclarationleak(window) { // implicit variable declaration in the js global,
holding a strong ref to the document doc = window.document; } implicitly declared variables can be avoided by using ecmascript 5's strict mode. strict mode also excludes several other error-prone code patterns. for some examples found in real-world add-ons, see bug 712733, bug 725875, and bug 727552. to avoid these issues, references to dom nodes in foreign document should instead be stored in a...
...And 2 more matches
OS.File for the main thread
s not exist. performance note: this operation is os-optimized under os x, linux/android, and windows. os.file.read() read the contents of a file promise<uint8array> read( in string path, [optional] in number bytes ) arguments path the full path to the file to read. bytesoptional the number of bytes to read. if unspecified, read the complete file. promise resolves to an array
holding bytes bytes (or less if the file did not contain as many bytes). promise can be rejected with os.file.error in case of any error, in particular if the file does not exist or if the process does not have the authorization to read it. as of firefox 30, os.file.read() takes an options object as second argument. promise<uint8array> read( in string path, [optional] in object options ) ar...
... ignored under non-unix platforms.. promise can be rejected with os.file.error in case of any error, in particular if the path does not represent an existing file. os.file.stat() obtain information about a file, such as size, creation date, etc. promise<file.info> stat( in string path ) arguments path the complete path to the file. promise resolves to an instance of file.info
holding information about a file. promise can be rejected with os.file.error in case of any error, in particular if the path does not represent an existing file. performance note: if the file is already opened, calling method stat() is much faster than calling function os.file.stat(). os.file.unixsymlink() create a symoblic link file, also known as "alias" files on mac os. this is similar to "...
...rrorco of 17 will be returned. os.file.writeatomic() write data to a file, atomically. unlike a regular write, this operation ensures that, until the contents are fully written, the destination file is not modified. promise<void> writeatomic( in string path, in arraybufferview data, in object options ) arguments path the full path to the destination file. data an arraybufferview
holding the data to write. firefox 37 note as of firefox 37, this method will neuter the array buffer. options an object that may contain the following fields tmppath if null or unspecified, write the data directly to path. if specified, write the data to a temporary file called tmppath and, once the write is complete, rename the file to replace path. performing this operation is a litt...
...on in the file) os.file.pos_end (bytes are counted from the end of the file) promise can be rejected with os.file.error in case of any error, in particular if the new position is before the start of the file, or if the file is closed. stat() obtain information about the file, such as size, creation date, etc. promise<file.info> stat() promise resolves to an instance of file.info
holding information about the file. promise can be rejected with os.file.error in case of any error, in particular if the file is closed. write() write bytes from a buffer to this file. note that, by default, this function may perform several i/o operations to ensure that the buffer is fully written. an example is seen here. promise<number> write( in arraybufferview source [optional] in ob...
Implementing controls using the Gamepad API - Game development
ous frame to the buttonscache array and takes fresh ones from the gamepadapi.controller object. then it loops through buttons and axes to get their actual states and values. detecting button presses the buttonpressed() method is also placed in the main game loop to listen for button presses. it takes two parameters — the button we want to listen to and the (optional) way to tell the game that
holding the button is accepted. without it you'd have to release the button and press it again to have the desired effect. buttonpressed: function(button, hold) { var newpress = false; // loop through pressed buttons for(var i=0,s=gamepadapi.buttonsstatus.length; i<s; i++) { // if we found the button we're looking for... if(gamepadapi.buttonsstatus[i] == button) { // set the boolean ...
...ewpress; }, there are two types of action to consider for a button: a single press and a hold. the newpress boolean variable will indicate whether there's a new 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. if we find it there it means that the button is being held, so there's no new press. in the end the newpress variable is returned. the buttonpressed function is used in the update loop of the game like this: if(gamepadapi.turbo) { if(gamepadapi.buttonpressed('a','hold')) { this.turbo_fire();...
...eturned. the buttonpressed function is used in the update loop of the game like this: if(gamepadapi.turbo) { if(gamepadapi.buttonpressed('a','hold')) { this.turbo_fire(); } if(gamepadapi.buttonpressed('b')) { this.managepause(); } } if gamepadapi.turbo is true and the given buttons are pressed (or held), we execute the proper functions assigned to them. 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. gamepads can get dusty from lying around inactive, meaning that checking for exact -1 or 1 values can be a problem. for this reason, it can be good to se...
HTML parser threading
enizermutex 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. the tree op queue is flushed to the main thread from time to time. there's a timer that calls timerflush() (which takes mtokenizermutex). tree ops from the queue in the tree builder are moved to a tree op stage (nshtml5treeopstage). the 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 n...
...zer return immediately when such an op is generated.) thus, a tree op that may cause the parser to block can only occur as the last op in a queue that runflushloop sees. preparing the parser thread for script execution when the parser thread sees that it has generated a tree op that attempts to execute a (non-async, non-defer) script, it starts speculating. it acquires mspeculationmutex and while
holding it, it creates a new speculation and adds it to the queue of speculations, flushes the tree ops to the main thread, marks the nshtml5streamparser as being in a speculating state and sets the newly created speculation object as the tree op sink (instead of the tree op stage described earlier) of the tree builder. the speculation object has a queue of tree ops (into which the tree builder will now ...
...e() tokenizer was not a carriage return, if the document.write() tokenizer is in the "data" state and if the tree builder state snapshot on the speculation matches the state of the document.write() tree builder, the speculation has succeeded. otherwise it has failed. if there is more than one speculation in the queue and if the speculation is successful, we can dequeue the first speculation while
holding mspeculationmutex without bothering the parser thread. in this case, the tree ops from the speculation are flushed into the tree op executor and continueafterscripts() returns early. (nshtml5treeopexecutor::runflushloop is on the call stack already in this case and will loop around to start flushing the ops right away.) if there's only one speculation or the speculation failed, it's necessary to ...
Addon
an true or false depending on whether the add-on is compatible with the current application version and platform version. isplatformcompatible read only boolean true or false depending on whether the add-on is compatible with the current operating system. name read only string the name of the add-on. pendingoperations read only integer a bitfield
holding all of the current operations that are waiting to be performed for this add-on. operations are generally deferred when a restart is necessary to accomplish them. permissions read only integer a bitfield
holding all the the operations that can be performed on this add-on. operations my be restricted based on system policies (e.g., the system administrator may not allow certain add-...
... your add-on as a parameter. applybackgroundupdates integer indicates whether updates found in the background for this add-on will be applied automatically. see auto update values. the user is provided a ui for this in the add-ons manager and it's the add-on provider's responsibility to remember its selection. contributors read only addonauthor[] an array of strings
holding the contributors of the add-on. description read only string the description of the add-on. developers read only addonauthor[] an array of strings
holding the developers of the add-on. homepageurl read only string the homepage url of the add-on. iconurl read only string the url of the icon that represents this add-on. instal...
...d-on that has not yet been downloaded, this may be an estimated value. sourceuri read only nsiuri the uri that this add-on was installed from. syncguid read only string string guid to identify the add-on in sync. the guid is generated randomly and is made consistent across devices during sync. translators read only addonauthor[] an array of strings
holding the translators of the add-on. updatedate read only date the date that the add-on was most recently updated. operationsrequiringrestart read only integer a bitfield
holding all of the operations that will require a restart to complete for this add-on. fulldescription read only string developercomments read only string eu...
Investigating leaks using DMD heap scan mode
xpcom_mem_bloat_log=1: this reports a list of the counts of every object created and destroyed and tracked by the xpcom leak tracking system. from this chart, you can see how many objects of a particular type were leaked through shutdown. this can come in handy during the manual analysis phase later, to get evidence to support your hunches. for instance, if you think that an nsfoo object might be
holding your leaking object alive, you can use this to easily see if we leaked an nsfoo object. moz_cc_log_shutdown=1: this generates a cycle collector log during shutdown. creating this log during shutdown is nice because there are less things unrelated to the leak in the log, and various cycle collector optimizations are disabled. a garbage collector log will also be created, which you may not need. ...
...ottom. it tells us that there is 1 unknown edge, and 2 known edges. what this means is that the leaking object has a refcount of 3, but the cycle collector was only told about these two references. in this case, a head element and a js object (the js reflector of the script element). we need to figure out what the unknown reference is from, as that is where our leak really is. figure out what is
holding the leaking object alive. now we need to use the dmd heap scan logs. these contain the contents of every live block of memory. the first step to using the dmd heap scan logs is to do some pre-processing for the dmd log. stacks need to be symbolicated, and we need to clamp the values contained in the heap. clamping is the same kind of analysis that a conservative gc does: if a word-aligned value...
...nt 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. ...
XPCOM array guide
reference counted, weak/strong nsimutablearray xpcom object yes no yes no reference counted, weak/strong nscomarray<t> xpcom object no yes yes* no reference counted, strong nstarray<t> any that has a default constructor and copy constructor no yes yes* no can hold objects directly, in which case it owns them. when
holding pointers, doesn't own the pointer. nsautotarray<t,n> any that has a default constructor and copy constructor no yes yes* yes can hold objects directly, in which case it owns them. when
holding pointers, doesn't own the pointer. nsisupportsarray xpcom object yes no yes* no reference counted, strong (*) note: concrete c++ arrays can be ma...
...veobjectsat() method to nscomarray<t>. this lets you delete multiple objects from the array at once by specifying the index to the first item to delete as well as the number of items to delete. for example, to remove three objects, starting at the third object in the array (that is, the object with index value 2): myarray.removeobjectsat(2, 3); nstarray<t> nstarray<t> is a typesafe array for
holding various objects. it can be used to hold objects directly, not just pointers to objects. usage it is most often used as a member of a c++ class to store a list of well-typed objects. it is also usually declared as an inline member rather than a pointer. for example, here is its use in a class: class medialist { public: void addmedium(const nsstring& amedium); private: nstarray<nsstring> m...
...an be used along with nsiutf8stringenumerator and nstarray<nscstring>. this first example demonstrates the case where a class which owns an nstarray<nsstring>, and are returns an nsistringenumerator to a caller. you can use the variation of ns_newstringenumerator that ensures the owner of the array outlives the enumerator. this is necessary because nsstringarray is not reference counted. without
holding a reference to the owner, the enumerator could be left with a dangling pointer to a deleted nstarray<nsstring>. class nsfoo : nsifoo { ... private: nstarray<nsstring> melementnames; }; nsfoo::getelementnames(nsistringenumerator** aresult) { // pass in "this" to make sure the enumerator // holds a reference to "this" return ns_newstringenumerator(aresult, melementnames, this); } one va...
Weak reference
in xpcom, a weak reference is a special object that contains a pointer to an xpcom object, but doesnot keep that object alive. if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull. why do i need this? when you hold an owning reference on an object (i.e., you have addrefed it), you are
holding that object in existence for the duration of your reference. this isn't always appropriate, and can lead to trouble. if, for instance, this owning reference is part of a cycle of owning references (e.g., if the referenced object also holds a owning reference back to you), then none of the objects in the cycle can be reclaimed without taking special measures. there are less severe situations. a naive design for an observer/observable ...
...t's easy to get a weak reference... nsweakptr weakptr = do_getweakreference(afooptr); // ... { // ...but to use my weak reference, i'll need a (short-lived) owning reference nscomptr<nsifoo> tempfooptr = do_queryreferent(weakptr); if ( tempfooptr ) tempfooptr->somefoomethod(...); // else, the `real' object has gone away } in a real world example, however, you are more likely to be
holding a weak reference in a member variable. in the following example, an nsobservable must keep some kind of a reference to each observer, in order to report events. the nsobservable doesn't want to keep the observers alive just to prevent a dangling pointer, however. so, instead of
holding an owning reference to an nsiobserver, it holds a weak reference. the weak reference doesn't artificially extend...
...ould write an implementation for you (if we modified it), or you could write one by hand as i discuss below. there are other, mostly negligible, costs: it's an extra indirection per call, and the easy implementation requires adding an extra pointer per interface to the target implementation. why can't i just queryinterface between the pair? it really feels like the nsiweakreference that you are
holding is just another interface on the target object. it seems reasonable to want to simply queryinterface between the two. why these extra calls: getweakreference and queryreferent? this would be possible if the weak reference was actually aggregated to the target object. the problem here is queryinterface. queryinterface must satisfy many requirements to allow com to work. among these requirements i...
Index - Web APIs
roperty returns a bluetoothcharacteristicproperties instance containing the properties of this characteristic. 326 bluetoothremotegattcharacteristic.readvalue() api, bluetooth, bluetoothremotegattcharacteristic, experimental, property, reference, web bluetooth api, readvalue the bluetoothremotegattcharacteristic.readvalue() method returns a promise that resolves to a dataview
holding a duplicate of the value property if it is available and supported. otherwise it throws an error. 327 bluetoothremotegattcharacteristic.service api, bluetooth, bluetoothremotegattcharacteristic, experimental, property, reference, service, web bluetooth api the bluetoothremotegattcharacteristic.service read-only property returns the bluetoothgattservice this characteristic bel...
...egattdescriptor.characteristic read-only property returns the bluetoothremotegattcharacteristic this descriptor belongs to. 335 readvalue() api, bluetooth, bluetoothgattdescriptor, bluetoothremotegattdescriptor, experimental, method, reference, web bluetooth api, readvalue() the bluetoothremotegattdescriptor.readvalue() method returns a promise that resolves to an arraybuffer
holding a duplicate of the value property if it is available and supported. otherwise it throws an error. 336 uuid api, bluetooth, bluetoothremotegattdescriptor, experimental, property, reference, web bluetooth api, uuid the bluetoothremotegattdescriptor.uuid read-only property returns the uuid of the characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for ...
...pi, ar, augmented reality, experimental, property, reference, vr, virtual reality, webxr, webxr device api, xrinputsession, gripspace the xrinputsource.gripspace read-only property of the xrinputsource interface returns an xrspace whose native origin tracks the pose that should be used to render virtual objects such that they appear to be held in the user's hand. for example, if a user were
holding a virtual straight rod, the native origin of this xrspace would be the approximate center of the user's curled fingers. 5251 xrpose the xrpose is a webxr api interface that represents position and orientation in a 3d space relative to an xrspace. 5252 xrpose.emulatedposition the emulatedposition readonly attribute of xrpose is a boolean that repressents...
KeyboardEvent.key - Web APIs
g.removechild(child); child = consolelog.firstchild; } }); result note: on browsers that don't fully implement the inputevent interface which is used for the beforeinput and input events, you may get incorrect output on those lines of the log output. case 1 when the shift key is pressed, a keydown event is first fired, and the key property value is set to the string shift. as we keep
holding this key, the keydown event does not continue to fire repeatedly because it does not produce a character key. when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key. the beforeinput and input events are fired nex...
... key 2, a keyup event is fired and the key property will maintain the string values @ and " for the different keyboard layouts respectively. as we finally release the shift key, another keyup event is fired for it, and the key attribute value remains shift. case 2 when the shift key is pressed, a keydown event is first fired, and the key property value is set to be the string shift. as we keep
holding this key, the keydown event does not continue to fire repeatedly because it produced no character key. when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to be the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key. the beforeinput and inputbeforeinput and input eve...
... it produced no character key. when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to be the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key. the beforeinput and inputbeforeinput and input events are fired next because a character key has been produced. as we keep
holding the key, the keydown event continues to fire repeatedly and the keyboardevent.repeat property is set to true. the beforeinput and input events are fired repeatedly as well. as we release the shift key, a keyup event is fired for it, and the key attribute value remains shift. at this point, notice that the key property value for the repeating keydown event of the key 2 key press is now "2" becaus...
Responsive images - Learn web development
runk down, making the person in the image very small and hard to see. it would probably be better to show a smaller, portrait image on mobile, which zooms in on the person. the <picture> element allows us to implement just this kind of solution. returning to our original not-responsive.html example, we have an image that badly needs art direction: <img src="elva-800w.jpg" alt="chris standing up
holding his daughter elva"> let's fix this, with <picture>! like <video> and <audio>, the <picture> element is a wrapper containing several <source> elements that provide different sources for the browser to choose from, followed by the all-important <img> element. the code in responsive.html looks like so: <picture> <source media="(max-width: 799px)" srcset="elva-480w-close-portrait.jpg"> <source ...
... is a wrapper containing several <source> elements that provide different sources for the browser to choose from, followed by the all-important <img> element. the code in responsive.html looks like so: <picture> <source media="(max-width: 799px)" srcset="elva-480w-close-portrait.jpg"> <source media="(min-width: 800px)" srcset="elva-800w.jpg"> <img src="elva-800w.jpg" alt="chris standing up
holding his daughter elva"> </picture> the <source> elements include a media attribute that contains a media condition — as with the first srcset example, these conditions are tests that decide which image is shown — the first one that returns true will be displayed. in this case, if the viewport width is 799px wide or less, the first <source> element's image will be displayed. if the viewport wi...
NSS 3.18.1 release notes
it in the mozilla.dev.security.policy forum. cn = e-guven kok elektronik sertifika hizmet saglayicisi sha1 fingerprint: dd:e1:d2:a9:01:80:2e:1d:87:5e:84:b3:80:7e:4b:b1:fd:99:41:34 the following intermediate ca certificate has been added as actively distrusted because it was misused to issue certificates for domain names the holder did not own or control. ...
...ev.security.policy forum. cn = e-guven kok elektronik sertifika hizmet saglayicisi sha1 fingerprint: dd:e1:d2:a9:01:80:2e:1d:87:5e:84:b3:80:7e:4b:b1:fd:99:41:34 the following intermediate ca certificate has been added as actively distrusted because it was misused to issue certificates for domain names the holder did not own or control. ...
Invariants
ee js_threadsafe. "are we in a request on cx?", where cx is any variable of type jscontext *, is a static yes for most lines of code where such a variable exists. occasionally it's a static no; other times we don't care. almost all jsapi callbacks provide a request; that is, when we call a callback with a cx argument, 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 locked, and which one, is static information for almost every line of code. the locking scheme is described under jsobjectops.dropproperty. (note that the locking scheme applies to all objects and talks about properties being locked. as implemented for native objects, the locking is not really that fine-grained, but that is a transparent optimization as long as we follow the rules.) a thread
holding a property lock never leaves or suspends the current request. with a few exceptions (known to brendan and probably jst and mrbkap), we never call a jsapi callback with a property locked. (that would risk deadlock too.) name instructions the first operand to a jsop_setname instruction is always produced by a preceding jsop_bindname instruction. (taken together, ecma 262-3 §11.13.1 and ecma 26...
Tracing JIT
interprets a backward-jump bytecode, the monitor makes note of the number of times the jump-target program-counter (pc) value has been jumped-to. this number is called the hit count for the pc. if the hit count of a particular pc reaches a threshold value, the target is considered hot. when the monitor decides a target pc is hot, it looks in a hashtable of fragments to see if there is a fragment
holding native code for that target pc. if it finds such a fragment, it transitions to executing mode. otherwise it transitions to recording mode. recording when the trace monitor enters recording mode, it constructs a new trace recorder, of type tracerecorder. it then passes control back to the spidermonkey interpreter. the interpreter continues interpreting bytecode, but with an important difference:...
...denotes a special case of bailing: when a trace calls a native spidermonkey c function that gets part-way through executing and then forces a trace-exit (possibly due to a nested c function depending on not-yet-flushed state in the trace). a deep bail is special only insofar as it requires flushing the full set of deferred writes in the trace if it occurs (and further, requires that all registers
holding temporary trace operands have flushed to the native stack before execution). bailing from a regular guard involves executing precise per-guard write-flushing code, as the guard encodes a specific failed condition on a specific set of operands, and so the exit code can be much more fine-grained about and reconstructing the pre-bail state. a deep bail must be conservative because it is forced by th...
nsICachingChannel
urn 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 this channel.
holding a reference to this key does not prevent the cached data from being removed. a cache key retrieved from a particular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible and provided the new channel instance was created with the same uri. the implementation of nsicachingchannel would be expected to use the cache...
...expected to use the cache entry identified by the cache token. depending on the value of nsirequest.loadflags(), the cache entry may be validated, overwritten, or simply read. the cache key may be null indicating that the uri of the channel is sufficient to locate the same cache entry. setting a null cache key is likewise valid. cachetoken nsisupports uniquely identifies the data in the cache.
holding a reference to this token prevents the cached data from being removed. a cache token retrieved from a particular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible. the implementation of nsicachingchannel would be expected to only read from the cache entry identified by the cache token and not try to validate ...
nsIChannel
is null, the channel implementation may use the notification callbacks from its load group. the channel may also query the notification callbacks from its load group if its notification callbacks do not supply the requested interface. interfaces commonly requested include: nsiprogresseventsink, nsiprompt, and nsiauthprompt / nsiauthprompt2. when the channel is done, it must not continue
holding references to this object. note: a channel implementation should take care when "caching" an interface pointer queried from its notification callbacks. if the notification callbacks are changed, then a cached interface pointer may become invalid and may therefore need to be re-queried. originaluri nsiuri the original uri used to construct the channel. this is used in the c...
...(referring uri), which is typically the page that contained the original uri (accessible from nsihttpchannel.) owner nsisupports the owner, corresponding to the entity that is responsible for this channel. used by the security manager to grant or deny privileges to mobile code loaded from this channel. note: this is a strong reference to the owner, so if the owner is also
holding a strong reference to the channel, care must be taken to explicitly drop its reference to the channel. securityinfo nsisupports transport-level security information (if any, else null) corresponding to the channel, normally presented through the interfaces nsitransportsecurityinfo and nsisslstatusprovider read only. uri nsiuri the uri corresponding to the channel. it...
nsIClipboardDragDropHooks
s the flavors or data presented to the os. used for drag and copy actions. because this can be called many times, it is highly recommended that the implementation be very efficient so user feedback is not negatively impacted. boolean oncopyordrag( in nsidomevent aevent, in nsitransferable trans ); parameters aevent the dom event (drag drop). null if triggered by copy. trans the transferable
holding the list of flavors and the data for each flavor. return value true to indicate that copy/drag can proceed. otherwise, false to indicate that the copy/drag is canceled, does not go to operating system. onpasteordrop() provide an alternative action to the built-in behavior when something is dropped on the browser or in an editor. boolean onpasteordrop( in nsidomevent event, in nsitransferable...
...d. otherwise, false to indicate that the copy/drag is canceled, does not go to operating system. onpasteordrop() provide an alternative action to the built-in behavior when something is dropped on the browser or in an editor. boolean onpasteordrop( in nsidomevent event, in nsitransferable trans ); parameters event the dom event (drag drop); null if triggered by paste. trans the transferable
holding the list of flavors and the data for each flavor. return value true to indicate the action was handled, do not perform built-in behavior. otherwise, false to indicate the action was not overridden, do built-in behavior. see also nsiclipboard ...
Reference Manual
erefore, no vtable or vptr. because a few key routines are factored out into a common non-template base class, the actual underlying pointer is stored as an nsisupports* (except in debug builds where nscap_feature_debug_ptr_types is turned on). it is because of these factored routines that nscomptr users must link with the xpcom library. when nscap_feature_debug_ptr_types is turned on, instead of
holding its underlying pointer in a variable of type nsisupports*, the nscomptr holds it in a pointer matching the underlying type. this allows source level debuggers to more easily "follow" the pointer. however, the routines that would normally be factored into a base class now must become template-specific inlines. there is no factored base class. this implies that the entire application must be compil...
...ryreferent exists to facilitate weak references based on nsiweakreference. an nsiweakreference is an xpcom object that acts as a proxy for another object. the nsiweakreference and this other object have a special relationship. they know about each other, but neither holds an owning reference to the other. the two objects cooperate to ensure that neither ever holds a dangling pointer to the other.
holding an owning reference on the nsiweakreference object allows you to get to this other object when you need to, but does not require it to go on living, just for you. to get to the object, you ask the nsiweakreference object to queryinterface it on your behalf. if the object still exists and supports the requested interface, you will (hopefully, temporarily) hold an owning reference to it. ...
Inputs and input sources - Web APIs
input source's gamepad object. this object provides access to all of the buttons, axes, trackpads, and so forth that may be a part of the controller. see advanced controllers using the gamepad object to learn how to use these controllers. properties of input sources each individual xrinputsource has a set of properties 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 variou...
...indicate that the squeeze action is no longer underway. this is sent whether the squeeze action succeeded or not. two common uses for the primary squeeze action are to grasp and/or pick up objects in the 3d world and to squeeze a trigger to fire a weapon in a game or simulation. example this sample code shows a set of squeeze event handlers that implement these events to manage picking up and
holding objects from the scene. the code presumes the existence of an avatar object representing the character, as used in several other eamples on this page, as well as the pickupobject() and dropobject() functions, which handle transferring an object from the world to a particular hand and releasing an object from the hand and placing it back into the world. picking up an object: handling squeezestart...
Web Locks API - Web APIs
otentially shared resource, identified by a name chosen by the web app. for example, if a web app running in multiple tabs wants to ensure that only one tab is syncing data between the network and indexed db, each tab could try to acquire a "my_net_db_sync" lock, but only one tab will succeed (the leader 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 queue...
...ed 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 = rej; }); // request the lock: navigator.locks.request('my_resource', lock => { // lock is acquired. return p; // now lock will be held until either resolve() ...
Using templates and slots - Web Components
an> <span slot="description">a placeholder inside a web component that users can fill with their own markup, with the effect of composing different dom trees together.</span> <dl slot="attributes"> <dt>name</dt> <dd>the name of the slot.</dd> </dl> </element-details> <element-details> <span slot="element-name">template</span> <span slot="description">a mechanism for
holding client- side content that is not to be rendered when a page is loaded but may subsequently be instantiated during runtime using javascript.</span> </element-details> about that snippet, notice these points: the snippet has two instances of <element-details> elements which both use the slot attribute to reference the named slots "element-name" and "description" we put in the <elem...
... inside a web component that users can fill with their own markup, with the effect of composing different dom trees together.</span> <dl slot="attributes"> <dt>name</dt> <dd>the name of the slot.</dd> </dl> </element-details> <element-details> <span slot="element-name">template</span> <span slot="description">a mechanism for
holding client- side content that is not to be rendered when a page is loaded but may subsequently be instantiated during runtime using javascript.</span> </element-details> <script> customelements.define('element-details', class extends htmlelement { constructor() { super(); const template = document .getelementbyid('elem...
package.json - Archive of obsolete content
provided in this add-on. defaults to "lib". note: this is deprecated along with cfx and is not available when using jpm. license the name of the license under which the add-on is distributed, with an optional url in parentheses. defaults to "mpl-2.0". note: it is recommended that you use an spdx license id. locales an object
holding json objects referenced by a locale name that use the following keys: title, description and homepage. these json objects will be used to localizations for the add-on's meta data shown within the add-ons manager. see the documentation for how to localize the add-on's meta data. main a string representing the name of a program module that is located in one of the top-leve...
Miscellaneous - Archive of obsolete content
a. this is the scrolling area. </div> <script type="text/javascript"> var elm = document.getelementbyid("scrollarea"); elm.addeventlistener("dommousescroll", function scroll(event){ //event.detail is positive for a downward scroll, negative for an upward scroll alert("scrolling " + event.detail + " lines"); }, false); </script> if you do not receive a dommousescroll event while
holding any of the modifier keys (ctrl,shift,alt,meta) you should check the mousewheel.withcontrolkey.action and related preferences. the meaning of the action preference is shown in the following table mousewheel.withxxxkey.action result 0 scroll by lines. if set, you will receive dommousescroll events. 1 scroll by page. 2 move around in the history. if s...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
ry". a browser element with this declaration is treated as a special browser among other xul documents, such that the window object displaying its web page can be accessed using the window.content property. in firefox itself, the content region of the active tab is declared as a browser element with type="content-primary". keyboard shortcuts to implement keyboard shortcuts (pressing a key while
holding down modifier keys like control or shift.) in a dhtml-based interface, you need a script that will intercept keyboard inputs. in xul, you can define keyboard shortcuts simply by using the key element, as shown in listing 19. <key id="key-save" key="s" modifiers="accel,shift" oncommand="save();"/> <key id="key-scroll-up" keycode="vk_page_up" oncommand="advancefocus(-1);"/> listing 19: defining...
Adding Events and Commands - Archive of obsolete content
drag and drop is a complicated thing to manage, there are some high level wrappers that facilitate working with it. also keep in mind that there are 2 drag and drop apis, the newest (and preferred) one introduced in firefox 3.5. event handlers can take an event argument, which is an event object that holds information on the event. you can get information on key modifiers (in case the user was
holding a modifier key like alt while performing the event), screen coordinates for mouse events, and most importantly, the target element for the event. for example: <button label="&xulschoolhello.defaultgreeting.label;" oncommand="xulschoolchrome.browseroverlay.changegreeting(event);" /> then on the javascript code you would have something like this: changegreeting : function(aevent) { // more ...
Intercepting Page Loads - Archive of obsolete content
cation.spec to get the url and match it against a regular expression. the request object arequest holds the request being processed, and you can run arequest.cancel(ns_binding_aborted) to cancel it. awebprogress.domwindow gives you access to the window where the content was going to be loaded. sometimes you do not care about redirects, and only want to detect the final page being loaded, the one
holding the actual content. in this case, your best bet is to use onstatechange, and filter to when the state flags indicate a document has begun being loaded: if ((astateflags & components.interfaces.nsiwebprogresslistener.state_start) && (astateflags & components.interfaces.nsiwebprogresslistener.state_is_document)) note the use of the binary mask & operator. to detect if this is a frame b...
The Essentials of an Extension - Archive of obsolete content
hello en-us locale/ this way we can have separate skins for windows, mac os x, and linux (plus other unix-like systems), each defined in a separate directory. since most other systems are unix-based, the "unix" skin is the default, with no flags. the chrome as mentioned earlier, the chrome is composed of 3 sections: content, locale and skin. the content is the most important section,
holding user interface (xul) and script (js) files. the skin section has the files that define most of the look and feel of the ui (using css and images, just like web pages). finally, the locale section holds all text used in the extension, in dtd and properties files. this division allows other developers to create themes that replace skins, and translators to create localizations in different language...
Tabbed browser - Archive of obsolete content
} } /*end do not edit here*/ /*start - do all your edits below here*/ var url = ohttp.uri.spec; //can get url without needing loadcontext if (loadcontext) { var contentwindow = loadcontext.associatedwindow; //this is the html window of the page that just loaded //adomwindow this is the firefox window
holding the tab var adomwindow = contentwindow.top.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsiwebnavigation).queryinterface(ci.nsidocshelltreeitem).roottreeitem.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidomwindow); var gbrowser = adomwindow.gbrowser; //this is the gbrowser object of the firefox window this tab is in var at...
Index - Archive of obsolete content
s. a row of tabs is displayed at the top of tabbox which may be used to switch between each page. the tabbox should contain two children, the first a tabs element which contains the tabs and the second a tabpanels element which contains the contents of the pages. 1915 tabbrowser element, mozilla, reference, xul, xul elements, xul reference, tabbrowser this element is used for
holding a set of read-only views of web documents. it is similar to the browser element, except that multiple documents can be displayed, each in a separate tab. 1916 tabpanel xul elements, xul reference a individual panel in a tabpanels element. this element is optional and you may just use any other container in place of it. 1917 tabpanels xul elements, xul reference...
MMgc - Archive of obsolete content
m) 97% [mem] unmanaged bytes 7 (28k) 53% [mem] -------- gross stats end ----- numbers are in pages (with m and k in parens). private is the number of private committed pages in the process, mmgc is the amount of memory gcheap has asked for from the os (not including jit). fixedmalloc vs. gc allocations are shown in the unmanaged vs. managed split. free is the amount of memory gcheap is
holding onto that isn't in use by the mutator. other is the delta between private and mmgc, it includes things like system malloc, stacks, loaded library data areas etc. when this is enable this information is logged everytime we log something interesting. so far something interesting means an incremental mark cycle, a sweep or a drc reap. they are logged like this: [mem] sweep(21) reclaimed 910 ...
Bookmark Keywords - Archive of obsolete content
>google bookmark site:developer.netscape.com</tt> <tt>google netscape xml support -site:netscape.com</tt> a few examples in the course of writing this article, a number of potentially useful bookmarks were considered as possible examples. instead of just throwing them away, we're providing them for you in the following table. even better, you can file them for future use by right-clicking (or
holding down the control key and clicking on the link) and filing the bookmarks using the "file bookmark..." option in the contextual menu that pops up. once that's been done, making the keymark work is a simple matter of going into the bookmark manager and adding a keyword! bookmark suggested keywords find bugzilla entry bug, bugzilla, bz search devmo devmo, de google search google, gg dictio...
Creating a Firefox sidebar extension - Archive of obsolete content
ocale is created. it is listed in example 2. the locale includes the name and shortcut keys for the sidebar. example 2. chrome/locale/emptysidebar.dtd <!entity emptysidebar.title "emptysidebar"> <!entity openemptysidebar.commandkey "e"> <!entity openemptysidebar.modifierskey "shift accel"> the content folder includes our sidebar, the emptysidebar.xul is shown in example 3. it creates a page
holding one label. other elements can be included, please read the xul tutorials for more information. example 3. chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> <?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css" ?> <!doctype page system "chrome://emptysidebar/locale/emptysidebar.dtd"> <page id="sbemptysideb...
Drag and Drop - Archive of obsolete content
ped onto other objects. the drag and drop interface many user interfaces allow one to drag particular objects around within the interface. for example, dragging files to other directories, or dragging an icon to another window to open the document it refers to. mozilla and xul provide a number of events that can handle when the user attempts to drag objects around. a user can start dragging by
holding down the mouse button and moving the mouse. the drag stops when the user releases the mouse. event handlers are called when the user starts and ends dragging, and at various points in-between. mozilla implements dragging by using a drag session. when a user requests to drag something that can be dragged, a drag session should be started. the drag session handles updating the mouse cursor and whe...
tree.onselect - Archive of obsolete content
« xul reference home onselect type: script code this event is sent to a tree when a row is selected, or whenever the selection changes. the user can select multiple rows by
holding down shift or control and clicking on a row. the onselect event will be sent for each item added to or removed from the selection. see the tree selection page on the tutorial for more information. ...
XUL Events - Archive of obsolete content
this event is sent when the mouse pointer moves away from an element during a drag. it is also called after a drop on an element. it is similar to the mouseout event but occurs during a drag. attribute: ondragexit draggesture this event is sent when the user starts dragging the element, usually by
holding down the mouse button and moving the mouse. attribute: ondraggesture dragover related to the mousemove event, this event is sent while something is being dragged over an element. the handler should indicate whether the object being dragged can be dropped. attribute: ondragover ...
Index - Archive of obsolete content
s. a row of tabs is displayed at the top of tabbox which may be used to switch between each page. the tabbox should contain two children, the first a tabs element which contains the tabs and the second a tabpanels element which contains the contents of the pages. 1184 tabbrowser element, mozilla, reference, xul, xul elements, xul reference, tabbrowser this element is used for
holding a set of read-only views of web documents. it is similar to the browser element, except that multiple documents can be displayed, each in a separate tab. 1185 tabpanel xul elements, xul reference a individual panel in a tabpanels element. this element is optional and you may just use any other container in place of it. 1186 tabpanels xul elements, xul reference...
ContextMenus - Archive of obsolete content
which the menu was opened. a typical usage is for the user to right-click on an element to display a menu of commands pertaining to what was clicked on. context menu events there are various ways in which a context menu can be opened. the most common is by clicking on an element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either
holding down the mouse button or by pressing the control key and clicking the mouse button. on windows, the context menu can also be opened by pressing the menu key on the keyboard (the key on many keyboards next to control with a menu image) or by pressing shift+f10. you should not assume that a user has used the mouse to open a context menu. when using the mouse to open a context menu, the context is ...
OpenClose - Archive of obsolete content
the keyboard can be used to navigate and select items as usual. popups attached using the context attribute are opened when the user performs an action that attempts to open a context menu. this action will vary on each platform, but it general it involves clicking on the element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either
holding down the mouse button or by pressing the control key and clicking the mouse button. on windows, the context menu can also be opened by pressing the menu key on the keyboard (the key on many keyboards next to control with a menu image) or by pressing shift+f10. for this reason, you should not assume that a user has used the mouse to open the context menu. the openpopup method regardless of the t...
itemCount - Archive of obsolete content
« xul reference itemcount type: integer read only property
holding the number of child items. example var bucket = document.getelementbyid("attachmentbucket"); if(bucket.itemcount == 0) { dump("\n\n no attachments \n\n"); } else { dump("\n\n attachment exists \n\n"); } ...
Broadcasters and Observers - Archive of obsolete content
tion and have all the elements that issue the back action disable themselves. we can use the attribute forwarding of commands to accomplish this. broadcasters there is a similar element called a broadcaster. broadcasters support attribute forwarding in the same way that commands do. they work the same as commands except that a command is used for actions, while a broadcaster is instead used for
holding state information. for example, a command would be used for an action such as back, cut or delete. a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not. in the former case, menu items and toolbar buttons would need to be disabled when there was no page to go back to, or no text to cut or delete. in the latter case, various user interface element...
Keyboard Shortcuts - Archive of obsolete content
shortcuts on the user's platform. usually, this would be the value you would use. access the user must press the special access key. the key used for access keys on the user's platform. your keyboard won't necessarily have all of the keys, in which case they will be mapped to modifier keys that you do have. the key element must be placed inside a keyset element. this element is designed for
holding a set of key elements, which serves to group all of the key definitions in one place in a file. any key elements outside of a keyset element will not work. each platform generally uses a different key for keyboard shortcuts. for example, windows uses the control key and the macintosh uses the command key. it would be inconvenient to define separate key elements for each platform. luckily, there ...
Stacks and Decks - Archive of obsolete content
, but they have additional features. in fact, many components can contain other elements. we've already seen that buttons may contain other things besides the default. a scroll bar is just a special type of box that creates its own elements if you don't provide them. it also handles the moving of the scroll bar thumb. in the next few sections, we'll introduce some elements that are designed for
holding other elements. they are all special types of boxes and allow all of the attributes of boxes on them. stacks the stack element is a simple box. it works like any other box but has the special property that its children are laid out all on top of each other. the first child of the stack is drawn underneath, the second child is drawn next, followed by the third and so on. any number of elements m...
Trees - Archive of obsolete content
ent. you can set the text for the cell using the label attribute. the first treecell in a row determines the content that will appear in the first column, the second treecell determines the content that will appear in the second column, and so on. the user can select the treeitems by clicking on them with the mouse, or by highlighting them with the keyboard. the user can select multiple items by
holding down the shift or control keys and clicking additional rows. to disable multiple selection, place a seltype attribute on the tree, set to the value single. with this, the user may only select a single row at a time. add a tree to our find files example let's add a tree to the find files window where the results of the search would be displayed. the tree will use a content tree view. the follow...
XPCOM Interfaces - Archive of obsolete content
tory part. filesize the size of the file. isdirectory() returns true if the nsilocalfile represents a directory. remove(recursive) deletes a file. if the recursive parameter is true, a directory and all of its files and subdirectories will also be deleted. copyto(directory,newname) copies a file to another directory, optionally renaming the file. the directory should be a nsilocalfile
holding the directory to copy the file to. moveto(directory,newname) moves a file to another directory, or renames a file. the directory should be a nsilocalfile
holding the directory to move the file to. in order to delete a file we first need to assign a file to the nsilocalfile. we can call the method initwithpath() to indicate which file we mean. just assign the path of the file to this property...
The Implementation of the Application Object Model - Archive of obsolete content
ented as a set of objects that can be accessed and manipulated. this is referred to as the dom (document object model). in a similar fashion, xul's content tree for a single window is represented as a set of objects that can be accessed and manipulated. this is referred to as the aom (application object model). how are xml dom/aom trees represented in nglayout? nglayout has its own objects for
holding content trees. nsxmlelement is used to represent a single node in a content tree for an xml language. in the absence of any modifications to xul, etc., this is what would be used by default to hold the tree for a remote xul file. this nsxmlelement implements a whole slew of interfaces, since raptor has multiple apis for referring to these objects. examples of these interfaces include nsidomelemen...
listbox - Archive of obsolete content
currentitem type: listitem element returns the currently focused item in the list box, which is only useful in a multiple selection list box. disabled type: boolean gets and sets the value of the disabled attribute. disablekeynavigation type: boolean gets or sets the value of the disablekeynavigation attribute. itemcount type: integer read only property
holding the number of child items. listboxobject type: nsilistboxobject the nsilistboxobject behind the list box. this property is read-only. most of the features of the list box are already available directly in the listbox, so you will rarely have need to use this box object directly. selectedcount type: integer returns the number of items that are currently selected. ...
menu - Archive of obsolete content
ibute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu. itemcount type: integer read only property
holding the number of child items. menupopup type: menupopup element a reference to the menupopup used by the menu or menulist. this property is read-only. open type: boolean this property will be set to true when the menu is open. the menu may be opened by setting the open property to true and closed by setting it to false. parentcontainer type: menu element read on...
menulist - Archive of obsolete content
ype: nsieditor a reference to the nsieditor for editable text. this property is read only. image type: image url the image associated with the currently selected item. inputfield type: textbox element a reference to the textbox element used for editable menu lists. this property is read only and applies to editable menulists only. itemcount type: integer read only property
holding the number of child items. label type: string gets and sets the value of the label attribute. menuboxobject type: nsimenuboxobject a reference to the nsimenuboxobject which implements the menu. menupopup type: menupopup element a reference to the menupopup used by the menu or menulist. this property is read-only. open type: boolean gets ...
radiogroup - Archive of obsolete content
e of accessibility object for the element. disabled type: boolean gets and sets the value of the disabled attribute. focuseditem type: radio element holds the currently focused item in the radiogroup, which may or may not be the same as the selected item. you can change the focused item by setting this property. itemcount type: integer read only property
holding the number of child items. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds the currently selected item. if no item is curre...
richlistbox - Archive of obsolete content
rrentitem type: listitem element returns the currently focused item in the list box, which is only useful in a multiple selection list box. disabled type: boolean gets and sets the value of the disabled attribute. disablekeynavigation type: boolean gets or sets the value of the disablekeynavigation attribute. itemcount type: integer read only property
holding the number of child items. scrollboxobject type: nsiscrollboxobject the scroll box object implements the nsiscrollboxobject interface, which may be used to retrieve and adjust the scroll position of the list box. selectedcount type: integer returns the number of items that are currently selected. selectedindex type: integer returns the index of the currently...
tabbrowser - Archive of obsolete content
it is similar to the browser element, except that multiple documents can be displayed, each in a separate tab. note: starting in firefox 3 (xulrunner/gecko 1.9), this is only used in the main firefox window and cannot be used in other xul windows by third-party applications or extensions. ...
tabs - Archive of obsolete content
o set the text which appears in the tooltip when the user moves the mouse over the new button in the tab row. properties accessibletype type: integer a value indicating the type of accessibility object for the element. disabled type: boolean gets and sets the value of the disabled attribute. itemcount type: integer read only property
holding the number of child items. selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds the currently selected item. if no item is curre...
tree - Archive of obsolete content
columnpicker type: boolean when set to false, a drop-down will appear in the upper right corner of the tree, which the user may use to show and hide columns. when set to true, the column picker will be hidden. the default value is false. onselect type: script code this event is sent to a tree when a row is selected, or whenever the selection changes. the user can select multiple rows by
holding down shift or control and clicking on a row. the onselect event will be sent for each item added to or removed from the selection. rows type: integer the number of rows to display in the element. if the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows. to get the actual number of rows in the eleme...
NPVariant - Archive of obsolete content
variant() initialize v to a variant of type npvarianttype_bool with the value val. int32_to_npvariant() initialize v to a variant of type npvarianttype_int32 with the value val. double_to_npvariant() initialize v to a variant of type npvarianttype_double with the value val. stringz_to_npvariant() initialize v to a variant of type npvarianttype_string with the value being an npstring
holding the utf-8 string value val. stringn_to_npvariant() initialize v to a variant of type npvarianttype_string with the value being an npstring
holding the utf-8 string value val with the length len. object_to_npvariant() initialize v to a variant of type npvarianttype_object with the value val. ...
Old Proxy API - Archive of obsolete content
ot of power to users, some operations are not trapped in order to keep the language consistent: the triple equal (===) operator is not trapped. p1 === p2 if and only if p1 and p2 refer to the same proxy. fixing a proxy does not alter its object identity (the object “generated” by the handler during fixing does not have its own object identity; it retains the object identity of the proxy, up
holding the illusion that the proxy “becomes” the object). object.getprototypeof(proxy) returns the prototype with which proxy was initialized for an object proxy, and returns function.prototype for a function proxy. typeof typeof anobjectproxy === "object" typeof afunctionproxy === "function" instanceof anobjectproxy instanceof c === true if and only if the prototype with whic...
Reference - Archive of obsolete content
t(o.myfunction); //not available in object which again suggests that object is not function. wich means that object actually doesn't inherit from function , but function inherits from object which is exactly the oppisite as my first thought (see picture above). i say this because now the function is not available in object, as if the inheritance is : object->function->instance but... while also
holding in account the previous example where it was avalable in both instances when prototyping object it should be : function->object->instance or (function=object)->instance and ofcourse function == object return false ;) and the following statements also tells me that function == object although math is only an instance of object... which basicly says function != object alert(function instanceof o...
XForms Select Element - Archive of obsolete content
upported. this attribute, when set to 'open', allows the user to provide free entry to the list. possible values are open and closed, default is closed. incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select element can be bound to a node containing simple content capable of
holding a sequence. the data binding restriction to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from an xforms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select contro...
Desktop mouse and keyboard controls - Game development
ayery += 5; } else if(uppressed) { playery -= 5; } ctx.drawimage(img, playerx, playery); requestanimationframe(draw); } the draw function first clears the whole canvas — we draw everything from scratch on every single frame. then the pressed key variables are checked and the playerx and playery variables (that we define earlier just after leftpressed and the others)
holding the position of the ship are adjusted by a given amount, let's say 5 pixels. then the player's ship is drawn on the screen and the next draw is called from within the requestanimationframe. we could write our own keycode object containing the key codes, for example: var keyboardhelper = { left: 37, up: 38, right: 39, down: 40 }; that way instead of using the codes to compare the input in the h...
Unconventional controls - Game development
oller is connected to your computer we can proceed with implementing support in our little demo. first, we add a <script> tag with the url pointing at this file, and add <div id="output"></div> just before the closing </body> tag for outputting diagnostic information. we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for
holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the state of our hand's grab status. we next add these lines after all the event listeners for keyboard and mouse, but before the draw method: var todegrees = 1 / (math.pi / 180); var horizontaldegree = 0; var verticaldegree = 0; var degreethreshold = 30; var gr...
Object reference - MDN Web Docs Glossary: Definitions of Web-related terms
a link to an object. object references can be used exactly like the linked objects. the concept of object references becomes clear when assigning the same object to more than one property. rather than
holding a copy of the object, each assigned property holds object references that link to the same object, so that when the object changes all properties referring to the object reflect the change. learn more general knowledge reference (computer science) on wikipedia ...
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
js treats an object, by using them as property keys. examples of well-known symbols are: symbol.iterator for array-like objects, or symbol.search for string objects. they are listed in the specification in the well-known symbols table: symbol.hasinstance symbol.isconcatspreadable symbol.iterator symbol.toprimitive …and so on. global symbol registry there is a global symbol registry
holding all available symbols. the methods that access the registry are symbol.for() and symbol.keyfor(); these mediate between the global symbol table (or "registry") and the run-time environment. the global symbol registry is mostly built by javascript's compiler infrastructure, and the global symbol registry's content is not available to javascript's run-time infrastructure, except through these refle...
Styling links - Learn web development
are blue. visited links are purple. hovering a link makes the mouse pointer change to a little hand icon. focused links have an outline around them — you should be able to focus on the links on this page with the keyboard by pressing the tab key (on mac, you'll need to use option + tab, or enable the full keyboard access: all controls option by pressing ctrl + f7.) active links are red (try
holding down the mouse button on the link as you click it.) interestingly enough, these default styles are nearly the same as they were back in the early days of browsers in the mid-1990s. this is because users know and have come to expect this behaviour — if links were styled differently, it would confuse a lot of people. this doesn't mean that you shouldn't style links at all, just that you should ...
Other form controls - Learn web development
single value. the optional size attribute provides control over how many options are visible when the select does not have focus. multiple choice select box by default, a select box only lets the user select a single value. by adding the multiple attribute to the <select> element, you can allow users to select several values, by using the default mechanism provided by the operating system (e.g.
holding down cmd/ctrl and clicking multiple values on desktop). <select id="multi" name="multi" multiple size="2"> <optgroup label="fruits"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </optgroup> <optgroup label="vegetables"> <option>carrot</option> <option>eggplant</option> <option>potato</option> </optgroup> </select> no...
Third-party APIs - Learn web development
explain it step by step: the while loop is a common pattern used to delete all of the contents of a dom element, in this case, the <section> element. we keep checking to see if the <section> has a first child, and if it does, we remove the first child. the loop ends when <section> no longer has any children. next, we set the articles variable to equal json.response.docs — this is the array
holding all the objects that represent the articles returned by the search. this is done purely to make the following code a bit simpler. the first if() block checks to see if 10 articles are returned (the api returns up to 10 articles at a time.) if so, we display the <nav> that contains the previous 10/next 10 pagination buttons. if less than 10 articles are returned, they will all fit on one page, so...
Reviewer Checklist
. if you're writing code that uses jsapi, chances are you got it wrong. try hard to avoid doing that. privacy issues there should be no logging of urls or content from which urls may be inferred. [fennec: android services has logger.pii() for this purpose (e.g., logging profile dir)]. tag for privacy review if needed. resource leaks in java, memory leaks are largely due to singletons
holding on to caches and collections, or observers sticking around, or runnables sitting in a queue. in c++, cycle-collect as needed. if javascript can see your object, it probably needs to be cycle-collected. [fennec: if your custom view does animations, it's better to clean up runnables in ondetachfromwindow().] ensure all file handles and other closeable resources are closed appropriately. [fennec...
JNI.jsm
on starts on the position of astart in the array and sets it to the values in avalsarray. this is done by calling .set for each element with the respective value in the avalsarray. void setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); parameters astart the position to start setting elements of the array in. avalsarray a javascript array
holding the values to set. return value this function has no return value, if you try to store the return value in a variable, it will be undefined. attributes attribute type description length number the number of elements in the array demonstration var my_jenv = null; try { my_jenv = jni.getforthread(); var sig = { string: 'ljava/lang/string;'...
OS.File.Info
filesystems) lastaccessdate the date at which the file was last accessed, as a javascript date object. note that the definition of last access may depend on the underlying operating system and file system. lastmodificationdate the date at which the file was last modified, as a javascript date object. platform-specific attributes unix unixowner a number
holding the identifier of the unix owner of this file. unixgroup a number
holding the identifier of the unix group of this file. unixmode a number
holding the unix access rights to this file. unixlaststatuschangedate date. this is the date of the latest write/renaming/mode change/... where ... is any write/set of inode information (such as owner, group, link count, mod...
Promise
his, at present, is implemented by randomizing the property name, for the lack of more sophisticated language or debugger support). these code-inaccessible, inspectable properties are: {{private:status}}: 0 for pending, 1 for fulfilled, or 2 for rejected. {{private:value}}: fulfillment value or rejection reason, for fulfilled or rejected promises only. {{private:handlers}}: array of objects
holding references to functions registered by the then() method, for pending promises only. examples see the examples page. handling errors and common pitfalls you should report unhandled errors, unless you're handing off the promise to a caller or another code path that will handle the error. // ###### wrong: silently drops any rejection notified by "os.file.exists". os.file.exists(path).then(ex...
PromiseWorker.jsm
ead of copied, this may be specified by making the argument an instance of basepromiseworker.meta or by using the atransferlist argument. by convention, the last argument may be an object options with some of the following fields: outexecutionduration {number|null} a parameter to be filled with the duration of the off main thread execution for this call. aclosure optional an object
holding strong references to value that should not be garbage-collected before the reply has been received. atransferlist optional an optional array of transferable objects to transfer ownership of. if the ownership of an object is transferred, it becomes unusable (neutered) in the context it was sent from, and it becomes available only to the worker it was sent to. only messageport and arraybuffer ob...
Application Translation with Mercurial
exts and text ids ("entities" or "keys"), allowing to quickly find translations for already translated texts. microsoft's terminology search allows fast lookups of localized technical terms. choosing what to translate go to the localization status page and click on the '<number> missing' label of the firefox branch on which you want to translate, e.g. fx_aurora. the page which opens has a bar
holding information about how many texts (strings) have already been translated, how many there are in english and your locale and have the same text, and how many are missing in your local. the interesting part follows below as list of missing texts. the first line shows the locale for which the texts are being translated (in this example: de - german). with the second line start the file paths of th...
Localization formats
localizer wanted to use one of the many powerful gettext tools, like po-editor, the msgid provides no context for translation or for other localizers to verify translations when qa-ing. this should have been avoided. in the case of download day, someone created entity-like identifiers in the msgid, which we have shown above with the "certificate_intro" key. then, an en-us repository was created
holding the translations to all the entity-like values of msgid. this is very non-standard because it avoids one of the obvious powers of gettext. when english content is used as the value of the msgid, there is no need to place that content in a special repository. but, in the download day example, when changes were made to en-us, the web-developer had to push those changes to all the repositories of a...
DMD
that information to file, giving a profile of the heap usage for the entire session. this is good for finding parts of the code that cause high heap churn, e.g. by allocating many short-lived allocations. "heap scanning" mode. this mode is like live mode, but it also records the contents of every live block in the log. this can be used to investigate leaks by figuring out which objects might be
holding references to other objects. building and running nightly firefox the easiest way to use dmd is with the normal nightly firefox build, which has dmd already enabled in the build. to have dmd active while running it, you just need to set the environment variable dmd=1 when running. for instance, on osx, you can run something like: dmd=1 /applications/firefox\ nightly.app/contents/macos/firefo...
JS::PerfMeasurement
the current os. at present, it returns true on linux when the <linux/perf_event.h> api is available (kernel 2.6.31 or later), and false everywhere else. perfmeasurement::perfmeasurement(eventmask tomeasure) the constructor creates a new profiling object, which measures some subset of the requested events. perfmeasurement::~perfmeasurement() take care not to leak profiling objects, as they may be
holding down expensive os-level state. eventmask eventsmeasured instances of perfmeasurement expose this constant. it will not have any more bits set than were set in the mask passed to the constructor, but if the os cannot or will not measure all of the requested events, then only those events that will actually be measured have their bits set. all the counter variables for events that are not being m...
Profiling with the Firefox Profiler
its name to the clipboard. a significant portion of time can be spent in idle, blocking calls like waiting for events. this is ideal for a responsive application to be ready to service incoming events. there are os-specific waiting functions like ntwaitformultipleobjects seen in the example above taken on windows or mach_msg_trap on macos. tip: you can quickly go deeper into the call tree by
holding down your right arrow key. alternatively, expand an entire tree segment by
holding alt and clicking on the arrow to the left of the collapsed tree segment. as we progress into a more specific part of the tree, you'll notice that the 'running time' decreases. this happens when a function has 2 or more non-trivial calls: the running time will be split between its children. tip: focus on one sec...
browser.altClickSave
the preference browser.altclicksave controls whether clicking a link while
holding the alt key starts the download of that link. type:boolean default value: false exists by default: yes application support:firefox 13.0 status: active; last updated 2012-03-19 introduction: pushed to nightly on 2012-03-02 bugs: bug 713052 values true clicking a link while
holding the alt key starts the download of that link. false (default) no action triggered (see bug 736985). ...
Preference reference
accessibility.tabfocusthe preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key.browser.altclicksavethe preference browser.altclicksave controls whether clicking a link while
holding the alt key starts the download of that link.browser.dom.window.dump.enabledthis setting enables the dump function, which sends messages to the system console. set it to true to enable it, or false to disable it.browser.dom.window.dump.filebrowser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true. changes require an application restart.browser.download.lastdir.savepersitebrowser.download.lastdir.savepersite controls whether the directory pre...
Introduction to NSPR
, also described as being "in the monitor." mutual exclusion guarantees that only one thread can be in the monitor at a time and that no thread may observe or modify the monitored data without being in the monitor. monitoring is about protecting data, not code. a monitored invariant is a boolean expression over the monitored data. the expression may be false only when a thread is in the monitor (
holding the monitor's mutex). this requirement implies that when a thread first enters the monitor, an evaluation of the invariant expression must yield a true. the thread must also reinstate the monitored invariant before exiting the monitor. therefore, evaluation of the expression must also yield a true at that point in execution. a trivial example might be as follows. suppose an object has three valu...
NSPR Error Handling
in the specified library. pr_insufficient_resources_error there are insufficient system resources to process the request. pr_directory_lookup_error a directory lookup on a network address has failed. pr_tpd_range_error attempt to access a thread-private data index that is out of range of any index that has been allocated to the process. pr_proc_desc_table_full_error the process' table for
holding open file descriptors is full. pr_sys_desc_table_full_error the system's table for
holding open file descriptors has been exceeded. pr_not_socket_error an attempt to use a non-network file descriptor on a network-only operation. pr_not_tcp_socket_error attempt to perform a tcp specific function on a non-tcp file descriptor. pr_socket_address_is_bound_erro attempt to bind an address to a t...
PR_CEnterMonitor
ecified in the address parameter to find a monitor in the monitor cache, then enters the lock associated with the monitor. if no match is found, an available monitor is associated with the address and the monitor's entry count is incremented (so it has a value of one). if a match is found, then either the calling thread is already in the monitor (and this is a reentrant call) or another thread is
holding the monitor's mutex. in the former case, the entry count is simply incremented and the function returns. in the latter case, the calling thread is likely to find the monitor locked by another thread and waits for that thread to exit before continuing. note: pr_centermonitor and pr_cexitmonitor must be paired--that is, there must be an exit for every entry--or the object will never become availab...
PR_IntervalNow
unning interval timer. syntax #include <prinrval.h> printervaltime pr_intervalnow(void); returns a printervaltime object. description you can use the value returned by pr_intervalnow() to establish epochs and to determine intervals (that is, compute the difference between two times). pr_intervalnow() is both very efficient and nonblocking, so it is appropriate to use (for example) while
holding a mutex. the most common use for pr_intervalnow() is to establish an epoch and test for the expiration of intervals. in this case, you typically call pr_intervalnow() in a sequence that looks like this: pruint32 interval = ... ; // milliseconds // ... prstatus rv; printervaltime epoch = pr_intervalnow(); pr_lock(data->mutex); while (!evaluatedata(data)) /* wait until condition is met */ ...
PR_Lock
locks a specified lock object. syntax #include <prlock.h> void pr_lock(prlock *lock); parameter pr_lock has one parameter: lock a pointer to a lock object to be locked. description when pr_lock returns, the calling thread is "in the monitor," also called "
holding the monitor's lock." any thread that attempts to acquire the same lock blocks until the holder of the lock exits the monitor. acquiring the lock is not an interruptible operation, nor is there any timeout mechanism. pr_lock is not reentrant. calling it twice on the same thread results in undefined behavior. see also pr_unlock ...
PR_SetThreadPrivate
n associated with the index before setting the new data value. the pointer at the index is swapped with null. if the swapped out value is not null, the destructor function is called. on return, the private data associated with the index is reassigned the new private data's value, even if it is null. the runtime provides no protection for the private data. the destructor is called with the runtime
holding no locks. synchronization is the client's responsibility. the only way to eliminate thread private data at an index prior to the thread's termination is to call pr_setthreadprivate with a null argument. this causes the index's destructor function to be called, and afterwards assigns a null in the table. a client must not delete the referant object of a non-null private data without first elimina...
PR_TransmitFile
ocket, prfiledesc *sourcefile, const void *headers, print32 hlen, prtransmitfileflags flags, printervaltime timeout); parameters the function has the following parameters: networksocket a pointer to a prfiledesc object representing the connected socket to send data over. sourcefile a pointer to a prfiledesc object representing the file to send. headers a pointer to the buffer
holding the headers to be sent before sending data. hlen length of the headers buffer in bytes. flags one of the following flags: pr_transmitfile_keep_open indicates that the socket will be kept open after the data is sent. pr_transmitfile_close_socket indicates that the connection should be closed immediately after successful transfer of the file. timeout time limit for completion of the t...
PR_Write
amount the amount of data, in bytes, to be written from the buffer. ...
Index
y (===) in that +0 and -0 are not the same and in that nan is the same as nan. the samevalue algorithm is equivalent to the following javascript: 441 js_saveexceptionstate jsapi reference, spidermonkey saves the current exception state (that is, any pending exception, or a cleared exception state) associated with the specified context cx, and returns a jsexceptionstate object
holding this state. that object may then be used to restore again the context using js_restoreexceptionstate, or discarded using js_dropexceptionstate. either of those two functions frees any memory used by the jsexceptionstate. 442 js_saveframechain jsapi reference, spidermonkey these two functions are used to set aside cx's call stack while that stack is inactive. after a call to j...
Bytecodes
ed to the current frame. local slots: holds the local variables used by the current code. expression slots: holds the temporary space that you need to calculate expressions on a stack. for example, in (a + b) + c you would push a, then push b, then add, then push c, then add, which requires a maximum depth of two expression slots. there are also some slots reserved for dedicated functionality,
holding values like this and the callee / return value. there is always a "top of stack" (tos) that corresponds to the latest value pushed onto the expression stack. all bytecodes implicitly operate in terms of this location. bytecode listing all opcodes are annotated with a [-popcount, +pushcount] to represent the overall stack-effects their execution. bytecode listing was moved to spidermonkey internal...
JIT Optimization Outcomes
n the object. this can occur if the operation is polymorphic on different object types and one or more of the object types contain the property at a different slot than the others. notobject optimization failed because the stored in the property could potentially be a non-object value. since only objects can be uniquely typed, the optimization strategy fails in this case. notstruct the object
holding the property is not a typed struct object. notunboxed the object whose property is being accessed is not formatted as an unboxed object. unboxedconvertedtonative the object whose property is being accessed was previously unboxed but was deoptimized and converted to a native object. structnofield the unboxed property being accessed does not correspond to a field on the typed object. inconsi...
JSObjectOps.defaultValue
ould convert obj to the given type, returning js_true with the resulting value in *vp on success, and returning js_false on error or exception. on success, *vp must be a primitive value: per es5 §8.12.8, every object "must ensure that its [[defaultvalue]] internal method can return only primitive values." debug builds of spidermonkey will assert if a convert callback is successful but leaves *vp
holding a primitive value. js_convertstub implements the default behavior for the jsclass.convert hook, which is to call obj.valueof() and obj.tostring() in accordance with the algorithm in es5 §8.12.8. ...
JS_CompileFunctionForPrincipals
nst char *filename, unsigned int lineno); name type description cx jscontext * the context in which to compile the function. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the function is to be associated. principals jsprincipals * pointer to the structure
holding the security information for this function. name const char * name to assign the newly compiled function. nargs unsigned int number of arguments to pass to the function. argnames const char ** names to assign to the arguments passed to the function. body const char * or const jschar * string containing the source code of the function to ...
JS_CompileScriptForPrincipals
no, jsversion version); // obsoleted since jsapi 19 name type description cx jscontext * the context in which to compile the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the script is associated. principals jsprincipals * pointer to the structure
holding the security information for this script. src const char * or const jschar * string containing the script to compile. length size_t the length of src, in characters. filename const char * name of file or url containing the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offe...
JS_EvaluateScriptForPrincipals
name type description cx jscontext * the context in which to run the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. this parameter is documented in detail at js_executescript. principals jsprincipals * pointer to the structure
holding the security information for this script. src / bytes / chars const char * or const jschar string containing the script to compile and execute. length unsigned int the length of src, in characters. filename const char * name of file or url containing the script. used to report filename or url in error messages. lineno unsigned int line n...
JS_PushArguments
cx also affects the interpretation of format, if js_addargumentformatter has been called. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. markp void ** out parameter. on success, *markp receives the internally allocated stack mark which should be passed to js_poparguments. format const char * null-terminated string
holding a list of format types to convert the following arguments to. ... various (in js_pusharguments) a variable number of arguments to be converted to jsvals. there must be one argument for each argument described in format. ap va_list (in js_pushargumentsva) the list of arguments to be converted to jsvals. there must be one argument for each argument described in format.
JS_SaveExceptionState
description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. description saves the current exception state (that is, any pending exception, or a cleared exception state) associated with the specified context cx, and returns a jsexceptionstate object
holding this state. that object may then be used to restore again the context using js_restoreexceptionstate, or discarded using js_dropexceptionstate. either of those two functions frees any memory used by the jsexceptionstate. the jsexceptionstate created by this function automatically roots any pending exception object which needs to be protected from the gc. this function returns null if the engine w...
Property attributes
ne_late don't define property when initially creating the constructor. some objects like function/object have self-hosted functions that can only be defined after the initialization is already finished. added in spidermonkey 38 mxr id search for jsprop_define_late jsfun_stub_gsops use js_propertystub getter/setter instead of defaulting to class gsops for property
holding function. added in spidermonkey 17 mxr id search for jsfun_stub_gsops jsfun_constructor native that can be called as a constructor. added in spidermonkey 17 mxr id search for jsfun_constructor jsprop_redefine_nonconfigurable if set, will allow redefining a non-configurable property, but only on a non-dom global. this is a temporary hack that wil...
mozIStorageAggregateFunction
async() this callback will run on a different thread from the rest of your code. likewise, if you execute sql on a different thread, this callback will be executed on that thread. this callback should be reentrant if any of the above applies to your use of the storage apis! void onstep( in mozistoragevaluearray afunctionarguments ); parameters afunctionarguments a mozistoragevaluearray
holding the arguments passed in to the function. onfinal() this is called after all results have been obtained and notified via mozistorageaggregatefunction. the implementation should finish its calculations on the data, and return a result. note this callback is executed on the thread that the statement or trigger is executing on. if you use mozistorageconnection.executeasync() or, mozistoragestat...
mozIStorageFunction
lback will run on a different thread from the rest of your code. likewise, if you execute sql on a different thread, this callback will be executed on that thread. this callback should be reentrant if any of the above applies to your use of the storage apis! nsivariant onfunctioncall( in mozistoragevaluearray afunctionarguments ); parameters afunctionarguments a mozistoragevaluearray
holding the arguments passed in to the function. return value an nsivariant this is the return value of the function. sample code both of the following code samples assume that the variable dbconn is an opened mozistorageconnection. javascript starting in gecko 1.9.1.4 (firefox 3.0.15), you can directly pass your function into the mozistorageconnection method mozistorageconnection, like this: dbc...
nsICookieAcceptDialog
extensions/cookie/nsicookieacceptdialog.idlscriptable this interface holds some constants for the cookie accept dialog. inherits from: nsisupports last changed in gecko 1.7 constants constant value description accept_cookie 0 value for accepting a cookie object. remember_decision 1 value for remembering a decision. hostname 2 value for
holding the hostname object. cookiesfromhost 3 value for
holding the cookie from the host. changingcookie 4 value for changing cookie. see also nsicookie ...
nsICryptoHMAC
tiple times with different algorithm types. warning: this approach is not fips compliant. note: this method must be called before any other method on this interface is called. void init( in unsigned long aalgorithm, in nsikeyobject akeyobject ); parameters aalgorithm the algorithm type to be used. this value must be one of the above valid algorithm types. akeyobject object
holding a key. to create the key object use for instance: var keyobject = components.classes["@mozilla.org/security/keyobjectfactory;1"] .getservice(components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_error_invalid_arg if an unsupported algorithm type is passed. reset() reiniti...
nsIDirIndex
because this has no reference back to their original source, changing these attributes won't affect the directory. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description contenttype string the content type; may be null if it is unknown. unspecified for directories. description wstring a description for the filename, which should be displayed by a viewer. lastmodified prtime last-modified time in seconds-since-epoch. if the last modified time is unknown, this value is -1. location string the fully qualified filename, expressed as a uri. ...
nsIFTPEventSink
in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onftpcontrollog(in boolean server, in string msg) methods onftpcontrollog allows a consumer to receive a log of the ftp control connection conversation. void onftpcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client. msg a string
holding response of the last command which had been sent. ...
nsIFile
poses the full target of the nsifile - the full path with any symbolic links dereferenced. accessor to the string path. the native version of these strings are not guaranteed to be a usable path to pass to nspr or the c stdlib. there are problems that affect platforms on which a path does not fully specify a file because two volumes can have the same name (for example mac). this is solved by
holding "private", native data in the nsifile implementation. this native data is lost when you convert to a string. do not pass to use with nspr or stdlib! read only. exceptions thrown ns_error_file_invalid_path indicates that this nsifile does not reference a symbolic link. constants constant value description normal_file_type 0 a norm...
Component; nsIPrefBranch
red with addobserver("bar.", ...) on a branch with root "foo.", modifying the preference "foo.bar.baz" will trigger the observer, and adata parameter will be "bar.baz". void addobserver( in string adomain, in nsiobserver aobserver, in boolean aholdweak ); parameters adomain the preference on which to listen for changes. this can be the name of an entire branch to observe. for example
holding the "root" prefbranch and calling addobserver("foo.bar.", ...) will observe changes to foo.bar.baz and foo.bar.bzip. aobserver the object to be notified if the preference changes. the structure of aobserver is any object with an observe function. see nsiobserver and here is a quick snippet: var myobserver = { observe: function(asubject, atopic, adata) { //do stuff here } } ahol...
nsIPrefBranch2
red with addobserver("bar.", ...) on a branch with root "foo.", modifying the preference "foo.bar.baz" will trigger the observer, and adata parameter will be "bar.baz". void addobserver( in string adomain, in nsiobserver aobserver, in boolean aholdweak ); parameters adomain the preference on which to listen for changes. this can be the name of an entire branch to observe. for example
holding the "root" prefbranch and calling addobserver("foo.bar.", ...) will observe changes to foo.bar.baz and foo.bar.bzip. aobserver the object to be notified if the preference changes. aholdweak true holds a weak reference to aobserver. the object must implement the nsisupportsweakreference interface or this will fail. false holds a strong reference to aobserver. removeobserver() remove a prefe...
nsIProfileUnlocker
can use this to attempt to force a profile to be unlocked. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void unlock(in unsigned long aseverity); constants constant value description attempt_quit 0 politely ask the process currently
holding the profile's lock to quit. force_quit 1 forcibly terminate the process
holding the profile lock. methods unlock() tries to unlock the profile by attempting or forcing the process that currently holds the lock to quit. void unlock( in unsigned long aseverity ); parameters aseverity either attempt_quit or force_quit. see also profile management nsitoolkitprofil...
nsIRadioInterfaceLayer
es attribute type description currentstate jsval read only. obsolete since gecko 13.0 microphonemuted bool radiostate jsval read only. ...
Getting Started Guide
lass, the actual object pointed to is a class derived from that abstract base class. the xpcom object is said to `implement that interface'. the client's reference to the object is typically called `an interface pointer'. an object may implement many interfaces. each interface is (at least conceptually) separately `reference counted'. that is, the interface keeps a count of the number of clients
holding references to it. when that count goes to zero, the interface may delete itself. clients are expected to keep this reference count accurate by incrementing it when they acquire a reference to the interface, and decrementing it before they let go. to facilitate this, all interfaces inherit from an abstract base class that provides the member functions addref, and release. a rule of xpcom is that ...
Using the clipboard
tion adddataflavor is used to tell the transferable that it needs to transfer data of a certain flavor. in this case, we are transferring the flavor "text/unicode" which is a unicode string. then, the function settransferdata is called which copies the data from the string into the transferable. this function takes three parameters. the first is the flavor we are setting, the second is the object
holding the string, and the third is the length of the data, in bytes. here, the length is multiplied by two because we are using a unicode string which requires two bytes per character. you can repeat the last two lines and call adddataflavor and settransferdata for multiple flavors. that way, you could have a text version and an html version of the content. the transferable object will hold its own co...
Streams - Plugins
void *buf); the plug-in should terminate the stream by calling npn_destroystream, when all data has been written to the stream, or in the event of an error. the instance parameter is the current plug-in; the stream parameter is a pointer to the stream being written to. the len parameter specifies the length, in bytes, of data written to the stream. the buf parameter is a pointer to the buffer
holding the data to write to the stream. for an example that demonstrates using this function with npn_newstream and npn_destroystream, see "example of sending a stream." deleting the stream when the stream is complete, the plug-in calls npn_destroystream to close and delete it. this applies to streams the plug-in creates with npn_newstream or streams created by the browser with npp_newstream. nperro...
Debugger.Frame - Firefox Developer Tools
n, a non-writable length property, and properties whose names are array indices. each property is a read-only accessor property whose getter returns the current value of the corresponding parameter. when the referent frame is popped, the argument value’s properties’ getters throw an error. handler methods of debugger.frame instances each debugger.frame instance inherits accessor properties
holding handler functions for spidermonkey to call when given events occur in the frame. calls to frames’ handler methods are cross-compartment, intra-thread calls: the call takes place in the thread to which the frame belongs, and runs in the compartment to which the handler method belongs. debugger.frame instances inherit the following handler method properties: onstep this property must be e...
Debugger.Source - Firefox Developer Tools
debugger may place its own properties on debugger.source instances, to store metadata about particular pieces of source code. debugger.source for javascript for a debugger.source instance representing a piece of javascript source code, its properties provide the source code itself as a string, and describe where it came from. each debugger.script instance refers to the debugger.source instance
holding the source code from which it was produced. if a single piece of source code contains both top-level code and function definitions, perhaps with nested functions, then the debugger.script instances for those all refer to the same debugger.source instance. each script indicates the substring of the overall source to which it corresponds. a debugger.source instance may represent only a portion of...
Measure a portion of the page - Firefox Developer Tools
lace as the settings/options button. when you want to use the tool, click this button. now when you mouse over the viewport, you'll see the mouse has a crosshair cursor with its current coordinates displayed beside it. when you hold the mouse button down and then drag, you'll start to draw a rectangle, with its x, y, and diagonal dimensions displayed. the units are in pixels. when you stop
holding the mouse down, the rectangle that was displayed on screen when you released the button will stay there until you click again, allowing you time to take screenshots, note the information down, etc. the rectangle can also be resized later on by clicking one of the handles around it. ...
Dominators - Firefox Developer Tools
any objects it doesn't find are unreachable, and can be deallocated. so when an object becomes unreachable (for example, because it is only referenced by a single local variable which goes out of scope) then any objects it references also become unreachable, as long as no other objects reference them: conversely, this means that objects are kept alive as long as some other reachable object is
holding a reference to them. shallow and retained size this gives rise to a distinction between two ways to look at the size of an object: shallow size: the size of the object itself retained size: the size of the object itself, plus the size of other objects that are kept alive by this object often, objects will have a small shallow size but a much larger retained size, through the references th...
Dominators view - Firefox Developer Tools
or internal structures. retaining paths panel the retaining paths panel is new in firefox 47. the retaining paths panel shows you, for a given node, the 5 shortest paths back from this node to a gc root. this enables you to see all the nodes that are keeping the given node from being garbage-collected. if you suspect that an object is being leaked, this will show you exactly which objects are
holding a reference to it. to see the retaining paths for a node, you have to select the node in the dominators tree panel: here, we've selected an object, and can see a single path back to a gc root. the window gc root holds a reference to an htmldivelement object, and that holds a reference to an object, and so on. if you look in the dominators tree panel, you can trace the same path there. if eit...
Examine and edit HTML - Firefox Developer Tools
the currently selected element. use in console assigns the currently selected node to a variable named temp0 (or temp1 if temp0 is already taken, and so on), then opens the split console, enabling you to interact with that node using the console's command line. expand all in the tree view, expand the current element and all the elements underneath it. this is equivalent to
holding the alt key and clicking the disclosure triangle next to an element. collapse in the tree view, collapse the current element. this is equivalent to clicking the disclosure arrow next to an element that's expanded. (paste) inner html paste the clipboard contents into the node as its innerhtml. (paste) outer html paste the clipboard contents into the node as its ...
Inspect and select colors - Firefox Developer Tools
or is a foreground color, the color picker tells you whether its contrast with the background color meets accessibility guidelines. hovering the mouse over the contrast message gives a more detailed explanation. the color picker includes an eyedropper icon: clicking this icon enables you to use the eyedropper to select a new color for the element from the page: clicking the color sample while
holding down the shift key changes the color format: ...
Attr - Web APIs
ttribute's name. namespaceuri read only a domstring representing the namespace uri of the attribute, or null if there is no namespace. localname read only a domstring representing the local part of the qualified name of the attribute. prefix read only a domstring representing the namespace prefix of the attribute, or null if no prefix is specified. ownerelement read only the element
holding the attribute. note: dom level 4 removed this property. the assumption was that since you get an attr object from an element, you should already know the associated element. as that doesn't hold true in cases like attr objects being returned by document.evaluate, the dom living standard reintroduced the property. gecko outputs a deprecation note starting from gecko 7.0 (firefox 7.0 / thun...
BluetoothRemoteGATTCharacteristic - Web APIs
otegattcharacteristic.getdescriptor() returns a promise that resolves to the first bluetoothgattdescriptor for a given descriptor uuid. bluetoothremotegattcharacteristic.getdescriptors() returns a promise that resolves to an array of all bluetoothgattdescriptor objects for a given descriptor uuid. bluetoothremotegattcharacteristic.readvalue() returns a promise that resolves to an arraybuffer
holding a duplicate of the value property if it is available and supported. otherwise it throws an error. bluetoothremotegattcharacteristic.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise. bluetoothremotegattcharacteristic.startnotifications() returns a promise when navigator.bluetooth is added to the active notification context. bluetoothremotegat...
readValue() - Web APIs
otherwise it throws an error. syntax bluetoothremotegattdescriptor.readvalue().then(function(value[]) { ... }) returns a promise that resolves to an arraybuffer. specifications specification status comment web bluetooththe definition of 'readvalue()' in that specification. draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
BluetoothRemoteGATTDescriptor - Web APIs
characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for theclient characteristic configuration descriptor. bluetoothremotegattdescriptor.valueread only returns the currently cached descriptor value. this value gets updated when the value of the descriptor is read. methods bluetoothremotegattdescriptor.readvalue() returns a promise that resolves to an arraybuffer
holding a duplicate of the value property if it is available and supported. otherwise it throws an error. bluetoothremotegattdescriptor.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise. specifications specification status comment web bluetooththe definition of 'bluetoothremotegattdescriptor' in that specification. draft ...
DirectoryReaderSync - Web APIs
) { // print out file's name. console.log(fileentry.name); }); }); }; worker.postmessage({'cmd': 'list'}); the following is worker.js code that gets the contents of the directory. // taking care of the browser-specific prefixes. self.requestfilesystemsync = self.webkitrequestfilesystemsync || self.requestfilesystemsync; // global for
holding the list of entry file system urls. var paths = []; function getallentries(dirreader) { var entries = dirreader.readentries(); for (var i = 0, entry; entry = entries[i]; ++i) { // stash this entry's filesystem in url paths.push(entry.tourl()); // if this is a directory, traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the...
Element.setCapture() - Web APIs
ort and you probably looking for element.setpointercapture instead, from the pointer events api. syntax element.setcapture(retargettoelement); retargettoelement if true, all events are targeted directly to this element; if false, events can also fire at descendants of this element. example in this example, the current mouse coordinates are drawn while you mouse around after clicking and
holding down on an element. <html> <head> <title>mouse capture example</title> <style type="text/css"> #mybutton { border: solid black 1px; color: black; padding: 2px; box-shadow: black 2px 2px; } </style> <script type="text/javascript"> function init() { var btn = document.getelementbyid("mybutton"); if (btn.setcapture) { btn.addeventlist...
Using the Gamepad API - Web APIs
will use for device state querying later. 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 do much more with the gamepad object, including
holding a reference to it and querying it to find out which buttons and axes are being pressed at any one time. doing so is often desirable for games or other interactive web pages that need to know the state of a gamepad now vs. the next time an event fires. performing such checks tends to involve using the gamepad object in conjunction with an animation loop (e.g., requestanimationframe), where develo...
HTMLFormElement - Web APIs
x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlformelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, htmlelement. htmlformelement.elements read only a htmlformcontrolscollection
holding all form controls belonging to this form element. htmlformelement.lengthread only a long reflecting the number of controls in the form. htmlformelement.name a domstring reflecting the value of the form's name html attribute, containing the name of the form. htmlformelement.method a domstring reflecting the value of the form's method html attribute, indicating the http method used to submit...
HTMLOutputElement - Web APIs
representing the value of the contents of the elements. behaves like the node.textcontent property. htmloutputelement.willvalidateread only a boolean indicating whether the element is a candidate for constraint validation. methods this interface also inherits methods from its parent, htmlelement. htmloutputelement.checkvalidity() checks the validity of the element and returns a boolean
holding the check result. htmloutputelement.reportvalidity() this method reports the problems with the constraints on the element, if any, to the user. if there are problems, fires an invalid event at the element, and returns false; if there are no problems, it returns true. when the problem is reported, the user agent may focus the element and change the scrolling position of the document or perform ...
Dragging and Dropping Multiple Items - Web APIs
that element. the dodrop event hander is called when dropping an item. it checks the mozitemcount property to check how many items have been dropped and iterates over them. for each item, the moztypesat() method is called to get the list of types. this list is iterated over to get all of the data associated with the drag. this processing is useful if you wish to examine the data that a drag is
holding. simply drop an item on the drop target in the example to see what items, formats and data was being dragged. see also html drag and drop api (overview) drag operations recommended drag types html5 living standard: drag and drop ...
KeyboardEvent.altKey - Web APIs
</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.altkey' in that specification. obsolete initial definition. ...
KeyboardEvent.ctrlKey - Web APIs
d. syntax var ctrlkeypressed = instanceofkeyboardevent.ctrlkey return value a boolean example <html> <head> <title>ctrlkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key pressed: " + e.key + "\n" + "ctrl key pressed: " + e.ctrlkey + "\n" ); } </script> </head> <body onkeypress="showchar(event);"> <p>press any character key, with or without
holding down the ctrl key.<br /> you can also use the shift key together with the ctrl key.</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.ctrlkey' in that specification. obsolete initial definition. ...
KeyboardEvent.initKeyboardEvent() - Web APIs
he event can be canceled. viewarg the windowproxy it is associated to. chararg the value of the char attribute. keyarg the value of the key attribute. locationarg the value of the location attribute. modifierslistarg a whitespace-delineated list of modifier keys that should be considered to be active on the event's key. for example, specifying "control shift" indicates that the user was
holding down the control and shift keys when pressing the key described by the event. repeatarg the value of the repeat attribute. ...
LockManager.request() - Web APIs
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; } // the lock was granted, and no other running code in this origin is
holding // the 'my_res_lock' lock until this returns. }); signal example to only wait for a lock for a short period of time, use the signal option. const controller = new abortcontroller(); // wait at most 200ms. settimeout(() => controller.abort(), 200); try { await navigator.locks.request('my_resource', {signal: controller.signal}, async lock => { // the lock was acquired! }); } catch (e...
Selection.anchorNode - Web APIs
the selection.anchornode read-only property returns the node in which the selection begins. a user may make a selection from left to right (in document order) or right to left (reverse of document order). the anchor is where the user began the selection. this can be visualized by
holding the shift key and pressing the arrow keys on your keyboard. the selection's anchor does not move, but the selection's focus, the other end of the selection, does move. syntax node = sel.anchornode specifications specification status comment selection apithe definition of 'selection.anchornode' in that specification. working draft current ...
Selection.focusNode - Web APIs
the selection.focusnode read-only property returns the node in which the selection ends. a user may make a selection from left to right (in document order) or right to left (reverse of document order). the focus is where the user ended the selection. this can be visualized by
holding the shift key and pressing the arrow keys on your keyboard to modify the current selection. the selection's focus moves, but the selection's anchor, the other end of the selection, does not move. syntax node = sel.focusnode specifications specification status comment selection apithe definition of 'selection.focusnode' in that specification. working draft current ...
Selection.rangeCount - Web APIs
rangecount every second. select text in the browser to see it change. html <table> <tr><td>a.1<td>a.2 <tr><td>b.1<td>b.2 <tr><td>c.1<td>c.2 javascript window.setinterval(function () { console.log(window.getselection().rangecount); }, 1000); result open your console to see how many ranges are in the selection. in gecko browsers, you can select multiple ranges across table cells by
holding down ctrl while dragging with the mouse. specifications specification status comment selection apithe definition of 'selection.rangecount' in that specification. working draft current ...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
itive values of pedestaldistance will move the camera up, while negative values will move it down. canting (rolling left and right) cant (or roll) is a rotation of the camera around its roll axis; that is, the camera remains fixed in space, and remains pointed at the same location, but rotates around so that the top of the camera is pointed in a different direction. you can visualize this by
holding your arm out in front of you with your hand open, palm down. imagine that your hand is the camera and the back of your hand represents the top of the camera. now rotate your hand so that the "camera" is upside-down. you have just canted your hand around the roll axis. in cinematography, cant can be used to simulate various types of unsteady motion such as waves or turbulence, but can also be used...
Functions and classes available to Web Workers - Web APIs
r values, which can then be easily sent using the xmlhttprequest send() method. ? (should be in 39 (39)) ? (yes) ? imagedata the underlying pixel data of an area of a canvas element. manipulating such data can be a complex task better suited to be delegated to a web worker. 25 (25) no support no support no support indexeddb database to store records
holding simple values and hierarchical objects. 37 (37), 42 (42) for idbcursorwithvalue. 10.0 (yes) 10.1 network information api provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.). 53.0 (53) only on mobile (yes) only on mobile no support no support notifications allows web pages to contro...
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. 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 u...
XRSession.onsqueezeend - Web APIs
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 specification status comment webxr device apithe definition of 'xrsession.onsqueezeend' in that specification. working draft initial definition. ...
ARIA: listbox role - Accessibility
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 option. shift + space (optional): selects contiguous items from the most recently selected item to the fo...
animation-timing-function - CSS: Cascading Style Sheets
stops including the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following jump terms is used: jump-start denotes a left-continuous function, so that the first jump happens when the animation begins; jump-end denotes a right-continuous function, so that the last jump happens when the animation ends; jump-none there is no jump on either end. instead,
holding at both the 0% mark and the 100% mark, each for 1/n of the duration. jump-both includes pauses at both the 0% and 100% marks, effectively adding a step during the animation iteration. start same as jump-start. end same as jump-end. step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) note: when you specify multiple comma-separated values on an anima...
<easing-function> - CSS: Cascading Style Sheets
ction, so that the first step or jump happens when the animation begins; jump-end denotes a right-continuous function, so that the last step or jump happens when the animation ends; jump-both denotes a right and left continuous function, includes pauses at both the 0% and 100% marks, effectively adding a step during the animation iteration; jump-none there is no jump on either end. instead,
holding at both the 0% mark and the 100% mark, each for 1/n of the duration start is the equivalent of jump-start end is the equivalent of jump-end end is the default. steps( n, <direction> ) steps(2, jump-start) steps(2, start) steps(4, jump-end) steps(4, end) steps(5, jump-none) steps(3, jump-both) steps-start the equivalent of steps(1, jump-start...
transition-timing-function - CSS: Cascading Style Sheets
cluding the 0% and 100% marks (on the 0%, 25%, 50%, 75%, and 100%) depends on which of the following jump terms is used: jump-start denotes a left-continuous function, so that the first jump happens when the transition begins; jump-end denotes a right-continuous function, so that the last jump happens when the animation ends; jump-none there is no jump on either end. instead,
holding at both the 0% mark and the 100% mark, each for 1/n of the duration jump-both includes pauses at both the 0% and 100% marks, effectively adding a step during the transition time. start same as jump-start. end same as jump-end. step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) accessibility concerns some animations can be helpful s...
Event reference
riptexecute 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 mozbrowsericonc...
HTML attribute: accept - HTML: Hypertext Markup Language
so see it running live. regardless of the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file. including the multiple attribute, as shown above, specifies that multiple files can be chosen at once. the user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by
holding down shift or control, and then clicking). if you only want the user to choose a single file per <input>, omit the multiple attribute. limiting accepted file types often you won't want the user to be able to pick any arbitrary type of file; instead, you often want them to select files of a specific type or types. for example, if your file input lets users upload a profile picture, you probably ...
HTML attribute: multiple - HTML: Hypertext Markup Language
and only if the multiple attribute is specified, the value can be a list of properly-formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. when multiple is set on the file input type, the user can select one or more files. the user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by
holding down shift or control, and then clicking). <input type="file" multiple name="uploads" id="uploads"> when the attribute is omitted, the user can only select a single file per <input>. the multiple attribute on the <select> element represents a control for selecting zero or more options from the list of options. otherwise, the <select> element represents a control for selecting a single <option>...
<a>: The Anchor element - HTML: Hypertext Markup Language
to contacts, or sending the number to another device. see rfc 3966 for syntax, additional features, and other details about the tel: url scheme. using the download attribute to save a <canvas> as a png to save a <canvas> element’s contents as an image, you can create a link with a download attribute and the canvas data as a data: url: example painting app with save link html <p>paint by
holding down the mouse button and moving it. <a href="" download="my_painting.png">download my painting</a> </p> <canvas width="300" height="300"></canvas> css html { font-family: sans-serif; } canvas { background: #fff; border: 1px dashed; } a { display: inline-block; background: #69c; color: #fff; padding: 5px 10px; } javascript var canvas = document.queryselector('canvas'), c...
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
e is a 2px groove border surrounding the contents, and a small amount of default padding. the element has min-inline-size: min-content by default. if a <legend> is present, it is placed over the block-start border. the <legend> shrink-wraps, and also establishes a formatting context. the display value is blockified. (for example, display: inline behaves as block.) there will be an anonymous box
holding the contents of the <fieldset>, which inherits certain properties from the <fieldset>. if the <fieldset> is styled with display: grid or display: inline-grid, then the anonymous box will be a grid formatting context. if the <fieldset> is styled with display: flex or display: inline-flex, then the anonymous box will be a flex formatting context. otherwise, it establishes a block formatting context...
<input type="file"> - HTML: Hypertext Markup Language
so see it running live. regardless of the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file. including the multiple attribute, as shown above, specifies that multiple files can be chosen at once. the user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by
holding down shift or control, and then clicking). if you only want the user to choose a single file per <input>, omit the multiple attribute. getting information on selected files the selected files' are returned by the element's htmlinputelement.files property, which is a filelist object containing a list of file objects. the filelist behaves like an array, so you can check its length property to get...
<select>: The HTML Select element - HTML: Hypertext Markup Language
shortcuts conflict with the os default shortcuts for mission control and application windows, so you'll have to turn these off before it will work. keyboard users can select multiple contiguous items by: focusing on the <select> element (e.g. using tab). selecting an item at the top or bottom of the range they want to select using the up and down cursor keys to go up and down the options.
holding down the shift key and then using the up and down cursor keys to increase or decrease the range of items selected. keyboard users can select multiple non-contiguous items by: focusing on the <select> element (e.g. using tab).
holding down the ctrl key then using the up and down cursor keys to change the "focused" select option, i.e. the one that will be selected if you choose to do so. the ...
<template>: The Content Template element - HTML: Hypertext Markup Language
think of a template as a content fragment that is being stored for subsequent use in the document. while the parser does process the contents of the <template> element while loading the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however. ...
HTML elements reference - HTML: Hypertext Markup Language
ns of standard html elements. element description <slot> the html <slot> element—part of the web components technology suite—is a placeholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together. <template> the html content template (<template>) element is a mechanism for
holding html that is not to be rendered immediately when a page is loaded but may be instantiated subsequently during runtime using javascript. obsolete and deprecated elements warning: these are old html elements which are deprecated and should not be used. you should never use them in new projects, and should replace them in old projects as soon as you can. they are listed here for informatio...
HTML documentation index - HTML: Hypertext Markup Language
td> element defines a cell of a table that contains data. it participates in the table model. 205 <template>: the content template element element, html, html web components, html:flow content, html:metadata content, html:phrasing content, html:script-supporting element, reference, template, web, web components the html content template (<template>) element is a mechanism for
holding html that is not to be rendered immediately when a page is loaded but may be instantiated subsequently during runtime using javascript. 206 <textarea> element, forms, html, html forms, reference, web, textarea the html <textarea> element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for ex...
Redirections in HTTP - HTTP
lish numerous goals: temporary redirects during site maintenance or downtime permanent redirects to preserve existing links/bookmarks after changing the site's urls, progress pages when uploading a file, etc. principle in http, redirection is triggered by a server sending a special redirect response to a request. redirect responses have status codes that start with 3, and a location header
holding the url to redirect to. when browsers receive a redirect, they immediately load the new url provided in the location header. besides the small performance hit of an additional round-trip, users rarely notice the redirection. there are several types of redirects, sorted into three categories: permanent redirections temporary redirections special redirections permanent redirections thes...
A re-introduction to JavaScript (JS tutorial) - JavaScript
meters it expects, in which case they will be set to undefined. add(); // nan // you can't perform addition on undefined you can also pass in more arguments than the function is expecting: add(2, 3, 4); // 5 // added the first two; 4 was ignored that may seem a little silly, but functions have access to an additional variable inside their body called arguments, which is an array-like object
holding all of the values passed to the function. let's re-write the add function to take as many values as we want: function add() { var sum = 0; for (var i = 0, j = arguments.length; i < j; i++) { sum += arguments[i]; } return sum; } add(2, 3, 4, 5); // 14 that's really not any more useful than writing 2 + 3 + 4 + 5 though. let's create an averaging function: function avg() { var sum...
TypeError: can't access dead object - JavaScript
ces to dom objects after their parent document has been destroyed to improve in memory usage and to prevent memory leaks. message typeerror: can't access dead object error type typeerror what went wrong? to improve in memory usage and to prevent memory leaks, firefox disallows add-ons to keep strong references to dom objects after their parent document has been destroyed. a dead object, is
holding a strong (keep alive) reference to a dom element that persists even after it was destroyed in the dom. to avoid these issues, references to dom nodes in foreign document should instead be stored in an object which is specific to that document, and cleaned up when the document is unloaded, or stored as weak references. examples checking if an object is dead components.utils offers a isdeadwrapp...
String - JavaScript
some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the indexof() method, or extracting substrings with the substring() method. ...
<feComponentTransfer> - SVG: Scalable Vector Graphics
the calculations are performed on non-premultiplied color values. the colors are modified by changing each channel (r, g, b, and a) to the result of what the children <fefuncr>, <fefuncb>, <fefuncg>, and <fefunca> return. ...
SVG documentation index - SVG: Scalable Vector Graphics
matrix. every pixel's color value [r,g,b,a] is matrix multiplied by a 5 by 5 color matrix to create new color [r',g',b',a']. 312 <fecomponenttransfer> element, svg, svg filter th <fecomponenttransfer> svg filter primitive performs color-component-wise remapping of data for each pixel. it allows operations like brightness adjustment, contrast adjustment, color balance or thres
holding. 313 <fecomposite> element, needsexample, svg, svg filter the <fecomposite> svg filter primitive performs the combination of two input images pixel-wise in image space using one of the porter-duff compositing operations: over, in, atop, out, xor, and lighter. additionally, a component-wise arithmetic operation (with the result clamped between [0..1]) can be applied. 31...