Search completed in 1.05 seconds.
RTCRemoteOutboundRtpStreamStats.remoteTimestamp - Web APIs
the rtc
remoteoutboundrtpstreamstats property
remotetimestamp indicates the timestamp on the
remote peer at which these statistics were sent. this differs from timestamp, which indicates the time at which the statistics were generated or received locally. syntax let
remotetimestamp = rtc
remoteoutboundrtpstreamstats.
remotetimestamp; value a domhighrestimestamp value indicating the timestamp on the
remote peer at which it sent these statistics. this is different from the value timestamp, which gives the time at which the statistics were generated or received by the local peer. if this property is present, it comes from the rtcp sender report (sr) block, which reflects the clock on the
remote peer at the time the message was sent. keep in mind that this means the clock may not be synchroni...
...sr) block, which reflects the clock on the
remote peer at the time the message was sent. keep in mind that this means the clock may not be synchronized with the local clock, and that both the current time and the pace at which the clock runs may differ to some extent. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtc
remoteoutboundrtpstreamstats.
remotetimestamp' in that specification. candidate recommendation initial definition. ...
remote/parent - Archive of obsolete content
enables you to load modules, and privileged parts of your add-on in general, into child processes. usage in multiprocess firefox: the browser ui runs in one process, sometimes called the chrome process or the parent process web content runs in one or more other processes, sometimes called content processes or
remote processes or child processes. by default, add-ons run in the chrome process and can't directly access web content. in the sdk, content scripts run in the child process, and, of course, can access web content. but content scripts don't have many more capabilities than untrusted web content. the sdk/
remote/parent module enables you to load sdk modules into the child process to give them direct access to content frames. these sdk modules have higher privileges than conten...
... have higher privileges than content scripts, and have their own module loader so they can load other sdk modules. its primary purpose is to help build apis. if you just need to access a web page, use sdk/page-mod to load a content script instead. terms process every application has at least one process running, the main process that displays the ui. multiprocess applications can have other
remote processes where untrusted content like webpages are loaded. each process can contain many frames. frame every dom page loaded as a part of the application is loaded in a content frame. this includes the content of every tab in an application like firefox and also some other ui elements. each frame loads in a process but sometimes the application may choose to switch from loading a tab in one...
...ication is loaded in a content frame. this includes the content of every tab in an application like firefox and also some other ui elements. each frame loads in a process but sometimes the application may choose to switch from loading a tab in one process to another. in this case the frame for that tab changes. ...
...And 32 more matches
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
the rtc
remoteoutboundrtpstreamstats dictionary's localid property is a string which can be used to identify the rtcinboundrtpstreamstats object whose
remoteid matches this value. together, these two objects provide statistics about the inbound and outbound sides of the same synchronization source (ssrc). syntax let localid = rtc
remoteoutboundrtpstreamstats.localid; value a domstring which can be compared to the value of an rtcinboundrtpstreamstats object's
remoteid property to see if the two represent statistics for each of the two sides of the same set of data received by the local peer. usage notes you can think of the local and
remote views of the same rtp stream as pairs, each of which has a reference back to the other one. ...
...string which can be compared to the value of an rtcinboundrtpstreamstats object's
remoteid property to see if the two represent statistics for each of the two sides of the same set of data received by the local peer. usage notes you can think of the local and
remote views of the same rtp stream as pairs, each of which has a reference back to the other one. thus, if an rtcstatsreport includes an
remote-outbound-rtp statistics object (of type rtc
remoteoutboundrtpstreamstats), it should also have a corresponding inbound-rtp object. both of these provide information about the same batch of packets being transmitted from the
remote peer to the local device. ...
... you can examine, try out, and experiment with this example on glitch. ...
...And 19 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
the rtcpeerconnection method set
remotedescription() sets the specified session description as the
remote peer's current offer or answer. the description specifies the properties of the
remote end of the connection, including the media format. the method takes a single parameter—the session description—and it returns a promise which is fulfilled once the description has been changed, asynchronously. this is typically called after receiving an offer or answer from another peer over the signaling server. keep in mind that if set
remotedescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). because descriptions will be exchanged until the two peers agree on a configuration, the description submitt...
...cally called after receiving an offer or answer from another peer over the signaling server. keep in mind that if set
remotedescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling set
remotedescription() does not immediately take effect. instead, the current connection configuration
remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. ...
...nging network conditions). because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling set
remotedescription() does not immediately take effect. instead, the current connection configuration
remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.set
remotedescription(sessiondescription); parameters sessiondescription an rtcsessiondescriptioninit or rtcsessiondescription which specifies the
remote peer's current offer or answer. ...
...And 18 more matches
EventTarget.removeEventListener() - Web APIs
the eventtarget.
removeeventlistener() method
removes from the eventtarget an event listener previously registered with eventtarget.addeventlistener(). the event listener to be
removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see matching event listeners for
removal syntax target.
removeeventlistener(type, listener[, options]); target.
removeeventlistener(type, listener[, usecapture]); parameters type a string which specifies the type of event for which to
remove an event listener. listener the eventlistener function of the event handler to
remove from the event target. options optional an options object that specifies characteristics about the event listener. the av...
... capture: a boolean which indicates that events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree. mozsystemgroup: available only in code running in xbl or in firefox' chrome, it is a boolean defining if the listener is added to the system group. ...
...temgroup: available only in code running in xbl or in firefox' chrome, it is a boolean defining if the listener is added to the system group. usecapture optional specifies whether the eventlistener to be
removed is registered as a capturing listener or not. if this parameter is absent, a default value of false is assumed. if a listener is registered twice, one with capture and one without,
remove each one separately.
removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa. return value undefined matching event listeners for
removal given an event listener previously added by calling addeventlistener(), you may eventually come to a point at which you need to
remove it. obviously, you need to specify the same type and listener par...
...And 16 more matches
JS::Remove*Root
obsolete since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 31 unregister a pointer to a gc thing so that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. ...
...obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 31 unregister a pointer to a gc thing so that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. ...
...is discouraged since it could be
removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 31 unregister a pointer to a gc thing so that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. ...
...And 14 more matches
FileSystemDirectoryEntry.removeRecursively() - Web APIs
receives a fileerror describing the error which occurred as input. return value undefined. ...
...receives a fileerror describing the error which occurred as input. return value undefined. ...
...receives a fileerror describing the error which occurred as input. return value undefined. ...
...And 10 more matches
BluetoothRemoteGATTCharacteristic - Web APIs
the bluetooth
remotegattcharacteristic interface of the web bluetooth api represents a gatt characteristic, which is a basic data element that provides further information about a peripheral’s service. ...
... the bluetooth
remotegattcharacteristic interface of the web bluetooth api represents a gatt characteristic, which is a basic data element that provides further information about a peripheral’s service. ...
... the bluetooth
remotegattcharacteristic interface of the web bluetooth api represents a gatt characteristic, which is a basic data element that provides further information about a peripheral’s service. ...
...And 9 more matches
counter-increment - CSS: Cascading Style Sheets
the counter-inc
rement css property increases or decreases the value of a css counter by a given value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the counter's value can be reset to an arbitrary number using the counter-reset css property. ...
...decreases the value of a css counter by a given value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the counter's value can be reset to an arbitrary number using the counter-reset css property. ...
... a given value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the counter's value can be reset to an arbitrary number using the counter-reset css property. ...
...And 9 more matches
Element.removeAttribute() - Web APIs
many attributes will not behave as expected if you set them to null. ...
...many attributes will not behave as expected if you set them to null. ...
...many attributes will not behave as expected if you set them to null. ...
...And 7 more matches
Node.removeChild() - Web APIs
the node.
removechild() method
removes a child node from the dom and returns the
removed node. syntax var oldchild = node.
removechild(child); or node.
removechild(child); child is the child node to be
removed from the dom. node is the parent node of child. oldchild holds a reference to the
removed child node, i.e., oldchild === child. the
removed child node still exists in memory, but is no longer part of the dom. with the first syntax form shown, you may reuse the
removed node later in your code, via the oldchild object reference. in the second syntax form, however, there is no oldchild reference kept, so assuming your code has not kept any other reference to the node elsewhere, it will immediately become unusable and irretrievable, and will usually be automatically deleted from me...
...ence kept, so assuming your code has not kept any other reference to the node elsewhere, it will immediately become unusable and irretrievable, and will usually be automatically deleted from memory after a short time. if child is actually not a child of the element node, the method throws an exception. ...
...ce to the node elsewhere, it will immediately become unusable and irretrievable, and will usually be automatically deleted from memory after a short time. if child is actually not a child of the element node, the method throws an exception. this will also happen if child was in fact a child of element at the time of the call, but was
removed by an event handler invoked in the course of trying to
remove the element (e.g., blur.) errors thrown the method throws an exception in 2 different ways: if the child was in fact a child of element and so existing on the dom, but was
removed the method throws the following exception: uncaught notfounderror: failed to execute '
removechild' on 'node': the node to be
removed is not a child of this node. if the child doesn't exist on the dom...
...And 7 more matches
JS::PerfMeasurement
note: at present, js::perfmeasu
rement is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. the js::perfmeasu
rement class, found in jsperf.h, lets you take detailed performance measu
rements of your code. it is a stopwatch profiler -- that is, it counts events that occur while code of interest is running; it does not do call traces or sampling. ...
...led performance measu
rements of your code. it is a stopwatch profiler -- that is, it counts events that occur while code of interest is running; it does not do call traces or sampling. ...
... the linux 2.6.31+ <linux/perf_event.h> interface, and so unfortunately are a little vague in their specification; for instance, we can't tell you exactly which level of cache you get misses for if you measure cache_misses. we also can't guarantee that all platforms will support all event types, once we have more than one back end for this interface. ...
...And 6 more matches
Web Console remoting - Firefox Developer Tools
this document describes the latest protocol, with changes that have been made since then. ...
...this document describes the latest protocol, with changes that have been made since then. ...
...this document describes the latest protocol, with changes that have been made since then. ...
...And 6 more matches
Measuring performance using the PerfMeasurement.jsm code module
the perfmeasu
rement.jsm javascript code module lets you take detailed performance measu
rements of your code. note: the perfmeasu
rement.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on. the first thing you need to do is to import the module into your scope: components.utils.import("resource://gre/modules/perfmeasu
rement.jsm") you can then create a perfmeasu
rement object. you give the constructor a bit-mask of events you're interested in; see note: at present, perfmeasu
rement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. for instance, let's measure instructions executed, cache references, and cache miss...
...it doesn't, however, start to record data. ...
...it doesn't, however, start to record data. ...
...And 5 more matches
JS_Remove*Root
obsolete since jsapi 31this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. syntax jsbool js_
removevalueroot(jscontext *cx, jsval *vp); jsbool js_
removestringroot(jscontext *cx, jsstring **spp); jsbool js_
removeobjectroot(jscontext *cx, jsobject **opp); jsbool js_
removegcthingroot(jscontext *cx, void **rp); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp jsval * ...
... js_
removestringroot(jscontext *cx, jsstring **spp); jsbool js_
removeobjectroot(jscontext *cx, jsobject **opp); jsbool js_
removegcthingroot(jscontext *cx, void **rp); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp jsval * address of the jsval variable to
remove from the root set. this must have been passed to either js_addvalueroot or js_addnamedvalueroot. spp jsstring * address of the jsstring* variable to
remove from the root set. this must have been passed to either js_addstringroot or js_addnamedstringroot. opp jsobject * address of the jsobject* variable to
remove from the root set. this must have been passed to ...
...spp jsstring * address of the jsstring* variable to
remove from the root set. this must have been passed to either js_addstringroot or js_addnamedstringroot. opp jsobject * address of the jsobject* variable to
remove from the root set. this must have been passed to either js_addobjectroot or js_addnamedobjectroot. rp void ** address of the pointer variable to
remove from the root set. this must have been passed to either js_addgcthingroot or js_addnamedgcthingroot. description js_
removeroot
removes the variable that rp points to from the garbage collector's root set. the entry for rp is
removed from the root set for the jsruntime associated with the context cx. ...
...And 5 more matches
ChildNode.remove() - Web APIs
the childnode.
remove() method
removes the object from the tree it belongs to. syntax node.
remove(); example using
remove() <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <div id="div-03">here is div-03</div> var el = document.getelementbyid('div-02'); el.
remove(); //
removes the div with the 'div-02' id childnode.
remove() is unscopable the
remove() method is not scoped into the with statement. see symbol.unscopables for more information. ...
...(); example using
remove() <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <div id="div-03">here is div-03</div> var el = document.getelementbyid('div-02'); el.
remove(); //
removes the div with the 'div-02' id childnode.
remove() is unscopable the
remove() method is not scoped into the with statement. see symbol.unscopables for more information. ...
...<div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <div id="div-03">here is div-03</div> var el = document.getelementbyid('div-02'); el.
remove(); //
removes the div with the 'div-02' id childnode.
remove() is unscopable the
remove() method is not scoped into the with statement. see symbol.unscopables for more information. ...
...And 5 more matches
RTCInboundRtpStreamStats.remoteId - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
...And 5 more matches
remote/child - Archive of obsolete content
enables an sdk module loaded into a child process to access web content in the child process and communicate with modules in the main process. usage the sdk/
remote/parent module enables sdk code to load modules into child processes. the sdk/
remote/child module is for these "child process modules". it provides two main things: access to web content loaded into this child process port mechanisms to communicate with the main process interacting with web content to interact with web content, the sdk/
remote/child module provides a frames property that's a list of all content frames loaded into this child process. ...
...access to web content loaded into this child process port mechanisms to communicate with the main process interacting with web content to interact with web content, the sdk/
remote/child module provides a frames property that's a list of all content frames loaded into this child process. each frame then has a content property that's the top-level dom window for the frame, and addeventlistener/
removeeventlistener functions that enable you to listen to dom events dispatched by the frame. communicating with the parent process to communicate with the parent process, the process, frames, and frame objects in sdk/
remote/child have a port object that you can use to receive messages from, and send messages to, code in the parent. see the documentation for sdk/
remote/parent for more details. g...
... frames a list of the content frames in this process. each element in this list is a frame. listen to attach and detach events to hear as frames are created and destroyed. methods forevery calls the callback for every existing frame and any new frames created in the future. ...
...And 4 more matches
Remotely debugging Firefox for Metro - Archive of obsolete content
this article explains how to use
remote debugging to inspect and code running in the new windows 8 ("metro-style") firefox app, using the developer tools in firefox on the desktop. prerequisites you will need: windows 8 (metro-style) firefox running in the touch-friendly "metro" mode on a windows 8 computer. firefox running in classic "desktop" mode on windows, mac os x, or linux, either on a separate computer or in a separate profile on the same computer. ...
... will need: windows 8 (metro-style) firefox running in the touch-friendly "metro" mode on a windows 8 computer. firefox running in classic "desktop" mode on windows, mac os x, or linux, either on a separate computer or in a separate profile on the same computer. ...
...parate computer or in a separate profile on the same computer. set up firefox for metro go to about:config in firefox for metro, and set the following required preference: devtools.debugger.
remote-enabled = true you may also want to set these optional preferences: devtools.debugger.force-local = false (if you want to connect from a different machine over the network) devtools.debugger.
remote-host (to change the tcp hostname where firefox will listen for connections) devtools.debugger.
remote-port (to change the tcp port number where firefox will listen for connections) devtools.debugger.prompt-connection = false (allow connections without displaying a confirmation prompt. this can be a security risk, especially if you also set the force-local preference to false.) set up firef...
...And 4 more matches
XRInputSourcesChangeEventInit.removed - Web APIs
the xrinputsourceschangeeventinit property
removed is an array of zero or more xrinputsource objects, each representing one input source which has been
removed from the xrsession. ...
... the xrinputsourceschangeeventinit property
removed is an array of zero or more xrinputsource objects, each representing one input source which has been
removed from the xrsession. ...
... the xrinputsourceschangeeventinit property
removed is an array of zero or more xrinputsource objects, each representing one input source which has been
removed from the xrsession. ...
...And 4 more matches
Connecting to Remote Content - Archive of obsolete content
it is an integral part of the modern web, and all major browsers support it. besides xml, it can be used to retrieve data in other formats, for example json, html and plain text. in this section we'll look into the xml and json communication mechanisms. ...
.... you can see that an instance of the xmlhttprequest class is created and it holds all functionality for making a request. we create this instance using xpcom instead of the usual way (new xmlhttprequest()) because this way works both in chrome and non-chrome code. following initialization, onload and onerror handlers are registered to a callback function to handle the response returned from the
remote server. in both cases aevent.target is an nsixmlhttprequest. in the onload callback function, the responsetext parameter contains the server response as text. if the response is an xml document, the responsexml property will hold an xmldocument object that can be manipulated using dom methods. sometimes the server doesn't specify an xml content-type header, which is necessary for the xml pars...
...s mode the code and user interface are blocked while waiting for a response to come back. note: requests can take a long time to process and you don't want users to be stuck waiting while a request is obtained and processed. therefore, it is very important that xmlhttprequest calls are always done asynchronously. now let's look at the most common types of content you can use to communicate with
remote servers. json content json is a very lightweight and simple data representation format, similar to the object representation used in javascript. unlike javascript, the json format doesn't allow any kind of code that can be run, only data. json used to be risky in terms of security because the favored way of parsing it was to use the javascript eval function. since eval executes any code con...
...And 3 more matches
dirRemove - Archive of obsolete content
returns an integer error code. for a list of possible values, see return codes. ...
... returns an integer error code. for a list of possible values, see return codes. ...
... returns an integer error code. for a list of possible values, see return codes. ...
...And 3 more matches
PerfMeasurement.jsm
the perfmeasu
rement.jsm javascript code module lets you take detailed performance measu
rements of your code. note: the perfmeasu
rement.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on. before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/perfmeasu
rement.jsm") see measuring performance using the perfmeasu
rement.jsm code module for details on how to use this api. note: at present, perfmeasu
rement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. method overview static bool canmeasuresomething(); void reset(); void start(); void sto...
...erview static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data. any measurable event that was not being recorded has a value of -1 (that is, 0xffffffffffffffff). note: these values are all zeroed (or set to -1, for events not being measured) when you initialize the perfmeasu
rement object, then they are not zeroed again unless you explicitly call the reset() method. this lets you accumulate measu
rements over multiple passes through code that you want to analyze. variable type description cpu_cycles uint64 the number of cpu cycles elapsed. instructions uint64 the number of instructions executed. cache_references uint64 the number of memory accesses that occu...
...read migrated from one cpu core to another. event types measured constant the eventsmeasured constant provides a mask indicating which event types were recorded. variable type description eventsmeasured eventmask a bit mask of the event types recorded; this can differ from the events requested if the platform doesn't support all of the event types you specified when creating the perfmeasu
rement object. constants event mask constants these constants are used to construct the mask indicating which events you want to monitor. constant value description cpu_cycles 0x00000001 measure cpu cycles elapsed. instructions 0x00000002 measure the number of instructions executed. cache_references 0x00000004 measure the number of cache references. cache_misses 0x00000008 measure the n...
...And 3 more matches
BluetoothRemoteGATTDescriptor - Web APIs
the bluetooth
remotegattdescriptor interface of the web bluetooth api provides a gatt descriptor, which provides further information about a characteristic’s value. interface interface bluetooth
remotegattdescriptor { readonly attribute bluetoothgattcharacteristic characteristic; readonly attribute uuid uuid; readonly attribute arraybuffer? ...
...provides a gatt descriptor, which provides further information about a characteristic’s value. interface interface bluetooth
remotegattdescriptor { readonly attribute bluetoothgattcharacteristic characteristic; readonly attribute uuid uuid; readonly attribute arraybuffer? ...
... a characteristic’s value. interface interface bluetooth
remotegattdescriptor { readonly attribute bluetoothgattcharacteristic characteristic; readonly attribute uuid uuid; readonly attribute arraybuffer? value; promise<arraybuffer> readvalue(); promise<void> writevalue(buffersource value); }; properties bluetooth
remotegattdescriptor.characteristicread only returns the bluetooth
remotegattcharacteristic this descriptor belongs to. bluetooth
remotegattdescriptor.uuidread only returns the uuid of the characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for theclient characteristic configuration descriptor. bluetooth
remotegattdescriptor.valueread only returns the currently cached descriptor value. this value gets updated when the value of the descr...
...And 3 more matches
BluetoothRemoteGATTService - Web APIs
the bluetooth
remotegattservice interface of the web bluetooth api represents a service provided by a gatt server, including a device, a list of referenced services, and a list of the characteristics of this service. ...
... the bluetooth
remotegattservice interface of the web bluetooth api represents a service provided by a gatt server, including a device, a list of referenced services, and a list of the characteristics of this service. ...
...ic> getcharacteristic(bluetoothcharacteristicuuid characteristic); promise<sequence<bluetoothgattcharacteristic>> getcharacteristics(optional bluetoothcharacteristicuuid characteristic); promise<bluetoothgattservice> getincludedservice(bluetoothserviceuuid service); promise<sequence<bluetoothgattservice>> getincludedservices(optional bluetoothserviceuuid service); }; properties bluetooth
remotegattservice.deviceread only returns information about a bluetooth device through an instance of bluetoothdevice. bluetooth
remotegattservice.isprimaryread only returns a boolean indicating whether this is a primary or secondary service. bluetooth
remotegattservice.uuidread only returns a domstring representing the uuid of this service. methods bluetooth
remotegattservice.getcharacter...
...And 3 more matches
Element.removeAttributeNS() - Web APIs
the
removeattributens() method of the element interface
removes the specified attribute from an element. syntax element.
removeattributens(namespace, attrname); parameters namespace is a string that contains the namespace of the attribute. attrname is a string that names the attribute to be
removed from the current node. ...
...
removeattributens(namespace, attrname); parameters namespace is a string that contains the namespace of the attribute. attrname is a string that names the attribute to be
removed from the current node. ...
... living standard ...
...And 3 more matches
Element.removeAttributeNode() - Web APIs
the
removeattributenode() method of the element object
removes the specified attribute from the current element. syntax
removedattr = element.
removeattributenode(attributenode) attributenode is the attr node that needs to be
removed.
removedattr is the
removed attr node. example // given: <div id="top" align="center" /> var d = document.getelementbyid("top"); var d_align = d.getattributenode("align"); d.
removeattributenode(d_align); // align is now
removed: <div id="top" /> notes if the
removed attribute has a default value, it is immediately replaced. the replacing attribute has the same namespace uri and local name, as well as the original prefix, when applicable. ...
...div id="top" align="center" /> var d = document.getelementbyid("top"); var d_align = d.getattributenode("align"); d.
removeattributenode(d_align); // align is now
removed: <div id="top" /> notes if the
removed attribute has a default value, it is immediately replaced. the replacing attribute has the same namespace uri and local name, as well as the original prefix, when applicable. there is no
removeattributenodens method; the
removeattributenode method can
remove both namespaced attributes and non-namespaced attributes. dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes ...
... living standard ...
...And 3 more matches
MediaQueryList.removeListener() - Web APIs
in the original implementation, the callback was a non-standard mediaquerylistlistener object. in the new implementation the standard event mechanism is used, and the callback is a standard function. return value void. ...
...in the original implementation, the callback was a non-standard mediaquerylistlistener object. in the new implementation the standard event mechanism is used, and the callback is a standard function. return value void. ...
...in the original implementation, the callback was a non-standard mediaquerylistlistener object. in the new implementation the standard event mechanism is used, and the callback is a standard function. return value void. ...
...And 3 more matches
RTCIceTransport.getRemoteParameters() - Web APIs
returns null if the parameters haven't been received yet. ...
... returns null if the parameters haven't been received yet. ...
... returns null if the parameters haven't been received yet. ...
...And 3 more matches
Selection.removeRange() - Web APIs
working draft current browser compatibility the compatibility table on this page is generated from structured data. ...
... working draft current browser compatibility the compatibility table on this page is generated from structured data. ...
... working draft current browser compatibility the compatibility table on this page is generated from structured data. ...
...And 3 more matches
Remote XUL - Archive of obsolete content
how to use xul delivered from a webserver, not as part of chrome. note: support for
remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a whitelist that lets you specify sites that can still use
remote xul. ...
... how to use xul delivered from a webserver, not as part of chrome. note: support for
remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a whitelist that lets you specify sites that can still use
remote xul. ...
... ...
...And 2 more matches
removeItemAt - Archive of obsolete content
« xul reference home
removeitemat( index ) return type: element
removes the child item in the element at the specified index. the method returns the
removed item. ...
... « xul reference home
removeitemat( index ) return type: element
removes the child item in the element at the specified index. the method returns the
removed item. ...
...
removeitemat( index ) return type: element
removes the child item in the element at the specified index. the method returns the
removed item. ...
...And 2 more matches
Using Remote XUL - Archive of obsolete content
introduction note: support for
remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a whitelist that lets you specify sites that can still use
remote xul. ...
... introduction note: support for
remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a whitelist that lets you specify sites that can still use
remote xul. ...
...ased language for describing application interfaces. it contains elements for all common ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers). xul is often used by desktop applications like mozilla but can also be loaded from a web server and rendered inside the content pane of a compatible browser. xul loaded and rendered in this way is called
remote xul and can be used for basic functions like web site navigation as well as to build sophisticated web-based applications. [***aw: we should have a screenshot here of a xul document loaded in a content window***] this tutorial walks you through the process of building xul-based navigation for the mozilla.org web site. after completing the tutorial you should understand how to: create xul ...
...And 2 more matches
PR_AtomicDecrement
the value returned is the referenced variable's final value. the modification to memory is unconditional. ...
...the value returned is the referenced variable's final value. the modification to memory is unconditional. ...
...the value returned is the referenced variable's final value. the modification to memory is unconditional. ...
...And 2 more matches
DataTransferItemList.remove() - Web APIs
the datatransferitemlist.
remove() method
removes the datatransferitem at the specified index from the list. if the index is less than zero or greater than one less than the length of the list, the list will not be changed. syntax datatransferitemlist.
remove(index); parameters index the zero-based index number of the item in the drag data list to
remove. if the index doesn't correspond to an existing item in the list, the list is left unchanged. return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be
removed. example this example shows the use of the
remove() method. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler wi...
...string(function (s){ console.log("... ...
...onsole.log("... ...
...And 2 more matches
IDBObjectStore.autoIncrement - Web APIs
the autoinc
rement read-only property of the idbobjectstore interface returns the value of the auto inc
rement flag for this object store. note that every object store has its own separate auto inc
rement counter. note: this feature is available in web workers. syntax var myautoinc
rement = objectstore.autoinc
rement; value a boolean: value meaning true the object store auto inc
rements. false the object store does not auto inc
rement. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.autoinc
rement to the console. for a full working example, see our to-do notifications app (view example live...
...s done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. d...
...And 2 more matches
MediaStream.onremovetrack - Web APIs
the mediastream.on
removetrack property is an eventhandler which specifies a function to be called when the
removetrack event occurs on a mediastream instance. this happens when a track of any kind is
removed from the media stream. this event is fired when the browser
removes a track from the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source. the
removetrack event does not get fired when javascript code explicitly
removes tracks from the stream (by calling
removetrack()). ...
... browser
removes a track from the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source. the
removetrack event does not get fired when javascript code explicitly
removes tracks from the stream (by calling
removetrack()). syntax mediastream.on
removetrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the
removetrack event which has occurred. the mediastreamtrack representing the track which was
removed is specified in the event's track property. ...
...ovetrack()). syntax mediastream.on
removetrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the
removetrack event which has occurred. the mediastreamtrack representing the track which was
removed is specified in the event's track property. example this example adds a listener which, when a track is
removed from the stream, logs the track that was
removed. ...
...And 2 more matches
PR_AtomicIncrement
the result of the function is the value of the memory after the operation. the writing of the memory is unconditional. ...
...the result of the function is the value of the memory after the operation. the writing of the memory is unconditional. ...
...the result of the function is the value of the memory after the operation. the writing of the memory is unconditional. ...
...the result of the function is the value of the memory after the operation. the writing of the memory is unconditional. ...
JS_RemoveRootRT
unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set. this enables any pointed-at gc thing to be garbage collected as needed. syntax jsbool js_
removerootrt(jsruntime *rt, void *rp); name type description rt jsruntime * pointer to the runtime with which the root was registered. rp void * address of the pointer to no longer protect. this must have been passed to one of js_addroot, js_addnamedroot, or js_addnamedrootrt earlier. description js_
removerootrt
removes the gc thing that rp points to from the list of gc things that are protected from garbage collection. rp is thus a pointer to a pointer to a js double, string, or object. do not pass a pointer to a js double, string, or obj...
...ier. description js_
removerootrt
removes the gc thing that rp points to from the list of gc things that are protected from garbage collection. rp is thus a pointer to a pointer to a js double, string, or object. do not pass a pointer to a js double, string, or object -- you must pass a pointer to a pointer or a pointer to a jsval that's a gc thing. the entry for the gc thing rp points to is
removed in the garbage collection hash table for the specified runtime, rt. js_
removerootrt always returns js_true. ...
...n. rp is thus a pointer to a pointer to a js double, string, or object. do not pass a pointer to a js double, string, or object -- you must pass a pointer to a pointer or a pointer to a jsval that's a gc thing. ...
...double, string, or object -- you must pass a pointer to a pointer or a pointer to a jsval that's a gc thing. the entry for the gc thing rp points to is
removed in the garbage collection hash table for the specified runtime, rt. js_
removerootrt always returns js_true. ...
BluetoothRemoteGATTCharacteristic.startNotifications() - Web APIs
specifications specification status comment web bluetooththe definition of 'startnotifications()' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'startnotifications()' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'startnotifications()' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'startnotifications()' in that specification. ...
BluetoothRemoteGATTServer - Web APIs
the bluetooth
remotegattserver interface of the web bluetooth api represents a gatt server on a
remote device. interface interface bluetooth
remotegattserver { readonly attribute bluetoothdevice device; readonly attribute boolean connected; promise<bluetooth
remotegattserver> connect(); void disconnect(); promise<bluetooth
remotegattservice> getprimaryservice(bluetoothserviceuuid service); promise<sequence<bluetooth
remotegattservice>> getprimaryservices(optional bluetoothserviceuuid service); }; properties bluetooth
remotegattserver.connectedread only a boolean value that returns true while this script execution environment is connected to this.device. it can be false while the user agent is physically connected. ...
...ce> getprimaryservice(bluetoothserviceuuid service); promise<sequence<bluetooth
remotegattservice>> getprimaryservices(optional bluetoothserviceuuid service); }; properties bluetooth
remotegattserver.connectedread only a boolean value that returns true while this script execution environment is connected to this.device. it can be false while the user agent is physically connected. bluetooth
remotegattserver.deviceread only a reference to the bluetoothdevice running the server. methods bluetooth
remotegattserver.connect() causes the script execution environment to connect to this.device. bluetooth
remotegattserver.disconnect() causes the script execution environment to disconnect from this.device. ...
... can be false while the user agent is physically connected. bluetooth
remotegattserver.deviceread only a reference to the bluetoothdevice running the server. methods bluetooth
remotegattserver.connect() causes the script execution environment to connect to this.device. bluetooth
remotegattserver.disconnect() causes the script execution environment to disconnect from this.device. bluetooth
remotegattserver.getprimaryservice() returns a promise to the primary bluetoothgattservice offered by the bluetooth device for a specified bluetoothserviceuuid. bluetooth
remotegattserver.getprimaryservices() returns a promise to a list of primary bluetoothgattservice objects offered by the bluetooth device for a specified bluetoothserviceuuid. specifications specification status ...
...e primary bluetoothgattservice offered by the bluetooth device for a specified bluetoothserviceuuid. bluetooth
remotegattserver.getprimaryservices() returns a promise to a list of primary bluetoothgattservice objects offered by the bluetooth device for a specified bluetoothserviceuuid. specifications specification status comment web bluetooththe definition of 'bluetooth
remotegattserver' in that specification. draft initial definition. ...
CanvasCaptureMediaStreamTrack - Web APIs
this lets applications that wish to specify the frame capture times directly do so, if they specified a framerate of 0 when calling capturestream(). ...
...this lets applications that wish to specify the frame capture times directly do so, if they specified a framerate of 0 when calling capturestream(). ...
...ng a call to htmlcanvaselement.capturestream(). part of the media capture and streams api. properties this interface inherits the properties of its parent, mediastreamtrack. canvascaptu
remediastreamtrack.canvas read only returns the htmlcanvaselement object whose surface is captured in real-time. methods this interface inherits the methods of its parent, mediastreamtrack. canvascaptu
remediastreamtrack.requestframe() manually forces a frame to be captured and sent to the stream. ...
...k. canvascaptu
remediastreamtrack.requestframe() manually forces a frame to be captured and sent to the stream. this lets applications that wish to specify the frame capture times directly do so, if they specified a framerate of 0 when calling capturestream(). specifications specification status comment media capture from dom elementsthe definition of 'canvascaptu
remediastreamtrack' in that specification. working draft initial definition ...
HTMLSelectElement.remove() - Web APIs
the htmlselectelement.
remove() method
removes the element at the specified index from the options collection for this select element. syntax collection.
remove(index); parameters index is a long for the index of the htmloptionelement to
remove from the collection. if the index is not found the method has no effect. ...
... the htmlselectelement.
remove() method
removes the element at the specified index from the options collection for this select element. syntax collection.
remove(index); parameters index is a long for the index of the htmloptionelement to
remove from the collection. if the index is not found the method has no effect. ...
... obsolete document object model (dom) level 1 specifi...
... to: <select id="existinglist" name="existinglist"> <option value="1">option: value 1</option> <option value="3">option: value 3</option> </select> */ specifications specification status comment html living standardthe definition of 'htmlselectelement.
remove()' in that specification. living standard html5the definition of 'htmlselectelement.
remove()' in that specification. recommendation is a snapshot of html living standard. document object model (dom) level 2 html specificationthe definition of 'htmlselectelement.
remove()' in that specification. obsolete document object model (dom) level 1 specificationthe definition of 'htmlselectelement.
remove()' in that specification. obsolete initial definitio...
PaymentResponse.payerEmail - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
RTCIceTransport.getRemoteCandidates() - Web APIs
the rtcicetransport method get
remotecandidates() returns an array which contains one rtcicecandidate for each of the candidates that have been received from the
remote peer so far during the current ice gathering session. each time your signaling code calls rtcpeerconnection.addicecandidate() to add a received candidate to the ice session, the ice agent places it in the list returned by this function. syntax
remotecandidates = rtcicetransport.get
remotecandidates(); parameters none. return value an array containing one rtcicecandidate object for each candidate that has been received so far from the
remote peer during the current ice candidate gathering session. it's important to keep in mind that there's no way to correlate these
remote candidates with compatible local candidates. to ...
...ng one rtcicecandidate object for each candidate that has been received so far from the
remote peer during the current ice candidate gathering session. it's important to keep in mind that there's no way to correlate these
remote candidates with compatible local candidates. to find the best match found so far, call rtcicetransport.getselectedcandidatepair(). example this simple example gets the
remote candidate list from the rtcicetransport for the first rtcrtpsender on the rtcpeerconnection, then outputs to the console all of the candidates in the list. ...
...to keep in mind that there's no way to correlate these
remote candidates with compatible local candidates. to find the best match found so far, call rtcicetransport.getselectedcandidatepair(). example this simple example gets the
remote candidate list from the rtcicetransport for the first rtcrtpsender on the rtcpeerconnection, then outputs to the console all of the candidates in the list. ...
... candidates with compatible local candidates. to find the best match found so far, call rtcicetransport.getselectedcandidatepair(). example this simple example gets the
remote candidate list from the rtcicetransport for the first rtcrtpsender on the rtcpeerconnection, then outputs to the console all of the candidates in the list. var
remotecandidates = pc.getsenders()[0].transport.transport.get
remotecandidates();
remotecandidates.foreach(function(candidate, index)) { console.log("candidate " + index + ": " + candidate.candidate); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.get
remotecandidates()' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.currentRemoteDescription - Web APIs
the read-only property rtcpeerconnection.current
remotedescription returns an rtcsessiondescription object describing the
remote end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a
remote peer. also included is a list of any ice candidates that may already have been generated by the ice agent since the offer or answer represented by the description was first instantiated. to change the current
remotedescription, call rtcpeerconnection.set
remotedescription(), which triggers a series of events which leads to this value being set. for details on what exactly happens and why the change isn't necessarily instantaneous, see pending and current descriptions in webrtc connectivity. unlike rtcpeercon...
...or answer represented by the description was first instantiated. to change the current
remotedescription, call rtcpeerconnection.set
remotedescription(), which triggers a series of events which leads to this value being set. for details on what exactly happens and why the change isn't necessarily instantaneous, see pending and current descriptions in webrtc connectivity. unlike rtcpeerconnection.
remotedescription, this value represents the actual current state of the local end of the connection;
remotedescription may specify a description which the connection is currently in the process of switching over to. syntax sessiondescription = rtcpeerconnection.current
remotedescription; return value the current description of the
remote end of the connection, if one has been set. if none has be...
...he connection;
remotedescription may specify a description which the connection is currently in the process of switching over to. syntax sessiondescription = rtcpeerconnection.current
remotedescription; return value the current description of the
remote end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the current
remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...eerconnection.current
remotedescription; return value the current description of the
remote end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the current
remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.current
remotedescription; if (sd) { alert("local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.current
remotedescription' in that specification. candidate rec...
RTCPeerConnection.onremovestream - Web APIs
the
removestream event has been
removed from the webrtc specification in favor of the existing
removetrack event on the
remote mediastream and the corresponding mediastream.on
removetrack event handler property of the
remote mediastream. the rtcpeerconnection api is now track-based, so having zero tracks in the
remote stream is equivalent to the
remote stream being
removed and the old
removestream event. the rtcpeerconnection.on
removestream event handler is a property containing the code to execute when the
removestream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is
removed from this connection. ...
...racks in the
remote stream is equivalent to the
remote stream being
removed and the old
removestream event. the rtcpeerconnection.on
removestream event handler is a property containing the code to execute when the
removestream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is
removed from this connection. syntax peerconnection.on
removestream = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type mediastreamevent. ...
...s sent when a mediastream is
removed from this connection. syntax peerconnection.on
removestream = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type mediastreamevent. ...
...om this connection. syntax peerconnection.on
removestream = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type mediastreamevent. ...
TextTrackList: removeTrack event - Web APIs
the
removetrack event is fired when a track is
removed from a texttracklist. ...
... the
removetrack event is fired when a track is
removed from a texttracklist. ...
... the
removetrack event is fired when a track is
removed from a texttracklist. ...
...hen a track is
removed from a texttracklist. bubbles no cancelable no interface trackevent event handler property on
removetrack examples using addeventlistener(): const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.addeventlistener('
removetrack', (event) => { console.log(`text track: ${event.track.label}
removed`); }); using the on
removetrack event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.texttracks.on
removetrack = (event) => { console.log(`text track: ${event.track.label}
removed`); }; specifications specification status html living standardthe definition of '
removetrack' in that specification. living standard ...
Animation.onremove - Web APIs
the animation interface's on
remove property (from the web animations api) is the event handler for the
remove event. this event is sent when the animation is
removed (i.e., put into an active replace state). syntax var
removehandler = animation.on
remove; animation.on
remove =
removehandler; value a function to be called to handle the
remove event, or null if no
remove event handler is set. ...
...s set. examples in our simple replace indefinite animations demo, you can see the following code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.on
remove = function() { console.log('animation
removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak.
...moved'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically
remove overriding forward filling animations. a console message is logged each time an animation it
removed, invoked when the
remove event is fired. specifications specification status comment web animationsthe definition of 'animation.on
remove' in that specification. working draft editor's draft. ...
AudioTrackList.onremovetrack - Web APIs
the audiotracklist on
removetrack event handler is called when the
removetrack event occurs, indicating that an audio track has been
removed from the media element, and therefore also from the audiotracklist. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was
removed from the media element's audiotracklist. note: you can also add a handler for the
removetrack event using addeventlistener(). syntax audiotracklist.on
removetrack = eventhandler; value set on
removetrack to a function that accepts as input a trackevent object which indicates in its track property which audio track has been
removed from the media element. example this simple example just fetches the current number of audio tracks in the media el...
...he
removetrack event using addeventlistener(). syntax audiotracklist.on
removetrack = eventhandler; value set on
removetrack to a function that accepts as input a trackevent object which indicates in its track property which audio track has been
removed from the media element. example this simple example just fetches the current number of audio tracks in the media element whenever a track is
removed from the media element. document.queryselector("my-video").audiotracks.on
removetrack = function(event) { mytrackcount = document.queryselector("my-video").audiotracks.length; }; the current number of audio tracks
remaining in the media element is obtained from audiotracklist property length. specifications specification status comment html living standardthe...
...ument.queryselector("my-video").audiotracks.on
removetrack = function(event) { mytrackcount = document.queryselector("my-video").audiotracks.length; }; the current number of audio tracks
remaining in the media element is obtained from audiotracklist property length. specifications specification status comment html living standardthe definition of 'audiotracklist.on
removetrack' in that specification. living standard html5the definition of 'audiotracklist.on
removetrack' in that specification. recommendation ...
BluetoothRemoteGATTCharacteristic.service - Web APIs
specifications specification status comment web bluetooththe definition of 'service' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'service' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'service' in that specification. ...
BluetoothRemoteGATTCharacteristic.stopNotifications() - Web APIs
}) returns a promise. specifications specification status comment web bluetooththe definition of 'stopnotifications()' in that specification. ...
...}) returns a promise. specifications specification status comment web bluetooththe definition of 'stopnotifications()' in that specification. ...
...}) returns a promise. specifications specification status comment web bluetooththe definition of 'stopnotifications()' in that specification. ...
BluetoothRemoteGATTCharacteristic.uuid - Web APIs
specifications specification status comment web bluetooththe definition of 'uuid' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'uuid' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'uuid' in that specification. ...
BluetoothRemoteGATTServer.connect() - Web APIs
parameters none. specifications specification status comment web bluetooththe definition of 'connect()' in that specification. ...
... parameters none. specifications specification status comment web bluetooththe definition of 'connect()' in that specification. ...
... parameters none. specifications specification status comment web bluetooththe definition of 'connect()' in that specification. ...
DOMTokenList.remove() - Web APIs
the
remove() method of the domtokenlist interface
removes the specified tokens from the list. syntax tokenlist.
remove(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token you want to
remove from the list. if the string is not in the list, no error is thrown, and nothing happens. return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then
remove a token from the list, and write the list into the <span>'s node.textcontent. ...
...turn value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then
remove a token from the list, and write the list into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; classes.
remove("c"); span.textcontent = classes; the output looks like this: to
remove multiple classes at once, you can supply multiple tokens. ...
...n = document.queryselector("span"); let classes = span.classlist; classes.
remove("c"); span.textcontent = classes; the output looks like this: to
remove multiple classes at once, you can supply multiple tokens. the order you supply the tokens doesn't have to match the order they appear in the list: let span2 = document.getelementsbytagname("span")[0] let classes2 = span.classlist; classes2.
remove("c", "b"); span2.textcontent = classes; specifications specification status comment domthe definition of '
remove()' in that specification. living standard initial definition ...
IdleDeadline.timeRemaining() - Web APIs
the time
remaining() method on the idledeadline interface returns the estimated number of milliseconds
remaining in the current idle period. the callback can call this method at any time to determine how much time it can continue to work before it must return. for example, if the callback finishes a task and has another one to begin, it can call time
remaining() to see if there's enough time to complete the next task. if there isn't, the callback can just return immediately, or look for other work to do with the
remaining time. by the time time
remaining() reaches 0, it is suggested that the callback should return control to the user agent's event loop. ...
...the value is ideally accurate to within about 5 microseconds. ...
...the value is ideally accurate to within about 5 microseconds. if the idledeadline object's didtimeout property is true, this method returns zero. ...
RTCPeerConnection.pendingRemoteDescription - Web APIs
the read-only property rtcpeerconnection.pending
remotedescription returns an rtcsessiondescription object describing a pending configuration change for the
remote end of the connection. this does not describe the connection as it currently stands, but as it may exist in the near future. use rtcpeerconnection.current
remotedescription or rtcpeerconnection.
remotedescription to get the current session description for the
remote endpoint. for details on the difference, see pending and current descriptions in webrtc connectivity. syntax sessiondescription = rtcpeerconnection.pending
remotedescription; return value if a
remote description change is in progress, this is an rtcsessiondescription describing the proposed configuration. otherwise, this returns null. example this example looks at th...
...n for the
remote endpoint. for details on the difference, see pending and current descriptions in webrtc connectivity. syntax sessiondescription = rtcpeerconnection.pending
remotedescription; return value if a
remote description change is in progress, this is an rtcsessiondescription describing the proposed configuration. otherwise, this returns null. example this example looks at the pending
remotedescription to determine whether or not there's a description change being processed. ...
...tcpeerconnection.pending
remotedescription; return value if a
remote description change is in progress, this is an rtcsessiondescription describing the proposed configuration. otherwise, this returns null. example this example looks at the pending
remotedescription to determine whether or not there's a description change being processed. var pc = new rtcpeerconnection(); … var sd = pc.pending
remotedescription; if (sd) { // there's a description change underway! } else { // no description change pending } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.pending
remotedescription' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.remoteDescription - Web APIs
the read-only property rtcpeerconnection.
remotedescription returns a rtcsessiondescription describing the session (which includes configuration and media information) for the
remote end of the connection. if this hasn't been set yet, this is null. the returned value typically reflects a
remote description which has been received over the signaling server (as either an offer or an answer) and then put into effect by your code calling rtcpeerconnection.set
remotedescription() in response. syntax var sessiondescription = peerconnection.
remotedescription; on a more fundamental level, the returned value is the value of rtcpeerconnection.pending
remotedescription if that property isn't null; otherwise, the value of rtcpeerconnection.current
remotedescription is returned. see pending and curren...
...n = peerconnection.
remotedescription; on a more fundamental level, the returned value is the value of rtcpeerconnection.pending
remotedescription if that property isn't null; otherwise, the value of rtcpeerconnection.current
remotedescription is returned. see pending and current descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the
remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...erty isn't null; otherwise, the value of rtcpeerconnection.current
remotedescription is returned. see pending and current descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the
remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.
remotedescription; if (sd) { alert("
remote session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no
remote session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.
remotedescription' in that specification. candidate recommen...
RTCPeerConnection.removeTrack() - Web APIs
the rtcpeerconnection.
removetrack() method tells the local end of the connection to stop sending media from the specified track, without actually
removing the corresponding rtcrtpsender from the list of senders as reported by rtcpeerconnection.getsenders(). if the track is already stopped, or is not in the connection's senders list, this method has no effect. if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the
remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. ...
...s not in the connection's senders list, this method has no effect. if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the
remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. syntax pc.
removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to
remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which
removes the track when the user clicks the button. var pc, sender; navigator.getusermedia(...
...track to a connection and sets up a listener on a close button which
removes the track when the user clicks the button. var pc, sender; navigator.getusermedia({video: true}, function(stream) { pc = new rtcpeerconnection(); var track = stream.getvideotracks()[0]; sender = pc.addtrack(track, stream); }); document.getelementbyid("closebutton").addeventlistener("click", function(event) { pc.
removetrack(sender); pc.close(); }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.
removetrack()' in that specification. candidate recommendation initial specification. ...
RTCRemoteOutboundRtpStreamStats - Web APIs
the webrtc statistics model's rtc
remoteoutboundrtpstreamstats dictionary extends the underlying rtcsentrtpstreamstats dictionary with properties measuring metrics specific to outgoing rtp streams. properties in addition to the properties defined by rtcsentrtpstreamstats and its underlying rtcrtpstreamstats and rtcstats dictionaries, rtc
remoteoutboundrtpstreamstats defines the following properties. localid a domstring which is used to find the local rtcinboundrtpstreamstats object which shares the same synchronization source (ssrc).
remotetimestamp a domhighrestimestamp specifying the timestamp (on the
remote device) at which the statistics in the rtc
remoteoutboundrtpstreamstats object were sent by the
remote endpoint. this is different from the timestamp found in the base rtcstats di...
... the rtc
remoteoutboundrtpstreamstats object were sent by the
remote endpoint. this is different from the timestamp found in the base rtcstats dictionary; it represents the time at which the object's statistics were received or generated by the local endpoint. reportssent an integer value indicating the total number of rtcp sender report (sr) blocks that this ssrc has sent. usage notes the rtc
remoteoutboundrtpstreamstats object's
remotetimestamp proeprty provides statistics based on the received data's ntp timestamp taken from an rtcp sender report (sr) block. be aware that the
remote clock may not be synchronized with the local clock (either in current time or speed at which time elapses). specifications specification status comment identifiers for webrtc's stat...
... candidate recommendation initial definition. ...
Selection.removeAllRanges() - Web APIs
working draft current browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... working draft current browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... current browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
Storage.removeItem() - Web APIs
the
removeitem() method of the storage interface, when passed a key name, will
remove that key from the given storage object if it exists. the storage interface of the web storage api provides access to a particular domain's session or local storage. if there is no item associated with the given key, this method will do nothing. syntax storage.
removeitem(keyname); parameters keyname a domstring containing the name of the key you want to
remove. return value undefined. example the following function creates three data items inside local storage, then
removes the image data item. ...
...ters keyname a domstring containing the name of the key you want to
remove. return value undefined. example the following function creates three data items inside local storage, then
removes the image data item. function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'mycat.png'); localstorage.
removeitem('image'); } we can do the same for the session storage. function populatestorage() { sessionstorage.setitem('bgcolor', 'red'); sessionstorage.setitem('font', 'helvetica'); sessionstorage.setitem('image', 'mycat.png'); sessionstorage.
removeitem('image'); } note: to see this used within a real world example, see our web storage demo. specifications specification s...
...pulatestorage() { sessionstorage.setitem('bgcolor', 'red'); sessionstorage.setitem('font', 'helvetica'); sessionstorage.setitem('image', 'mycat.png'); sessionstorage.
removeitem('image'); } note: to see this used within a real world example, see our web storage demo. specifications specification status comment html living standardthe definition of 'storage.
removeitem' in that specification. living standard ...
TextTrackList.onremovetrack - Web APIs
the texttracklist on
removetrack event handler is called when the
removetrack event occurs, indicating that a text track has been
removed from the media element, and therefore also from the texttracklist. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was
removed from the media element's texttracklist. note: you can also add a handler for the
removetrack event using addeventlistener(). syntax texttracklist.on
removetrack = eventhandler; value set on
removetrack to a function that accepts as input a trackevent object which indicates in its track property which text track has been
removed from the media element. example this simple example just fetches the current number of text tracks in the first media elem...
...
removetrack event using addeventlistener(). syntax texttracklist.on
removetrack = eventhandler; value set on
removetrack to a function that accepts as input a trackevent object which indicates in its track property which text track has been
removed from the media element. example this simple example just fetches the current number of text tracks in the first media element whenever a track is
removed from the media element. document.queryselectorall("video, audio")[0].texttracks.on
removetrack = function(event) { mytrackcount = document.queryselectorall("video, audio")[0].texttracks.length; }; the current number of text tracks
remaining in the media element is obtained from texttracklist property length. specifications specification status comment html li...
...torall("video, audio")[0].texttracks.on
removetrack = function(event) { mytrackcount = document.queryselectorall("video, audio")[0].texttracks.length; }; the current number of text tracks
remaining in the media element is obtained from texttracklist property length. specifications specification status comment html living standardthe definition of 'texttracklist: on
removetrack' in that specification. living standard ...
VideoTrackList.onremovetrack - Web APIs
the videotracklist on
removetrack event handler is called when the
removetrack event occurs, indicating that a video track has been
removed from the media element, and therefore also from the videotracklist. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was
removed from the media element's videotracklist. note: you can also add a handler for the
removetrack event using addeventlistener(). syntax videotracklist.on
removetrack = eventhandler; value set on
removetrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been
removed from the media element. example this simple example just fetches the current number of video tracks in the media ele...
...he
removetrack event using addeventlistener(). syntax videotracklist.on
removetrack = eventhandler; value set on
removetrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been
removed from the media element. example this simple example just fetches the current number of video tracks in the media element whenever a track is
removed from the media element. document.queryselector("my-video").videotracks.on
removetrack = function(event) { mytrackcount = document.queryselector("my-video").videotracks.length; }; the current number of video tracks
remaining in the media element is obtained from videotracklist property length. specifications specification status comment html living standardthe...
...ment.queryselector("my-video").videotracks.on
removetrack = function(event) { mytrackcount = document.queryselector("my-video").videotracks.length; }; the current number of video tracks
remaining in the media element is obtained from videotracklist property length. specifications specification status comment html living standardthe definition of 'videotracklist: on
removetrack' in that specification. living standard ...
mssitemodejumplistitemremoved - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mssitemodejumplistitem
removed event occurs when mssitemodeshowjumplist is called and an item has been
removed from a jump list by the user. ...
...this event is not triggered if mssitemodeclearjumplist has been called. ...
...is proprietary method is specific to internet explorer and microsoft edge. syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mssitemodejumplistitem
removed", handler, usecapture) general info synchronous no bubbles no cancelable no note this event is raised once for every item that has been
removed since the last time mssitemodeshowjumplist was called. this event is not triggered if mssitemodeclearjumplist has been called. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. see also microsoft api extensions ...
removeSession - Archive of obsolete content
the argument should be an object which implements the nsiautocompletesession interface. ...
...the argument should be an object which implements the nsiautocompletesession interface. ...
smartcard-remove
the smartcard-
remove event is fired when the
removal of a smart card has been detected. specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. ...
... description targetread only eventtarget the event target (the topmost target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. example document.addeventlistener("smartcard-
remove", smartcardchangehandler ); related events smartcard-insert ...
Mailnews and Mail code review requirements
owing two rubber-stamps based on this proposal on the tb-planning mailing list. the procedure to use these is to be sure to: include "rs=simple-orange-fix" or "rs=orange-debugging" in the first line of the commit message paste a link to the pushed commit with the rubber stamp in the bug make sure you pasted a link to any try-server pushes of the patch in the bug rs=simple-orange-fix requi
rements: the patch is fixing an intermittent orange test failure. the patch is a change exclusively to test logic. the patch has identified a likely problem and fixes it; no commenting out tests/changing what a test tests/adding huge timeouts. (you could still ask a reviewer to approve such things, though.) the patch does not change public test frameworks, specifically, nothing in mailnews/te...
...been run locally on the appropriate platform(s). specifically, if the xpcshell test will do different things on windows than it will do on os x or linux, it must be run on windows and one of os x / linux. the author of the patch is the module owner or a peer of the module to which the test corresponds. a bug is still required, even if it is immediately marked fixed. rs=orange-debugging requi
rements: the patch is trying to fix an intermittent orange test failure. the patch only touches test logic. the patch only adds/modifies logging statements, although the logs can be conditional. the patch must have been run at least once on the try server. (i have done some mozmill orange fixing where the try server would not duplicate the orange failures of the trunk and so in order to get th...
BluetoothRemoteGATTCharacteristic.properties - Web APIs
specifications specification status comment web bluetooththe definition of 'properties' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'properties' in that specification. ...
BluetoothRemoteGATTCharacteristic.readValue() - Web APIs
}) returns a promise that resolves to an dataview. specifications specification status comment web bluetooththe definition of 'readvalue()' in that specification. ...
...}) returns a promise that resolves to an dataview. specifications specification status comment web bluetooththe definition of 'readvalue()' in that specification. ...
BluetoothRemoteGATTCharacteristic.value - Web APIs
specifications specification status comment web bluetooththe definition of 'value' in that specification. ...
... specifications specification status comment web bluetooththe definition of 'value' in that specification. ...
CSSStyleDeclaration.removeProperty() - Web APIs
the cssstyledeclaration.
removeproperty() method interface
removes a property from a css style declaration object. syntax var oldvalue = style.
removeproperty(property); parameters property is a domstring representing the property name to be
removed. note that multi-word property names are hyphenated and not camel-cased. return value oldvalue is a domstring equal to the value of the css property before it was
removed. exceptions domexception no_modification_allowed_err: if the property or declaration block is read only. ...
... property is a domstring representing the property name to be
removed. note that multi-word property names are hyphenated and not camel-cased. return value oldvalue is a domstring equal to the value of the css property before it was
removed. exceptions domexception no_modification_allowed_err: if the property or declaration block is read only. example the following javascript code
removes the background-color css property from a selector rule: var declaration = document.stylesheets[0].rules[0].style; var oldvalue = declaration.
removeproperty('background-color'); specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration.
removeproperty()' in that specification. working draft documen...
CSSStyleSheet.removeRule() - Web APIs
the obsolete cssstylesheet method
removerule()
removes a rule from the stylesheet object. it is functionally identical to the standard, preferred method deleterule(). note: this is a legacy method which has been replaced by the standard method deleterule(). you should use that instead. syntax cssstylesheet.
removerule(index) parameters index the index into the stylesheet's cssrulelist indicating the rule to be
removed. return value undefined example this example
removes the first rule from the stylesheet mystyles. ...
...method deleterule(). note: this is a legacy method which has been replaced by the standard method deleterule(). you should use that instead. syntax cssstylesheet.
removerule(index) parameters index the index into the stylesheet's cssrulelist indicating the rule to be
removed. return value undefined example this example
removes the first rule from the stylesheet mystyles. mystyles.
removerule(0); you can rewrite this to use the standard deleterule() method very easily: mystyles.deleterule(0); specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.
removerule()' in that specification. working draft ...
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
applications that need to carefully control the timing of rendering and frame capture can use requestframe() to directly specify when it's time to capture a frame. to prevent automatic capture of frames, so that frames are only captured when requestframe() is called, specify a value of 0 for the capturestream() method when creating the stream. syntax stream.requestframe(); return value undefined usage notes there is currently an issue flagged in the specification pointing out that at this time, no exceptions are being thrown if the canvas isn't origin-clean. ...
... working draft initial definition ...
MediaRecorder.ignoreMutedMedia - Web APIs
the igno
remutedmedia property of the mediarecorder interface indicates whether the mediarecorder instance will record input, when the input mediastreamtrack is muted. if this attribute is false, mediarecorder will record silence for audio and black frames for video. the default is false. syntax var boolean = mediarecorder.igno
remutedmedia mediarecorder.igno
remutedmedia = boolean value a boolean. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e a boolean. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
MediaStreamTrack.remote - Web APIs
the mediastreamtrack.
remote read-only property allows javascript to know whether a webrtc mediastreamtrack is from a
remote source or a local one. it returns a boolean with a value of true if the track is sourced
remotely (that is, sourced by an rtcpeerconnection), or false if it is sourced locally. ...
... the mediastreamtrack.
remote read-only property allows javascript to know whether a webrtc mediastreamtrack is from a
remote source or a local one. it returns a boolean with a value of true if the track is sourced
remotely (that is, sourced by an rtcpeerconnection), or false if it is sourced locally. ...
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
possible values: gl.framebuffer: collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.draw_framebuffer: equivalent to gl.framebuffer. used as a destination for drawing, rendering, clearing, and writing operations. gl.read_framebuffer: used as a source for reading operations. attachment a glenum specifying the attachment point for the texture. ...
...a gl.invalid_enum error is thrown if target is not gl.framebuffer. attachment is not one of the accepted attachment points. ...
RTCIceCandidatePair.remote - Web APIs
the
remote property of the rtcicecandidatepair dictionary specifies the rtcicecandidate describing the configuration of the
remote end of a viable webrtc connection. syntax
remotecandidate = rtcicecandidatepair.
remote; value an rtcicecandidate which describes the configuration of the
remote end of a viable pair of ice candidates. the rtcicecandidatepair is returned by the rtcicetransport method getselectedcandidatepair(). example this one-line example simply obtains the current candidate pair and then from that gets the
remote candidate. var candidatepair = pc.getsenders()[0].transport.transport.getselectedcandidatepair(); var
remotecandidate = candidatepair.
remote; the rtcicetransport is found by getting the list of rtcrtpsender objects for the rtcpeerconnection pc. in the first rt...
...port is found by getting the list of rtcrtpsender objects for the rtcpeerconnection pc. in the first rtcrtpsender, we get the rtcdtlstransport over which the media data is being transmitted and finally, from that, the rtcicetransport. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidatepair.
remote' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection: removestream event - Web APIs
the obsolete
removestream event was sent to an rtcpeerconnection to inform it that a mediastream had been
removed from the connection. you can use the rtcpeerconnection interface's on
removestream property to set a handler for this event. this is the counterpart to the addstream event, which is also obsolete. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.on
removestream important: this event has been
removed from the webrtc specification in favor of the existing
removetrack event on the
remote mediastream and the corresponding mediastream.on
removetrack event handler property of the
remote mediastream. ...
...astreamevent event handler property rtcpeerconnection.on
removestream important: this event has been
removed from the webrtc specification in favor of the existing
removetrack event on the
remote mediastream and the corresponding mediastream.on
removetrack event handler property of the
remote mediastream. the rtcpeerconnection api is now track-based, so having zero tracks in the
remote stream is equivalent to the
remote stream being
removed, which caused a
removestream event. ...
SourceBuffer.remove() - Web APIs
end a double representing the end of the time range, in seconds. return value undefined. exceptions exception explanation invalidaccesserror the mediasource.duration property is equal to nan, the start parameter is negative or greater than mediasource.duration, or the end parameter is less than or equal to start or equal to nan. ...
...ue undefined. exceptions exception explanation invalidaccesserror the mediasource.duration property is equal to nan, the start parameter is negative or greater than mediasource.duration, or the end parameter is less than or equal to start or equal to nan. invalidstateerror the sourcebuffer.updating property is equal to true, or this sourcebuffer has been
removed from the mediasource. example tbd. specifications specification status comment media source extensionsthe definition of '
remove()' in that specification. recommendation initial definition. ...
SourceBuffer.removeAsync() - Web APIs
the
removeasync() method of the sourcebuffer interface starts the process of asynchronously
removing from the sourcebuffer media segments found within a specific time range. a promise is returned, which is fulfilled when the buffers in the specified time range have been
removed. this method can only be called when updating is false. if that's not the case, call abort() instead. syntax
removepromise = sourcebuffer.
removeasync(start, end); parameters start a double representing the start of the time range, in seconds. end a double representing the end of the time range, in seconds. return value a promise whose fulfillment handler is executed once the buffers in the specified time range have been
removed from the sourcebuffer. example this example establishes an asynch...
...g the end of the time range, in seconds. return value a promise whose fulfillment handler is executed once the buffers in the specified time range have been
removed from the sourcebuffer. example this example establishes an asynchronous function, emptysourcebuffer(), which simply clears the contents of the specified sourcebuffer. async function emptysourcebuffer(msbuffer) { await msbuffer.
removeasync(0, infinity).catch(function(e) { handleexception(e); } } specifications not currently part of the mse specification. specification status comment media source extensions recommendation initial definition. ...
Remainder (%) - JavaScript
the
remainder operator (%) returns the
remainder left over when one operand is divided by a second operand. it always takes the sign of the dividend. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: var1 % var2 examples
remainder with positive dividend 12 % 5 // 2 1 % -2 // 1 1 % 2 // 1 2 % 3 // 2 5.5 % 2 // 1.5
remainder with negative dividend -12 % 5 // -2 -1 % 2 // -1 -4 % 2 // -0
remainder with nan nan % 2 // nan specifications specification ecmascript (ecma-262)the definition of '
remainder operator' in that specification. ...
Remainder assignment (%=) - JavaScript
the
remainder assignment operator (%=) divides a variable by the value of the right operand and assigns the
remainder to the variable. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x %= y meaning: x = x % y examples using
remainder assignment // assuming the following variable // bar = 5 bar %= 2 // 1 bar %= 'foo' // nan bar %= 0 // nan specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification. ...
Index - Web APIs
per second. 112 audiobuffersourcenode api, audio, audiobuffersourcenode, interface, media, reference, web audio api the audiobuffersourcenode interface is an audioscheduledsourcenode which represents an audio source consisting of in-memory audio data, stored in an audiobuffer. it's especially useful for playing back audio which has particularly stringent timing accuracy requi
rements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. 113 audiobuffersourcenode.audiobuffersourcenode() api, audio, audiobuffersourcenode, constructor, media, reference, web audio api the audiobuffersourcenode() constructor creates a new audiobuffersourcenode object instance. 114 audio...
...reatemediastreamdestination() api, audiocontext, method, reference, référence(2), web audio api, createmediastreamdestination the mediastream is created when the node is created and is accessible via the mediastreamaudiodestinationnode's stream attribute. this stream can be used in a similar way as a mediastream obtained via navigator.getusermedia — it can, for example, be sent to a
remote peer using the rtcpeerconnection addstream() method. 129 audiocontext.createmediastreamsource() api, audio, audiocontext, audionode, media, mediastream, mediastreamtrack, method, reference, web, web audio, web audio api, createmediastreamsource for more details about media stream audio source nodes, check out the mediastreamaudiosourcenode reference page. 130 au...
...entifying the language used in the audio track. 192 audiotrack.sourcebuffer api, audio, audiotrack, html dom, mse, media, media source extensions, property, read-only, reference, sourcebuffer, track the read-only audiotrack property sourcebuffer returns the sourcebuffer that created the track, or null if the track was not created by a sourcebuffer or the sourcebuffer has been
removed from the mediasource.sourcebuffers attribute of its parent media source. 193 audiotracklist api, audio, audiotracklist, html dom, interface, media, reference, track list, tracks, list the audiotracklist interface is used to represent a list of the audio tracks contained within a given html media element, with each track represented by a separate audiotrack object in the l...
...And 246 more matches
Index - Archive of obsolete content
n, sublime text editor or any other. syntax highliting support for .htaccess files less. 3 2015 mdn fellowship program 2015, archive, fellowship no summary! 4 api api, archive archived documentation about obsolete web standards apis. 5 navigator api, navigator features that used to hang off the navigator interface, but have since been
removed. 6 navigator.moznotification api, deprecated, mobile, non-standard, property, reference provides support for creating notification objects, which are used to display desktop notification alerts to the user. currently, these are only supported on firefox mobile and firefox os. see displaying notifications for an example. 7 window: deviceproximity event senso...
...ntext of web pages whose url matches a given pattern. 50 page-worker add-on sdk create a permanent, invisible page and access its dom. 51 panel add-on sdk, add-ons, extensions creates transient dialogs to implement part of an add-on's user interface. 52 passwords add-on sdk interact with firefox's password manager to add, retrieve and
remove stored credentials. 53 private-browsing add-on sdk check whether a given object is private, so an add-on can respect private browsing 54 querystring add-on sdk utility functions for working with query strings. 55 request needsupdate, sdk, add-on make simple network requests. 56 selection add-on sdk get and set ...
... places/history access the user's browsing history. 99 platform/xpcom implement xpcom objects, factories, and services. 100 preferences/event-target add-on sdk listen to changes to the preferences system in firefox. 101 preferences/service add-on sdk, jetpack, sdk access the preferences system in firefox. 102
remote/child module, reference, sdk enables an sdk module loaded into a child process to access web content in the child process and communicate with modules in the main process. 103
remote/parent reference, sdk enables you to load modules, and privileged parts of your add-on in general, into child processes. 104 stylesheet/style modify styles usin...
...And 64 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
acts as none on elements with no special styling. m...
...alue demo browser description none div{ color: black; -moz-appearance:none; -webkit-appearance:none; appearance:none; } <div>lo
rem</div> firefox chrome safari edge no special styling is applied. this is the default. auto div{ color: black; -moz-appearance: auto; -webkit-appearance: auto; appearance:auto; } <div>lo
rem</div> none the user agent selects the appropriate special styling based on the element. acts as none on elements with no special styling. ...
...{ color: black; -moz-appearance: auto; -webkit-appearance: auto; appearance:auto; } <div>lo
rem</div> none the user agent selects the appropriate special styling based on the element. acts as none on elements with no special styling. menulist-button div { color: black; -moz-appearance: menulist-button; -webkit-appearance: menulist-button; } <div>lo
rem</div> firefox chrome safari edge the element is styled as a button that would indicate a menulist can be opened. ...
...And 59 more matches
RTCPeerConnection - Web APIs
the rtcpeerconnection interface represents a webrtc connection between the local computer and a
remote peer. it provides methods to connect to a
remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d...
...e="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcpeerconnection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructorrtcpeerconnection() the rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local device and a
remote peer.propertiesalso inherits properties from: eventtargetcantrickleicecandidatesthe read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the
remote peer can accept trickled ice candidates.connectionstate the read-only connectionstate property of the rtcpeerconnection interface indicates the current state of the peer connection by return...
...on by returning one of the string values specified by the enum rtcpeerconnectionstate.currentlocaldescription read only the read-only property rtcpeerconnection.currentlocaldescription returns an rtcsessiondescription object describing the local end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a
remote peer. also included is a list of any ice candidates that may already have been generated by the ice agent since the offer or answer represented by the description was first instantiated.current
remotedescription read only the read-only property rtcpeerconnection.current
remotedescription returns an rtcsessiondescription object describing the
remote end of the connection as it was most recently s...
...And 36 more matches
Multiple-column layout - Learn web development
d the page, you will get three columns: .container { column-count: 3; } the columns that you create have flexible widths — the browser works out how much space to assign each column. column-count example body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 arial, helvetica, sans-serif; } <div class="container"> <h1>simple multicol example</h1> <p> lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lo
rem placerat vulputate. duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor imperdiet nunc, at ultricies tellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare...
...inibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius commodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lo
rem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu urna eget velit cursus viverra quis vestibulum sem. aliquam tincidunt eget purus in interdum. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> .container { column-count: 3; } change your css to use column-width as fo...
... cursus viverra quis vestibulum sem. aliquam tincidunt eget purus in interdum. ...
...And 34 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
ative way. finally, we will learn a bit more about components. so far, we've seen how components can share data using props, and communicate with their parents using events and two-way data binding. now we will see how components can also expose methods and variables. the following new components will be developed throughout the course of this article: moreactions: displays the check all and
remove completed buttons, and emits the corresponding events required to handle their functionality. newtodo: displays the <input> field and add button for adding a new todo. todosstatus: displays the "x out of y items completed" status heading. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then...
...isplays the "x out of y items completed" status heading. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/05-advanced-concepts or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts
remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/76cc90c43a37452e8c7f70521f88b698?version=3.23.2 working on the moreactions component now we'll tackle the check all and
remove completed buttons. let's create a component that will be in charge of displaying the buttons and emitting the cor...
...ll tackle the check all and
remove completed buttons. let's create a component that will be in charge of displaying the buttons and emitting the corresponding events. create a new file — components/moreactions.svelte. when the first button is clicked, we'll emit a checkall event to signal that all the todos should be checked/unchecked. when the second button is clicked, we'll emit a
removecompleted event to signal that all of the completed todos should be
removed. ...
...And 32 more matches
CustomizableUI.jsm
ns and items in firefox's main window ui. it is available in the firefox window as the customizableui property on the window. if you want to use it from a jsm or another context without a window reference, you need to import it yourself: components.utils.import("resource:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, moving and
removing customizable widgets. manage the areas in which these widgets are shown. note that it is expressly not really aware about the specific ui used by users to make customizations. this is handled by customizemode.jsm, which interacts with customizableui through a listener mechanism. areas areas are parts of the user interface in which customizable widgets can be placed. customizableui assum...
...hevron) in the toolbar. in order to register such a toolbar, set the 'overflowable' property to true, and provide the id of the anchor in the 'anchor' property. widgets widget is the term that customizableui uses for each of the items in a customizable area. note that these are also abstract cross-window objects; customizableui will manage the actual dom manipulation involved with adding/moving/
removing widgets in all windows for you. there are three main types of widgets: 'legacy' xul widgets, which are the way customizableui represents widgets whose dom representation is present (or overlaid) into a window; api-style widgets, which are the new widgets customizableui can create and manage for you. these come in 3 types themselves: button which are simple toolbar buttons which...
...ar, or as a sliding 'subview' of the menu panel when such a widget is in the menu panel. custom which are widgets that are custom-created by some js supplied by the consumer for more details, see api-provided widgets. 'special' widgets: these are the representations of xul <toolbarseparator>, <toolbarspring> and <toolbarspacer> elements. customizableui provides apis to add, move and
remove all these different widgets, and mostly abstracts the dom away from you. the lifetime of your widget should be identical to the lifetime of the add-on - it's process-global, so if you call createwidget on bootstrap's "startup" and destroywidget on bootstrap's "shutdown", that's enough. listeners customizableui provides a way to listen for various bits of customization happening. this can be...
...And 28 more matches
Index
p in the previous chapter) and uses xpcom tools that make coding a lot easier and more efficient. it also introduces a basic string type that is used with many of the apis in both xpcom and gecko. 113 detailed xpcom hashtable guide guide, xpcom a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and
removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: 114 how to build an xpcom component in javascript add-ons, extensions, javascript, tutorial, xpcom if you are looking for add-on sdk solution for xpcom javascript components then check out platform/xpcom module first. 115 inheriting from implementation cla...
... in gecko 2.0 gecko 2.0, xpcom several changes that affect xpcom component compatibility are taking place in gecko 2. this article details those changes, and provides suggestions for how to update your code. 122 xpcom hashtable guide a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and
removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: 123 mozilla::services namespace developing mozilla, xpcom the services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be a...
...hree folder classes - nslocalmailfolder, nsimapmailfolder, and nsnewsfolder. they all inherit from nsmsgdbfolder, which implements a lot of the core functionality. rss feeds are implemented by nslocalmailfolder. ...
...And 26 more matches
nsINavBookmarksService
index(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8string getitemtitle(in long long aitemid); unsigned short getitemtype(in long long aitemid); astring getkeywordforbookmark(in long long aitemid); obsolete since gecko 40.0 astring getkeywordforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction get
removefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void importbookmarkshtml(in nsiuri url); obsolete since gecko 1.9 void importbookmarkshtmltofolder(in nsiuri url, in print64 folder); obsolete since gecko 1.9 print32 indexoffolder(in print64 parent, in print64 folder); obsolete since gecko 1.9 ...
...r, in nsiuri item, in print32 index); obsolete since gecko 1.9 long long insertseparator(in long long aparentid, in long aindex); boolean isbookmarked(in nsiuri auri); void movefolder(in print64 folder, in print64 newparent, in print32 index); obsolete since gecko 1.9 void moveitem(in long long aitemid, in long long anewparentid, in long aindex); void
removechildat(in long long afolder, in long aindex); obsolete since gecko 2.0 void
removefolder(in long long afolder); obsolete since gecko 2.0 void
removefolderchildren(in long long aitemid); void
removeitem(in long long aitemid); void
removeobserver(in nsinavbookmarkobserver observer); void replaceitem(in print64 folder, in nsiuri item, in nsiuri newitem...
...own or is not required to be specified, such as when appending an item to a folder. type_bookmark 1 this is an index for type "bookmark". type_folder 2 this is an index for type "folder". type_separator 3 this is an index for type "separator". type_dynamic_container 4 this is an index for type "dynamic container". dynamic containers were
removed in gecko 11, but the type index
remains to prevent reuse. methods addobserver() this method adds a bookmark observer. if ownsweak is false, the bookmark service will keep an owning reference to the observer. if ownsweak is true, then aobserver must implement nsisupportsweakreference, and the bookmark service will keep a weak reference to the observer. void addobserver( in nsinavbo...
...And 26 more matches
sslerr.html
described in this chapter. ssl error codes sec error codes ssl error codes table 8.1 error codes defined in sslerr.h constant value description ssl_error_export_only_server -12288 "unable to communicate securely. peer does not support high-grade encryption." the local system was configured to support the cipher suites permitted for domestic use. the
remote system was configured to support only the cipher suites permitted for export use. ssl_error_us_only_server -12287 "unable to communicate securely. peer requires high-grade encryption which is not supported." the
remote system was configured to support the cipher suites permitted for domestic use. the local system was configured to support only the cipher suites pe...
...this can be due to a misconfiguration at either end. it can be due to a server being misconfigured to use a non-rsa certificate with the rsa key exchange algorithm. ...
...: certificate or key not found in database. certificate not marked trusted in database and certificate's issuer not marked trusted in database. wrong password for key database. missing database. ssl_error_bad_certificate -12284 "unable to communicate securely with peer: peers's certificate was rejected." a certificate was received from the
remote system and was passed to the certificate authentication callback function provided by the local application. that callback function returned secfailure, and the bad certificate callback function either was not configured or did not choose to override the error code returned by the certificate authentication callback function. -12283 (unused) ssl_error_bad_client ...
...And 25 more matches
Signaling and video calling - Web APIs
pon server. through this third server, the two devices can locate one another, and exchange negotiation messages. in this article, we will further enhance the websocket chat first created as part of our websocket documentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. you can try out this example on glitch, and you can
remix the example to experiment with it as well. you can also look at the full project on github. note: if you try out the example on glitch, please note that any changes made to the code will immediately reset any connections. in addition, there is a short timeout period; the glitch instance is for quick experiments and testing only. the signaling server establishing a webrtc connection between...
... following fields: type the message type; either "video-offer" or "video-answer". name the sender's username. target the username of the person to receive the description (if the caller is sending the message, this specifies the callee, and vice-versa). sdp the sdp (session description protocol) string describing the local end of the connection from the perspective of the sender (or the
remote end of the connection from the receiver's point of view). at this point, the two participants know which codecs and codec parameters are to be used for this call. they still don't know how to transmit the media data itself though. this is where interactive connectivity establishment (ice) comes in. exchanging ice candidates two peers need to exchange ice candidates to negotiate the actual ...
...on a better (usually higher-performance) candidate, the stream may change formats as needed. though not currently supported, a candidate received after media is already flowing could theoretically also be used to downgrade to a lower-bandwidth connection if needed. each ice candidate is sent to the other peer by sending a json message of type "new-ice-candidate" over the signaling server to the
remote peer. each candidate message include these fields: type the message type: "new-ice-candidate". target the username of the person with whom negotiation is underway; the server will direct the message to this user only. candidate the sdp candidate string, describing the proposed connection method. you typically don't need to look at the contents of this string. all your code needs to do ...
...And 25 more matches
Floats - Learn web development
ng a block of text around an element. you can follow along by creating a new index.html file on your computer, filling it with a simple html template, and inserting the below code into it at the appropriate places. at the bottom of the section, you can see a live example of what the final code should look like. first, we'll start off with some simple html — add the following to your html body,
removing anything that was inside there before: <h1>simple float example</h1> <div class="box">float</div> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lo
rem placerat vulputate. duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor imperdiet nunc, at ultricies tellus laoreet sit amet. </p> <p>sed auctor cursus massa at port...
...an finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius commodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lo
rem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu urna eget velit cursus viverra quis vestibulum sem. aliquam tincidunt eget purus in interdum. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> now apply the following css to your html (using a <style> element or a <link> to a separate .c...
...</p> <p>duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor imperdiet nunc, at ultricies tellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac o...
...And 24 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
el needs to be opened and the rtcpeerconnection needs to be created. the stun server listed here is obviously not a real one; you'll need to replace stun.myserver.tld with the address of a real stun server. ...
...ion needs to be created. the stun server listed here is obviously not a real one; you'll need to replace stun.myserver.tld with the address of a real stun server. ...
...raints = { audio: true, video: true }; const config = { iceservers: [{ urls: "stun:stun.mystunserver.tld" }] }; const selfvideo = document.queryselector("video.selfview"); const
remotevideo = document.queryselector("video.
remoteview"); const signaler = new signalingchannel(); const pc = new rtcpeerconnection(config); this code also gets the <video> elements using the classes "selfview" and "
remoteview"; these will contain, respectively, the local user's self-view and the view of the incoming stream from the
remote peer. connecting to a
remote peer the start() function shown here can be called by either of the two end-points that want to talk to one another. it doesn't matter who does it first; the negotiation will just work. async function start() { try { const stream = await n...
...And 19 more matches
The Implementation of the Application Object Model - Archive of obsolete content
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 nsidomelement, nsidomnode, nsixmlcontent, and nsicontent. what is rdf? rdf (pronounced r-d-f) has never been a ravening demon intent upon taking over the earth, although that does depend on who you ask. rdf stands for resource...
...'t do much to help the layman understand exactly what it does. rdf provides a very general mechanism for representing relationships between different disparate types of data. the relationships between data are represented as a directed labeled graph structure. the data itself can be fed in from any number of different sources (e.g., from a local file system, from your bookmarks file, or from some
remote downloadable rdf file), and can then be combined into a single graph. ok, so after that paragraph many of you probably still don't understand what rdf does, so here's the short and sweet version. rdf can suck up data from different places (like your bookmarks and history or another web site), and it can combine them. this gives you a feature called aggregation, the ability to put completely di...
...other web site), and it can combine them. this gives you a feature called aggregation, the ability to put completely different kinds of data into the same place. for example, the traditional bookmarks tree view could contain anything from mail messages to local files to maps of other sites. this same ability to aggregate data leads to another capability of rdf. ...
...And 18 more matches
Fundamental text and font styling - Learn web development
etter (selects the first letter of an element's text), ::first-line (selects the first line of an element's text), or ::selection (selects the text currently highlighted by the cursor.) fonts let's move straight on to look at properties for styling fonts. in this example we'll apply some different css properties to the same html sample, which looks like this: <h1>tommy the cat</h1> <p>well i
remember it as though it were a meal ago...</p> <p>said tommy the cat as he reeled back to clear whatever foreign matter may have nestled its way into his mighty throat. many a fat alley rat had met its demise while staring point blank down the cavernous barrel of this awesome prowling machine. truly a wonder of nature this urban predator — tommy the cat had many a story to tell. but it was a ra...
...nt of the selected elements (which is usually the text, but can also include a couple of other things, such as an underline or overline placed on text using the text-decoration property). color can accept any css color unit, for example: p { color: red; } this will cause the paragraphs to become red, rather than the standard browser default black, like so: <h1>tommy the cat</h1> <p>well i
remember it as though it were a meal ago...</p> <p>said tommy the cat as he reeled back to clear whatever foreign matter may have nestled its way into his mighty throat. many a fat alley rat had met its demise while staring point blank down the cavernous barrel of this awesome prowling machine. truly a wonder of nature this urban predator — tommy the cat had many a story to tell. but it was a ra...
...d for a sans-serif font! note: font names that have more than one word — like trebuchet ms — need to be surrounded by quotes, for example "trebuchet ms". a font-family example let's add to our previous example, giving the paragraphs a sans-serif font: p { color: red; font-family: helvetica, arial, sans-serif; } this gives us the following result: <h1>tommy the cat</h1> <p>well i
remember it as though it were a meal ago...</p> <p>said tommy the cat as he reeled back to clear whatever foreign matter may have nestled its way into his mighty throat. many a fat alley rat had met its demise while staring point blank down the cavernous barrel of this awesome prowling machine. truly a wonder of nature this urban predator — tommy the cat had many a story to tell. but it was a ra...
...And 18 more matches
imgIContainer
solete since gecko 2.0 imagecontainer getimagecontainer(); native code only! nsiframe getrootlayoutframe(); violates the xpcom interface guidelines pruint16 gettype(); violates the xpcom interface guidelines void init(in print32 awidth, in print32 aheight, in imgicontainerobserver aobserver); obsolete since gecko 2.0 void lockimage(); void
removeframe(in gfxiimageframe item); obsolete since gecko 1.9.2 void requestdecode(); void requestdiscard(); void requestrefresh([const] in timestamp atime); violates the xpcom interface guidelines void resetanimation(); void restoredatadone(); native code only! obsolete since gecko 2.0 void setdiscardable(in string amimetype); native code onl...
.... type_vector 1 flag_none 0x0 flags for imgicontainer operations. meanings: flag_none: lack of flags. flag_sync_decode: forces synchronous/non-progressive decode of all available data before the call returns. it is an error to pass this flag from a call stack that originates in a decoder (that is, from a decoder observer event). flag_decode_no_p
remultiply_alpha: do not p
remultiply alpha if it is not already p
remultiplied in the image data. flag_decode_no_colorspace_conversion: do not do any colorspace conversion; ignore any embedded profiles, and do not convert to any particular destination space. flag_clamp: extend the image to the fill area by clamping image sample coordinates instead of by tiling. this only affects 'draw()'. ...
... frame_first: the first frame frame_current: the current frame. ...
...And 18 more matches
nsIContentPrefService2
onkey 2.17) description content preferences allow the application to associate arbitrary data, or "preferences", with specific domains, or web "content". specifically, a content preference is a structure with three values: a domain with which the preference is associated, a name that identifies the preference within its domain, and a value. (see nsicontentpref below.) for example, if you want to
remember the user's preference for a certain zoom level on www.mozilla.org pages, you might store a preference whose domain is "www.mozilla.org", whose name is "zoomlevel", and whose value is the numeric zoom level. a preference need not have a domain, and in that case the preference is called a "global" preference. this interface doesn't impart any special significance to global preferences; they're...
...void getcachedbysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, out unsigned long len, [retval,array,size_is(len)] out nsicontentpref prefs); nsicontentpref getcachedglobal(in astring name, in nsiloadcontext context); void getglobal(in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void
removealldomains(in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removeallglobals(in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removebydomain(in astring domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removebydomainandname(in astring domain, in ...
...
removeallglobals(in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removebydomain(in astring domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removebydomainandname(in astring domain, in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removebyname(in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removebysubdomain(in astring domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void
removebysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); ...
...And 18 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
known svggraphicselement instead of svglocatable and svgtransformable implementation status unknown svggeometryelement with svggeometryelement.ispointinfill() and svggeometryelement.ispointinstroke() methods partially implemented (bug 1239100). the methods ispointinfill() and ispointinstroke() are not implemented yet (bug 1325319). ...
...vggeometryelement.ispointinstroke() methods partially implemented (bug 1239100). the methods ispointinfill() and ispointinstroke() are not implemented yet (bug 1325319). ...
...ods partially implemented (bug 1239100). the methods ispointinfill() and ispointinstroke() are not implemented yet (bug 1325319). ...
...And 18 more matches
context-menu - Archive of obsolete content
adds items, submenus, and menu separators to the page's context menu. usage instead of manually adding items when particular contexts occur and then
removing them when those contexts go away, you bind items to contexts, and the adding and
removing is automatically handled for you. items are bound to contexts in much the same way that event listeners are bound to events. when the user invokes the context menu, all of the items bound to the current context are automatically added to the menu. if no items are bound, none are added. likewise, any items that were previously in the menu but are not bound to the current context are automatically
removed from the menu. you never need to manually
remove your items from the menu unless you want them to never appear again. for example, if your add...
...rather, create your item only once and supply a context that matches the target url. context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. ...
...ion) predicatefunction is called when the menu is invoked, and the context occurs when the function returns a true value. the function is passed an object with properties describing the menu invocaton context. array an array of any of the other types. this context occurs when all contexts in the array occur. menu items also have a context property that can be used to add and
remove declarative contexts after construction. for example: var context = require("sdk/context-menu").selectorcontext("img"); mymenuitem.context.add(context); mymenuitem.context.
remove(context); when a menu item is bound to more than one context, it appears in the menu when all of those contexts occur. in content scripts the declarative contexts are handy but not very powerful. for instance, you...
...And 17 more matches
MMgc - Archive of obsolete content
mmgc::gcobject { // mymanagedclass is a gcobject, and // avmplus::stringp is a rcobject, so use drcwb drcwb(stringp) mystring; }; when are the macros not needed? write barriers are not needed for stack-based local variables, regardless of whether the object pointed to is gcobject, gcfinalizedobject, rcobject or rcfinalizedobject. the gc marks the entire stack during collection, and not inc
rementally, so write barriers aren't needed. write barriers are not needed for pointers to gc objects from unmanaged memory (gcroot). gcroots are marked at the end of the mark phase, and not inc
rementally, so no write barriers are required. drc() is required for rc objects, since the reference count must be maintained. write barriers are not needed for c++ objects that exist purely on the stack, and ...
...the heap. the flash player class "nativeinfo" is a good example. such objects are essentially the same as stack-based local variables. zeroing rcobjects all rcobjects (including all subclasses) must zero themselves out completely upon destruction. asserts enforce this. the reason is that our collector zeroes memory upon free and this was hurting performance. since mmgc must traverse objects to dec
rement refcounts properly upon destruction, i just made destructors do zeroing too. this mostly applies to non-pointer fields as drcwb smart pointers do this for you. poisoned memory in debug builds, mmgc writes "poison" into deallocated memory as a debugging aid. here's what the different poison values mean: 0xfafafafa uninitialized unmanaged memory 0xedededed unmanaged memory that was freed ex...
...threading the gc routines are not currently thread safe, we're operating under the assumption that none of the player spawned threads create gc'd things. if this isn't true we hope to eliminate other threads from doing this and if we can't do that we will be forced to make our gc thread safe, although we hope we don't have to do that. threading gets more complicated because...
...And 17 more matches
Notes on HTML Reflow - Archive of obsolete content
ing new continuation frames, for example, for a text frame when the text must be wrapped. some reflows are immediate in response to user or script actions; for example, resizing the window or changing the document's default font. these are dispatched directly from the presentation shell (e.g., nsipresshell::stylechangereflow), and affect the entire frame tree. other reflows are inc
remental and are dealt with asynchronously; for example, when content streams in from the network. inc
remental reflows are queued by the presentation shell for batched dispatch. reflow state the reflow state object, nshtmlreflowstate, is used to pass constraining information "down" from parent frames to child frames. for example, a <div> with a constrained width (e.g., set via the css widt...
...l reflows have a reason , which is maintained in the reflow state object (and may mutate, as described below). the reflow reason controls how a frame reacts during a reflow, and is one of the following: initial, for the very first time that the frame hierarchy is flowed. in this case, a frame knows that there is no residual state that can be used to simplify geometry computation. ...
...a frame reacts during a reflow, and is one of the following: initial, for the very first time that the frame hierarchy is flowed. in this case, a frame knows that there is no residual state that can be used to simplify geometry computation. inc
remental, when something in the frame tree changes; for example, when more content is read from the network, or some script manipulates the dom. an inc
remental reflow is targeted at a single frame in the frame hierarchy. during an inc
remental reflow, a frame can assume that none of the constraints computed "from above" (for example, available width) have changed; instead, something "within" the frame has changed, which may have bottom-up impact to the frame hierarchy. resize, when the containing boundary for the frame hierarchy cha...
...And 17 more matches
tabbrowser - Archive of obsolete content
autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. ...
... autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autoscroll ...
... autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autoscroll type: boolean se...
...And 17 more matches
RDF in Mozilla FAQ - Archive of obsolete content
uge) rdf/xml dump. it describes thousands of web sites using a mix of the dublin core metadata vocabulary and the dmoz taxonomy. see their rdf pages for more information. if you have problems with the dmoz and chefmoz data, it's best to contact those projects directly. but if you do something interesting with this content (eg. have mozilla use it, eg. by loading chunks of it into a xul ui from a
remote site), don't forget to let mozilla-rdf and the rdf interest group lists know. those lists would probably also be interested in tools for cleaning / re-processing / storing the dmoz data too. see the sites using odp data pages for some directories based on the odp rdf dumps. what is a datasource? rdf can generally be viewed in two ways: either as a graph with nodes and arcs, or as a "soup" of...
...table is keyed by the datasource's "uri", which is either the url of an rdf/xml file, or a "special" uri starting with rdf: that refers to a built-in datasource. datasources may be loaded via the rdf service using the getdatasource() method. if the uri argument refers to an rdf/xml file's url, then the rdf service will create an rdf/xml datasource and asynchronously parse it. the datasource will
remain "cached" until the last reference to the datasource is released. if the uri argument refers to a built-in datasource, the rdf service will use the xpcom component manager to load a component whose contractid is constructed using the "special" uri and the well-known prefix@mozilla.org/rdf/datasource;1?name=</code>. for example, rdf:foo would load: @mozilla.org/rdf/datasource;1?name=foo ...
...by setting // ablocking to tr...
...And 17 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ult/pref as in /usr/lib/thunderbird-5/default/pref ) for the record/history purpose ... the old netscape 4.x the file is encoded (byte-shift/rotary is 7), and the presence of the file (netscape.cfg) in the mozilla_home directory suffices for it to be read and executed. for mozilla 1.x.x, firefox, thunderbird or netscape 7 it is still a javascript file, the byte-shift is 13 by default, but can be
removed using the pref("general.config.obscure_value", 0); preference in any appropriate .js file dedicated to autoconfig (here autoconf.js). the name of the file can be anything you want because it is named by a general.config preference that should be added at the end of file mozilla_home/default/pref/autoconf.js or mozilla_home/greprefs/autoconf.js: pref("general.config.filename", "mozilla.cfg");...
...alues returned from the ldap query ldap_values = values; var uid = getldapvalue(values, "uid"); var cn = getldapvalue(values, "cn"); var mail = getldapvalue(values, "mail"); var url = getldapvalue(values, "labeleduri"); // those ldap variables are only available in this processldapvalues context! // so we set the preferences that need them here. ...
...attrs array, // uses the previous processldapvalues() getldapattributes( ldaphost, ldapbase, ldapfilter, ldapattrs.join(",") ); // create account // see also http://blog.deanandadie.net/2010/06/easy-thunderbird-account-management-using-mcd/ // identity defaultpref("mail.identity.id1.fullname", userinfo.cn ); defaultpref("mail.identity.id1.smtpserver", "smtp1" ); defaultpref("mail.identity.id1.use
remail", userinfo.mail ); // imap server settings defaultpref("mail.server.server1.hostname", "myimap.server.com" ); defaultpref("mail.server.server1.name", userinfo.mail ); defaultpref("mail.server.server1.port", 993 ); defaultpref("mail.server.server1.sockettype", 3 ); defaultpref("mail.server.server1.type", "imap" ); defaultpref("mail.server.server1.username", userinfo.mail ); // smtp server set...
...And 16 more matches
Componentizing our Svelte app - Learn web development
ponents and share information among them. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/04-componentizing-our-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app
remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/99b9eb228b404a2f8c8959b22c0a40d3?version=3.23.2 breaking the app into components in svelte, an application is composed from one or more components. a component is a reusable, self-contained block of code that encapsulates html, css and java...
...input and button that allow you to enter a new todo item. filterbutton.svelte: the all, active, and completed buttons that allow you to apply filters to the displayed todo items. todosstatus.svelte: the "x out of y items completed" heading. todo.svelte: an individual todo item. each visible todo item will be displayed in a separate copy of this component. moreactions.svelte: the check all and
remove completed buttons at the bottom of the ui that allow you to perform mass actions on the todo items. in this article we will concentrate on creating the filterbutton and todo components; we'll get to the others in future articles. let's get started. note: in the process of creating our first couple of components, we will also learn different techniques to communicate between components, ...
...make use of our filterbutton component. first of all, we need to import it — add the following line at the top of the todos.svelte <script> section: import filterbutton from './filterbutton.svelte' now, replace the filters <div> with a call to the filterbutton component, which takes the current filter as a prop — the below line is all you need: <filterbutton {filter} /> note:
remember that when the html attribute name and variable matches, they can be replaced with {variable}, that's why we could replace <filterbutton filter={filter} /> with <filterbutton {filter} />. so far so good! let's try out the app now. you'll notice that when you click on the filter buttons, they are selected and the style updates appropriately. but! we have a problem — the todos aren't filter...
...And 16 more matches
sslfnc.html
plication attempts to set or set the policy or preference for one of the old fips cipher suite numbers, the library recognizes the old number and sets or gets the value for the new cipher suite number instead. in this release, the three ssl_fortezza_ cipher suites cannot be enabled unless there is a pkcs #11 module available with a fortezza-enabled token. the ssl_fortezza_ cipher suites will be
removed in nss 3.11. ssl_cipherprefgetdefault gets the current default preference setting for a specified ssl2 or ssl3 cipher suite. syntax #include "ssl.h" secstatus ssl_cipherprefsetdefault(print32 cipher, prbool *enabled); parameters this function has the parameters listed below. cipher the cipher suite whose default preference setting you want to...
...he factory setting. ssl_clearsessioncache empties the ssl client session id cache. syntax #include "ssl.h" void ssl_clearsessioncache(void); description you must call ssl_clearsessioncache after you use one of the ssl export policy functions to change cipher suite policy settings or use ssl_cipherprefsetdefault to enable or disable any cipher suite. otherwise, the old settings
remain in the session cache and will be used instead of the new settings. this function clears only the client cache. the client cache is not configurable. it is located in ram (not on disk), and has the following characteristics: maximum number of entries: unlimited ssl 2.0 timeout value: 100 seconds ssl 3.0 timeout value: 24 hours note: if an ssl client application does not call ssl_c...
... must use one of these functions to create a server cache. this function creates two caches: theserver session id cache (also called the server session cache, or server cache), and theclient-auth certificate cache (also called the client cert cache, or client auth cache). both caches are used only for sessions where the program handshakes as a server. the client-auth certificate cache is used to
remember the certificates previously presented by clients for client certificate authentication. passing a null value or a value that is out of range for any of the parameters causes the server default value to be used in the server cache. the values that you pass affect only the server cache, not the client cache. initializing multi-processing with a shared ssl server cache to start a mult...
...And 16 more matches
A simple RTCDataChannel sample - Web APIs
rogramming model can be used for each. in this example, we will open an rtcdatachannel connection linking two elements on the same page. while that's obviously a contrived scenario, it's useful for demonstrating the flow of connecting two peers. we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a
remote computer for another example. the html first, let's take a quick look at the html that's needed. there's nothing incredibly complicated here. first, we have a couple of buttons for establishing and closing the connection: <button id="connectbutton" name="connectbutton" class="buttonleft"> connect </button> <button id="disconnectbutton" name="disconnectbutton" class="buttonright" disabled>...
...t event listeners on the three buttons. establishing a connection when the user clicks the "connect" button, the connectpeers() method is called. we're going to break this up and look at it a bit at a time, for clarity. note: even though both ends of our connection will be on the same page, we're going to refer to the one that starts the connection as the "local" one, and to the other as the "
remote" end. set up the local peer localconnection = new rtcpeerconnection(); sendchannel = localconnection.createdatachannel("sendchannel"); sendchannel.onopen = handlesendchannelstatuschange; sendchannel.onclose = handlesendchannelstatuschange; the first step is to create the "local" end of the connection. this is the peer that will send out the connection request. the next step is to create...
...ection request. the next step is to create the rtcdatachannel by calling rtcpeerconnection.createdatachannel() and set up event listeners to monitor the channel so that we know when it's opened and closed (that is, when the channel is connected or disconnected within that peer connection). it's important to keep in mind that each end of the channel has its own rtcdatachannel object. set up the
remote peer
remoteconnection = new rtcpeerconnection();
remoteconnection.ondatachannel = receivechannelcallback; the
remote end is set up similarly, except that we don't need to explicitly create an rtcdatachannel ourselves, since we're going to be connected through the channel established above. instead, we set up a datachannel event handler; this will be called when the data channel is opened; th...
...And 16 more matches
Working with Svelte stores - Learn web development
do information to web storage, allowing our todos to persist over page reloads. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/06-stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores
remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/d1fa84a5a4494366b179c87395940039?version=3.23.2 dealing with our app state we have already seen how our components can communicate with each other using props, two-way data binding, and events. in all these cases we were dealing with commun...
...content: <script> import { alert } from '../stores.js' import { ondestroy } from 'svelte' let alertcontent = '' const unsubscribe = alert.subscribe(value => alertcontent = value) ondestroy(unsubscribe) </script> {#if alertcontent} <div on:click={() => alertcontent = ''}> <p>{ alertcontent }</p> </div> {/if} <style> div { position: fixed; cursor: pointer; margin-right: 1.5
rem; margin-left: 1.5
rem; margin-top: 1
rem; right: 0; display: flex; align-items: center; border-radius: 0.2
rem; background-color: #565656; color: #fff; font-size: 0.875
rem; font-weight: 700; padding: 0.5
rem 1.4
rem; font-size: 1.5
rem; z-index: 100; opacity: 95%; } div p { color: #fff; } div svg { height: 1.6
rem; fill: currentcolor; width: 1.4
rem; margin-right: 0.
... margin-left: 1.5
rem; margin-top: 1
rem; right: 0; display: flex; align-items: center; border-radius: 0.2
rem; background-color: #565656; color: #fff; font-size: 0.875
rem; font-weight: 700; padding: 0.5
rem 1.4
rem; font-size: 1.5
rem; z-index: 100; opacity: 95%; } div p { color: #fff; } div svg { height: 1.6
rem; fill: currentcolor; width: 1.4
rem; margin-right: 0.5
rem; } </style> let's walk through this piece of code in detail. at the beginning we import the alert store. next we import the ondestroy() lifecycle function, which lets us execute a callback after the component has been unmounted. we then create a local variable named alertcontent. ...
...And 15 more matches
IME handling guide
/or ecompositionchange event if necessary. one of the other important jobs of this is, when a focused editor handles a dispatched ecompositionchange event, this modifies the stored composition string and its clause information. the editor refers the stored information for creating or modifying a text node representing a composition string. and before dispatching ecomposition* events, this class
removes ascii control characters from dispatching composition event's data in the default settings. although, this can be disabled with "dom.compositionevent.allow_control_characters" pref. finally, this class guarantees that requesting to commit or cancel current composition to ime is perefored synchronously. see forcibly committing composition section for the detail. editor/libeditor mozilla::ed...
...fe actually, but it causes a lot of oranges of automated tests. see also notifications to ime section for the detail of sending notifications. currently, widgetquerycontentevent is handled via imecontentobserver because if it has a cache of selection, it can set reply of equeryselectedtext event only with the cache. that is much faster than using contenteventhandler. e10s support even when a
remote process has focus, native ime handler in chrome process does its job. so, there is process boundary between native ime handler and focused editor. unfortunately, it's not allowed to use syncronous communication from chrome process to a
remote process. this means that chrome process (and also native ime and our native ime handler) cannot query the focused editor contents directly. for fixing th...
...aret::mrect caret rect at mcaret::moffset. if caret isn't actually exists, it's computed with a character rect at the offset. mtextrectarray::mstart if there is composition, mstart is same as mcompositionstart. otherwise, uint32_max. mtextrectarray::mrects each character rects of composition string. meditorrect the rect of editor element. mozilla::contentcacheinchild this exists only in
remote processes. this is created as a member of puppetwidget. when puppetwidget receives notifications to ime from imecontentobserver in the
remote process, it makes this class modify its cached content. then, this class do that with widgetquerycontentevents. finally, puppetwidget sends the notification and contentcacheinparent instance as contentcache to its parent process. mozilla::contentcachein...
...And 15 more matches
Power profiling overview
s. it serves as a starting point for anybody doing power profiling for the first time. basic physics concepts in physics, power is the rate of doing work. it is equivalent to an amount of energy consumed per unit time. in si units, energy is measured in joules, and power is measured in watts, which is equivalent to joules per second. although power is an instantaneous concept, in practice measu
rements of it are determined in a non-instantaneous fashion, i.e. by dividing an energy amount by a non-infinitesimal time period. strictly speaking, such a computation gives the average power but this is often referred to as just the power when context makes it clear. in the context of computing, a fully-charged mobile device battery (as found in a laptop or smartphone) holds a certain amount of en...
... if all cores are idle then the entire package can also become idle, which reduces power consumption even further. the fraction of time that a package or core spends in an idle c-state is called the c-state residency. this is a misleading term — the active state, c0, is also a c-state — but one that is nonetheless common. intel processors have model-specific registers (msrs) containing measu
rements of how much time is spent in different c-states, and tools such as powermetrics (mac), powertop and turbostat (linux) can expose this information. a wakeup occurs when a core or package transitions from an idle state to the active state. this happens when the os schedules a process to run due to some kind of event. common causes of wakeups include scheduled timers going off and blocked i/o s...
...sequence of the existence of c-states is that observations made during power profiling — even more than with other kinds of profiling — can disturb what is being observed. for example, the gecko profiler takes samples at 1000hz using a timer. each of these samples can trigger a wakeup, which consumes power and obscures firefox's natural wakeup patterns. for this reason, integrating power measu
rements into the gecko profiler is unlikely to be useful, and other power profiling tools typically use much lower sampling rates (e.g. 1hz.) p-states intel processors also support multiple p-states. p0 is the state where the processor is operating at maximum frequency and voltage, and higher-numbered p-states operate at a lower frequency and voltage to reduce power consumption. processors can have...
...And 15 more matches
Index
e. the resulting jsid, on success, is either an interned string or a well-known symbol; either way it is immune to gc so there is no need to visit *idp during gc marking.. 64 js::protokeytoid jsapi reference, reference, référence(2), spidermonkey js::protokeytoid converts a specified js prototype key key, to a js id. js::protokeytoid stores a jsid to *idp. 65 js::
remove*root jsapi reference, obsolete, reference, référence(2), spidermonkey js::
remove*root
removes the variable that rp points to from the garbage collector's root set. 66 js::rooted jsapi reference, reference, référence(2), spidermonkey here, ptr represents the private member of js::rooted<t>, typed with t. 67 js::setlargeallocationfailurecallback ...
...ack is a hook that applications may install to be called at some point during property access. a jsdeletepropertyop may be installed on a jsclass to hook property deletes. 96 jsenumerateop jsapi reference, spidermonkey jsenumerateop is called just before an object is enumerated (via a for...in statement, an array comprehension, or a call to js_enumerate). it should define any
remaining lazy properties that should be enumerable but are not yet defined in obj. this hook does not implement iteration: once the properties are defined, the javascript engine can enumerate them. 97 jserrorformatstring jsapi reference, reference, référence(2), spidermonkey jserrorformatstring is a struct to represent error message and type, returned by js_reporterrornumber f...
... be cleaned up by the garbage collector (private data stored in the object by the application, file handles, etc.) 108 jsfreeop jsapi reference, reference, référence(2), spidermonkey various finalization api takes not jscontext * but rather either jsfreeop structure or its library-private counterpart freeop. these structures wrap parameters that are passed to the finalizers
removing most of explicit dependencies on jscontext in the finalization code. 109 jsfunction api, guide, jsapi, needscontent, spidermonkey jsfunction is a type in the jsapi. the apis js_newfunction, js_definefunction, js_compilefunction, and their unicode equivalents return values of type jsfunction *. 110 jsfunctionspec jsapi reference, spidermonkey jsfuncti...
...And 15 more matches
nsINavBookmarkObserver
toolkit/components/places/nsinavbookmarksservice.idlscriptable this interface is an observer for bookmark changes. ...
...atebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folder, in print64 oldparent, in print32 oldindex, in print64 newparent, in print32 newindex); obsolete since gecko 1.9 void onfolder
removed(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onitemadded(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring aguid, in acstring aparentguid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisann...
...anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); void onitemmoved(in long long aitemid, in long long aoldparentid, in long aoldindex, in long long anewparentid, in long anewindex, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid); void onitem
removed(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in acstring aguid, in acstring aparentguid); void onitemreplaced(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 void onitemvisited(in long long aitemid, in long long avisitid, in prtime atime, in unsigned long atransitiontype, in nsiuri ...
...And 15 more matches
Client-side storage - Learn web development
uses. it consists of javascript apis that allow you to store data on the client (i.e. on the user's machine) and then retrieve it when needed. this has many distinct uses, such as: personalizing site preferences (e.g. showing a user's choice of custom widgets, color scheme, or font size). persisting previous site activity (e.g. storing the contents of a shopping cart from a previous session,
remembering if a user was previously logged in). saving data and assets locally so a site will be quicker (and potentially less expensive) to download, or be usable without a network connection. saving web application generated documents locally for use offline often client-side and server-side storage are used together. for example, you could download a batch of music files (perhaps used by a we...
...m('name','chris'); the storage.getitem() method takes one parameter — the name of a data item you want to retrieve — and returns the item's value. now type these lines into your javascript console: let myname = localstorage.getitem('name'); myname upon typing in the second line, you should see that the myname variable now contains the value of the name data item. the storage.
removeitem() method takes one parameter — the name of a data item you want to
remove — and
removes that item out of web storage. type the following lines into your javascript console: localstorage.
removeitem('name'); let myname = localstorage.getitem('name'); myname the third line should now return null — the name item no longer exists in the web storage. the data persists! one key f...
... our javascript code into it. create an index.js file in the same directory as your html file. we'll start off by creating references to all the html features we need to manipulate in this example — we'll create them all as constants, as these references do not need to change in the lifecycle of the app. ...
...And 14 more matches
nsIAnnotationService
out unsigned long count, [retval, array, size_is(count)] out nsivariant result); void getitemannotationnames(in long long aitemid, [optional] out unsigned long count, [retval, array, size_is(count)] out nsivariant result); boolean pagehasannotation(in nsiuri auri, in autf8string aname); boolean itemhasannotation(in long long aitemid, in autf8string aname); void
removepageannotation(in nsiuri auri, in autf8string aname); void
removeitemannotation(in long long aitemid, in autf8string aname); void
removepageannotations(in nsiuri auri); void
removeitemannotations(in long long aitemid); void copypageannotations(in nsiuri asourceuri, in nsiuri adesturi, in boolean aoverwritedest); void copyitemannotations(in long long ...
...void
removepageannotations(in nsiuri auri); void
removeitemannotations(in long long aitemid); void copypageannotations(in nsiuri asourceuri, in nsiuri adesturi, in boolean aoverwritedest); void copyitemannotations(in long long asourceitemid, in long long adestitemid, in boolean aoverwritedest); void addobserver(in nsiannotationobserver aobserver); void
removeobserver(in nsiannotationobserver aobserver); nsiuri getannotationuri(in nsiuri auri, in autf8string aname); constants constant value description expire_session 0 for temporary data that can be discarded when the user exits.
removed at application exit. expire_weeks 2 for general page settings, things the user is interested in seeing...
...ri getannotationuri(in nsiuri auri, in autf8string aname); constants constant value description expire_session 0 for temporary data that can be discarded when the user exits.
removed at application exit. expire_weeks 2 for general page settings, things the user is interested in seeing if they come back to this page some time in the near future.
removed at 30 days. expire_months 3 something that the user will be interested in seeing in their history like favicons. if they haven't visited a page in a couple of months, they probably aren't interested in many other annotations, the positions of things, or other stuff you create, so put that in the weeks policy.
removed at 180 days. expire_never 4 for data that shou...
...And 14 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
'hs...
...d]); dropdowns[topic] = this; }; dropdown.prototype.toggle = function toggle(state) { if (typeof(state) === 'boolean') this.state = state === false ? ...
...ion(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addeventlistener("click", function(e) { document.
removeeventlistener("mousemove", slidermotion); setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addeventlistener("mouseup", slideend); document.addeventlistener("mousemove", slidermotion); }); var slideend = function slide...
...And 14 more matches
SpiderMonkey 1.8.5
. it is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8 the following features in earlier versions of spidermonkey have been dropped. support for extended class methods (in particular, jsequalityop) has been
removed. multithreaded js programs that race against the same objects are now explicitly not supported. multithreaded programs are allowed, but each thread must operate on objects in a separate compartment, isolated from the other threads. the old build system (using makefile.ref) is no longer supported. spidermonkey 1.8.5 includes a new configure-based build system, introduced shortly after active...
... applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. previous versions of spidermonkey supported two types of native functions: jsnative and jsfastnative. all support for the slow native function type has been
removed, and the fast signature has been renamed to jsnative. embeddings that defined jsnatives in previous versions must update all those functions to the new signature. getters and setters of type jspropertyop took an id parameter of type jsval. the type of the parameter has been changed to jsid. many getters and setters simply ignore the id anyway; if the value is needed, use js_idtovalue. the t...
... has been changed to jsid. many getters and setters simply ignore the id anyway; if the value is needed, use js_idtovalue. the type of setters has changed from jspropertyop to jsstrictpropertyop (to accomodate es5 strict mode). to migrate, simply add a jsbool strict parameter to each setter function. it is safe for the setter to ignore the value of the argument. the rooting apis (js_addroot, js_
removeroot, etc.) have been replaced with a family of type-safe functions (js_addstringroot, js_
removestringroot, etc.) that are easier to use correctly. js_newdouble, js_newdoublevalue, and js_newnumbervalue are gone. instead use double_to_jsval, int_to_jsval, and uint_to_jsval, which are faster and can't fail. js_getstringbytes and js_getstringchars are gone. there is no longer an infallible way ...
...And 13 more matches
Using XPCOM Components
components like the ones in this section are obtained and used by the mozilla browser. cookie manager cookie management is one of the many sets of functionality that is made available to the browser in the form of an xpcom component and that can be reused by developers who want similar functionality in their applications. whenever a user accesses the cookie manager dialog to view, organize, or
remove cookies that have been stored on the system, they are using the cookiemanager component behind the scenes. the cookie manager dialog shows user interface[cookie-manager-ui] that is presented to the user in mozilla for working with the cookiemanager component. the cookie manager dialog this dialog is written in xul and javascript, and uses a part of xpcom called xpconnect to seamlessly conn...
... (see connecting to components from the interface below). xul is just one way to expose the functionality of the cookiemanager component-but it's a particularly useful one in the mozilla world. the functionality of the cookiemanager component is available through the nsicookiemanager interface, which is comprised of the public methods in the table below. the nsicookiemanager interface
removeall
remove all cookies from the cookie list. enumerator enumerate through the cookie list.
remove
remove a particular cookie from the list. in xpcom the interface is guaranteed to stay the same even if the underlying implementation changes. the interfaces are public, in other words, and the implementations are private[private-xpcom-interfaces]. when a user sele...
...rator enumerate through the cookie list.
remove
remove a particular cookie from the list. in xpcom the interface is guaranteed to stay the same even if the underlying implementation changes. the interfaces are public, in other words, and the implementations are private[private-xpcom-interfaces]. when a user selects one of the cookies displayed in the list and then clicks the
remove button, the
remove method in the nsicookiemanager interface is called. the function is carried out by the cookiemanager component, and the selected cookie is deleted from disk and
removed from the displayed list. ...
...And 13 more matches
nsIDownloadManager
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) implemented by: @mozilla.org/download-manager;1. ...
...tdownload(in unsigned long aid); void onclose(); obsolete since gecko 1.9.1 void open(in nsidomwindow aparent, in nsidownload adownload); obsolete since gecko 1.9.1 void openprogressdialogfor(in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloadonclose); obsolete since gecko 1.9.1 void pausedownload(in unsigned long aid); void
removedownload(in unsigned long aid); void
removedownloadsbytimeframe(in long long abegintime, in long long aendtime); void
removelistener(in nsidownloadprogresslistener alistener); void resumedownload(in unsigned long aid); void retrydownload(in unsigned long aid); void savestate(); obsolete since gecko 1.8 void startbatchupdate(); obsolete si...
...tartbatchupdate(); obsolete since gecko 1.9.1 attributes attribute type description activedownloadcount long the number of files currently being downloaded. read only. activedownloads nsisimpleenumerator an enumeration of active nsidownloads. read only. cancleanup boolean whether or not there are downloads that can be cleaned up (
removed) that is downloads that have completed, have failed or have been canceled. read only. datasource nsirdfdatasource read only. obsolete since gecko 1.8 dbconnection mozistorageconnection the database connection to the downloads database. read only. defaultdownloadsdirectory nsilocalfile returns the platform default downloads directory. read only. ...
...And 13 more matches
nsIXULTemplateBuilder
of the query are processed by a separate component called a query processor. this query processor is expected to use this query to generate results when asked by the template builder. the template builder then generates output for each result based on the <rule> elements. this allows the query processor to be specific to a particular kind of input data or query syntax, while the template builder
remains independent of the kind of data being used. due to this, the query processor will be supplied with the datasource and query which the template builder handles in an opaque way, while the query processor handles these more specifically. results implement the nsixultemplateresult interface and may be identified by an id which must be unique within a given set of query results. each query may be...
...e content within the rule's <action> body is inserted as a sibling of the <template>, assuming the template builder creates real dom content. only one rule will match a result. for a tree builder, for example, the content within the action body is used to create the tree rows instead. a matching result must have its rulematched() method called. when a result no longer matches, the result's hasbeen
removed() method must be called. optionally, the rule may have a <bindings> section which may be used to define additional variables to be used within an action body. each of these declared bindings must be supplied to the query processor via its addbinding() method. the bindings are evaluated after a rule has matched. templates may generate content recursively, using the previous iteration's results...
...he result objects from each iteration to be used directly as the reference points for the next iteration. when using multiple queries, each may generate results with the same id. more than one of these results may match one of the rules in their respective queries, however only the result for the earliest matching query in the template becomes the active match and generates output. the addresult,
removeresult, replaceresult and resultbindingchanged methods may be called by the query processor to indicate that the set of valid results has changed, such that a different query may match. if a different match would become active, the content for the existing match is
removed and the content for the new match is generated. a query processor is not required to provide any support for updating resul...
...And 13 more matches
EventTarget.addEventListener() - Web APIs
specifies characteristics about the event listener. the available options are: capture a boolean indicating that events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree. once a boolean indicating that the listener should be invoked at most once after being added. if true, the listener would be automatically
removed when invoked. passive a boolean that, if true, indicates that the function specified by listener will never call preventdefault(). if a passive listener does call preventdefault(), the user agent will do nothing other than generate a console warning. see improving scrolling performance with passive listeners to learn more. mozsystemgroup a boolean indicating that the listener should...
...f addeventlistener() was a boolean value indicating whether or not to use capture. over time, it became clear that more options were needed. rather than adding more parameters to the function (complicating things enormously when dealing with optional values), the third parameter was changed to an object that can contain various properties defining the values of options to configure the process of
removing the event listener. because older browsers (as well as some not-too-old browsers) still assume the third parameter is a boolean, you need to build your code to handle this scenario intelligently. you can do this by using feature detection for each of the options you're interested in. for example, if you want to check for the passive option: let passivesupported = false; try { const opt...
...ons you're interested in. for example, if you want to check for the passive option: let passivesupported = false; try { const options = { get passive() { // this function will be called when the browser // attempts to access the passive property. ...
...And 13 more matches
Array.prototype.splice() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax let arrdeleteditems = array.splice(start[, deletecount[, item1[, item2[, ...]]]]) parameters start the index at which to start changing the array. if greater than the length of the array, start will be set to the length of the array. in this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided. ...
...y element as item[n*] provided. if negative, it will begin that many elements from the end of the array. (in this case, the origin -1, meaning -n is the index of the nth last element, and is therefore equivalent to the index of array.length - n.) if array.length + start is less than 0, it will begin from index 0. deletecount optional an integer indicating the number of elements in the array to
remove from start. if deletecount is omitted, or if its value is equal to or larger than array.length - start (that is, if it is equal to or greater than the number of elements left in the array, starting at start), then all the elements from start to the end of the array will be deleted. note: in ie8, it won't delete all when deletecount is omitted. if deletecount is 0 or negative, no ele...
...tart. if deletecount is omitted, or if its value is equal to or larger than array.length - start (that is, if it is equal to or greater than the number of elements left in the array, starting at start), then all the elements from start to the end of the array will be deleted. note: in ie8, it won't delete all when deletecount is omitted. ...
...And 13 more matches
Index - Archive of obsolete content
te (xul) xul attributes, xul reference no summary! 6 flexgroup "flexgroup" is used to group flexible elements together and should be set to an integer. elements with a lower flexgroup are flexed first. when those elements have reached their maximum sizes, the elements with the next higher flexgroup are flexed. this process continues until there are no more elements
remaining. the same process occurs when decreasing the size, except in the other direction. 7 accelerated xul, xul attribute, xul reference no summary! 8 acceltext xul attributes, xul reference no summary! 9 accessible xul attributes, xul reference no summary! 10 accesskey reference, xul, xul attributes, xul reference, acce...
...y! 153 ignoreincolumnpicker xul attributes, xul reference no summary! 154 ignorekeys xul attributes, xul reference no summary! 155 image xul attributes, xul reference no summary! 156 image.onload no summary! 157 inactivetitlebarcolor xul attributes, xul reference no summary! 158 inc
rement xul attributes, xul reference no summary! 159 index xul attributes, xul reference no summary! 160 inputtooltiptext xul attributes, xul reference no summary! 161 insertafter xul attributes, xul reference no summary! 162 insertbefore xul attributes, xul reference no summary! 163 instantapply ...
...rence, needsattention no summary! 258 ordinal xul attributes, xul reference no summary! 259 orient xul attributes, xul reference no summary! 260 pack xul attributes, xul reference no summary! 261 page no summary! 262 pageid xul attributes, xul reference no summary! 263 pageinc
rement xul attributes, xul reference no summary! 264 pagestep xul attributes, xul reference no summary! 265 panel.consumeoutsideclicks no summary! 266 panel.fade xul, xul attribute, xul reference no summary! 267 panel.flip reference, référence(2), xul, xul attribute, xul reference no summary! 268 ...
...And 12 more matches
scale - Archive of obsolete content
either horizontally or vertically allows the user to select a value by dragging a thumb on the bar. use the orient attribute to specify the orientation of the scale. the default value is horizontal which displays a horizontal scale. lower values are to the left and higher values are to the right. set the orient attribute to vertical to use a vertical scale. ...
...tally or vertically allows the user to select a value by dragging a thumb on the bar. use the orient attribute to specify the orientation of the scale. the default value is horizontal which displays a horizontal scale. lower values are to the left and higher values are to the right. set the orient attribute to vertical to use a vertical scale. ...
...umb on the bar. use the orient attribute to specify the orientation of the scale. the default value is horizontal which displays a horizontal scale. lower values are to the left and higher values are to the right. set the orient attribute to vertical to use a vertical scale. the user may use the arrow keys to inc
rement and dec
rement the value by one unit, or the page up and page down keys to inc
rement and dec
rement the value by one page, as specified by the pageinc
rement attribute. ...
...And 12 more matches
TypeScript support in Svelte - Learn web development
g our svelte applications, further resources, and more. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/07-typescript-support or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/07-typescript-support
remember to run npm install && npm run dev to start your app in development mode. repl unfortunately, typescript support is not yet available in the repl. typescript: optional static typing for javascript typescript is a superset of javascript that provides features such as optional static typing, classes, interfaces, and generics. the goal of typescript is to help catch mistakes early through it...
...any typescript features even without declaring variable types. availability of new and future javascript features: typescript transpiles many recent es6 features to plain old-school javascript, allowing you to use them even on user-agents that don't support them natively yet. typescript also has some disadvantages: not true static typing: types are only checked at compile time, and they are
removed from the generated code. steep learning curve: even though typescript is a superset of javascript and not a completely new language, there is a considerable learning curve, especially if you have no experience at all with static languages like java or c#. more code: you have to write and maintain more code. no replacement for automatic tests: even though types might help you catch several ...
...ting svelte project to add typescript support to an existing svelte project you can follow these instructions. alternatively, you can download the setuptypescript.js file to a scripts folder inside your project's root folder, and then run node scripts/setuptypescript.js. you can even use degit to download the script. that's what we will do to start porting our application to typescript. note:
remember that you can run npx degit opensas/mdn-svelte-tutorial/07-typescript-support svelte-todo-typescript to get the complete to-do list application in javascript before you start porting it to typescript. go to the root directory of the project and enter these commands: npx degit sveltejs/template/scripts scripts # download script file to a scripts folder node scripts/setuptypescript.js...
...And 12 more matches
Styling Vue components with CSS - Learn web development
mal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { /* 1 */ overflow: visible; } input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68
rem; margin: 0 auto; font: 1.6
rem/1.25 "helvetica neue", helvetica, arial, sans-serif; background-color: #f5f5f5; color: #4d4d4d; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; } @media screen and (min-width: 620px) { body { font-size: 1.9
rem; line-height: 1.31579; } } /*end resets*/ next, in your src/main.js file, import the reset.css file like so: ...
... /*end resets*/ next, in your src/main.js file, import the reset.css file like so: import './assets/reset.css'; this will cause the file to get picked up during the build step and automatically added to our site. the reset styles should be applied to the app now. the images below show the look of the app before and after the reset is applied. before: after: noticeable changes include the
removal of the list bullets, background color changes, and changes to the base button and input styles. adding global styles to single file components now that we've reset our css to be uniform across browsers, we need to customize the styles a bit more. there are some styles that we want to apply across components in our app. while adding these files directly to the reset.css stylesheet would work...
...ow that we've reset our css to be uniform across browsers, we need to customize the styles a bit more. there are some styles that we want to apply across components in our app. while adding these files directly to the reset.css stylesheet would work, we'll instead add them to the <style> tags in app.vue to demonstrate how this can be used. there are already some styles present in the file. ...
...And 12 more matches
nsIBrowserHistory
inherits from: nsiglobalhistory2 last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/browser/nav-history-service;1. ...
...browserhistory); method overview void addpagewithdetails(in nsiuri auri, in wstring atitle, in long long alastvisited); obsolete since gecko 15.0 void markpageasfollowedlink(in nsiuri auri); obsolete since gecko 22.0 void markpageastyped(in nsiuri auri); obsolete since gecko 22.0 void registeropenpage(in nsiuri auri); obsolete since gecko 9.0 void
removeallpages(); void
removepage(in nsiuri auri); void
removepages([array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void
removepagesbytimeframe(in long long abegintime, in long long aendtime); void
removepagesfromhost(in autf8string ahost, in boolean aentiredomain); void
removevisitsbytimeframe(in long lon...
... attribute type description count obsolete since gecko 15.0 pruint32 indicates if there are entries in global history. for performance reasons this does not return the real number of entries. read only. lastpagevisited obsolete since gecko 10.0 autf8string the last page that was visited in a top-level window. read only. note: the count attribute was
removed in gecko 15.0 because it was only used to determine if there were any entries at all anyway, so the nsinavhistoryservice.hashistoryentries attribute is better for this. methods addpagewithdetails() obsolete since gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) note: this method was
removed in gecko 15.0. you should use moziasynchistory.updateplaces(...
...And 12 more matches
WebRTC connectivity - Web APIs
nother the information needed in order to exchange media data. this exchange is handled using interactive connectivity establishment (ice, a protocol which lets two devices use an intermediary to exchange offers and answers even if the two devices are separated by network address translation (nat). each peer, then, keeps two descriptions on hand: the local description, describing itself, and the
remote description, describing the other end of the call. the offer/answer process is performed both when a call is first established, but also any time the call's format or other configuration needs to change. regardless of whether it's a new call, or reconfiguring an existing one, these are the basic steps which must occur to exchange the offer and answer, leaving out the ice layer for the moment:...
... rtcpeerconnection.setlocaldescription() to set that offer as the local description (that is, the description of the local end of the connection). after setlocaldescription(), the caller asks stun servers to generate the ice candidates the caller uses the signaling server to transmit the offer to the intended receiver of the call. the recipient receives the offer and calls rtcpeerconnection.set
remotedescription() to record it as the
remote description (the description of the other end of the connection). the recipient does any setup it needs to do for its end of the call: capture its local media, and attach each media tracks into the peer connection via rtcpeerconnection.addtrack() the recipient then creates an answer by calling rtcpeerconnection.createanswer(). the recipient calls rtcp...
...calling rtcpeerconnection.createanswer(). the recipient calls rtcpeerconnection.setlocaldescription(), passing in the created answer, to set the answer as its local description. the recipient now knows the configuration of both ends of the connection. the recipient uses the signaling server to send the answer to the caller. the caller receives the answer. the caller calls rtcpeerconnection.set
remotedescription() to set the answer as the
remote description for its end of the call. it now knows the configuration of both peers. media begins to flow as configured. pending and current descriptions taking one step deeper into the process, we find that localdescription and
remotedescription, the properties which return these two descriptions, aren't as simple as they look. because during rene...
...And 12 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
ed in conjunction min and max to define the range of acceptable values. <input type="range" name="range" min="0" max="25"/> html5 reset a button that resets the contents of the form to default values. not recommended. <input type="reset" name="reset"/> search a single-line text field for entering search strings. line-breaks are automatically
removed from the input value. may include a delete icon in supporting browsers that can be used to clear the field. displays a search icon instead of enter key on some devices with dynamic keypads. <input type="search" name="search"/> html5 submit a button that submits the form. <input type="submit" name="submit"/> tel a control for entering a t...
...e="search"/> html5 submit a button that submits the form. <input type="submit" name="submit"/> tel a control for entering a telephone number. displays a telephone keypad in some devices with dynamic keypads. <input type="tel" name="tel"/> html5 text the default value. a single-line text field. line-breaks are automatically
removed from the input value. <input type="text" name="text"/> time a control for entering a time value with no time zone. <input type="time" name="time"/> html5 url a field for entering a url. looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards. <input ty...
...trol when it has no value set readonly almost all boolean. the value is not editable required almost all boolean. a value is required or must be check for the form to be submittable size email, password, tel, text size of the control src image same as src attribute for <img>; address of image resource step numeric types inc
remental values that are valid. type all type of form control value all current value of the form control. submitted with the form as part of a name/value pair. width image same as width attribute for <img> a few additional non-standard attributes are listed following the descriptions of the standard attributes. individual attributes accept v...
...And 12 more matches
Web video codec guide - Web media technologies
ue; the speed of the rotation interferes with the frequency of the sampling performed during compression or encoding. color edging color edging is a type of visual artifact that presents as spurious colors introduced along the edges of colored objects within the scene. these colors have no intentional color relationship to the contents of the frame. loss of sharpness the act of
removing data in the process of encoding video requires that some details be lost. if enough compression is applied, parts or potentially all of the image could lose sharpness, resulting in a slightly fuzzy or hazy appearance. lost sharpness can make text in the image difficult to read, as text—especially small text—is very detail-oriented content, where minor alterations can significantly impac...
...irection. then that shift is stored, along with a description of the pixels that have moved that can't be described just by that shift. in essence, the encoder finds the moving objects, then builds an internal frame of sorts that looks like the original but with all the objects translated to their new locations. in theory, this approximates the new frame's appearance. then, to finish the job, the
remaining differences are found, then the set of object shifts and the set of pixel differences are stored in the data representing the new frame. this object that describes the shift and the pixel differences is called a residual frame. original frame inter-frame differences difference after motion compensation the first full frame as seen by the viewer...
...yback may be a negative factor, careful decision-making can result in a good end result. if a 1080p video is reduced to 720p prior to encoding, the resulting video can be much smaller while having much higher visual quality; even after scaling back up during playback, the result may be better than encoding the original video at full size and accepting the quality hit needed to meet your size requi
rements. reduced frame rate similarly, you can
remove frames from the video entirely and decrease the frame rate to compensate. this has two benefits: it makes the overall video smaller, and that smaller size allows motion compensation to accomplish even more for you. for exmaple, instead of computing motion differences for two frames that are two pixels apart due to inter-frame motion, skipping ev...
...And 12 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
as text and comment nodes, it will return their string value. for attribute nodes, the attribute value is returned. for all other nodes, null is returned. ownerdocument returns the document object containing the current node. parentnode returns the parent node of the current node. previoussibling returns the node immediately preceding the current one.
removeattribute( aname )
removes the specified attribute from the current node. setattribute( aname, avalue ) sets the value of the specified attribute with the specified value. internet explorer has a nonstandard quirk, where many of these apis will skip white space text nodes that are generated, for example, by new line characters. mozilla will not skip these, so sometimes you...
... createelement( atagname ) creates and returns a new and parentless dom node of the type specified by atagname. createtextnode( atextvalue ) creates and returns a new and parentless dom textnode with the data value specified by atextvalue. insertbefore( anewnode, achildnode ) inserts anewnode before achildnode, which must be a child of the current node.
removechild( achildnode )
removes achildnode and returns a reference to it. replacechild( anewnode, achildnode ) replaces achildnode with anewnode and returns a reference to the
removed node. document fragments for performance reasons, you can create documents in memory, rather than working on the existing document's dom. dom level 1 core introduced document fragments, which ar...
...d with the text/css mimetype. mozilla will respect this and only load css files with that mimetype if the web page is in strict standards mode. internet explorer will always load the css file, no matter with which mimetype it is served. web pages are considered in strict standards mode when they start with a strict doctype. to solve this problem, you can make the server send the right mimetype or
remove the doctype. i'll discuss more about doctypes in the next section. css and units many web applications do not use units with their css, especially when you use javascript to set the css. mozilla tolerates this, as long as the page is not rendered in strict mode. since internet explorer does not support true xhtml, it does not care if no units are specified. if the page is in strict standards...
...And 11 more matches
Space Manager Detailed Design - Archive of obsolete content
adeltawidth, nscoord adeltaheight, affectededge aedge = rightedge); /** * offset the region associated with aframe by the specified amount. * * returns ns_ok if successful, ns_error_invalid_arg if there is no region * tagged with aframe */ nsresult offsetregion(nsiframe* aframe, nscoord dx, nscoord dy); /** *
remove the region associated with afrane. * * returns ns_ok if successful and ns_error_invalid_arg if there is no region * tagged with aframe */ nsresult
removeregion(nsiframe* aframe); /** * clears the list of regions representing the unavailable space. */ void clearregions(); /** * methods for dealing with the propagation of float damage during * reflow. */ pr...
...coord abottom, nsvoidarray*); ~bandrect(); // list operations bandrect* next() const {return (bandrect*)pr_next_link(this);} bandrect* prev() const {return (bandrect*)pr_prev_link(this);} void insertbefore(bandrect* abandrect) {pr_insert_before(abandrect, this);} void insertafter(bandrect* abandrect) {pr_insert_after(abandrect, this);} void
remove() {pr_
remove_link(this);} // split the band rect into two vertically, with this band rect becoming // the top part, and a new band rect being allocated and returned for the // bottom part // // does not insert the new band rect into the linked list bandrect* splitvertically(nscoord abottom); // split the band rect into two horizontally, with this band rect becomin...
... rect into two horizontally, with this band rect becoming // the left part, and a new band rect being allocated and returned for the // right part // // does not insert the new band rect into the linked list bandrect* splithorizontally(nscoord aright); // accessor functions prbool isoccupiedby(const nsiframe*) const; void addframe(const nsiframe*); void
removeframe(const nsiframe*); prbool hassameframelist(const bandrect* abandrect) const; print32 length() const; }; // circular linked list of band rects struct bandlist : bandrect { bandlist(); // accessors prbool isempty() const {return pr_clist_is_empty((prcliststr*)this);} bandrect* head() const {return (bandrect*)pr_list_head(this);} bandrect* tail() const ...
...And 11 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
gh traffic. 46 cia glossary, security cia (confidentiality, integrity, availability) (also called the cia triad or aic triad) is a model that guides an organization's policies for information security. 47 cms cms, composing, content management system, glossary a cms (content management system) is software that allows users to publish, organize, change, or
remove various kinds of content, not only text but also embedded images, video, audio, and interactive code. 48 cors glossary, infrastructure, security cors (cross-origin resource sharing) is a system, consisting of transmitting http headers, that determines whether browsers block frontend javascript code from accessing responses for cross-origin requests. 49 cors-safe...
...e response is an http response that can be cached, that is stored to be retrieved and used later, saving a new request to the server. not all http responses can be cached, these are the following constraints for an http response to be cached: 61 caldav caldav, glossary, infrastructure caldav (calendaring extensions to webdav) is a protocol standardized by the ietf and used to
remotely access calendar data from a server. 62 call stack call stack, codingscripting, glossary, javascript a call stack is a mechanism for an interpreter (like the javascript interpreter in a web browser) to keep track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc. ...
...gs. this can be used for example to work out what should go on each page of a website. the name comes from the fact that often card sorting is carried out by literally writing the items to sort onto cards, and then arranging the cards into piles. 67 carddav carddav, glossary, infrastructure carddav (vcard extension to webdav) is a protocol standardized by the ietf and used to
remote-access or share contact information over a server. 68 certificate authority cryptography, glossary, security a certificate authority (ca) is an organization that signs digital certificates and their associated public keys. this certifies that an organization that requested a digital certificate (e.g., mozilla corporation) is authorized to request a certificate for the subj...
...And 11 more matches
HTML text fundamentals - Learn web development
hort story i am a statistician and my name is trish. ...
...character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%">milk eggs bread hummus</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent...
...the first two roundabouts turn left at the third roundabout the school is on your right, 300 meters up the road</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent...
...And 11 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
ponents state and iterating over lists. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/03-adding-dynamic-behavior or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-behavior
remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/c862d964d48d473ca63ab91709a0a5a0?version=3.23.2 working with todos our todos.svelte component is currently just displaying static markup; let's start making it a bit more dynamic. we'll take the tasks information from the markup and store i...
... doesn't have a way of expressing logic — like conditionals and loops. svelte does. in this case we use the {#each...} directive to iterate over the todos array. the second parameter, if provided, will contain the index of the current item. also, a key expression can be provided, which will uniquely identify each item. svelte will use it to diff the list when data changes, rather than adding or
removing items at the end, and it's a good practice to always specify one. finally, an :else block can be provided, which will be rendered when the list is empty. let's give it a try. replace the existing <ul> element with the following simplified version to get an idea of how it works: <ul> {#each todos as todo, index (todo.id)} <li> <input type="checkbox" checked={todo.completed}/> ...
...] </script> <todos todos={todos} /> when the attribute and the variable have the same name, svelte allows you to just specify the variable as a handy shortcut, so we can rewrite our last line like this. try this now. <todos {todos} /> at this point your todos should render just like they did before, except that now we're passing them in from the app.svelte component. toggling and
removing todos let's add some functionality to toggle the task status. svelte has the on:eventname directive for listening to dom events. let's add a handler to the on:click event of the checkbox input to toggle the completed value. update the <input type="checkbox"> element inside src/components/todos.svelte as follows: <input type="checkbox" id="todo-{todo.id}" on:click={() => todo.comp...
...And 11 more matches
OS.File for the main thread
in string destpath, [optional] in object options); promise<bool> exists(in string path); promise<string> getcurrentdirectory(); promise<void> makedir(in string path, [optional] in object options); promise<void> move(in string sourcepath, in string destpath); promise<uint8array> read(in string path, [optional] in object options); promise<void>
remove(in string path, [optional] in object options); promise<void>
removeemptydir(in string path, [optional] in object options); promise<void>
removedir(in string path, [optional] in object options); promise<void> setcurrentdirectory(in string path); promise<void> setdates(in string path, in date|number accessdate, in date|number modificationdate); promis...
... are given, the file will be opened for appending on unix/linux. however, the file is not opened for appending on windows. see bug 924858. starting with gecko 27, you may use the append flag instead. for an example using append see here. truncate | trunc if true, the file will be opened for writing. if the file does not exist, it will be created. if the file exists, its contents will be
removed. cannot be used with create. create if true, file will be opened for writing. the file must not exist. if the file already exists, throw an error. cannot be used with truncate or existing. existing if true, the file must already exist. if the file does not exist, throw an error. cannot be used with create. append if true, the file will be opened for appending, meaning the equivale...
..., files are created with a default mode of 0600 (file is private to the user, the user can read and write). you can build this mode from values os.constants.libc.s_i*. winshare (ignored under non-windows platforms) if specified, a sharing policy, as per windows function createfile. if unspecified, files are opened with a default sharing policy (file is not protected against being read/written/
removed by another process or another use in the same process). you can build this policy from constants os.constants.win.file_share_*. winsecurity (ignored under non-windows platforms) if specified, a security policy, as per windows function createfile. if unspecified, no security attributes. winaccess (ignored under non-windows platforms) if specified, access mode, as per windows function c...
...And 11 more matches
about:memory
it also lets you do other memory-related operations like trigger gc and cc, dump gc & cc logs, and dump dmd reports. it is present in all builds and does not require any preparation to be used. how to generate memory reports let's assume that you want to measure firefox's memory usage. perhaps you want to investigate it yourself, or perhaps someone has asked you to use about:memory to generate "memory reports" so they can investigate a problem you are having. follow these steps. at the moment of interest (e.g. ...
... you are using a communication channel where only text can be sent, such as a comment thread on a website, click on the "measure..." button. this will cause a tree-like structure to be generated text within about:memory. this structure is just text, so you can copy and paste some or all of this text into any kind of text buffer. (you don't need to take a screenshot.) this text contains fewer measu
rements than a memory reports file, but is often good enough to diagnose problems. don't click "measure..." repeatedly, because that will cause the memory usage of about:memory itself to rise, due to it discarding and regenerating large numbers of dom nodes. note that in both cases the generated data contains privacy-sensitive details such as the full list of the web pages you have open in other ta...
... this is most useful when loading memory reports files obtained from a firefox os device. memory reports are saved to file as gzipped json. these files can be loaded as is, but they can also be loaded after unzipping. interpreting memory reports almost everything you see in about:memory has an explanatory tool-tip. hover over any button to see a description of what it does. hover over any measu
rement to see a description of what it means. measu
rement basics most measu
rements use bytes as their unit, but some are counts or percentages. most measu
rements are presented within trees. for example: 585 (100.0%) -- preference-service └──585 (100.0%) -- referent ├──493 (84.27%) ── strong └───92 (15.73%) -- weak ├──92 (15.73%) ── alive ...
...And 11 more matches
GCIntegration - SpiderMonkey Redirect 1
the spidermonkey garbage collector (gc) will be changing a lot in the future. this page is intended to explain the changes that are happening, with a focus on how they will affect gecko code that uses jsapi. at a high level, there are three issues to be aware of: interactions between the garbage collector and the cycle collector inc
remental garbage collection moving garbage collection the apis for gc/cc interaction and inc
remental gc are already in place. development of moving gc (both generational and compacting) is under way, but only in the javascript shell so far. we're still thinking about how the apis for moving gc should work. overview before digging too deep, here are some quick rules of thumb for how to write code that will work smoothly with the gc regardless of cha...
...object is native. as much as possible, avoid trace hooks. if objects are structured as described above, there should be no need for them. this should be obvious by now, but never ever allow a gc thing point to a gc thing in a different compartment unless it's a wrapper that's registered in the cross-compartment wrapper map. now, on to the details... ...
.... as much as possible, avoid trace hooks. if objects are structured as described above, there should be no need for them. this should be obvious by now, but never ever allow a gc thing point to a gc thing in a different compartment unless it's a wrapper that's registered in the cross-compartment wrapper map. now, on to the details... ...
...And 11 more matches
Garbage collection
much of the gc work is performed on helper threads. principal data structures cell a cell is the unit of memory that is allocated and collected by the gc, as used externally. in other words, from the point of view of the rest of the engine, the job of the gc is to allocate cells and automatically collect them. cell is the base class for all classes that are allocated by the gc, e.g., jsobject. allocation kind cells are classified by allocation kind. the allocation kind determines the size of the object and the finalization behavior. ...
...ties of compartments are: every cell (js heap object) belongs to at most one compartment. (some cells are shared across all compartments in a zone.) an object may not hold a direct pointer to an object in another compartment. instead, it must store a wrapper for the other object. this allows compartments to be used for security checks: objects in the same compartment have the same access requi
rements, so no checks are needed, but checks may be done when traversing cross-compartment wrappers. the engine may gc a single compartment without gcing the others. the engine can also gc a set of compartments without gcing the rest. cross-compartment wrappers are used as roots for single- and multi-compartment gcs. compartments are a fundamental cross-cutting concept in spidermonkey (see also co...
... at the level of a zone, not an individual compartment. unlike compartments, zones have no special security properties. some properties of zones are: every compartment belongs to exactly one zone every js heap object belongs to exactly one zone. objects from the same zone but different compartments can share an arena. objects from different zones cannot be stored in the same arena. a zone
remains alive as long as any js heap objects in the zone are alive. chunk a chunk is the largest internal unit of memory allocation. a chunk is 1mb and contains arenas, padding, the mark bitmap (chunkbitmap), a bitmap of decommitted arenas, and a chunk header (chunkinfo). the chunkinfo contains a list of unallocated arenas, starting at chunkinfo::freearenashead and linked through arenaheader::ne...
...And 11 more matches
HTMLInputElement.stepUp() - Web APIs
the htmlinputelement.stepup() method inc
rements the value of a numeric type of <input> element by the value of the step attribute, or the default step value if the step attribute is not explicitly set. the method, when invoked, inc
rements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified. ...
...ement by the value of the step attribute, or the default step value if the step attribute is not explicitly set. the method, when invoked, inc
rements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified. ...
...the method, when invoked, inc
rements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified. ...
...And 11 more matches
Migrating from webkitAudioContext - Web APIs
the web audio api went through many iterations before reaching its current state. it was first implemented in webkit, and some of its older parts were not immediately
removed as they were replaced in the specification, leading to many sites using non-compatible code. in this article, we cover the differences in web audio api since it was first implemented in webkit and how to update your code to use the modern web audio api. the web audio standard was first implemented in webkit, and the implementation was built in parallel with the work on the specification of the api. as the specification evolved and changes were made to the spec, some of the old implementation pieces were not
removed from the webkit (and blink) implementations due to backwards compatibility reasons. new engines i...
... changes to starting and stopping nodes in webkitaudiocontext, there are two ways to start and stop audiobuffersourcenode and oscillatornode: the noteon() and noteoff() methods, and the start() and stop() methods. (audiobuffersourcenode has yet another way of starting output: the notegrainon() method.) the noteon()/notegrainon()/noteoff() methods were the o...
... the latter version of createbuffer() was potentially expensive, because it had to decode the aud...
...And 11 more matches
Border-image generator - CSS: Cascading Style Sheets
ab.png" data-stateid="border5"/> <img class="image" src="https://udn.realityripple.com/samples/fb/c0b285d3da.svg" data-stateid="border6"/> </div> </div> <div id="load-actions" class="group section"> <div id="toggle-gallery" data-action="hide"> </div> <div id="load-image" class="button"> upload image </div> <input id="
remote-url" type="text" placeholder="load an image from url"/> <div id="load-
remote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="name"> control box </div> <div class="separator"></div> <div class="property"> <div class="name">scale</div> <div class="ui-input...
...tion='hide'] { background-image: url('https://mdn.mozillademos.org/files/6005/arrow-up-white.png'); } .button { width: 100px; height: 25px; margin: 10px; color: #fff; text-align: center; font-size: 12px; line-height: 25px; background-color: #379b4a; border-radius: 2px; float: left; } .button:hover { cursor: pointer; background-color: #3380c4; } #load-image { float: left; } #load-
remote { width: 30px; background-image: url('https://mdn.mozillademos.org/files/6003/arrow-right-white.png'); background-repeat: no-repeat; background-position: center center; } #
remote-url { width: 200px; height: 23px; margin: 10px; padding: 0 5px; border: 1px solid #379b4a; border-radius: 2px; float: left; transition: width 0.5s; } #
remote-url:focus { box-shadow: 0px 0px 3px -1px #3...
...ion(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addeventlistener("click", function(e) { document.
removeeventlistener("mousemove", slidermotion); setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addeventlistener("mouseup", slideend); document.addeventlistener("mousemove", slidermotion); }); var slideend = function slide...
...And 11 more matches
Using CSS transitions - CSS: Cascading Style Sheets
omplex transitions. as it doesn't make sense to animate some properties, the list of animatable properties is limited to a finite set. note: the set of properties that can be animated is changing as the specification develops. the auto value is often a very complex case. the specification recommends not animating from and to auto. some user agents, like those based on gecko, implement this requi
rement and others, like those based on webkit, are less strict. using animations with auto may lead to unpredictable results, depending on the browser and its version, and should be avoided. defining transitions css transitions are controlled using the shorthand transition property. this is the best way to configure transitions, as it makes it easier to avoid out of sync parameters, which can be ve...
...hanges to all other properties occur instantaneously as usual. transition-duration specifies the duration over which transitions should occur. you can specify a single duration that applies to all properties during the transition, or multiple values to allow each property to transition over a different period of time. ...
...n-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 1s <div class="parent"> <div class="box">lo
rem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position: absolute; -webkit-transition-property: width height background-color font-size left top -webkit-transform color; -webkit-transition-duration: 1s; -webkit-transition-timing-function: ease-in-out; ...
...And 11 more matches
Event reference
s 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 mozbrowsericonchange mozbrowserlocationchange mozbrowserloadend mozbrowserloadstart mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange dom mutation events domattributenamechanged dom...
...each event is listed along w...
...each event is listed along with the interfa...
...And 11 more matches
Web audio codec guide - Web media technologies
joint stereo can reduce the size of the encoded audio to some extent the parameters availabl...
... joint stereo can reduce the size of the encoded audio to some extent the parameters available—and the range of possible values—varies from codec to codec, and ev...
...lossy codecs work compared to lossless ones, especially the fact that lossless ones have to be much more conservative with their compression, lossy codecs nearly always result in significantly smaller compressed audio than lossless codecs do. generally speaking, the most common reasons to choose lossless audio are because you require archival-quality storage, or because the audio samples will be
remixed and recompressed, and you wish to avoid the amplification of artifacts in the audio due to recompression. for real-time streaming of audio, a lossy codec is usually required in order to ensure the flow of data can keep up with the audio playback rate regardless of network performance. maximum number of channels the audio delivered to each speaker in a sound system is provided by one audio c...
...And 11 more matches
Creating Event Targets - Archive of obsolete content
modules as event targets we can adapt this code into a separate module that exposes the sdk's standard event interface. to do this we'll use the event/core module. create a new file in "lib" called "bookmarks.js", and add the following code: var { emit, on, once,...
...it duplicates the previous code, but with a few changes: import emit(), on(), once(), and off() from event/core replace listener functions with calls to emit(), passing the appropriate event type export its own event api. this cons...
...it duplicates the previous code, but with a few changes: import emit(), on(), once(), and off() from event/core replace listener functions with calls to emit(), passing the appropriate event type export its own event api. this consists of three functions: ...
...And 10 more matches
jspage - Archive of obsolete content
rsion");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],10)||0,build:parseint(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execscript){window.execscript(b);}else{var a=document.createelement("script");a.setattribute("type","text/javascript"); a[(browser.engine.webkit&&browser.engine.version<420)?"innertext":"text"]=b;document.head.appendchild(a);document.head.
removechild(a);}return b;}native.uid=1; var $uid=(browser.engine.trident)?function(a){return(a.uid||(a.uid=[native.uid++]))[0];}:function(a){return a.uid||(a.uid=native.uid++);};var window=new native({name:"window",legacy:(browser.engine.trident)?null:window.window,initialize:function(a){$uid(a); if(!a.element){a.element=$empty;if(browser.engine.webkit){a.document.createelement("iframe");}a.element.p...
...ceof function){b=class.instantiate(b);}this.implement(b); },this);}};var chain=new class({$chain:[],chain:function(){this.$chain.extend(array.flatten(arguments));return this;},callchain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; },clearchain:function(){this.$chain.empty();return this;}});var events=new class({$events:{},addevent:function(c,b,a){c=events.
removeon(c);if(b!=$empty){this.$events[c]=this.$events[c]||[]; this.$events[c].include(b);if(a){b.internal=true;}}return this;},addevents:function(a){for(var b in a){this.addevent(b,a[b]);}return this;},fireevent:function(c,b,a){c=events.
removeon(c); if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},re...
...ts[c]=this.$events[c]||[]; this.$events[c].include(b);if(a){b.internal=true;}}return this;},addevents:function(a){for(var b in a){this.addevent(b,a[b]);}return this;},fireevent:function(c,b,a){c=events.
removeon(c); if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},
removeevent:function(b,a){b=events.
removeon(b); if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},
removeevents:function(c){var d;if($type(c)=="object"){for(d in c){this.
removeevent(d,c[d]); }return this;}if(c){c=events.
removeon(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.
removeevent(d,b[a]); }}return this;}});events.
removeon=function(a){r...
...And 10 more matches
RDF Modifications - Archive of obsolete content
« previousnext » one of the most useful aspects of using templates with rdf datasources is that when the rdf datasource changes, for instance a new triple is added, or a triple is
removed, the template updates accordingly, adding or
removing result output as needed. no extra code needs to be written to do this; it happens automatically. this involves a third type of observer involved in a template builder, an nsirdfobserver, used to listen for modifications to the rdf datasource. naturally, this only applies to rdf queries. when the datasource is modified, the datasource will notify any observers of the change. the template builder uses these notifcations to update the template as necessary based on the new or
removed information. you don't need to implement this observer yo...
... rdf datasources. however, as it is possible to use and/or implement other query types with templates, these additional types may support automatic updating. there are two main situations when the notifications are made. the first is when the modification functions on the datasource are called. there are four such functions: 'assert', to add a new triple (or arrow) to the rdf graph, 'unassert' to
remove a triple, 'change' to adjust the target of a triple, and 'move' to adjust the source of a 'triple'. for mozilla's datasources, the latter two just unassert the old triple and add a new one, creating the effect of changing the value. however, only one notification is made. for instance, an assert call looks like the following: var source = rdf.getresource("http://www.xulplanet.com/ndeakin/imag...
...tions, but it is worth discussing separately. when the rdf parser loads rdf/xml, it starts with a new empty datasource, and as the parser parses the input data, it calls the datasource's assert function to add each found triple. in effect, this isn't any different than adding the same set of triples yourself using the assert method. when reloading a datasource, you might think that the rdf parser
removes all the existing data, loads the new data, and adds it to the datasource. or, you might think that it creates a fresh datasource with the new data. actually, the parser does something smarter. when reloading a datasource, it keeps the existing rdf triples intact, and only modifies the datasource based on what has changed. when parsing, any triples that already exist are not added again. if a ...
...And 10 more matches
notificationbox - Archive of obsolete content
they are different) of global object gbrowser: notifybox = gbrowser.getnotificationbox() examples <notificationbox flex="1"> <browser src="http://www.mozilla.org"/> </notificationbox> there is a more complex code available in the code snippets area. ...
...lobal object gbrowser: notifybox = gbrowser.getnotificationbox() examples <notificationbox flex="1"> <browser src="http://www.mozilla.org"/> </notificationbox> there is a more complex code available in the code snippets area. ...
...ifybox = gbrowser.getnotificationbox() examples <notificationbox flex="1"> <browser src="http://www.mozilla.org"/> </notificationbox> there is a more complex code available in the code snippets area. ...
...And 10 more matches
Introduction to CSS layout - Learn web development
y property. this property allows us to change the default way something displays. everything in normal flow has a value of display, used as the default way that elements they are set on behave. for example, the fact that paragraphs in english display one below the other is due to the fact that they are styled with display: block. if you create a link around some text inside a paragraph, that link
remains inline with the rest of the text, and doesn’t break onto a new line. this is because the <a> element is display: inline by default. you can change this default display behavior. for example, the <li> element is display: block by default, meaning that list items display one below the other in our english document. if we change the display value to inline they now display next to each other,...
...an still help you achieve specific tasks. by understanding the nature of each layout task, you will soon find that when you look at a particular component of your design the type of layout best suited to it will often be clear. floats floating an element changes the behavior of that element and the block level elements that follow it in normal flow. the element is moved to the left or right and
removed from normal flow, and the surrounding content floats around the floated item. the float property has four possible values: left — floats the element to the left. right — floats the element to the right. none — specifies no floating at all. this is the default value. inherit — specifies that the value of the float property should be inherited from the element's parent element. ...
... element. in the example below we float a <div> left, and give it a margin on the right to push the text away from the element. this gives us the effect of text wrapped around that box, and is most of what you need to know about floats as used in modern web design. floats example body { width: 90%; max-width: 900px; margin: 0 auto; } p { line-height: 2; word-spacing: 0.1
rem; } .box { background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; border-radius: 5px; } <h1>simple float example</h1> <div class="box">float</div> <p> lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lo
rem placerat vulputate. duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor ...
...And 10 more matches
Advanced form styling - Learn web development
input { -webkit-appearance: none; appearance: none; } note: it is a good idea to always include both declarations — prefixed and unprefixed — when using a prefixed property. prefixed usually means "work in progress", so in the future browser vendors may come to a consensus to drop the prefix. the above code is good for future-proofing against such an eventuali...
... progress", so in the future browser vendors may come to a consensus to drop the prefix. the above code is good for future-proofing against such an eventuality. the following live example shows you what they look like in your system — default on the left, and with the above css applied on the right (find it here also if you want to test it on other systems). in most cases, the effect is to
remove the stylized border, which makes css styling a bit easier, but isn't really essential. in a couple of cases — search and radio buttons/checkboxes, it becomes way more useful. we'll look at those now. taming search boxes <input type="search"> is basically just a text input, so why is appearance: none; useful here? the answer is that in chromium-based browsers on macos, search boxes have som...
... field also fixes this problem, as it disables or "breaks" the aqua appearance too. the following styled search doesn't have appearance: none; applied, but it doesn't suffer from the same problem in macos chrome as the previous example. note: you may have noticed that in the search field, the "x" delete icon disappears when the input loses focus in edge and chrome, but stays put in safari. to
remove via css, you can use input[type="search"]::-webkit-search-cancel-button { display: none; }. however, this seems to get rid of the icon with focus too, with no apparent way to get it back. styling checkboxes and radio buttons styling a checkbox or a radio button is tricky by default. the sizes of check boxes and radio buttons are not meant to be changed with their default designs, and browse...
...And 10 more matches
How to build custom form controls - Learn web development
ls such as the <select> element or if you want to provide custom behaviors, you may consider building your own controls. in this article, we will discuss how to build a custom control. to that end, we will work with an example: rebuilding the <select> element. we will also discuss how, when, and whether building your own control makes sense, and what to consider when building a control is a requi
rement. note: we'll focus on building the control, not on how to make the code generic and reusable; that would involve some non-trival javascript code and dom manipulation in an unknown context, and that is out of the scope of this article. design, structure, and semantics before building a custom control, you should start by figuring out exactly what you want. this will save you some precious ...
...t, the value may change but the option will definitely not be highlighted accordingly, once again because we did not define any keyboard interactions over options when the control is in its opened state (we have only defined what should happen when the control is opened, but nothing after that). we have to think a little further: what about the escape key? pressing esc key closes an open select.
remember, if you want to provide the same functionality as the existing native <select>, it should behave the exact same way as the select for all users, from keyboard to mouse to touch to screen reader, and any other input device. in our example, the missing specifications are obvious so we will handle them, but it can be a real problem for exotic new controls. when it comes to standardized element...
... our design and structure are ready, we can write the javascript code to make the control actually work. warning: the following is educational code, not production code, and should not be used as-is. it is neither future-proof nor will not work on legacy browsers. it also has redundant parts that should be optimized in production code. why isn't it working? before starting, it's important to
remember javascript in the browser is an unreliable technology. custom controls rely on javascript to tie everything together. however, there are cases in which javascript isn't able to run in the browser: the user has turned off javascript: this is unusual; very few people turn off javascript nowadays. the script did not load: this is one of the most common cases, especially in the mobile world ...
...And 10 more matches
Looping code - Learn web development
with a certain value — this is the starting point of the loop ("start: i have no food", above). a condition, which is a true/false test to determine whether the loop continues to run, or stops — usually when the counter reaches a certain value. this is illustrated by "have i got enough food?", above. let's say he needs 10 portions of food to feed his family. an iterator, which generally inc
rements the counter by a small amount on each successive loop, until the condition is no longer true. we haven't explicitly illustrated this above, but we could think about the farmer being able to collect say 2 portions of food per hour. after each hour, the amount of food he has collected is inc
remented by two, and he checks whether he has enough food. if he has reached 10 portions (the point where...
...loop constructs. the first, which you'll use most of the time, is the for loop — this has the following syntax: for (initializer; condition; final-expression) { // code to run } here we have: the keyword for, followed by some parentheses. inside the parentheses we have three items, separated by semi-colons: an initializer — this is usually a variable set to a number, which is inc
remented to count the number of times the loop has run. it is also sometimes referred to as a counter variable. a condition — as mentioned before, this defines when the loop should stop looping. this is generally an expression featuring a comparison operator, a test to see if the exit condition has been met. a final-expression — this is always evaluated (or run) each time the loop has gone ...
...n. it is also sometimes referred to as a counter variable. a condition — as mentioned before, this defines when the loop should stop looping. this is generally an expression featuring a comparison operator, a test to see if the exit condition has been met. a final-expression — this is always evaluated (or run) each time the loop has gone through a full iteration. it usually serves to inc
rement (or in some cases dec
rement) the counter variable, to bring it closer to the point where the condition is no longer true. some curly braces that contain a block of code — this code will be run each time the loop iterates. let's look at a real example so we can visualize what these do more clearly. const cats = ['bill', 'jeff', 'pete', 'biggles', 'jasmin']; let info = 'my cats are ca...
...And 10 more matches
Arrays - Learn web development
prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. ...
... in the same way that you accessed the letters in a string. enter the following into your console: shopping[0]; // returns "bread" you can also modify an item in an array by simply giving a single array item a new value. try this: shopping[0] = 'tahini'; shopping; // shopping will now return [ "tahini", "milk", "cheese", "hummus", "noodles" ] note: we've said it before, but just as a
reminder — computers start counting from 0! note that an array inside an array is called a multidimensional array. you can access an item inside an array that is itself inside another array by chaining two sets of square brackets together. for example, to access one of the items inside the array that is the third item inside the random array (see previous section), we could do something like thi...
...is to use the tostring() method. tostring() is arguably simpler than join() as it doesn't take a parameter, but more limiting. with join() you can specify different separators, whereas tostring() always uses a comma. ...
...And 10 more matches
source-editor.jsm
the source-editor.jsm javascript code module implements an editor specifically tailored for editing source code; its primary purpose is to provide support for web developer tools to display and edit web site code. the editor provided is eclipse orion. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource:///modules/source-editor.jsm"); warning: much of the functionality of the source editor is implemented by a secondary code module (by default, source-editor-orion.jsm). you must not directly import that code module; it is essentially an implementation detail. its functionality is all exposed through source-editor.jsm. ...
...struction void destroy(); void init(element aelement, object aconfig, function acallback); search operations number find(string astring, [optional] object options); number findnext(boolean awrap); number findprevious(boolean awrap); event management void addeventlistener(string aeventtype, function acallback); void
removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); number gettopindex(); boolea...
...you can then use this value to detect when the contents of the text are different from your most recent save. in addition, when this value changes, the "dirtych...
...And 10 more matches
NSS_3.12_release_notes.html
h/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_is
removable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepointorderlen (see keyhi.h) seckey_ecparamstokeysize (see keyhi.h) secmod_deletemoduleex (see secmod.h) sec_getregisteredhttpclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) v...
... in pkcs11n.h, all the _netscape_ macros are renamed with _nss_ for example, cko_netscape_crl becomes cko_nss_crl. ne...
..._destroy bug 421870: strsclnt crashed in pkix tests. ...
...And 10 more matches
Color picker tool - CSS: Cascading Style Sheets
'hs...
...ion(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addeventlistener("click", function(e) { document.
removeeventlistener("mousemove", slidermotion); setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addeventlistener("mouseup", slideend); document.addeventlistener("mousemove", slidermotion); }); var slideend = function slide...
...semove", slidermotion); setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addeventlistener("mouseup", slideend); document.addeventlistener("mousemove", slidermotion); }); var slideend = function slideend(e) { document.
removeeventlistener("mousemove", slidermotion); document.body.style.cursor = "auto"; slider.style.cursor = "pointer"; }; var slidermotion = function slidermotion(e) { slider.style.cursor = "e-resize"; var delta = (e.clientx - startx) / obj.sensivity | 0; var value = delta * obj.step + start_value; setvalue(obj.topic, value); }; return slider; }; var inputslider = functi...
...And 10 more matches
Codecs used by WebRTC - Web media technologies
e web, it's of additional importance when videoconferencing in order to ensure that the participants are able to communicate without lag or interruptions. of secondary importance is the need to keep the video and audio synchronized, so that the movements and any ancillary information (such as slides or a projection) are presented at the same time as the audio that corresponds. general codec requi
rements before looking at codec-specific capabilities and requi
rements, there are a few overall requi
rements that must be met by any codec configuration used with webrtc. unless the sdp specifically signals otherwise, the web browser receiving a webrtc video stream must be able to handle video at at least 20 fps at a minimum resolution of 320 pixels wide by 240 pixels tall. it's encouraged that vid...
...ays to ask for specific media configurations. supported video codecs webrtc establishes a baseline set of codecs which all compliant browsers are required to support. some browsers may choose to allow other codecs as well. ...
...see this article on sumo for details. for details on webrtc-related considerations for each codec, see the sub-sections below by following the links on each codec's name. ...
...And 10 more matches
textbox - Archive of obsolete content
es | attributes | properties | methods | related ] an input field where the user can enter text. it is similar to the html input element. only one line of text is displayed by default. the multiline attribute can be specified to display a field with multiple rows. more information is available in the xul tutorial. ...
...ls, decimalplaces, disabled, emptytext, hidespinbuttons, inc
rement, label, max, maxlength, min, multiline, newlines, onblur, onchange, onfocus, oninput, placeholder, preference, readonly, rows, searchbutton, size, spellcheck, tabindex, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, inc
rement, inputfield, label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tabindex, textlength, timeout, type, value, valuenumber, wraparound methods decrease, increase, reset, select, setselectionrange style classes plain examples <vbox> <label control="your-name" value="enter your name:"/> <textbox id="your-name" value="jo...
...xtbox when it has no value. this is superseded by the placeholder attribute in gecko 2.0. the old name is retained for compatibility, but you should update your code. hidespinbuttons type: boolean if true, the number box does not have arrow buttons next to it to allow the user to adjust the value. the value may still be adjusted with the keyboard. the default value is false. inc
rement type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). the default value is 1. label type: string if present and not empty, this will be exposed to screen readers through the label property. type: integer the maximum value that the scale o...
...And 9 more matches
Theme changes in Firefox 2 - Archive of obsolete content
do! browser changes requiring theme updates there are a number of changed and deleted files in the browser that may require you to make changes to your theme. the table lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details browser/base/searchdialog.xul browser/base/content/searchdialog.css
removed from firefox 2. feeds/addfeedreader.xul feeds/addfeedreader.css new file that presents ui for adding a new feed reader. feeds/subscribe.xhtml feeds/subscribe.css new file that presents the ui for subscribing to an rss feed. preferences/downloads.xul -
removed from firefox 2. preferences/general.xul -
removed from firefox 2. ...
... changes to the default theme the table below lists all the changes made in the default theme for firefox 2; you can use this information as a starting point for figuring out the changes you need to make. file description of change browser/bookmarks/addbookmark.css updated to include microsummary-related css changes. ...
...n the safe browsing warning window is displayed. browser/safebrowsing/warning24x24.png new file; this is the warning icon that's displayed inside the safe browsing warning window. browser/search-bar-background-mid.png new file; the background for the middle part of the search bar. the ends of the bar are now skinned separately. browser/search-bar-background.png
removed file. browser/search-bar.png
removed file. browser/search-go-rtl.png new file; the go button displayed when it's at the left end of the search bar. browser/search-go.png new file; the go button displayed when it's located at the right end of the search bar. browser/search-provider-bkgnd-rtl.png new file; the background drawn behind the search pr...
...And 9 more matches
Starting our Svelte Todo list app - Learn web development
ta into it using props, and save its state. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/02-starting-our-todo-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/02-starting-our-todo-app
remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/b7b831ea3a354d3789cefbc31e2ca495?version=3.23.2 todo list app features this is how our todo list app wil look like once it's ready: using this ui our user will be able to: browse their tasks. mark tasks as completed/pending without d...
...m install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/b7b831ea3a354d3789cefbc31e2ca495?version=3.23.2 todo list app features this is how our todo list app wil look like once it's ready: using this ui our user will be able to: browse their tasks. mark tasks as completed/pending without deleting them.
remove tasks. add new tasks. filter tasks by status: all tasks, active tasks, or completed tasks. edit tasks. mark all tasks as active/completed.
remove all completed tasks. building our first component let's create a todos.svelte component — this will contain our list of todos. create a new folder — src/components. note: you can put your components anywhere inside the src fol...
...n development mode, svelte will issue a warning in the browser console when specifying a prop that doesn't exist in the component; in this case we have a name prop being specified when we instantiate the app component inside src/main.js, which isn't used inside app. the console should currently give you a message along the lines of "<app> was created with unknown prop 'name'". ...
...And 9 more matches
Localizing with Koala
earch bar is next to the right of the location bar, and by default points to the google search. if you click on the highlighted arrow pointing down while reading this tutorial on mdc, you will see two string that need to be translated: add "mdc search" manage search engines... there is also a tooltip that appears when you hover over the magnifying glass icon on the right side of the bar. requi
rements mercurial, linux, windows or mac os x. instructions preparation install komodo edit. install koala extension. go to tools > add-ons. search for "koala". click add to komodo edit... restart komodo when the installation is complete. you should see a new button in komodo's toolbar, with two options: startpage and management. before you can use them, you need to create a new koala project. ...
...cd c:\mozilla\l10n\application\firefox c:\mozilla\l10n\application\firefox> rmdir 3.6 c:\mozilla\l10n\application\firefox> hg clone http://hg.mozilla.org/releases/mozilla-1.9.2 3.6 requesting all changes adding changesets adding manifests adding file changes added 33099 changesets with 158636 changes to 50664 files (+9 heads) updating working directory 40357 files updated, 0 files merged, 0 files
removed, 0 files unresolved configure the locale locale id: x-testing (put your locale's code) version: 3.6 location: choose the folder where you want to keep the localized files or leave empty for now check "mercurial" if you wish to use mercurial to keep the revision history of your files (very recommended) existing localizations: url: if you're editing an existing localization or you already...
...it ...
...And 9 more matches
SpiderMonkey 1.8.7
, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.7 is supported on all the platforms where firefox 10 runs. spidermonkey 1.8.7 includes type inference, which boosts the speed of the jägermonkey jit by about 30% over version 1.8.5. type inference largely obviates tracemonkey, so the tracemonkey jit has been
removed. the jit is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8.7 this covers migrating from version 1.8.5. see the 1.8.5 release notes for information on migrating from earlier versions. the following feature...
... 1.8.5. this is not a bug, and, any embedding which depends upon deterministic finalization is fatally flawed. typed rooting api the rooting api has been changed from an error-prone void ** interface to an interface which accepts pointers to specific types. js_addroot has been replaced by js_addobjectroot, js_addvalueroot and js_addstringroot; similar changes were made for js_addnamedroot and js_
removeroot. since jsdoubles are now stored in the jsval, instead of on the heap, we no longer need to define roots for them. compartments spidermonkey 1.8.5 introduces the concept of compartments. a compartment is a global object, a context, and a set of related objects with no outside references (crosscompartment wrappers excepted). the new garbage collector can perform per-container garbage collec...
...l_is_int was true. while this was never specified behaviour, it is no longer true; numeric values which are integers are frequently encoded as jsdouble inside the jsval. embedders must be careful when converting numbers from jsvals into c. note also that spidermonkey can now fit a full 32-bit integer (jsint) inside a jsval without promoting to a jsdouble. jsextendedclass jsextendedclass has been
removed from the api entirely. jsid previous spidermonkey versions could freely interchange jsid and jsval. they are no longer compatible; using js_valuetoid and js_idtovalue to convert between the two is mandatory. jsnative, jsfastnative previous versions of jsapi supported two types of native functions -- jsnative and jsfastnative. the so-called "slow natives" are no longer supported; as such jsf...
...And 9 more matches
Places Developer Guide
the item. this is mainly for use by extensions that sync bookmark data between different profiles. moveitem (afolderid, anewparentid, aindex) - move an item from one folder to another. for bookmarks: changebookmarkuri(aitemid, auri) - change a bookmark's uri. setkeywordforbookmark(aitemid, akeyword) - set the keyword for a bookmark. deleting bookmark items with the bookmarks service:
removeitem(aitemid) - works for all types
removefolder(aitemid) - works for folders and livemarks
removefolderchildren(aitemid) - works for folders and livemarks observing bookmark events the nsinavbookmarkobserver interface is used for observing bookmarks activity such as item additions, changes and deletions. // create a bookmark observer var observer = { onbeginupdatebatch: function() { ...
... bookmark observer var observer = { onbeginupdatebatch: function() { // this method is notified when a batch of changes are about to occur. // observers can use this to suspend updates to the user-interface, for example // while a batch change is occurring. }, onendupdatebatch: function() { this._inbatch = false; }, onitemadded: function(id, folder, index) { }, onitem
removed: function(id, folder, index) { }, onitemchanged: function(id, property, isannotationproperty, value) { // isannotationproperty is a boolean value that is true of the changed property is an annotation. // you can access a bookmark item's annotations with the <code>nsiannotationservice</code>. }, onitemvisited: function(id, visitid, time) { // the visit id can be used with t...
... (iid.equals(ci.nsinavbookmarkobserver) || iid.equals(ci.nsisupports)) { return this; } throw cr.ns_error_no_interface; }, }; // register the observer with the bookmarks service var bmsvc = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); bmsvc.addobserver(observer, false); // un-register the observer when done. bmsvc.
removeobserver(observer); html import/export the nsiplacesimportexportservice service is used for import and export of bookmarks in the netscape bookmarks html format. note that this service is only currently available for firefox, not other toolkit-based applications. importing: importhtmlfromfile (nsilocalfile afile, boolean aisinitialimport) - this imports all the bookmarks in the specified f...
...And 9 more matches
Starting WebLock
reate a component. since the component hasn't been created yet, there are no instantiated nsiobserver objects that can be passed into the nsiobserverservice, nor can the component code do anything until it is loaded. registering for notifications the nsiobserverservice interface has methods for registering and unregistering an nsiobserver object. these two methods are used to dynamically add or
remove an observer to a notification topic. but weblock needs to be instantiated and added to the observer service automatically, which also implies some sort of persistent data (after all, we want to have the component start up every time the application does). this is where a new service that manages sets of related data comes in handy. this service, the nsicategoryservice, is what xpcom and gecko...
... manager, service manager, category manager, and the component registrar to register itself properly with xpcom. the next step is to expose additional functionality to gecko applications and other clients to query and control the weblock component. for example, the user interface needs to be able to enable and disable the web locking functionality, see what sites are in the whitelist, and add or
remove sites from that list. weblock needs to provide an api, and it needs to hook into gecko in order to implement the actual locking functionality. the weblock user interface the weblock component in this tutorial uses xul to define the additional browser ui in a cross-platform way, and xul uses javascript to access and control xpcom components, but gecko's pluggable ui allows any user interface...
...general, the weblock service interface needs to include the following functionality: lock - enable web locking so that any browser in the gecko application is restricted to the white list of website domains. unlock - disable web locking. this should allow any browser in the gecko application to browse any website regardless of the white list. addsite - add the current url to the white list.
removesite -
remove the current url from the white list. enumeratesites - allows the enumeration of all sites in the white list. enumeratesites might be used in the user interface to provide something like an editable listbox of all sites in the white list. even this simple outline presents some ambiguity, however. it's certainly not enough to spell out the interface for the weblock component in t...
...And 9 more matches
nsIPermissionManager
rbird 16 / seamonkey 2.13) inherits from: nsisupports method overview void add(in nsiuri uri, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void addfromprincipal(in nsiprincipal principal, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void
remove(in autf8string host, in string type); void
removefromprincipal(in nsiprincipal principal, in string type); void
removepermission(in nsipermission perm); void
removeallsince(in int64_t since); void
removeall(); pruint32 testexactpermission(in nsiuri uri, in string type); pruint32 testexactpermissionfromprincipal(...
... consumers should choose this string to be unique, with respect to other consumers. permission an integer specifying the permission. see nsipermissionmanager.permission_type_constants. expiretype expiration type of the permission. see nsipermissionmanager.permission_expiration_constants. expiretime time (in milliseconds since jan 1 1970 0:00:00) representing expiration of this permission. ...
... should choose this string to be unique, with respect to other consumers. permission an integer specifying the permission. see nsipermissionmanager.permission_type_constants. expiretype expiration type of the permission. see nsipermissionmanager.permission_expiration_constants. expiretime time (in milliseconds since jan 1 1970 0:00:00) representing expiration of this permission. ...
...And 9 more matches
Element.classList - Web APIs
tring via element.classname. syntax const elementclasses = elementnodereference.classlist; returns a domtokenlist representing the contents of the element's class attribute. if the class attribute is not set or empty, it returns an empty domtokenlist, i.e. a domtokenlist with the length property equal to 0. ...
...e is not set or empty, it returns an empty domtokenlist, i.e. a domtokenlist with the length property equal to 0. the domtokenlist itself is read-only, although you can modify it using the add() and
remove() methods. ...
...empty domtokenlist, i.e. a domtokenlist with the length property equal to 0. the domtokenlist itself is read-only, although you can modify it using the add() and
remove() methods. ...
...And 9 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
ontexts, it's useful to have a general idea of what rtp does and does not offer. rtp is a data transport protocol, whose mission is to move data between two endpoints as efficiently as possible under current conditions. those conditions may be affected by everything from the underlying layers of the network stack to the physical network connection, the intervening networks, the performance of the
remote endpoint, noise levels, traffic levels, and so forth. since rtp is simply a data transport, it is augmented by the closely-related rtp control protocol (rtcp), which is defined in rfc 3550, section 6. rtcp adds features including quality of service (qos) monitoring, participant information sharing, and the like. it isn't adequate for the purposes of fully managing users, memberships, permissi...
...m features. rtp supports multicast; while this isn't yet important for webrtc, it's likely to matter in the future, when webrtc is (hopefully) enhanced to support multi-user conversations. rtp isn't limited to use in audiovisual communication. it can be used for any form of continuous or active data transfer, including data streaming, active badges or status display updates, or control and measu
rement information transport. things rtp doesn't do rtp itself doesn't provide every possible feature, which is why other protocols are also used by webrtc. some of the more noteworthy things rtp doesn't include: editor's note: we should add information about where these deficiencies are compensated for, if they are at all. rtp does not guarantee quality-of-service (qos). while rtp is intende...
...brtc infrastructure. for example, rtcp handles qos monitoring. rtcpeerconnection and rtp each rtcpeerconnection has methods which provide access to the list of rtp transports that service the peer connection. these correspond to the following three types of transport supported by rtcpeerconnection: rtcrtpsender rtcrtpsenders handle the encoding and transmission of mediastreamtrack data to a
remote peer. the senders for a given connection can be obtained by calling rtcpeerconnection.getsenders(). rtcrtpreceiver rtcrtpreceivers provide the ability to inspect and obtain information about incoming mediastreamtrack data. a connection's receivers can be obtained by calling rtcpeerconnection.getreceivers(). rtcrtptransceiver an rtcrtptransceiver is a pair of one rtp sender and one rtp rece...
...And 9 more matches
window.location - Web APIs
nullam ultrices dolor ac dolor imperdiet ullamcorper. suspendisse quam libero, luctus auctor mollis sed, malesuada condimentum magna. quisque in ante tellus, in placerat est. pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. donec a mi magna, quis mattis dolor. etiam sit amet ligula quis urna auctor imp...
...cilisis nisi fringilla. in tincidunt tincidunt tincidunt. nulla vitae tempor nisl. etiam congue, elit vitae egestas mollis, ipsum nisi malesuada turpis, a volutpat arcu arcu id risus.</p> <p>nam faucibus, ligula eu fringilla pulvinar, lectus tellus iaculis nunc, vitae scelerisque metus leo non metus. proin mattis lobortis lobortis. quisque accumsan faucibus erat, vel varius tortor ultricies ac. lo
rem ipsum dolor sit amet, consectetur adipiscing elit. sed nec libero nunc. nullam tortor nunc, elementum a consectetur et, ultrices eu orci. lo
rem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque a nisl eu sem vehicula egestas.</p> <p>aenean viverra varius mauris, sed elementum lacus interdum non. phasellus sit amet lectus vitae eros egestas pellentesque fermentum eget magna. quisque ...
...t. pellentesque vitae sollicitudin nunc. donec neque magna, lobortis id egestas nec, sodales quis lectus. fusce cursus sollicitudin porta. suspendisse ut tortor in mauris tincidunt rhoncus. maecenas tincidunt fermentum facilisis. pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> <p>suspendisse turpis nisl, consectetur in lacinia ut, ornare vel mi. lo
rem ipsum dolor sit amet, consectetur adipiscing elit. proin non lectus eu turpis vulputate cursus. mauris interdum tincidunt erat id pharetra. nullam in libero elit, sed consequat lectus. morbi odio nisi, porta vitae molestie ut, gravida ut nunc. ut non est dui, id ullamcorper orci. praesent vel elementum felis. maecenas ornare, dui quis auctor hendrerit, turpis sem ullamcorper odio, in auctor magna...
...And 9 more matches
Canvas code snippets - Archive of obsolete content
this method gets a reference to the iframe's window and draws this window to a canvas object. note that this only works if you are running the page from chrome. if you try running the code a...
...blob); yield new promise(accept => { reader.onloadend = accept }); return yield os.file.writeatomic(path, new uint8array(reader.result), { tmppath: path + '.tmp' }); }); } loading a
remote page onto a canvas element the following class first creates a hidden iframe element and attaches a listener to the frame's load event. once the
remote page has loaded, the
remotepageloaded method fires. this method gets a reference to the iframe's window and draws this window to a canvas object. ...
...en iframe element and attaches a listener to the frame's load event. once the
remote page has loaded, the
remotepageloaded method fires. this method gets a reference to the iframe's window and draws this window to a canvas object. note that this only works if you are running the page from chrome. if you try running the code as a plain webpage, you will get a 'security error" code: "1000' error. ...
...And 8 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
some of that will have to be replaced and the rest will need to be loaded differently. ...
....jsm, you'll do so via privileged javascript code like this: components.utils.import("resource://gre/modules/services.jsm"); from here on out, it is assumed you've imported services.jsm somewhere at the top of whatever file you're in and will be using it in all code examples. the examples will also assume that you know how to properly add instructions to your add-on's chrome.manifest to add and
remove resource, chrome, locale, & etc. mappings, so that you can access your files with custom paths such as: resource://myaddon/filename.ext chrome://myaddon/content/filename.ext step 2: no more resource:// uris for files internal to your bundle unfortunately, resource mappings in your chrome.manifest were not usable in restartless add-ons until mozilla finally fixed this bug in firefox 38, whic...
...ust the static file contents, not any loaded script/data). step 2a: load your jsm from chrome:// now with that preface out of the way, this part is easy: drop support for firefox 3.x if you haven't already, move your jsm files to wherever you've got your chrome mapping to for your xul overlay and/or windows, import your files from that new chrome mapped path instead of the old resource one, and
remove your "resource" line from your chrome.manifest file. it's probably a good idea to do this even if you aren't going fully restartless / extractionless due to the previously mentioned exposure to content of resource mappings. also, drop support for firefox 4 through 9 while you're at it. prior to firefox 10, the chrome.manifest file you rely on wasn't loaded automatically for restartless add-on...
...And 8 more matches
Tabbed browser - Archive of obsolete content
yz"); // focus tab tabbrowser.selectedtab = newtab; // focus *this* browser window in case another one is currently focused tabbrowser.ownerdocument.defaultview.focus(); } } the function can be called like so: openandreuseonetabperattribute("myextension-myattribute", "http://developer.mozilla.org/"). closing a tab this example closes the currently selected tab. gbrowser.
removecurrenttab(); there is also a more generic
removetab method, which accepts a xul tab element as its single parameter. changing active tab this moves one tab forward (to the right). gbrowser.tabcontainer.advanceselectedtab(1, true); this moves one tab to the left. gbrowser.tabcontainer.advanceselectedtab(-1, true); detecting page load see also code snippets:on page load function exam...
...rowser window has // been initialised. we add a callback to the tabbed browser // when the browser's window gets loaded. window.addeventlistener("load", function () { // add a callback to be run every time a document loads. // note that this includes frames/iframes within the document gbrowser.addeventlistener("load", examplepageload, true); }, false); ... ...
...wser's window gets loaded. window.addeventlistener("load", function () { // add a callback to be run every time a document loads. // note that this includes frames/iframes within the document gbrowser.addeventlistener("load", examplepageload, true); }, false); ... // when no longer needed gbrowser.
removeeventlistener("load", examplepageload, true); ... ...
...And 8 more matches
Introduction to SSL - Archive of obsolete content
n enable or disable any of the supported cipher suites for both clients and servers. when a particular client and server exchange information during the ssl handshake, they identify the strongest enabled cipher suites they have in common and use those for the ssl session. note: firefox 2 ships with ssl 2.0 support disabled by default, in favor of ssl 3.0. in addition, ssl 2.0 support is entirely
removed in firefox 8. decisions about which cipher suites a particular organization decides to enable depend on trade-offs among the sensitivity of the data involved, the speed of the cipher, and the applicability of export rules. some organizations may want to disable the weaker ciphers to prevent ssl connections with weaker encryption. however, due to u.s. government restrictions on products that...
...uthentication"). if the server cannot be authenticated, the user is warned of the problem and informed that an encrypted and authenticated connection cannot be established. if the server can be successfully authenticated, the client goes on to step 4. using all data generated in the handshake so far, the client (with the cooperation of the server, depending on the cipher being used) creates the p
remaster secret for the session, encrypts it with the server's public key (obtained from the server's certificate, sent in step 2), and sends the encrypted p
remaster secret to the server. if the server has requested client authentication (an optional step in the handshake), the client also signs another piece of data that is unique to this handshake and known by both the client and server. in this c...
...t in step 2), and sends the encrypted p
remaster secret to the server. if the server has requested client authentication (an optional step in the handshake), the client also signs another piece of data that is unique to this handshake and known by both the client and server. in this case the client sends both the signed data and the client's own certificate to the server along with the encrypted p
remaster secret. if the server has requested client authentication, the server attempts to authenticate the client (for details, see "client authentication"). if the client cannot be authenticated, the session is terminated. ...
...And 8 more matches
Common causes of memory leaks in extensions - Extensions
this page explains coding patterns that cause extension to cause memory leaks. causes of zombie compartments zombie compartments are a particular kind of memory leak. all zombie compartments in extensions are caused by a failure to release resources appropriately in certain circumstances, such as when a window is closed, a page unloads, or an extension is disabled or
removed. 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 refer...
...ction modifydocument2(document) { // the "body" dom node holding a reference to leakref will prevent // that function object from being garbage collected and hence // will leak the whole bootstrap compartment. document.body.someproperty = leakref; } see also kris maglione's guide to cleaning up bootstrapped extensions. failing to clean up event listeners extensions can be disabled and
removed by user actions, but it also happens when an add-on is updated. if a bootstrapped (restartless) extension fails to clean up event listeners when disabled or
removed, the listeners will still reference the enclosing scope — usually the bootstrap.js sandbox — and therefore keep that scope (and its enclosing compartment) alive until the window is unloaded. if the window in question is browse...
..., the leaked compartment might survive for quite some time. function leakref() {} function main(window) { // this is a potential leak, as the window (e.g. browser.xul) will hold on to // the leakref function and the enclosing compartment via the listener. ...
...And 8 more matches
Client-side form validation - Learn web development
this article leads you through basic concepts and examples of client-side form validation. prerequisites: computer literacy, a reasonable understanding of html, css, and javascript. ...
...umber" name="amount" value="1" min="1" max="10"> </div> <div> <button>submit</button> </div> </form> here you'll see that we've given the text field a minlength and maxlength of six, which is the same length as banana and cherry. we've also given the number field a min of one and a max of ten. entered numbers outside this range will show as invalid; users won't be able to use the inc
rement/dec
rement arrows to move the value outside of this range. if the user manually enters a number outside of this range, the data is invalid. the number is not required, so
removing the value will still result in a valid value. input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } div { margin-bottom: 10px; } here is the example running live: note: yo...
...alid value. input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } div { margin-bottom: 10px; } here is the example running live: note: you can find this example live on github as fruit-length.html (see also the source code.) note: <input type="number"> (and other types, such as range and date) can also take a step attribute, which specifies what inc
rement the value will go up or down by when the input controls are used (such as the up and down number buttons). in the above example we've not included a step attribute, so the value defaults to 1. this means that floats, like 3.2, will also show as invalid. full example here is a full example to show usage of html's built-in validation features. first, some html: <form> <p> <fieldset> ...
...And 8 more matches
Video and Audio APIs - Learn web development
ack controls: this is not as immediately useful for video playback, but it does have advantages. one big issue with the native browser controls is that they are different in each browser — not very good for cross-browser support! another big issue is that the native controls in most browsers aren't very keyboard-accessible. you can solve both these problems by hiding the native controls (by
removing the controls attribute), and programming your own with html, css, and javascript. in the next section we'll look at the basic tools we have available to do this. the htmlmediaelement api part of the html5 spec, the htmlmediaelement api provides features to allow you to control video and audio players programmatically — for example htmlmediaelement.play(), htmlmediaelement.pause(), etc. t...
...radius: 10px; position: absolute; bottom: 20px; left: 50%; margin-left: -200px; background-color: black; box-shadow: 3px 3px 5px black; transition: 1s all; display: flex; } .player:hover .controls, player:focus .controls { opacity: 1; } we start off with the visibility of the custom controls set to hidden. in our javascript later on, we will set the controls to visible, and
remove the controls attribute from the <video> element. this is so that, if the javascript doesn't load for some reason, users can still use the video with the native controls. we give the controls an opacity of 0.5 by default, so that they are less distracting when you are trying to watch the video. only when you are hovering/focusing over the player do the controls appear at full opacity. we lay ...
...constants to hold references to all the objects we want to manipulate. we have three groups: the <video> element, and the controls bar. the play/pause, stop, rewind, and fast forward buttons. the outer timer wrapper <div>, the digital timer readout <span>, and the inner <div> that gets wider as the time elapses. next, insert the following at the bottom of your code: media.
removeattribute('controls'); controls.style.visibility = 'visible'; these two lines
remove the default browser controls from the video, and make the custom controls visible. playing and pausing the video let's implement probably the most important control — the play/pause button. first of all, add the following to the bottom of your code, so that the playpausemedia() function is invok...
...And 8 more matches
Setting up your own test automation environment - Learn web development
im the test is passed. webdriver will then close down the firefox instance and stop. testing in multiple browsers at once there is also nothing to stop you running the test on multiple browsers simultaneously. let's try this! create another new file inside your project directory called google_test_multiple.js. you can feel free to change the references to some of the other browsers we added,
remove them, etc., depending on what browsers you have available to test on your operating system. you'll need to make sure you have the right browser drivers set up on your system. in terms of what string to use inside the .forbrowser() method for other browsers, see the browser enum reference page. give it the following contents, then save it: const webdriver = require('selenium-webdriver'), ...
... so here we've done the test as before, except that this time we've wrapped it inside a function, searchtest(). we've created new browser instances for multiple browsers, then passed each one to the function so the test is performed on all three browsers! ...
...s reference for details of the features in this section and the ones below it. you can use any url to point to your resource, including a file:// url to test a local document: driver.get('file:///users/chrismills/git/learning-area/tools-testing/cross-browser-testing/accessibility/fake-div-buttons.html'); or driver.get('http://localhost:8888/fake-div-buttons.html'); but it is better to use a
remote server location so the code is more flexible — when you start using a
remote server to run your tests (see later on), your code will break if you try to use local paths. add this line to the bottom of quick_test.js now: driver.get('http://mdn.github.io/learning-area/tools-testing/cross-browser-testing/accessibility/native-keyboard-accessibility.html'); interacting with the document now ...
...And 8 more matches
AddonManager
lcallback? callback, in string mimetype) promise? getallinstalls(in installlistcallback? callback) promise? getinstallsbytypes(in string types[], in installlistcallback? callback) void installaddonsfromwebpage(in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[]) void addinstalllistener(in installlistener listener) void
removeinstalllistener(in installlistener listener) promise? getalladdons(in addonlistcallback? callback) promise? getaddonbyid(in string id, in addoncallback? callback) promise? getaddonbysyncguid(in string id, in addoncallback? callback) promise? getaddonsbyids(in string ids[], in addonlistcallback? callback) promise? getaddonsbytypes(in string types[], ...
... autou...
... autoupdatedefault boolean whether add-ons should auto-update by default (overrideable per add-on). corresponds to th...
...And 8 more matches
NSS 3.46 release notes
s/nss_3_46_rtm/src/ other releases are available in nss releases. new in nss 3.46 this release contains no significant new functionality, but concentrates on providing improved performance, stability, and security. of particular note are significant improvements to aes-gcm performance on arm. ...
...leases are available in nss releases. new in nss 3.46 this release contains no significant new functionality, but concentrates on providing improved performance, stability, and security. of particular note are significant improvements to aes-gcm performance on arm. ...
...ty, and security. of particular note are significant improvements to aes-gcm performance on arm. ...
...And 8 more matches
nsIFaviconService
ko 22.0 astring getfavicondataasdataurl(in nsiuri afaviconuri); obsolete since gecko 22.0 nsiuri getfaviconforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconimageforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconlinkforicon(in nsiuri afaviconuri); boolean isfailedfavicon(in nsiuri afaviconuri); void
removefailedfavicon(in nsiuri afaviconuri); void setandloadfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); obsolete since gecko 22.0 void setfavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string ...
...ed favicon cache. the lifespan of the favicon cache is up to the caching system. this cache will also be written to if you use setandloadfaviconforpage() method and it encounters an error while fetching an icon. void addfailedfavicon( in nsiuri afaviconuri ); parameters afaviconuri the uri of an icon in the favicon service. can be null. expireallfavicons() expires all known favicons,
removing them from the database. note: this is an asynchronous operation; when it completes, a "places-favicons-expired" notification is dispatched through the observer's service. void expireallfavicons(); parameters none. getfavicondata() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was
removed in gecko 22.0. you should u...
... output parameter where the binary favicon data will be placed. this will be null if we have this uri but have no data associated with it. exceptions thrown ns_error_not_available thrown when we have never heard of this favicon url. getfavicondataasdataurl() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was
removed in gecko 22.0. you should use the new async api moziasyncfavicons.getfavicondataforpage() instead. this method retrieves the given favicon data, returning it as a data url throws an exception if we don't have data. if there is no data but we have an entry for this favicon, returns null. astring getfavicondataasdataurl( in nsiuri afaviconuri ); parameters afaviconuri uri of the fa...
...And 8 more matches
nsIHTMLEditor
undselection(in nsidomelement aanchorelement); boolean isanonymouselement(in nsidomelement aelement); void makeorchangelist(in astring alisttype, in boolean entirelist, in astring abullettype); boolean nodeisblock(in nsidomnode node); void pastenoformatting(in long aselectiontype); void rebuilddocumentfromsource(in astring asourcestring); void
removealldefaultproperties(); void
removeallinlineproperties(); void
removedefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void
removeinlineproperty(in nsiatom aproperty, in astring aattribute); void
removeinsertionlistener(in nsicontentfilter infilter); void
removelist(in astring alisttype); void replaceheadconten...
...added to the created anonymous element. return value a dom element. createelementwithdefaults() return a new element with default attribute values. this does not rely on the selection, and is not sensitive to context. used primarily to supply new element for various insert element dialogs (image, link, table, and horizontalrule are the only returned elements as of 9/12/18); namedanchor was
removed in firefox 63. nsidomelement createelementwithdefaults( in astring atagname ); parameters atagname the html tagname. special input value for links: use "href" to get a link node (an "a" tag with the "href" attribute set) return value the new element created. decreasefontsize() decrease font size for text in selection by 1 html unit all existing text is scanned for existing <font...
... suppress spurious drag/drop events to workaround bug 50703. do not use this method! it will go away after first release! void ignorespuriousdragevent( in boolean aignorespuriousdragevent ); parameters aignorespuriousdragevent increasefontsize() increase font size for text in selection by 1 html unit all existing text is scanned for existing <font size> attributes so they will be inc
remented instead of inserting new <font> tag. void increasefontsize(); parameters none. indent() document me! void indent( in astring aindent ); parameters aindent insertelementatselection() insert an element, which may have child nodes, at the selection used primarily to insert a new element for various insert element dialogs, but it enforces the html 4.0 dtd "cancontain" rules, ...
...And 8 more matches
nsIWindowMediator
in wstring awindowtype); pruint32 getzlevel(in nsixulwindow awindow); native code only! nsisimpleenumerator getzorderdomwindowenumerator(in wstring awindowtype, in boolean afronttoback); nsisimpleenumerator getzorderxulwindowenumerator(in wstring awindowtype, in boolean afronttoback); void registerwindow(in nsixulwindow awindow); native code only! void
removelistener(in nsiwindowmediatorlistener alistener); void setzlevel(in nsixulwindow awindow, in pruint32 azlevel); native code only! void setzposition(in nsixulwindow inwindow, in unsigned long inposition, in nsixulwindow inbelow); native code only! void unregisterwindow(in nsixulwindow awindow); native code only! void updatewindowtimestamp(in nsixulwindow awind...
...ng tabs will fire the alert. ...
...s} = components; var windowlistener = { onopenwindow: function (awindow) { // wait for the window to finish loading let domwindow = awindow.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidomwindowinternal || ci.nsidomwindow); domwindow.addeventlistener("load", function () { domwindow.
removeeventlistener("load", arguments.callee, false); //this
removes this load function from the window //window has now loaded now do stuff to it //as example this will add a function to listen to tab select and will fire alert in that window if (domwindow.gbrowser && domwindow.gbrowser.tabcontainer) { domwindow.gbrowser.tabcontainer.addeventlistener('tabselect', function () { domwindow.a...
...And 8 more matches
Background Tasks API - Web APIs
round its event loop. this code draws any pending updates to the document currently being displayed, runs any javascript code the page needs to run, accepts events from input devices, and dispatches those events to the elements that should receive them. in addition, the event loop handles interactions with the operating system, updates to the browser's own user interface, and so forth. it's an ext
remely busy chunk of code, and your main javascript code may run right inside this thread along with all of this. certainly most if not all code that is capable of making changes to the dom is running in the main thread, since it's common for user interface changes to only be available to the main thread. because event handling and screen updates are two of the most obvious ways users notice perform...
...otted. while the browser, your code, and the web in general will continue to run normally if you go over the specified time limit (even if you go way over it), the time restriction is intended to ensure that you leave the system enough time to finish the current pass through the event loop and get on to the next one without causing other code to stutter or animation effects to lag. currently, time
remaining() has an upper limit of 50 milliseconds, but in reality you will often have less time than that, since the event loop may already be eating into that time on complex sites, with browser extensions needing processor time, and so forth. avoid making changes to the dom within your idle callback. by the time your callback is run, the current frame has already finished drawing, and all layout u...
...ionally identical; settimeout() doesn't let you make use of idle periods, but instead runs your code when possible, leaving us to do the best we can to avoid causing the user to experience performance lag. window.requestidlecallback = window.requestidlecallback || function(handler) { let starttime = date.now(); return settimeout(function() { handler({ didtimeout: false, time
remaining: function() { return math.max(0, 50.0 - (date.now() - starttime)); } }); }, 1); } if window.requestidlecallback is undefined, we create it here. the function begins by recording the time at which our implementation was called. we'll be using that to compute the value returned by our shim for time
remaining(). then we call settimeout(), passing into it a function which r...
...And 8 more matches
HTMLInputElement.stepDown() - Web APIs
the htmlinputelement.stepdown([n]) method dec
rements the value of a numeric type of <input> element by the value of the step attribute or up to n multiples of the step attribute if a number is passed as the parameter. the method, when invoked, dec
rements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified. valid on all numeric, date, and time input types that support the step attribute, includingdate, month, week, time, datetime-local, number, and range. given <input id="mytime" type="time" max="17:00" step="900" value="17:00">, invoking mytime.step(3) will change the value to 16:15, dec
rementing the time by 3 * 900, or 45 minutes. mytime.step(), with no parameter, would have resulted in 16:45, as n defaults to...
... and time input types that support the step attribute, includingdate, month, week, time, datetime-local, number, and range. given <input id="mytime" type="time" max="17:00" step="900" value="17:00">, invoking mytime.step(3) will change the value to 16:15, dec
rementing the time by 3 * 900, or 45 minutes. mytime.step(), with no parameter, would have resulted in 16:45, as n defaults to 1. ...
... number, and range. given <input id="mytime" type="time" max="17:00" step="900" value="17:00">, invoking mytime.step(3) will change the value to 16:15, dec
rementing the time by 3 * 900, or 45 minutes. mytime.step(), with no parameter, would have resulted in 16:45, as n defaults to 1. <!-- dec
rements by intervals of 900 seconds (15 minute) --> <input type="time" max="17:00" step="900"> <!-- dec
rements by intervals of 7 days (one week) --> <input type="date" max="2019-12-25" step="7"> <!-- dec
rements by intervals of 12 months (one year) --> <input type="month" max="2019-12" step="12"> the method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set within the form control. the default value for the...
...And 8 more matches
Web audio spatialization basics - Web APIs
es, or have some kind of surround sound system to plug your computer into. creating an audio listener so let's begin! the baseaudiocontext (the interface the audiocontext is extended from) has a listener property that returns an audiolistener object. this represents the listener of the scene, usually your user. you can define where they are in space and in which direction they are facing. they
remain static. the pannernode can then calculate its sound position relative to the position of the listener. let's create our context and listener and set the listener's position to emulate a person looking into our room: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); const listener = audioctx.listener; const posx = window.innerwidth/2;...
...eed math.sin and math.cos to help us draw that circle. let's set up a rotation rate, which we'll convert into a radian range value for use in math.sin and math.cos later, when we want to figure out the new coordinates when we're rotating our boombox: // set up rotation constants const rotationrate = 60; // bigger number equals slower sound rotation const q = math.pi/rotationrate; //rotation inc
rement in radians we can also use this to work out degrees rotated, which will help with the css transforms we will have to create (note we need both an x and y-axis for the css transforms): // get degrees for css const degreesx = (q * 180)/math.pi; const degreesy = (q * 180)/math.pi; let's take a look at our left rotation as an example. we need to change the x orientation and the z orientation ...
...// get degrees for css const degreesx = (q * 180)/math.pi; const degreesy = (q * 180)/math.pi; let's take a look at our left rotation as an example. ...
...And 8 more matches
panel - Archive of obsolete content
content is built from the list of currently open tabs: panels are useful for presenting temporary interfaces to users in a way that is easier for users to ignore and dismiss than a modal dialog, since panels are hidden the moment users interact with parts of the application interface outside them. a panel's content is loaded as soon as it is created, before the panel is shown, and the content
remains loaded when a panel is hidden, so it is possible to keep a panel around in the background, updating its content as appropriate in preparation for the next time it is shown. your add-on can receive notifications when a panel is shown or hidden by listening to its show and hide events. opening a panel will close any panel created by the panel() constructor that is already open, even if that p...
...y the panel() constructor that is already open, even if that panel was opened by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from the url supplied in the contenturl option to the panel's constructor. you can load
remote html into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, contenturl: "https://en.wikipedia.org/w/index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs. to do this, save the html in your add-on's data directory and load it using t...
...ww.bbc.co.uk/mobile/index.html", contentscript: myscript }); mypanel.port.on("click-link", function(url) { console.log(url); }); mypanel.show(); this example uses contentscript to supply the script as a string. it's usually better practice to use contentscriptfile, which is a url pointing to a script file saved under your add-on's data directory. warning: unless your content script is ext
remely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. getting user input note: this example uses the action button api, which is only available from firefox ...
...And 7 more matches
widget - Archive of obsolete content
the widget api is deprecated from firefox 29 onwards. please see the ui module for replacements. in particular, for a simple button, try the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis. create a simple user interface for an add-on in firefox's add-on bar. usage "widgets" are small pieces of content that live in the firefox 4 add-on bar. they can be simple icons or complex web pages. you can attach panels to them that open when they're clicked, or you can define a custom click handler to perform some other action, like opening a web page in a tab. there are a few advantages to using widgets over an ad hoc user interface. ...
...ally means you have to send messages between the content script and the main add-on code. you can specify one or more content scripts to load into the widget using the contentscript or contentscriptfile options to the widget() constructor. you can communicate with the script using either the postmessage() api or (preferably, usually) the port api. unless your content script is ext
remely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. for example, suppose we want to implement a media player as an add-on. we could implement the main user i...
... = function() { addon.port.emit("stop"); } } next, add a script tag to reference "button-script.js", and call its init() function on load: <html> <head> <script src="button-script.js"></script> </head> <body onload="init()"> <img src="play.png" id="play-button"> <img src="pause.png" id="pause-button"> <img src="stop.png" id="stop-button"> </body> </html> finally,
remove the line attaching the content script from "main.js": const widgets = require("sdk/widget"); const data = require("sdk/self").data; var player = widgets.widget({ id: "player", width: 72, label: "player", contenturl: data.url("buttons.html") }); player.port.emit("init"); player.port.on("play", function() { console.log("playing"); }); player.port.on("pause", function() { console...
...And 7 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
try to avoid using it. draft this page is not complete. « previousnext » this document was authored by taiga (gomita) gomibuchi and was originally published in japanese for the firefox developers conference summer 2007. gomita-san won "most useful upgraded extension" award in mozilla's 2006 "extend firefox" competition for scrapbook, and was runner-up in the "extend firefox 2" contest for firegestures. the chapters so far have each focused on technologies in isolation—xul, javascript, css, and xpcom. ...
...efox. in the following you will find a brief description how to do so; a more detailed one can be found under setting up an extension development environment. create a development profile if you want to partition your everyday browsing environment from your development environment in firefox, set up a second profile for development. ...
...e for development. to create this dev profile start firefox with firefox.exe -no-
remote -p dev on the first start the profile manager will appear, where you can create the dev profile and configure its home-path. change your preferences for more efficient development before you get to work developing your extension, you’ll want to change some of your firefox preferences. this isn’t a requi
rement for extension development, but i recommend it as a way to work more efficiently. preference description value nglayout.debug.disable_xul_cache (not present in firefox 3.5+) ordinarily, firefox will cache xul documents after they have been read in once, to speed subsequent displays. disabling this cache forces xul documents to be reloaded any every time ...
...And 7 more matches
Layout System Overview - Archive of obsolete content
presentation formatting is also required to provide compatibility with legacy browsers (microsoft internet explorer and netscape navigator 4.x). the decision about when to apply css-specified formatting and when to apply legacy formatting is controlled by the document's doctype specification. ...
...n a paged presentation to a printer, or even an aural presentation to a speech-synthesizer. to date the only real use of this multiple presentation ability is seen in printing, where multiple presentations are managed, all connected to the same content model. (note: it is unclear if this is really a benefit - it may have been better to use a copy of the content model for each presentation, and to
remove the complexity of managing separate presentations - analysis is needed here). the idea of supporting a non-visual presentation is interesting. layout's support for aural presentations is undeveloped, though conceptually, it is possible and supported by the architecture. how layout does its job: frames and reflow so, layout is concerned with providing a presentation, in galley or paged mode. gi...
...or many other computations during the formatting of the frames. once a frame is created for a content element, it must be formatted. we refer to this as 'laying out' the frame, or as 'reflowing' the frame. each frame implements a reflow method to compute its position and size, among other things. for more details on the reflow mechanism, see the reflow overview document... the css formatting requi
rements present two distinct layout models: 1) the in-flow model, where the geometry of an element is influenced by the geometry of the elements that precede it, and 2) the positioned model, where the geometry of an element is not influenced by the geometry of the elements that precede it, or in any case, is influenced more locally. the in-flow case is considered the 'normal' case, and corresponds to...
...And 7 more matches
Modularization techniques - Archive of obsolete content
queryinterface() method. the caller passes in an id and a pointer to a address to place the resulting interface. if the query is successful, queryinterface() will return ns_ok. if the object does not support the given interface, it will return ns_nointerface. reference counting is performed using the addref() and release() methods. an objects reference count generally starts at zero. addref() inc
rements that reference count, and release() dec
rements it. if a call to release() causes the reference count to hit zero, the object will generally free itself. a successful queryinterface() will call addref() on the requested interface before returning. both addref() and release() return the resulting reference count. the convenience macros ns_addref() and ns_release() are preferred over calling ad...
...s_imethod lockfactory(prbool alock) = 0; the reason for using factories is that it provides a mechanism for creating an object without having access to the class declaration for that object. calling new foo() requires that at compile time you have access to the class declaration of foo(). a factory allows an implementor to hide both the class declaration and creation details of an object, an ext
remely important step for allowing maximum flexibility in the implementation of a class and reducing compile time dependencies. it can even be used to eliminate all link time dependencies on the class and its factory entirely. the component manager one of the major goals of our modularization is to
remove link time dependencies. so how do you find a module if you've never linked with it? we've crea...
...ytes is probably a footnote somewhere. on windows you can use the programs uuidgen and guidgen, which ship with visual c++, to generate ids. a simple example it is recommended that you use xpidl to define your interfaces. this sample code should be updated to reflect this, but it gives you a good basic understanding of com from the c++ perspective. file nsisample.h nsisample.h defines an ext
remely simple interface and its interface id (iid). the important things to notice are that the interface inherits from nsisupports, and all member functions are pure virtual methods. #include "nsisupports.h" // {57ecad90-ae1a-11d1-b66c-00805f8a2676} #define ns_isample_iid \ {0x57ecad90, 0xae1a, 0x11d1, \ {0xb6, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x26, 0x76}} /* * nsisample interface declaration */...
...And 7 more matches
Practical positioning examples - Learn web development
ave this somewhere sensible on your local computer, and open it up in your text editor. let's look at the html contained within the body: <section class="info-box"> <ul> <li><a href="#" class="active">tab 1</a></li> <li><a href="#">tab 2</a></li> <li><a href="#">tab 3</a></li> </ul> <div class="panels"> <article class="active-panel"> <h2>the first tab</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque turpis nibh, porttitor nec venenatis eu, pulvinar in augue. vestibulum et orci scelerisque, vulputate tellus quis, lobortis dui. vivamus varius libero at ipsum mattis efficitur ut nec nisl. nullam eget tincidunt metus. donec ultrices, urna maximus consequat aliquet, dui neque eleifend lo
rem, a auctor libero turpis at sem. aliquam ut ...
...ulum et orci scelerisque, vulputate tellus quis, lobortis dui. vivamus varius libero at ipsum mattis efficitur ut nec nisl. nullam eget tincidunt metus. donec ultrices, urna maximus consequat aliquet, dui neque eleifend lo
rem, a auctor libero turpis at sem. aliquam ut porttitor urna. nulla facilisi.</p> </article> <article> <h2>the second tab</h2> <p>this tab hasn't got any lo
rem ipsum in it. ...
...dunt metus. donec ultrices, urna maximus consequat aliquet, dui neque eleifend lo
rem, a auctor libero turpis at sem. aliquam ut porttitor urna. nulla facilisi.</p> </article> <article> <h2>the second tab</h2> <p>this tab hasn't got any lo
rem ipsum in it. but the content isn't very exciting all the same.</p> </article> <article> <h2>the third tab</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque turpis nibh, porttitor nec venenatis eu, pulvinar in augue. ...
...And 7 more matches
Beginning our React todo list - Learn web development
c subset of tasks: all tasks, only the active task, or only the completed tasks. we'll tackle these stories one-by-one. pre-project housekeeping create-react-app has made a few files we won't be using at all for our project. we're not going to write per-component stylesheets, so first delete the app.css import from the top of app.js. we are also not going to be using the logo.svg file, so
remove that import too. then, copy and paste the following commands into your terminal to delete some unneeded files. make sure you’re starting in the app's root directory! # move into the src directory of your project cd src # delete a few files rm -- app.test.js app.css logo.svg serviceworker.js setuptests.js # move back up to the root of the project cd .. notes: two of the files we’re d...
... <span>active</span> <span classname="visually-hidden"> tasks</span> </button> <button type="button" classname="btn toggle-btn" aria-pressed="false"> <span classname="visually-hidden">show </span> <span>completed</span> <span classname="visually-hidden"> tasks</span> </button> </div> <h2 id="list-heading"> 3 tasks
remaining </h2> <ul role="list" classname="todo-list stack-large stack-exception" aria-labelledby="list-heading" > <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> ...
... it's ugly, and doesn’t function yet, but that's okay — we'll style it in a moment. first, consider the jsx we have, and how it corresponds to our user stories: we have a <form> element, with an <input type="text"> for writing out a new task, and a button to submit the form. we have an array of buttons that will be used to filter our tasks. we have a heading that tells us how many tasks
remain. we have our 3 tasks, arranged in an un-ordered list. each task is a list item (<li>), and has buttons to edit and delete it and a checkbox to check it off as done. the form will allow us to make tasks; the buttons will let us filter them; the heading and list are our way to read them. the ui for editing a task is conspicuously absent for now. that's okay – we'll write that later. access...
...And 7 more matches
Introducing a complete toolchain - Learn web development
o be. all web projects will be different, and you need to consider what parts of your toolchain are necessary and consider each part carefully. the smallest toolchain is one that has no links at all. you would handcode the html, use "vanilla javascript" (meaning no frameworks or intermediary languages), and manually upload it all to a server for hosting. however, more complicated software requi
rements will likely benefit from the usage of tools to help simplify the development process. in addition, you should include tests before you deploy to your production server to ensure your software works as intended — this already sounds like a necessary toolchain. for our sample project, we'll be using a toolchain specifically designed to aid our software development and support the technical c...
... to the project. npm will be used to install subsequent parts of our toolchain. first of all, however, we'll install git to help with revision control. code revision control it's possible you've heard of "git" before. git is currently the most popular source code revision control tool available to developers — revision control provides many advantages, such as a way to backup your work in a
remote place, and a mechanism to work in a team on the same project without fear of overwriting each other's code. it might be obvious to some, but it bears repeating: git is not the same thing as github. git is the revision control tool, whereas github is an online store for git repositories (plus a number of useful tools for working with them). note that, although we're using github in this chapte...
...wn html element or invalid css property is used, due to the resilient nature of these two languages nothing is likely to break. javascript is a lot more fragile — mistakenly calling a function that doesn't exist for example causes your javascript to break; linting javascript is therefore very important, especially for larger projects. the go to tool for javascript linting is eslint. it's an ext
remely powerful and versatile tool but can be tricky to configure correctly and you could easily consume many hours trying to get a configuration just right! out of the box, eslint is going to complain that it can't find the configuration file if you run it. the configuration file supports multiple formats but for this project we'll use .eslintrc.json (the leading period means the file is hidden by ...
...And 7 more matches
HTTP Cache
the cache api is completely thread-safe and non-blocking. there is no ipc support. it's only accessible on the default chrome process. when there is no profile the new http cache works, but everything is stored only in memory not obeying any particular limits. it is strongly encoraged to not use the old cache api any more - nsicacheservice et al. it will soon be completely obsoleted and
removed (bug 913828). nsicachestorageservice the http cache entry-point. accessible as a service only, fully thread-safe, scriptable. //github.com/realityripple/uxp/blob/master/netwerk/cache2/nsicachestorageservice.idl "@mozilla.org/netwerk/cache-storage-service;1" provides methods accessing “storage” objects – see nsicachestorage below – giving further access to ca...
... mandatory argument to *storage methods of nsicachestorageservice. //github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a...
... mandatory argument to *storage methods of nsicachestorageservice. //github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a helper interface wrap...
...And 7 more matches
How to implement a custom autocomplete search component
* @return {string} the uri to the image to display */ getimageat : function (index) { return ''; }, /** * get the final value that should be completed when the user confirms * the match at the given index. ...
...tion (index) { return ''; }, /** * get the final value that should be completed when the user confirms * the match at the given index. * @return {string} the final value of the result at the given index */ getfinalcompletevalueat: function(index) { return this.getvalueat(index); }, /** *
removes the value at the given index from the autocomplete results. ...
...t the final value that should be completed when the user confirms * the match at the given index. * @return {string} the final value of the result at the given index */ getfinalcompletevalueat: function(index) { return this.getvalueat(index); }, /** *
removes the value at the given index from the autocomplete results. * if
removefromdb is set to true, the value should be
removed from * persistent storage as well. ...
...And 7 more matches
Python binding for NSS
cated elements of the python-nss api are marked with python deprecation warnings as well as being documented in the nss module documentation. as of python 2.7 deprecation warnings are no longer reported by default. it is suggested python developers using python-nss periodically run their code with deprecation warnings enabled. depercated elements will persist for a least two releases before being
removed from the api entirely. project history red hat utilizes both nss and python in many of it's projects, however it was not previously possible to call nss directly from python. to solve this problem red hat generously funded the initial development of python-nss as well as it's continued maintenance. red hat following it's open source philosophy has contributed the source to the mozilla secu...
...se date 2016-09-01 scm tag pynss_release_1_0_0 source download https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/pynss_release_1_0_0/src/ change log official 1.0.0 release, only minor tweaks from the 1.0.0beta1 release. allow custom include root in setup.py as command line arg. add tls chacha20 poly1305 constants.
remove checks for whether a socket is open for reading. it's not possible for the binding to know in all cases, especially if the socket is created from an xternal socket passed in. the following module functions were added: nss.get_all_tokens the following constants were added: ssl.tls_ecdhe_rsa_with_chacha20_poly1305_sha256 ssl.tls_ecdhe_ecd...
...ssl_version_from_major_minor ssl.get_default_ssl_version_range ssl.get_supported_ssl_version_range ssl.set_default_ssl_version_range ssl.ssl_library_version_from_name ssl.ssl_library_version_name ssl.get_cipher_suite_info ssl.ssl_cipher_suite_name ssl.ssl_cipher_suite_from_name the following deprecated module functions were
removed: ssl.nssinit ssl.nss_ini ssl.nss_shutdown the following classes were added: sslciphersuiteinfo sslchannelinfo the following class methods were added: certificate.trust_flags certificate.set_trust_attributes sslsocket.set_ssl_version_range sslsocket.get_ssl_version_range ...
...And 7 more matches
JSAPI reference
since jsapi 32 high-level type-conversion routines for packing and unpacking function arguments. js_convertarguments obsolete since jsapi 38 js_convertargumentsva obsolete since jsapi 38 js_pusharguments obsolete since javascript 1.8.5 js_pushargumentsva obsolete since javascript 1.8.5 js_poparguments obsolete since javascript 1.8.5 js_addargumentformatter obsolete since jsapi 18 js_
removeargumentformatter obsolete since jsapi 18 the following functions convert js values to various types. they can be safely applied to jsvals of any type. they may return new objects. for example, js_valuetoobject(cx, s) where s is a string creates a new string wrapper object. these functions may call javascript methods. for example, js_valuetostring(cx, obj) may call obj.tostring(). js::tobo...
...egc js_getgcparameter js_setgcparameter js_getgcparameterforthread added in spidermonkey 17 js_setgcparameterforthread added in spidermonkey 17 js_setgcparametersbasedonavailablememory added in spidermonkey 31 enum jsgcparamkey js_setgccallback enum jsgcstatus js_addfinalizecallback added in spidermonkey 38 enum jsfinalizestatus added in spidermonkey 17 js_
removefinalizecallback added in spidermonkey 38 js_setgczeal added in spidermonkey 1.8 js_schedulegc added in spidermonkey 17 js_dumpheap added in spidermonkey 1.8 js_setgccallbackrt obsolete since jsapi 13 js_setfinalizecallback added in spidermonkey 17 obsolete since jsapi 32 js_markgcthing obsolete since jsapi 5 js_isabouttobefinalized obsolete since jsapi 35 js_clearnewbornroots obsole...
...since jsapi 38 js::addnamedvalueroot added in spidermonkey 31 obsolete since jsapi 38 js::addnamedvaluerootrt added in spidermonkey 31 obsolete since jsapi 38 js::addnamedscriptroot added in spidermonkey 31 obsolete since jsapi 38 js::addnamedstringroot added in spidermonkey 31 obsolete since jsapi 38 js::addnamedobjectroot added in spidermonkey 31 obsolete since jsapi 38 js::
remove*root added in spidermonkey 31 obsolete since jsapi 38 js::
removevalueroot added in spidermonkey 31 obsolete since jsapi 38 js::
removestringroot added in spidermonkey 31 obsolete since jsapi 38 js::
removeobjectroot added in spidermonkey 31 obsolete since jsapi 38 js::
removescriptroot added in spidermonkey 31 obsolete since jsapi 38 js::
removevaluerootrt added in spidermonkey 3...
...And 7 more matches
XPCOM array guide
bes the available arrays as well as the enumerator classes that can be used to get to them. in this document the term array refers to a container for multiple objects with a numeric, zero-based index. the standard array classes are: nsiarray - a scriptable container for scriptable xpcom objects. this array is read-only, and the interface does not provide any methods that will allow adding and
removing members. nsimutablearray - a scriptable container for scriptable xpcom objects, which allows addition and
removal of member objects. this interface actually derives from nsiarray. nstarray<t> - a c++ class which provides a typesafe container for objects or primitive types (pointers, integers, and so on). the objects must define a default constructor and a copy constructor. to use indexof w...
...ay xpcom object yes no yes* no reference counted, strong (*) note: concrete c++ arrays can be made read-only by declaring them const. for example: // handlelist cannot modify the array because of const void handlelist(const nstarray<t>&); in-place enumeration most of the arrays presented here provide callback-style means to enumerate members of an array. instead of inc
rementally accessing each element of the array by its index, the arrays provide a way to pass in a callback function that will be called for each element in the array. for most concrete c++ classes like nstarray<t> and nscomarray<t>, indexing should be faster than the callback-style enumeration, because accessing an indexed member of such an array is usually very fast, while enumeration has slight f...
... nsiarray or nsimutablearray as appropriate. when the array can or should be modified, then use nsimutablearray: // array is read-only because it uses nsiarray void printsize(nsiarray* elements) { pruint32 count; elements->getlength(&count); printf("there are %d elements.\n", count); } // using nsimutablearray, so callee may modify void tweakarray(nsimutablearray* elements) { elements->
removeelementat(0); elements->appendelement(newelement, pr_false); } while it is usually possible to call queryinterface on an nsiarray to get access to the nsimutablearray interface, this is against convention and it should be avoided. // no need for the double-pointer, and this violates xpcom rules // which expect acess to a new object void tweakarray(nsimutablearray** elements) { // ugh, ex...
...And 7 more matches
nsIMsgFolder
sgthread thread); void setlabelformessages(in nsisupportsarray messages, in nsmsglabelvalue label); nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); void setmsgdatabase(in nsimsgdatabase msgdatabase); nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); boolean shouldsto
remsgoffline(in nsmsgkey msgkey); boolean hasmsgoffline(in nsmsgkey msgkey); nsiinputstream getofflinefilestream(in nsmsgkey msgkey, out pruint32 offset, out pruint32 size); void downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); nsimsgfolder getchildwithuri(in acstring uri, in boolean deep, in boolean caseinsensitive); void ...
...); void setstringproperty(in string propertyname, in acstring propertyvalue); boolean isancestorof(in nsimsgfolder folder); boolean containschildnamed(in astring name); nsimsgfolder getchildnamed(in astring aname); nsimsgfolder findsubfolder(in acstring escapedsubfoldername); void addfolderlistener(in nsifolderlistener listener); void
removefolderlistener(in nsifolderlistener listener); void notifypropertychanged(in nsiatom property, in acstring oldvalue, in acstring newvalue); void notifyintpropertychanged(in nsiatom property, in long oldvalue, in long newvalue); void notifyboolpropertychanged(in nsiatom property, in boolean oldvalue, in boolean newvalue); void notifypropertyflagchanged(in nsim...
...propertychanged(in nsiatom property, in boolean oldvalue, in boolean newvalue); void notifypropertyflagchanged(in nsimsgdbhdr item, in nsiatom property, in unsigned long oldvalue, in unsigned long newvalue); void notifyunicharpropertychanged(in nsiatom property, in astring oldvalue, in astring newvalue); void notifyitemadded(in nsisupports item); void notifyitem
removed(in nsisupports item); void notifyfolderevent(in nsiatom event); void listdescendents(in nsisupportsarray descendents); void shutdown(in boolean shutdownchildren); void setinvfeditsearchscope(in boolean asearchthisfolder, in boolean asetonsubfolders); void copydatatooutputstreamforappend(in nsiinputstream aistream, in long alength, in nsioutputstrea...
...And 7 more matches
Using IndexedDB - Web APIs
his tutorial walks you through using the asynchronous api of indexeddb. if you are not familiar with indexeddb, you should first read basic concepts about indexeddb. for the reference documentation on the indexeddb api, see the indexeddb article and its subpages. this article documents the types of objects used by indexeddb, as well as the methods of the asynchronous api (the synchronous api was
removed from spec). basic pattern the basic pattern that indexeddb encourages is the following: open a database. create an object store in the database. start a transaction and make a request to do some database operation, like adding or retrieving data. wait for the operation to complete by listening to the right kind of dom event. do something with the results (which can be foun...
...es, and a single database can contain any number of object stores. whenever a value is stored in an object store, it is associated with a key. there are several different ways that a key can be supplied depending on whether the object store uses a key path or a key generator. the following table shows the different ways the keys are supplied: key path (keypath) key generator (autoinc
rement) description no no this object store can hold any kind of value, even primitive values like numbers and strings. you must supply a separate key argument whenever you want to add a new value. yes no this object store can only hold javascript objects. the objects must have a property with the same name as the key path. no yes this object store ...
...newly created objectstore. var customerobjectstore = db.transaction("customers", "readwrite").objectstore("customers"); customerdata.foreach(function(customer) { customerobjectstore.add(customer); }); }; }; as indicated previously, onupgradeneeded is the only place where you can alter the structure of the database. in it, you can create and delete object stores and build and
remove indices. object stores are created with a single call to createobjectstore(). the method takes a name of the store, and a parameter object. even though the parameter object is optional, it is very important, because it lets you define important optional properties and refine the type of object store you want to create. in our case, we've asked for an object store named "customers" and defined...
...And 7 more matches
RTCPeerConnection.addTrack() - Web APIs
ream objects to which the track should be added. the specified track doesn't necessarily have to already be part of any of the specified streams. instead, the streams are simply a way to group tracks together on the receiving end of the connection, making sure they are synchronized. any tracks that are added to the same stream on the local end of the connection will be on the same stream on the
remote end. return value the rtcrtpsender object which will be used to transmit the media data. note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver. the associated receiver is muted (indicating that it is not able to deliver packets) until and unless one or more streams are added to the receiver by the
remote peer. exceptions invalidaccesserror the spec...
... since streams are specific to each peer, specifying one or more streams means the other peer will create a corresponding stream (or streams) automatically on the other end of the connection, and will then automatically add the received track to those streams. streamless tracks if no streams are specified, then the track is streamless. ...
...rack to those streams. streamless tracks if no streams are specified, then the track is streamless. this is perfectly acceptable, although it will be up to the
remote peer to decide what stream to insert the track into, if any. this is a very common way to use addtrack() when building many types of simple applications, where only one stream is needed. for example, if all you're sharing with the
remote peer is a single stream with an audio track and a video track, you don't need to deal with managing what track is in what stream, so you might as well just let the transceiver handle it for you. here's an example showing a function that uses getusermedia() to obtain a stream from a user's camera and microphone, then adds each track from the stream to the peer connection, without specifying a ...
...And 7 more matches
Box-shadow generator - CSS: Cascading Style Sheets
; this.pointer = pointer; setmousetracking(node, updateslider.bind(this)); sliders[topic] = this; setvalue(topic, this.value); } var setbuttoncomponent = function setbuttoncomponent(node) { var type = node.getattribute('data-type'); var topic = node.getattribute('data-topic'); if (type === "sub") { node.textcontent = '-'; node.addeventlistener("click", function() { dec
rement(topic); }); } if (type === "add") { node.textcontent = '+'; node.addeventlistener("click", function() { inc
rement(topic); }); } } var setinputcomponent = function setinputcomponent(node) { var topic = node.getattribute('data-topic'); var unit_type = node.getattribute('data-unit'); var input = document.createelement('input'); var unit = document.createelement(...
...lement('span'); unit.textcontent = unit_type; input.setattribute('type', 'text'); node.appendchild(input); node.appendchild(unit); input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { setvalue(topic, e.target.value | 0); }); subscribe(topic, function(value) { node.children[0].value = value; }); } var inc
rement = function inc
rement(topic) { var slider = sliders[topic]; if (slider === null || slider === undefined) return; if (slider.value + slider.step <= slider.max) { slider.value += slider.step; setvalue(slider.topic, slider.value) notify.call(slider); } }; var dec
rement = function dec
rement(topic) { var slider = sliders[topic]; if (slider === null || slider === undefined...
...= value; slider.pointer.style.left = pos - offset / 2 + "px"; slider.node.setattribute('data-value', value); notify.call(slider); } var setmousetracking = function setmousetracking(elem, callback) { elem.addeventlistener("mousedown", function(e) { callback(e); document.addeventlistener("mousemove", callback); }); document.addeventlistener("mouseup", function(e) { document.
removeeventlistener("mousemove", callback); }); } var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscribers[topic] = []; subscribers[topic].push(callback); } var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); } var notify = function notify() { if (sub...
...And 7 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
t mobile/tablet friendly, can be a lot more effort than just creating a separate mobile site or app, especially if it is a sprawling enterprise site. read more about responsive design advantages and disadvantages. you can also read our discussion on the basics of responsive design, if you need some more background information and basics. fluid grids the best place to start is with fluid measu
rements for our application layout — essentially, this means using a combination of percentages and ems/
rems to size your containers and text, not fixed widths such as pixels. this has a lot of advantages in that the layout will adapt to different viewport dimensions. let's look at an example. we've written a simple-but-fun prototype for an application called snapshot, which takes a video stream f...
...: these weird x- elements may be unfamiliar; they are part of brick, mozilla's ui element library for mobile web apps. we have used brick to create the mobile layout for snapshot, which you will read more about below. to get these sitting side-by-side we have used the following rules: x-card { width: 100%; } x-card:nth-child(1), x-card:nth-child(2) { width: 30%; float: left; padding: 2
rem; } x-card:nth-child(3) { width: 40%; float: left; height: 100%; overflow: auto; padding: 2
rem; } so we're giving the first two columns a width of 30%, and the third a width of 40%, floating the columns all left. this way they end up side-by-side, and their proportions
remain the same as the browser window size varies. this is just a simple grid example, but you can apply this principl...
...ns, naked and unstyled. because the size of replaced elements is dictated by the size of the media inserted into them, and the media is a fixed size, they explode out of their containing elements and make a mess of the layout. this is pretty horrible, but generally this kind of problem is easily fixed with some simple css: img, video { max-width: 100%; } this tells the replaced elements to
remain constrained inside their container's widths, no matter what. however, if they aren't as wide as their containers, they will not stretch to fill them. in the snapshot example, we ended up with slightly different code: x-card:nth-child(1) video, x-card:nth-child(2) img { width: 100%; … } this is because in our case, we do in fact want the video and image to stretch to always fill their...
...And 7 more matches
passwords - Archive of obsolete content
interact with firefox's password manager to add, retrieve and
remove stored credentials. usage a credential is the set of information a user supplies to authenticate herself with a service. typically a credential consists of a username and a password. using this module you can: search for credentials which have been stored in the password manager. you can then use the credentials to access their related service (for example, by logging into a web site). store credentials in the password manager. you can store different sorts of credentials, as outlined in the "credentials" section below.
remove stored credentials from the password manager. credentials in this api, credentials are represented by objects. you create credential objects to pass into the api, and the ...
...word input in a form. omitted for add-on credentials and http authentication credentials. oncomplete function the callback function that is called once the function completes successfully. onerror function the callback function that is called if the function failed. the callback is passed an error argument: this is an nsiexception object. ...
...orm. omitted for add-on credentials and http authentication credentials. oncomplete function the callback function that is called once the function completes successfully. onerror function the callback function that is called if the function failed. the callback is passed an error argument: this is an nsiexception object. ...
...And 6 more matches
Enhanced Extension Installation - Archive of obsolete content
folder which tells the startup system that something has changed on the next restart. a copy of the xpi file the item was installed from is set aside since the xpinstall system cleans up the temporary file it hands to the extension system. if the item is not compatible, the extension system asks the appropriate update service (either the one specified by the item, or the default one) if there is
remote compatibility information that supercedes the compatibility information held by the item. if there is, and this
remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). finalization for themes, the item is immediately installed fully, rather than awa...
...nts, defaults and chrome manifests. uninstallation, disabling, enabling these functions work on the same principle as installation - the user requests an action through the ui while the application is running and metadata is written (tobeuninstalled, tobedisabled, tobeenabled) and a .autoreg file created in the profile so that on the subsequent startup the extension system's startup routine can
remove files (in the uninstall case) and write a new extensions.ini file listing the directories for the currently "active" items. ("active" items are items that are enabled.) a whole new world install locations we have several targets for where items can be installed. these include: the application profile directory <profile>/extensions/ the application install directory <application>/extensi...
... is written from the current state of the cache. the pending operations list is used by the install operation finalization routine (|_finishoperations|) to get a list of items that are to be operated on. since all metadata is now stored in the profile directory, there is no longer any need for special extension system handling of the -register command line flag, so support for that has been
removed. datasource structure since there is now only a single rdf/xml datasource for storage of all installed items, the staggered datasource structure used by firefox 1.0 and the use of an internal composite datasource is no longer required. the extension system retains an object implementing nsirdfdatasource (so that it can supply special properties in addition to the set stored simply in the xm...
...And 6 more matches
Template Logging - Archive of obsolete content
g error, or simply that there shouldn't be any data anyway. fortunately, some debugging and logging support is provided with templates that may help. logging template results there are two main ways in which template errors may be detected. the first debugging method involves logging all new results that apply to the template due to the data changing as well as logging results that are changed or
removed. in addition, each result generated when the template is first created and initialized is logged. this logging of result changes is not done by default; it must be enabled with a flag. <vbox datasources="..." flags="logging"/> the flags attribute on the root element of the template should include the logging flag. if other flags are used as well, separate them with spaces. enabling logging w...
...with a flag. <vbox datasources="..." flags="logging"/> the flags attribute on the root element of the template should include the logging flag. if other flags are used as well, separate them with spaces. enabling logging will output details to the error console for each result. the error console can be found on the firefox tools menu. this logging of results can be very useful for debugging, but
remember to
remove this flag when you have finished and the template works correctly, as the logging can take up extra time that is not necessary when the template is working. each result is logged in a form much like the following: in template with id root using ref http://www.some-fictitious-zoo.com/birds new active result for query 2 matching rule 1: http://www.some-fictitious-zoo.com/birds/empero...
...ddition, this result matches the first <rule> of query 2. this information may be used to determine if results are not matching the correct rules. if you, for example, were expecting rule 2 to match, examine the rules and ensure that the logic is correct. the final piece of information is the phrase 'new active result'. this indicates first, that this is a new result, as opposed to a result being
removed, and second, that this result is 'active'. being active means that the result is not being overridden by an earlier query. as this example implies multiple queries are being used, we can determine that the first query did not provide a result with the given id, and that the result from the second query is used instead. this allows us to narrow down what query and rule is being used to generat...
...And 6 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
this should be one of the characters that appears in the label attribute for the element. alwaysopenpopup obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif...
...ears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. maxlength type: integer the maximum number of characters that the textbox allows to be entered. maxrows type: integer the number of rows to show in the results list at a time. a scrollbar will appear so the user can scroll through the
remaining items. minresultsforpopup obsolete since gecko 1.9.1 type: integer the minimum number of results that must be returned for the popup to be displayed. the default value is 1. a zero value will always open the popup unless the textbox is empty. this can be used to display additional items that are not autocomplete results. as of gecko 1.9.1, this attribute is now alw...
... for more information about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. in addition, arrow buttons appear next to the textbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, inc
rement, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the command event will fire as the user modifies the value. a listener for the command event should update search results. if the searchbutton attribute is set to true, the command event is only fired if the user presses th...
...And 6 more matches
Tree View Details - Archive of obsolete content
the same level. this function is used, specifically, to draw the nesting lines along the side of the tree. the getparentindex method is expected to return the parent row of a given row, that is, the row before it with a lower nesting value. all of these methods must be implemented by the view for children to be handled properly. containers there are also three functions, iscontainer, iscontaine
rempty and iscontaineropen that are used to handle a parent item in the tree. the iscontainer method should return true if a row is a container and might contain children. the iscontaine
rempty method should return true if a row is an empty container, for instance, a directory with no files in it. the iscontaineropen method is used to determine which items are opened and closed. the view is requi...
... a container may be rendered differently than a non-container. for instance, a container may have a folder icon beside it. a style sheet may be used to style items based on various properties such as whether a row is open. this is described in a later section. ...
...ecko 2.0), custom nsitreeview implementations must be prepared to handle a call to toggleopenstate for any row index which returns true for a call to iscontainer, regardless of whether the container is empty. review of the methods here is a review of the methods needed to implement hierarchical views: getlevel(row) hasnextsibling(row, afterindex) getparentindex(row) iscontainer(row) iscontaine
rempty(row) iscontaineropen(row) toggleopenstate(row) the afterindex argument to hasnextsibling function is used as optimization to only start looking for the next sibling after that point. for instance, the caller might already know where the next sibling might possibly be. imagine a situation where a row had subrows and those subrows had child rows of their own and several are open. it could take...
...And 6 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
presents its certificate to the client to authenticate the server's identity. the authentication process uses public-key encryption and digital signatures to confirm that the server is in fact the server it claims to be. once the server has been authenticated, the client and server use techniques of symmetric-key encryption, which is very fast, to encrypt all the information they exchange for the
remainder of the session and to detect any tampering that may have occurred. servers may optionally be configured to require client authentication as well as server authentication. in this case, after server authentication is successfully completed, the client must also present its certificate to the server to authenticate the client's identity before the encrypted ssl session can be established. f...
...kes it possible to encrypt email messages. this is also important for some business users. however, using encryption for email requires careful planning. if the recipient of encrypted email messages loses his or her private key and does not have access to a backup copy of the key, for example, the encrypted messages can never be decrypted. single sign-on network users are frequently required to
remember multiple passwords for the various services they use. for example, a user might have to type a different password to log into the network, collect email, use directory services, use the corporate calendar program, and access various servers. multiple passwords are an ongoing headache for both users and system administrators. users have difficulty keeping track of different passwords, tend to...
... to the customer's accounts. a company might give a new employee a client ssl certificate that allows the company's servers to identify that employee and authorize access to the company's servers. server ssl certificates. used to identify servers to clients via ssl (server authentication). server authentication may be used with or without client authentication. server authentication is a requi
rement for an encrypted ssl session. for more information, see "ssl protocol". example: internet sites that engage in electronic commerce (commonly known as e-commerce) usually support certificate-based server authentication, at a minimum, to establish an encrypted ssl session and to assure customers that they are dealing with a web site identified with a particular company. the encrypted ssl ses...
...And 6 more matches
Archived JavaScript Reference - Archive of obsolete content
obsolete javascript features and unmaintained docs arguments.callerthe obsolete arguments.caller property used to provide the function that invoked the currently executing function. this property has been
removed and no longer works.array comprehensionsthe array comprehension syntax was a javascript expression which allowed you to quickly assemble a new array based on an existing one. however, it has been
removed from the standard and the firefox implementation. do not use it!array.observe()the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects. it provided a stream of changes in order of occurrence. it's equivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"]. however, this...
...andard and the firefox implementation. do not use it!array.observe()the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects. it provided a stream of changes in order of occurrence. it's equivalent to object.observe() invoked with the accept type list ["add", "update", "delete", "splice"]. however, this api has been deprecated and
removed from browsers. you can use the more general proxy object instead.array.unobserve()the array.unobserve() method was used to
remove observers set by array.observe(), but has been deprecated and
removed from browsers. you can use the more general proxy object instead.arraybuffer.transfer()the static arraybuffer.transfer() method returns a new arraybuffer whose contents have been taken from the o...
... function syntax for writing simple functions.for each...inthe for each...in statement iterates a specified variable over all values of object's properties. for each distinct property, a specified statement is executed.function.aritynot part of any standard.function.prototype.isgenerator()the non-standard isgenerator() method used to determine whether or not a function is a generator. it has been
removed from firefox starting with version 58.generator comprehensionsthe generator comprehension syntax was a javascript expression which allowed you to quickly assemble a new generator function based on an existing iterable object. however, it has been
removed from the standard and the firefox implementation. do not use it!handler.enumerate()the handler.enumerate() method used to be a trap for for.
...And 6 more matches
Styling links - Learn web development
mlelement.focus()) — this is styled using the :focus pseudo class. active: a link when it is being activated (e.g. clicked on), styled using the :active pseudo class. default styles the following example illustrates what a link will behave like by default (the css is simply enlarging and centering the text to make it stand out more.) <p><a href="#">a simple link</a></p> p { font-size: 2
rem; text-align: center; } note: all the links in the examples in this page are fake links — a # (hash, or pound sign) is put in place of the real url. this is because if the real links were included, clicking on them would break the examples (you'd end up with an error, or a page loaded in the embedded example that you couldn't get back from.) # just links to the current page. you'll notic...
...ll write out our empty rulesets: a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { } this order is important because the link styles build on one another, for example the styles in the first rule will apply to all the subsequent ones, and when a link is being activated, it is also being hovered over. if you put these in the wrong order, things won't work properly. ...
...the styles in the first rule will apply to all the subsequent ones, and when a link is being activated, it is also being hovered over. if you put these in the wrong order, things won't work properly. to
remember the order, you could try using a mnemonic like love fears hate. ...
...And 6 more matches
Index - Learn web development
we'll probably add to this resource as time goes on. 51 cooperative asynchronous javascript: timeouts and intervals animation, beginner, codingscripting, guide, intervals, javascript, loops, asynchronous, requestanimationframe, setinterval, settimeout, timeouts this tutorial looks at the traditional methods javascript has available ...
..., you are expected to use the bouncing balls demo from the previous article as a starting point, and add some new and interesting features to it. 66 inheritance in javascript article, beginner, codingscripting, constructor, function, getter, inheritance, javascript, learn, oojs, oop, object, object member, prototype, extends, l10n:priority, setter this article has covered the
remainder of the core oojs theory and syntax that we think you should know now. at this point you should understand javascript object and oop basics, prototypes and prototypal inheritance, how to create classes (constructors) and object instances, add features to classes, and create subclasses that inherit from other classes. 67 javascript object basics api, article, beginner, codingsc...
...ber" game, step by step. 77 arrays arrays, article, beginner, codingscripting, javascript, join, learn, pop, push, l10n:priority, shift, split, unshift in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name. here we look at why this is useful, then explore how to create an array, retrieve, add, and
remove items stored in an array, and more besides. 78 basic math in javascript — numbers and operators article, beginner, codingscripting, guide, javascript, learn, math, operators, augmented, inc
rement, l10n:priority, maths, modulo in this article we have covered the fundamental information you need to know about numbers in javascript, for now. you'll see numbers used again an...
...And 6 more matches
Introduction to automated testing - Learn web development
piling nascent javascript features for maximum cross-browser reach, and so on. use a browser automation system like selenium to run specific tests on installed browsers and return results, alerting you to failures in browsers as they crop up. commercial cross-browser testing apps like lambdatest, sauce labs, browserstack, and testingbot are based on selenium, but allow you to access their set up
remotely using a simple interface, saving you the hassle of setting up your own testing system. we will look at how to set up your own selenium-based testing system in the next article. in this article, we'll look at how to set up a task runner, and use the basic functionality of commercial systems like the ones mentioned above. note: the above two categories are not mutually exclusive. it is pos...
...e() function to pass that source to another command to do something else with. we can chain as many of these together as we want. we first run htmltidy() on the source, which goes through and fixes errors in our file. the second pipe() function writes the output html file to the build directory. in the input version of the file, you may have noticed that we put an empty <p> element; htmltidy has
removed this by the time the output file has been created. autoprefixer and css-lint install using the following lines: npm install --save-dev gulp-autoprefixer npm install --save-dev gulp-csslint add the following dependencies to gulpfile.js: const autoprefixer = require('gulp-autoprefixer'); const csslint = require('gulp-csslint'); add the following test to the bottom of gulpfile.js: ...
...(); } here we grab our style.css file, run csslint on it (which outputs a list of any errors in your css to the terminal), then runs it through autoprefixer to add any prefixes needed to make nascent css features run in older browsers. at the end of the pipe chain, we output our modified prefixed css to the build directory. ...
...And 6 more matches
Mozilla’s UAAG evaluation report
ation report covers nightly builds of the mozilla web browser itself, running on windows 2000, as of february 20, 2002. we are claiming to support html 4, css 2, png, jpg and gif. this evaluation does not cover mailnews or composer. there may be accessibility and customizability features not listed here. a very good resource is the customizing document. ...
...e accessibility and customizability features not listed here. a very good resource is the customizing document. when filing mozilla bugs based on uaag requi
rements, please use bug 24413 as the uaag meta bug. checkpoint information (same scaled used on w3c's uaag implementation reports pages) rating scale c: complete implementation vg: very good implementation, almost all requi
rements satisfied g: good implementation, most important requi
rements satisfied p: poor implementation, some requi
rements satisfied and/or difficult for user to access feature ni: not implemented nr: not rated na: not applicable document under construction guideline 1. support input and output device-independence. checkpoint title status notes/plans...
... most browsers do not allow the user to select text with the keyboard alone. we intend to do this with a caret browsing feature. 1.2 activate event handlers. ...
...And 6 more matches
Eclipse CDT
introduction eclipse cdt (c/c++ development tools) is an open-source ide for c and c++ development with advanced code assistance (inheritance/call graph explorer, jump to definition, refactoring, autocomplete, syntax highlighting, and so on). system requi
rements eclipse will use a lot of memory to fully index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after indexing is complete). therefore, it is not recommended for use if your machine only has 4 gb of ram. installing eclipse regarding llvm4eclipsecdt, do not install or select this toolchain for mozilla development. this plugin is intended mainly for managed projects but we use an unmanaged project for mozilla (since it has its own bui...
...nd that any changes you make may be ignored if they conflict with existing bindings, or if they are overridden by a binding for a more specific context. for example, changing the find next command to cmd-g/ctrl-g is not sufficient. for that to work you also either need to find the existing bindings for that key combination (using the bindings column to sort by key combination helps with this) and
remove them, or else you need to make your binding very specific by setting the "when" field to "c/c++ editor" instead of the more general "editing text". opening files you can quickly open a file by name using cmd-shift-r/ctrl-shift-r. although eclipse doesn't do fuzzy matching when you type a file name, it does allow you to use wildcards. to quickly switch between a source file and its header fi...
...thod you searched for will be highlighted (you may need to scroll to it) - double click to see its definition. the results for "quick type hierarchy" will only show those classes in the inheritance tree that override the method. double click on a class to go straight to its override's definition. building from eclipse in short, don't do this. eclipse doesn't have good facilities for building inc
rementally in individual directories in the way that mozilla developers generally require. more importantly, unless you're willing to screw up eclipse's code assistance (in which case why bother using eclipse) you're going to have to set eclipse's "build" step to do a very slow, non-parallel, full rebuild. (see the "code assistance" section above for why.) nevertheless, if you understand the above w...
...And 6 more matches
Release phase
here, we'll continue to stay true to the original intent of this guide and only present you with the technical information you need to become an official release. we'll primarily focus on getting your release repository setup and the mercurial commands you'll need to know to use that repository. for more information on the release part of the l10n process, visit the mozilla wiki here. ...
...ing your connection protocols. configuration before you try pushing, you need to tell ssh which username you wish to use for connecting with hg.mozilla.org. this should be your mozilla ldap account name. add the following lines to your ~/.ssh/config file, replacing user@host.domain with your mozilla ldap account name: host hg.mozilla.org user user@host.domain if you have already cloned the
remote repository using the http protocol using this command: $ hg clone http://hg.mozilla.org/releases/l10n-central/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell mercurial to push using ssh. your .hg/hgrc file shoud look like this (add the emphasized line): [paths] default = hg.mozilla.org/releases/l10n-central/x-testing default-push = ssh://hg.mo...
...mozilla.org/releases/l10n-central/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell mercurial to push using ssh. ...
...And 6 more matches
Memory reporting
g a memory reporter. and please ask nnethercote to co-review any memory reporter patch. mozilla code has infrastructure that lets different parts of the code report on their memory usage. this is most obviously used in about:memory and telemetry. this document describes things that you should know when writing a memory reporter. memory reporters a memory reporter makes one or more memory measu
rements (a.k.a. reports). each reporter implements a collectreports function which takes a nsimemoryreportercallback argument; for each measu
rement the reporter must pass in several values, including: a path (which identifies the report); an amount (the most important thing); a unit (most commonly bytes, but sometimes a unitless count or percentage); a description of what is measured. see ...
... two ways to measure memory reporters can be divided into the two following kinds. ...
...fies the report); an amount (the most important thing); a unit (most commonly bytes, but sometimes a unitless count or percentage); a description of what is measured. see the nsimemoryreporter documentation and nsimemoryreporter.idl for full details. making measu
rements nsimemoryreporter provides the high-level interface for a memory reporter, but the heart of a memory reporter is the measu
rement of the "amount". two ways to measure memory reporters can be divided into the two following kinds. traversal-based reporters traverse one or more data structures and measure the size of all the allocated blocks in the data structure. counter-based reporters maintain a counter that is inc
remented on each relevant allocation and dec
remented on each relevant deallocation. traversal-based ...
...And 6 more matches
NSS API Guidelines
some data from the arena; this may overlap the chunk thread b has. boom! threadmark code notes the thread id, whenever an arena is marked, and disallows any allocations or marks by any other thread. (frees are allowed.) the arena_destructor_list preprocessor definition, and the code it encloses, are an effort to make the following work together: arenas, letting you allocate stuff and then
removing them all at once lazy creation of pure-memory objects from asn.1 blobs, for example use of nsspkixcertificate doesn't drag all the code in for all constituent objects, unless they're actually being used our agressive pointer-tracking facility all these are useful, but they don't combine well. now some of the pointer-tracking pressure has eased off, we can drop its use when it becomes too...
...ept classname can be used in other object files. secport_add_pointer(classname, pointer) - add pointer as a valid pointer for classclassname. this is usually called by a create function. secport_verify_pointer(classname, pointer, secerror, returnvalue)- check if a given pointer really belongs to the requested class. if it doesn't set the error secerror and return the value returnvalue. secport_
remove_pointer(classname, pointer) -
remove a pointer from the valid list. usually called by a destroy function. finally, error logging should be added an documented when debug is turned on. interfaces for these are in nspr. thread safety code developed using the nss apis needs to make use of thread safety features. first to examine is object creation and deletion. object creation is usually n...
...reated. exceptions to this include objects which are created on the fly, or as global objects. deletion, on the other hand, may be trickier. threads may be referencing the object at the same time a another thread tries to delete it. the semantics depend on the way the application uses the object, also how and when the application wants to destroy it. for some data structures, this problem can be
removed by protected reference counting. the object does not disappear until all users have released it. next we examine global data, including function local static structures. just initialized, and never to be changed global data, does not need to protection from mutexes. we should also determine if global data should be moved to a session context (see session context and global effects below). ...
...And 6 more matches
JSAPI User Guide
all of these functions, classes, and variables are stored as properties of the global object. a minimal example each of the three key elements described in the previous section requires a few jsapi calls: the runtime: use js_newruntime to create it and js_destroyruntime to clean it up when you're done. when your application is done with spidermonkey altogether, use js_shutdown to free any
remaining cached resources. (this is a mere nicety if the process is about to exit anyway. but as that is not always the case, calling js_shutdown is a good habit to get into.) the context: use js_newcontext and js_destroycontext. for maximum ecmascript standard compliance, applications should also use js_setoptions to enable jsoption_varobjfix. to get the latest javascript language features, a...
...is likely due to a gc-related error. the application must ensure that the garbage collector can reach all the objects, numbers, and strings that are still being used. otherwise, the gc will free the memory occupied by those values, leading to a probable crash the next time your program tries to use them. there are many ways to ensure that a value is gc-reachable. ...
...if these values must not be accessible from javascript, use reserved slots instead. ...
...And 6 more matches
SpiderMonkey 1.8.8
platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8.8 the following features in earlier versions of spidermonkey have been dropped. the jsresolve_classname and jsresolve_with resolve flags (passed to jsclass.resolve when jsclass.flags contains jsclass_new_resolve) have been
removed. spidermonkey 1.8.8 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the ...
... them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been
removed. these and other changes are explained in detail below. new javascript language features javascript 1.8.8 includes significant updates to language features, yo. typedef changes many types have been
removed from the jsapi and replaced with simpler alternatives. including jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code...
...studio 2010 and later) is only invoked for those compilers. otherwise <stdint.h> is used. the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio. ...
...And 6 more matches
Observer Notifications
y for a while. the notification is not repeated during a continuous inactivity period. windows these topics indicate points of interest during the lifetime of a window. topic subject description dom-window-destroyed nsidomwindow called just before a dom window is destroyed. inner-window-destroyed nsidomwindow called when an inner window is
removed from the backward/forward cache. see working with bfcache for information about the bfcache, and inner and outer windows for details about how the window hierarchy works. extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed. the window id can be obtained from subject.queryinterface(components.interfaces.nsisuppo...
...after a top level xul window is registered with the window mediator service. xul-window-visible nsiappwindow called just after a xul window is made visible. browsing-context-discarded browsingcontext called while a browsingcontext is being discarded. by this point, the browsingcontext will have been detached from its browsingcontextgroup and parent windowcontext, and
removed from any browsingcontext tree it was a part of. this is sent before browsingcontext::closed() is updated. window-global-created windowglobalparent called just after a windowglobalparent is initialized. a windowglobal actor has a lifetime matching that of an nsglobalwindowinner. window-global-destroyed windowglobalparent called just before a windowglobalparent is ...
...ter a windowglobalparent is initialized. a windowglobal actor has a lifetime matching that of an nsglobalwindowinner. window-global-destroyed windowglobalparent called just before a windowglobalparent is destroyed. by this point, the wgp being destroyed will have cleaned up most of its state, including its browsingcontext children and jswindowactors. additionally, it will have been
removed from any windowcontext tree it was part of. io notifications these topics can be used to watch the io service for useful information. topic description offline-requested called to query whether the application can go offline. the attempt to go offline can be canceled. note: if your code chooses to cancel the attempt to go offline, it must notify the user. ...
...And 6 more matches
nsICommandLine
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) components may implement the nsicommandlinehandler interface to add custom command line handling behavior. ...
... form, these are preceded by a single dash. some flags may take parameters; for example: "-url <param>" or "-install-xpi <param>". method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void
removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line. the application name is not part of the command line. read only. preventdefault boolean there may be a command-line handler which performs a default action if there wa...
... handler which performs a default action if there was no explicit action on the command line (open a default browser window, for example). this flag allows the default action to be prevented. state unsigned long the type of command line being processed. see state constants. read only. windowcontext nsidomwindow a window to be targeted by this command line. in most cases, this will be null (x
remote will sometimes set this attribute). read only. workingdirectory nsifile the working directory for this command line. use this property instead of the working directory for the current process, since a redirected command line may have had a different working directory. read only. constants state constants constant value description state_initial_launch 0 the first launch of the applic...
...And 6 more matches
nsIDOMWindowUtils
t aleftsize, in boolean aignorerootscrollframe, in boolean aflushlayout); void processupdates(); obsolete since gecko 13.0 void purgepccounts(); unsigned long redraw([optional] in unsigned long acount); void renderdocument(in nsconstrect arect, in pruint32 aflags, in nscolor abackgroundcolor, in gfxcontext athebescontext); native code only! ...
...this state is not the same as ime-mode: disabled. ime_status_enabled 1 users can use all functions of ime. this state is same as ime-mode: normal. ime_status_password 2 users cannot use most ime functions. on gtk2, users can use "simple ime" which only suppo...
...s set, the selection is set from aoffset + alength to aoffset. select_character 0 select_cluster 1 select_word 2 select_line 3 select_beginline 4 select_endline 5 select_paragraph 6 select_wordnospace 7 agent_sheet 0 a possible type of a style sheet loaded/
removed with loadsheet()/
removesheet(). see css2 specification for details. user_sheet 1 a possible type of a style sheet loaded/
removed with loadsheet()/
removesheet(). see css2 specification for details. author_sheet 2 a possible type of a style sheet loaded/
removed with loadsheet()/
removesheet(). see css2 specification for details. methods activatenativemenu...
...And 6 more matches
nsINavHistoryResultViewer
toolkit/components/places/public/nsinavhistoryservice.idlscriptable lets nsinavhistoryresult instances notify places views of changes in the results.
removed in gecko 2.0 and replaced with the nsinavhistoryresultobserver interface, which is similar but allows multiple clients to observe the result at once. 1.0 66 introduced gecko 1.9 obsolete gecko 2.0 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. note: most methods in this interface were renamed in gecko 1.9.2,...
...eywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aoldindex, in nsinavhistorycontainerresultnode anewparent, in unsigned long anewindex); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void node
removed(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long aoldindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8string anewuri); void nodereplaced(in nsinavhistorycontainerresultnode parent, in nsinavhistoryresultnode olditem, in nsinavhistoryresultnod...
...inavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aoldindex, in nsinavhistorycontainerresultnode anewparent, in unsigned long anewindex ); parameters anode the moved item. aoldparent the item's old parent. aoldindex the item's index in the old parent. anewparent the item's new parent. anewindex the item's index in the new parent.
remarks at the moment, this method is called only when an item is moved within the same container. when an item is moved between containers, a new node is created for the item, and the item
removed/itemadded methods are used. nodetitlechanged() called right after the title of a node has changed. void nodetitlechanged( in nsinavhistoryresultnode anode, in autf8string anewtitle ); parameters ...
...And 6 more matches
Component; nsIPrefBranch
n string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue); long getintpref(in string aprefname,requires gecko 54 [optional] in long adefaultvalue); long getpreftype(in string aprefname); void lockpref(in string aprefname); boolean prefhasuservalue(in string aprefname); boolean prefislocked(in string aprefname); void
removeobserver(in string adomain, in nsiobserver aobserver); void resetbranch(in string astartingat); void setboolpref(in string aprefname, in long avalue); void setcharpref(in string aprefname, in string avalue); requires gecko 58 void setstringpref(in string aprefname, in utf8string avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, i...
...ver. clearuserpref() called to clear a user set value from a specific preference. this will, in effect, reset the value to the default value. if no default value exists the preference will cease to exist. note: this method does nothing if the prefbranch it is called on is a default branch. void clearuserpref( in string aprefname ); parameters aprefname the preference to be cleared.
remarks note: prior to gecko 6.0, this method would throw an exception if there was no user value set for the specified preference. now, this method never throws. instead, it simply does nothing. deletebranch() called to
remove all of the preferences referenced by this branch. note: this method can be called on either a default or user branch but, in effect, always operates on both. void delet...
... getboolpref() called to get the state of an individual boolean preference. boolean getboolpref( in string aprefname, [optional] in boolean adefaultvalue ); parameters aprefname the boolean preference to get the state of. ...
...And 6 more matches
Deprecated tools - Firefox Developer Tools
over the course of devtools development, we have added several experimental panels to try out new ideas. not all of these have had wide adoption, and due to the cost of maintenance, seldom used panels are eventually
removed. we have created this list of deprecated or
removed panels. this page documents the deprecated panels and the bugs that track their
removal. although these panels have been
removed, you still have access to the old code, and there are alternative webextensions that you can try to get similar functionality. when we deprecate a panel, we begin by getting feedback from the community to determine the impact of
removing that panel. once we have decided to
remove the panel, we will provide a warning message, and finally, we will
remove the panel from the codebase. you may se...
... description scratchpad provided an environment for experimenting with javascript code. you can write, run, and examine the result of code that interacts with the web page. ...
... description scratchpad provided an environment for experimenting with javascript code. you can write, run, and examine the result of code that interacts with the web page. ...
...And 6 more matches
RTCConfiguration - Web APIs
instantiating a connection, or used with the rtcpeerconnection.getconfiguration() and rtcpeerconnection.setconfiguration() methods, which allow inspecting and changing the configuration while a connection is established. the options include ice server and transport settings and identity information. properties bundlepolicy optional specifies how to handle negotiation of candidates when the
remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. if this property isn't specified, a set of certificates is generated automatically for eac...
...the policy isn't specified, all is assumed by default, allowing all candidates to be considered. a value of relay limits the candidates to those relayed through another server, such as a stun or turn server. peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection. if this value is set (it defaults to null), the rtcpeerconnection will not connect to a
remote peer unless it can successfully authenticate with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the rtcrtcpmuxpolicy enum. the default is "require". constants rtcbundlepolicy enum the rtcbundlepolicy enum defines string constants which are used to request a spe...
...with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the rtcrtcpmuxpolicy enum. the default is "require". ...
...And 6 more matches
Video player styling basics - Developer guides
. note: in some cases some basic css is omitted from the code examples here as its use is either obvious or not specifically relevant to styling the video player. ...
...s omitted from the code examples here as its use is either obvious or not specifically relevant to styling the video player. ...
...re as its use is either obvious or not specifically relevant to styling the video player. ...
...And 6 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
for stuff like: 0.1 + 0.2 == 0.30000000000000004; in practice, integer values are treated as 32-bit ints, and some implementations even store it that way until they are asked to perform an instruction that's valid on a number but not on a 32-bit integer. this can be important for bit-wise operations. the standard arithmetic operators are supported, including addition, subtraction, modulus (or
remainder) arithmetic, and so forth. there's also a built-in object that we did not mention earlier called math that provides advanced mathematical functions and constants: math.sin(3.5); var circumference = 2 * math.pi * r; you can convert a string to an integer using the built-in parseint() function. this takes the base for the conversion as an optional second argument, which you should always p...
...een the case since 2013 or so. unless you're certain of your string format, you can get surprising results on those older browsers: parseint('010'); // 8 parseint('0x10'); // 16 here, we see the parseint() function treat the first string as octal due to the leading 0, and the second string as hexadecimal due to the leading "0x". the hexadecimal notation is still in place; only octal has been
removed. if you want to convert a binary number to an integer, just change the base: parseint('11', 2); // 3 similarly, you can parse floating point numbers using the built-in parsefloat() function. unlike its parseint() cousin, parsefloat() always uses base 10. you can also use the unary + operator to convert values to numbers: + '42'; // 42 + '010'; // 10 + '0x10'; // 16 a special value ...
...ript, blocks do not have scope; only functions have a scope. so if a variable is defined using var in a compound statement (for example inside an if control structure), it will be visible to the entire function. however, starting with ecmascript 2015, let and const declarations allow you to create block-scoped variables. operators javascript's numeric operators are +, -, *, / and % which is the
remainder operator (which is the same as modulo.) values are assigned using =, and there are also compound assignment statements such as += and -=. these extend out to x = x operator y. x += 5; x = x + 5; you can use ++ and -- to inc
rement and dec
rement respectively. these can be used as a prefix or postfix operators. the + operator also does string concatenation: 'hello' + ' world'; // "hello w...
...And 6 more matches
Intercepting Page Loads - Archive of obsolete content
browser window. it is full of useful functions, so you should always keep it in mind when you want to handle tabs and web content windows. attaching the load event handler to gbrowser allows us to listen to these events for all tabs, without having to worry how many tabs are open. gbrowser exists in every browser window. we store the handler function in a private variable because later we want to
remove it when we do not need it anymore. gbrowser.
removeeventlistener("load", this._loadhandler, true); finally, the actual code for the handler, which is very simple: _onpageload : function(event) { // this is the content document of the loaded page. let doc = event.originaltarget; if (doc instanceof htmldocument) { // is this an inner frame? if (doc.defaultview.frameelement) { ...
... get and modify the response text before it gets to the original requester. you won't be able to make dom modifications like with the load events, since these notifications are triggered before the response arrives and is parsed into dom tree, so this is not the best approach for the typical greasemonkey-style extensions. notes on usage: efficiency is very important when adding http observers.
remember that your observe method will be called for every http request made by firefox, usually several dozen per page visit. in the previous example, one of the first things we do is check if the url is of interest to us, otherwise we let it go. avoid heavy, time-consuming operations, or the user's browsing experience will become exasperating. . you have to take into account that a page load may ...
... or the user's browsing experience will become exasperating. . you have to take into account that a page load may involve several http requests, specially when redirects are involved. if you enter gmail.com in your browser, you will probably be redirected a few times before reaching the page that actually displays any content. all of these "hops" will involve a call to your observer. . the afo
rementioned observer notifications page has more information about these notifications and links to other useful documentation. webprogresslisteners when used in the chrome, this is a more sophisticated way of intercepting and modifying the various stages in page loads. but of course, there's always a price to pay: web progress listeners in the chrome are attached to specific instances of the brows...
...And 5 more matches
Setting up an extension development environment - Archive of obsolete content
xtended guide on how to set up even more user profiles, take a look at multiple firefox profiles. this particularly comes in handy for the use of all currently available firefox versions. it even allows the running of simultaneous versions, at the same time. to quickly achieve our task of creating just a developer profile, we will start the application with the parameters: /path/to/firefox -no-
remote -p profilename without these parameters, the default behavior of your mozilla applications is to only open the everyday user profile: named default. as we are specifically defining the user profile dev, if you don't have the dev profile already created, the profile selection window opens, where you can create it. in the following example, the described command starts a new instance of firefo...
.... as we are specifically defining the user profile dev, if you don't have the dev profile already created, the profile selection window opens, where you can create it. in the following example, the described command starts a new instance of firefox, with a profile called dev; even if an instance of firefox is already running. ...
... profile already created, the profile selection window opens, where you can create it. in the following example, the described command starts a new instance of firefox, with a profile called dev; even if an instance of firefox is already running. ...
...And 5 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
adverse user experience. due to the large volume of user complaints regarding hidden settings being changed against their will, and not being restored after the add-ons responsible are disabled, mozilla will take any steps necessary to mitigate the impact of offending add-ons. in particular, changing the location bar search keyword url in a way which is not automatically reset when the add-on is
removed will result in a reset prompt for users. other settings violations designed to restrict user choice will result in stronger action, such as blacklisting of the add-ons in question. the most technically sound method of achieving this, and the only acceptable way of changing preferences such that they are automatically restored on add-on uninstall, is to make such changes in the default prefere...
...es if the values have not been changed // in the meantime. for (let [name, [origvalue, value]] in iterator(savedprefs)) { if (defaultprefs.getcharpref(name) == value) defaultprefs.setcharpref(name, origvalue); } } function install() {} function uninstall() {} changing the default search engine this change comes in two parts: 1) installing a new search engine (and
removing it when your extension is disabled), and 2) setting it as a default (and restoring the previous default when your extension is uninstalled). adding a new search engine search engines may be added either directly via an api call, or indirectly via an xml description file. while the former is the simpler method, it does not support complex descriptions containing suggestion urls or separate ke...
...t it if (selectsearch && !engine.hidden) { services.search.moveengine(engine, 0); services.search.currentengine = engine; } } function shutdown(data, reason) { // clean up the search engine on uninstall or disabled. if (reason == addon_uninstall || reason == addon_disable) { let engine = services.search.getenginebyname(engine_details.name); // only
remove the engine if it appears to be the same one we // added. if (engine && engine.getsubmission("_searchterms_").uri.spec == engine_details.url) services.search.
removeengine(engine); } } function install() {} function uninstall() {} the complex method requires two files, an xml search description file and a javascript file to register the engine. in non-restartles...
...And 5 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done inc
rementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. note: for seamonkey 2.0 and all versions of thunderbird prior to 3.0 you also need to provide the disablehistory attribute. enablehistory new in thunderbird 1requires seamonkey 2.0 type: boolean if true, an arrow button will appear on the end of...
...ears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. maxlength type: integer the maximum number of characters that the textbox allows to be entered. maxrows type: integer the number of rows to show in the results list at a time. a scrollbar will appear so the user can scroll through the
remaining items. minresultsforpopup new in thunderbird 3requires seamonkey 2.0 type: integer the minimum number of results that must be returned for the popup to be displayed. the default value is 1. new in thunderbird 3requires seamonkey 2.0 a zero value will always open the popup. this can be used to display additional items that are not autocomplete results. nomatc...
... for more information about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. in addition, arrow buttons appear next to the textbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, inc
rement, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the command event will fire as the user modifies the value. a listener for the command event should update search results. if the searchbutton attribute is set to true, the command event is only fired if the user presses th...
...And 5 more matches
XUL Structure - Archive of obsolete content
style both html and xul, and many of the features can be shared between both. however, there are some features that are specific to html, such as forms, and others which are specific to xul, such as overlays. since xul and html are handled in the same way, you can load both from either your local file system, from a web page, or from an extension or standalone xulrunner application. content from
remote sources (e.g. http://localhost/~username/ ), regardless of whether they are html or xul or another document type, are limited in the type of operations they can perform, for security reasons. for this reason, mozilla provides a method of installing content locally and registering the installed files as part of its chrome system. this allows a special url form, called a chrome:// url, to be use...
...arger and more sophisticated than most extensions. firefox and thunderbird, as well as number of other components are all written in xul and are all accessible via chrome urls. you can examine these packages by looking in the chrome directory where firefox or another xul application is built. the chrome url always begins with 'chrome://'. in much the same way as an 'http://' url always refers to
remote web sites accessed using http, and the 'file://' url always refers to local files, the 'chrome://' url always refers to installed packages and extensions. we'll look more at the syntax of a chrome url in the next section. it is important to note that when accessing content through a chrome url, it gains the enhanced privileges described above that other kinds of urls do not. for instance, an h...
...nsion. this distinction is important. this means that there are certain things that content of web pages cannot do, such as read the user's bookmarks. this distinction is not based on the kind of content being displayed; only on the type of url used. both html and xul placed on a web site have no extra permissions; however both html and xul loaded through a chrome url have enhanced permissions.
remote xul was disabled in firefox 8, so the following is of historic interest only. if you are going to use xul on a web site, you can just put the xul file on the web site as you would an html file, and then load its url in a browser http://localhost/xul.php. ensure that your web server is configured to send xul files with the content type of application/vnd.mozilla.xul+xml (eg with php header('co...
...And 5 more matches
listbox - Archive of obsolete content
ation, itemcount, listboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset,
removeitemat,
removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> <listbox id="thelist" rows="10" width="400"> <listhead> <listheader label="1ct gem" ...
...t entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done inc
rementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. rows type: integer the number of ro...
... appenditem( label, value ) re...
...And 5 more matches
menuitem - Archive of obsolete content
r this attribute to have any effect. note: if the checked attribute is set to true, and you persist its value via the persist attribute, mozilla will fail to persist its value when the menuitem is unchecked because of bug 15232. a workaround is to set the autocheck attribute to false, then programmatically set the checked attribute when the user selects the item, and set it to false instead of
removing the attribute (i.e. do menuitem.setattribute("checked", "false") instead of menuitem.
removeattribute("checked")) when the user unchecks the menuitem, as a value of false will both correctly hide the checkmark and persist its hidden state. command type: id set to the id of a command element that is being observed by the element. closemenu type: one of the values below indica...
... type: id set to the id of a command element that is being observed by the element. closemenu type: one of the values below indicates if the menu closes when the menuitem is activated. auto this, the default value if the closemenu attribute is not specified, closes up the menu and all parent menus. single the menu the item is contained within is closed, but the parent menus
remain open. none no menus are closed. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start t...
...menuitems that have the same value for their name attributes are part of the same radio group. only one menuitem in the same radio group can be checked at once. more information on adding checkmarks to menus in the xul tutorial validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored
remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the image will be loaded from the cache if possible. value type: string the string attribute allows you to associate a data value with an element. it is...
...And 5 more matches
richlistbox - Archive of obsolete content
ion, itemcount, scrollboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset,
removeitemat,
removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <richlistbox> <richlistitem> <description>a xul description!</description> </richlistitem> <richlistitem> <button label="a xul button"/> </richlistitem> </richlistbox> the richlistbox element contains multiple richlistitem elements, which can con...
... entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done inc
rementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. seltype type: one of the values below used to ind...
... appenditem( label, value ) ...
...And 5 more matches
tree - Archive of obsolete content
t entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done inc
rementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. editable type: boolean indicates that the cells of the tree may be edited. enablecolumndrag type: boolean when set to true, the user may drag the column headers around to change the order in which they are displayed. flags type: space-separated lis...
...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 element, use the getrowcount method. seltype type: one of the values below used to indicate whether mult...
...ls can be selected text rows are selected; however, the selection highlight appears only over the text of the primary column. for richlistbox, this is new in firefox 3.5. statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree state information. this is used to hold which tree items are open and which items are collapsed. this information will be
remembered for the next time the xul file is opened. if you do not specify this attribute, state information will be stored in the local store (rdf:local-store). tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. treelines type: boo...
...And 5 more matches
WAI-ARIA basics - Learn web development
via javascript, accessibility can suffer — screenreader users will find it difficult to work out what the feature does if there are no semantics or other clues. in these situations, aria can help to provide what's missing with a combination of roles like button, listbox, or tabgroup, and properties like aria-required or aria-posinset to provide further clues as to functionality. one thing to
remember though — you should only use wai-aria when you need to! ideally, you should always use native html features to provide the semantics required by screenreaders to tell their users what is going on. sometimes this isn't possible, either because you have limited control over the code, or because you are creating something complex that doesn't have an easy html element to implement it. in such...
...ou just load the file by loading it directly into the browser (via double clicking, etc.). to get it to run, you will need to upload it to a web server, for example using github, or a local web server like python's simplehttpserver. there is an additional consideration here — only the bit of text that updates is read out. it might be nice if we always read out the heading too, so the user can
remember what is being read out. to do this, we can add the aria-atomic property to the section. update your <section> tag again, like so: <section aria-live="assertive" aria-atomic="true"> the aria-atomic="true" attribute tells screenreaders to read out the entire element contents as one atomic unit, not just the bits that were updated. note: you can see the finished example at aria-live.html (s...
...ria-atomic="true" attribute tells screenreaders to read out the entire element contents as one atomic unit, not just the bits that were updated. note: you can see the finished example at aria-live.html (see it running live). note: the aria-relevant property is also quite useful for controlling what gets read out when a live region is updated. you can for example only get content additions or
removals read out. enhancing keyboard accessibility as discussed in a few other places in the module, one of the key strengths of html with respect to accessibility is the built-in keyboard accessibility of features such as buttons, form controls, and links. generally, you are able to use the tab key to move between controls, the enter/return key to select or activate controls, and occasionally ot...
...And 5 more matches
CSS values and units - Learn web development
or web development are listed in the table below. unit relative to em font size of the parent, in the case of typographical properties like font-size, and font size of the element itself, in the case of other properties like width. ex x-height of the element's font. ch the advance measure (width) of the glyph "0" of the element's font.
rem font size of the root element. lh line height of the element. vw 1% of the viewport's width. vh 1% of the viewport's height. vmin 1% of the viewport's smaller dimension. vmax 1% of the viewport's larger dimension. exploring an example in the example below you can see how some relative and absolute length units behave. the firs...
...element. vw 1% of the viewport's width. vh 1% of the viewport's height. vmin 1% of the viewport's smaller dimension. vmax 1% of the viewport's larger dimension. exploring an example in the example below you can see how some relative and absolute length units behave. the first box has a width set in pixels. as an absolute unit this width will
remain the same no matter what else changes. the second box has a width set in vw (viewport width) units. this value is relative to the viewport width, and so 10vw is 10 percent of the width of the viewport. if you change the width of your browser window, the size of the box should change, however this example is embedded into the page using an <iframe>, so this won't work. to see this in action you...
...tive to the font size. i've set a font size of 1em on the containing <div>, which has a class of .wrapper. change this value to 1.5em and you will see that the font size of all the elements increases, but only the last item will get wider, as the width is relative to that font size. after following the instructions above, try playing with the values in other ways, to see what you get. ems and
rems em and
rem are the two relative lengths you are likely to encounter most frequently when sizing anything from boxes to text. it's worth understanding how these work, and the differences between them, especially when you start getting on to more complex subjects like styling text or css layout. the below example provides a demonstration. the html is a set of nested lists — we have three lists...
...And 5 more matches
UI pseudo-classes - Learn web development
iv { margin-bottom: 20px; display: flex; flex-flow: row wrap; } the effect this has is that the label and input sit on separate lines because they are both width: 100%, but the <span> has a width of 0 so can sit on the same line as the input. now onto the generated content. ...
...ple to provide out-of-range messages for the numeric inputs, as well as saying whether they are required. ...
.... when you've typed in a valid age (i.e. in the range of 12-120), the input turns valid. if however, you then change the age entry to one that is out of range, the "outside allowable value range" message then pops up in place of "required". note: to enter an invalid/out-of-range value, you'll have to actually focus the form and type it in using the keyboard. the spinner buttons won't let you inc
rement/dec
rement the value outside the allowable range. styling enabled and disabled inputs, and read-only and read-write an enabled element is an element that can be activated; it can be selected, clicked on, typed into, etc. a disabled element on the other hand cannot be interacted with in any way, and its data isn't even sent to the server these two states can be targeted using :enabled and :...
...And 5 more matches
Introduction to events - Learn web development
n'); for (let i = 0; i < buttons.length; i++) { buttons[i].onclick = bgchange; } note that another option here would be to use the foreach() built-in method available on nodelist objects: buttons.foreach(function(button) { button.onclick = bgchange; }); note: separating your programming logic from your content also makes your site more friendly to search engines. addeventlistener() and
removeeventlistener() the newest type of event mechanism is defined in the document object model (dom) level 2 events specification, which provides browsers with a new function — addeventlistener(). this functions in a similar way to the event handler properties, but the syntax is obviously different. we could rewrite our random color example to look like this: const btn = document.queryselector(...
...te to put all the code inside the addeventlistener() function, in an anonymous function, like this: btn.addeventlistener('click', function() { var rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundcolor = rndcol; }); this mechanism has some advantages over the older mechanisms discussed earlier. first, there is a counterpart function,
removeeventlistener(), which
removes a previously added listener. for example, this would
remove the listener set in the first code block in this section: btn.
removeeventlistener('click', bgchange); this isn't significant for simple, small programs, but for larger, more complex programs it can improve efficiency to clean up old unused event handlers. plus, this allows you to have the same button pe...
... second, you can register multiple handlers for the same listener. the following two handlers wouldn't both be applied: myelement.onclick = functiona; myelement.onclick = functionb; the second line overwrites the value of onclick set by the first line. ...
...And 5 more matches
Drawing graphics - Learn web development
ch as background-image, and svg. this however was still not enough. while you could use css and javascript to animate (and otherwise manipulate) svg vector images — as they are represented by markup — there was still no way to do the same for bitmap images, and the tools available were rather limited. the web still had no way to effectively create animations, games, 3d scenes, and other requi
rements commonly handled by lower level languages such as c++ or java. the situation started to improve when browsers began to support the <canvas> element and associated canvas api — apple invented it in around 2004, and other browsers followed by implementing it in the years that followed. as you'll see below, canvas provides many useful tools for creating 2d animations, games, data visualizatio...
...e experiments on to. first make a local copy of our 0_canvas_start.html file, and open it in your text editor. add the following code into it, just below the opening <body> tag: <canvas class="mycanvas"> <p>add suitable fallback here.</p> </canvas> we have added a class to the <canvas> element so it will be easier to select if we have multiple canvases on the page, but we have
removed the width and height attributes for now (you could add them back in if you wanted, but we will set them using javascript in a below section). canvases with no explicit width and height default to 300 pixels wide by 150 pixels high. now add the following lines of javascript inside the <script> element: const canvas = document.queryselector('.mycanvas'); const width = canvas.width = wi...
...thing exactly halfway across the width of the canvas). if you save and load your example in a browser now, you'll see nothing, which is fine, but you'll also see scrollbars — this is a problem for us, which happens because the <body> element has a margin that, added to our full-window-size canvas, results in a document that's wider than the window. to get rid of the scrollbars, we need to
remove the margin and also set overflow to hidden. add the following into the <head> of your document: <style> body { margin: 0; overflow: hidden; } </style> the scrollbars should now be gone. note: you should generally set the size of the image using html attributes or dom properties, as explained above. you could use css, but the trouble then is that the sizing is done after ...
...And 5 more matches
Deploying our app - Learn web development
can commit our code and push to github and the updated code will automatically trigger the entire build routine. if all is well, we get a live change deployed automatically. the only action we need to perform is that initial "push". however, we do have to set these steps up, and we'll look at that now. the build process again, because we're using parcel for development, the build option is ext
remely simple to add. instead of running the server with npx parcel src/index.html, we can run it with npx parcel build src/index.html and parcel will build everything ready for production instead of just running it for development and testing purposes. this includes doing minification and tree-shaking of code, and cache-busting on filenames. the newly-created production code is placed in a new dire...
...sks, and finally release a new update. we're going to add the build command to our package.json file as an npm script, so that the command npm run build will trigger the build process. this step isn't necessary, but it is a good best practice to get into the habit of setting up — across all our projects, we can then rely on npm run build to always do the complete build step, without needing to
remember the specific build command arguments for each project. open the package.json file in your project's root directory, and find the scripts property. we'll add a build command that we can run to build our code. add the following line to your project now: "scripts": { ... "build": "parcel build src/index.html" } note: if the scripts property already has a command inside ...
... finally the code needs to be pushed to your github hosted repository. let's do that now. over at github, visit https://github.com/new and create your own repository to host this code. give your repository a short, memorable name, without spaces in it (use hyphens to separate words), and a description, then click create repository at the bottom of the page. ...
...And 5 more matches
Midas
selection for the given command. supported commands command value description backcolor a color code. this command will set the background color of the document. bold if there is no selection, the insertion point will set bold for subsequently typed characters. if there is a selection and all of the characters are already bold, the bold will be
removed. otherwise, all selected characters will become bold. contentreadonly this command will make the editor readonly(true)or editable(false). anticipated usage is for temporarily disabling input while something else is occurring elsewhere in the web page. copy if there is a selection, this command will copy the selection to the clipboard. if there isn't a selec...
...cally accel-c) with or without the signed js or any code on the page to handle it. createlink a uri. this command will not do anything if no selection is made. if there is a selection, a link will be inserted around the selection with the url parameter as the href of the link. cut if there is a selection, this command will copy the selection to the clipboard and
remove the selection from the edit control. if there isn't a selection, nothing will happen. note: this command won't work without setting a pref or using signed js. see: more about security preferences note: the shortcut key will automatically trigger this command (typically accel-x) with or without the signed js or any code on the page to handle it. decreasefontsize thi...
...block, that block becomes the first li and ul. if the caret is inside a numbered item, the numbered item becomes a bulleted item. insertparagraph inserts a new paragraph. italic if there is no selection, the insertion point will set italic for subsequently typed characters. if there is a selection and all of the characters are already italic, the italic will be
removed. otherwise, all selected characters will become italic. justifycenter center-aligns the current block. justifyfull fully-justifies the current block. justifyleft left-aligns the current block. justifyright right aligns the current block. outdent outdent the block where the caret is located. if the block is not...
...And 5 more matches
PKCS11 Implement
this document supplements the information in pkcs #11: cryptographic token interface standard, version 2.0 with guidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions. function-specific information organized in the same categories as the pkcs #11 specification. ...
... default library names; currently, these names should not include any double quotation marks. (this is more restrictive than pkcs 2.0 and may change in future versions of nss.). slot and token management c_getslotlist the nss calls c_getslotlist on startup or when it loads a new module, requests all the module's slots, and keeps track of the list from that point on. ...
... module, requests all the module's slots, and keeps track of the list from that point on. the slots are expected to
remain static: that is, the module never has more slots or fewer slots than the number on the original list. c_getslotinfo the nss calls c_getslotinfo on startup or when it loads a new module and reads in the information that can be viewed on the slot information page. if the ckf_
removable_device flag is set, nss also calls c_getslotinfo whenever it looks up slots to make sure the token is present. if the ckf_
removable_device flag is not set, nss uses that token information without checking again. if the ckf_
removable_device flag is not set, the ckf_token_present flag must be set, or else nss marks the slot as bad and will never use it. the nss doesn't currently use the ckf_h...
...And 5 more matches
Hacking Tips
since spidermonkey 48, we have a gdb unwinder. this unwinder is able to read the frames created by the jit, and to display the frames which are after these jit frames. $ gdb --args out/dist/bin/js ./foo.js […] spidermonkey unwinder is disabled by default, to enable it type: enable unwinder .* spidermonkey (gdb) b js::...
...50 typein:2 (0x7fffef1231c0 @ 24) #25158 0x7fffefbbc1c8 typein:3 (0x7fffef1231c0 @ 47) #25159 0x7fffefbbc140 typein:2 (0x7fffef1231c0 @ 24) #25160 0x7fffefbbc0b8 typein:3 (0x7fffef1231c0 @ 47) #25161 0x7fffefbbc030 typein:5 (0x7fffef123280 @ 9) note, you can do the exact same exercise above using lldb (necessary on osx after apple
removed gdb) by running lldb -f js then following the
remaining steps. since spidermonkey 48, we have a gdb unwinder. this unwinder is able to read the frames created by the jit, and to display the frames which are after these jit frames. $ gdb --args out/dist/bin/js ./foo.js […] spidermonkey unwinder is disabled by default, to enable it type: enable unwinder .* spidermonkey (gdb) b js::math_cos (gdb) run […] #0 js::math_cos (cx=0x14f264...
...if you want to know at which lir the code is failing at, the js::ion::codegenerator::generatebody function can be intrumented to dump the lir id before each instruction. for (; iter != current->end(); iter++) { ionspew(ionspew_codegen, "instruction %s", iter->opname()); […] ...
...And 5 more matches
SpiderMonkey 17
er platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 17 the following features in earlier versions of spidermonkey have been dropped. the jsresolve_classname and jsresolve_with resolve flags (passed to jsclass.resolve when jsclass.flags contains jsclass_new_resolve) have been
removed. spidermonkey 17 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the cod...
... them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been
removed. these and other changes are explained in detail below. new javascript language features javascript 17 includes significant updates to language features, yo. typedef changes many types have been
removed from the jsapi and replaced with simpler alternatives. including jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code. ...
...studio 2010 and later) is only invoked for those compilers. otherwise <stdint.h> is used. the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio. ...
...And 5 more matches
SpiderMonkey 38
tion. the js::handle<js::value> and js::mutablehandle<js::value> classes have been specialized to implement the same interface as js::value, for simplicity and to ease migration pain. changes to introduce handles to the jsapi are not individually documented, because of the breadth of the changes involved. the following features in earlier versions of spidermonkey have been dropped. xxx list
removed features here spidermonkey 38 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most functions that have changed still have the same names and implement essentially unchanged functionality. applications will need significant changes, but most of those changes will be detected by the c/...
... deleted apis js::addnamedobjectroot (bug 1107639) js::addnamedscriptroot (bug 1...
...opertydefinitionbehavior (bug 825199) symbol_to_jsid (bug 645416) obsolete apis ... ...
...And 5 more matches
Shell global objects
tion in js shell. variables scriptargs an array that contains arguments passed to js shell. scriptpath a string that is a path of script. console an object that has following property: log evaluate and print expressions to stdout. this function is an alias of the print() function. timesaccessed returns a number that indicates how many times this variable is accessed perfmeasu
rement see perfmeasu
rement.jsm. shell only functions functions always available version([number]) get or force a script compilation version number. options([option ...]) get or toggle javascript options. load(['foo.js' ...]) load files named by string arguments. filename is relative to the current working directory. loadrelativetoscript(['foo.js' ...]) load files named by string argumen...
...that this sets an object metadata callback that will override any other object metadata callback that may be set. disabletrackallocations() stop capturing the js stack at every allocation. makefinalizeobserver() get a special object whose finalization increases the counter returned by the finalizecount function. finalizecount() return the current value of the finalization counter that is inc
remented each time an object returned by the makefinalizeobserver is finalized. resetfinalizecount() reset the value returned by finalizecount(). gcpreservecode() preserve jit code during garbage collections. startgc([n [, 'shrinking']]) start an inc
remental gc and run a slice that processes about n objects. if shrinking is passesd as the optional second argument, perform a shrinking gc rather ...
... fullcompartmentchecks(true|false) if true, check for compartment mismatches before every gc. ...
...And 5 more matches
Detailed XPCOM hashtable guide
hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. ...
...e disjunct (i.e. you can store entries with keys 1, 5, and 3000). lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted: stored sorted; iterated over in a sorted fashion. unsorted: stored unsorted; cannot be iterated over in a sorted manner. inserting/
removing: o(n): adding and
removing items from a large array can be time-consuming o(1): adding and
removing items from hashtables is a quick operation wasted space: none: arrays are packed structures, so there is no wasted space. some: hashtables are not packed structures; depending on the implementation, there may be significant wasted memory. in their implementation, ha...
... hash to find the location in the hashtable. good hashtable implementations will automatically resize the hashtable in memory if extra space is needed, or if too much space has been allocated. when should i use a hashtable? hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or
removed. hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access. in these situations, an array, a linked-list, or various tree data structures are more efficient. mozilla's hashtable implementations mozilla has several hashtable implementations, which have been tested and, tuned, and hide the inner c...
...And 5 more matches
Mozilla internal string guide
g nsstring nscstring nsautostring nsautocstring etc... the string classes distinguish, as part of the type hierarchy, between strings that must have a null-terminator at the end of their buffer (ns[c]string) and strings that are not required to have a null-terminator (nsa[c]string). nsa[c]string is the base of the string classes (since it imposes fewer requi
rements) and ns[c]string is a class derived from it. functions taking strings as parameters should generally take one of these four types. in order to avoid unnecessary copying of string data (which can have significant performance cost), the string classes support different ownership models. all string classes support the following three ownership models dynamically: reference counted, copy-on-w...
...des an api for assignment, individual character access, basic manipulation of characters in the string, and string comparison. this class corresponds to the xpidl astring parameter type. nsastring is not necessarily null-terminated. nsstring/nscstring: builds on nsastring by guaranteeing a null-terminated storage. this allows for a method (.get()) to access the underlying character buffer. the
remainder of the string classes inherit from either nsastring or nsstring. thus, every string class is compatible with nsastring. since every string derives from nsastring (or nsacstring), they all share a simple api. common read-only methods: .length() - the number of code units (bytes for 8-bit string classes and char16_ts for 16-bit string classes) in the string. .isempty() - the fastest way ...
...dwriting(); // because `cur` may change during the loop, track the position // within the string. ...
...And 5 more matches
mozIPersonalDictionary
read only. methods addcorrection() adds a misspelling to the list of corrections. note that this method is not currently implemented.
...read only. methods addcorrection() adds a misspelling to the list of corrections. note that this method is not currently implemented. void addcorrection( in wstring word, in wstring correction, in wstring la...
...ize_is(count)] out wstring words, out pruint32 count ); parameters word the word to get the list of corrections for. words the list of corrections. count the number of corrections in the list. ignoreword() adds a word to the ignore all list. void ignoreword( in wstring word ); parameters word the word to add to the ignore list. load() loads the dictionary. void load(); parameters none.
removecorrection()
removes a misspelling from the list of corrections. this
removes a single misspelling and correction pair from the list. void
removecorrection( in wstring word, in wstring correction, in wstring lang ); parameters word the incorrect spelling of the word to
remove from the list of corrections. correction the correct spelling of the word. lang the language of the word. notes...
...And 5 more matches
nsILoginManagerStorage
read only. methods ad...
...read only. methods addlogin() called by the log...
...propertybag, only the properties specified in the nsipropertybag are changed in oldlogin and its corresponding nsiloginmetainfo. void modifylogin( in nsilogininfo oldlogin, in nsisupports newlogindata ); parameters oldlogin the login to be modified. newlogindata the login information to replace the oldlogin with. this may be specified as either an nsilogininfo or an nsipropertybag2 object. ...
...And 5 more matches
nsIMessageListenerManager
1. ...
...gename, in nsimessagelistener listener, [optional] in boolean listenwhenclosed) void
removemessagelistener(in astring messagename, in nsimessagelistener listener); void addweakmessagelistener(in astring messagename, in nsimessagelistener listener); void
removeweakmessagelistener(in astring messagename, in nsimessagelistener listener); methods addmessagelistener() register listener to receive messagename. all listener callbacks for a particular message are invoked when that message is received. the message manager holds a strong reference to listener. if the same listener registers twice for the same messa...
...elistener listener, [optional] in boolean listenwhenclosed); parameters messagename a string indicating the name of the message to listen for. listener an nsimessagelistener to invoke when a message is received. see nsimessagelistener for details of the message syntax. ...
...And 5 more matches
nsINavHistoryResultObserver
windex); void nodekeywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodelastmodifiedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aoldindex, in nsinavhistorycontainerresultnode anewparent, in unsigned long anewindex); void node
removed(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode aitem, in unsigned long aoldindex); void nodereplaced(in nsinavhistorycontainerresultnode aparentnode, in nsinavhistoryresultnode aoldnode, in nsinavhistoryresultnode anewnode, in unsigned long aindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodetitlechanged(in nsinavhistoryresultnode anode, in...
...ting a view for each update). void batching( in boolean atogglemode ); parameters atogglemode specify true to start batch mode or false to finish the batch. containerclosed() obsolete since gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) called when a container node's state changes from opened to closed. note: this method was deprecated in gecko 2.0 and
removed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8). implement the containerstatechanged() method instead. void containerclosed( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node which was closed. containeropened() obsolete since gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) called wh...
...ethod instead. void containerclosed( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node which was closed. containeropened() obsolete since gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) called when a container node's state changes from closed to opened. note: this method was deprecated in gecko 2.0 and
removed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8). implement the containerstatechanged() method instead. void containeropened( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node which was opened. containerstatechanged() called when a container node's state changes. void containerstatechanged( in nsinavhistorycontainerresu...
...And 5 more matches
Debugger.Object - Firefox Developer Tools
otype.makedebuggeevalue to create debugger.object instances for given debuggee objects, or use debugger.object.prototype.copy and debugger.object.prototype.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals. debugger.object instances protect their referents from the garbage collector; as long as the debugger.object instance is live, the referent
remains live. this means that garbage collection has no visible effect on debugger.object instances. accessor properties of the debugger.object prototype a debugger.object instance inherits the following accessor properties from its prototype: proto the referent's prototype (as a new debugger.object instance), or null if it has no prototype. class a string naming the ecmascript [[class]...
....defineproperty, except that the target object is implicit, and in a different compartment from the function and descriptor.) defineproperties(properties) add the properties given byproperties to the referent. (this function behaves like object.defineproperties, except that the target object is implicit, and in a different compartment from theproperties argument.) deleteproperty(name)
remove the referent's property namedname. return true if the property was successfully
removed, or if the referent has no such property. return false if the property is non-configurable. seal() prevent properties from being added to or deleted from the referent. return this debugger.object instance. (this function behaves like the standard object.seal function, except that the object to be seal...
...allable, call it with the giventhis value andargument values, and return a completion value describing how the call completed.this should be a debuggee value, or { asconstructor: true } to invoke the referent as a constructor, in which case spidermonkey provides an appropriate this value itself. eachargument must be a debuggee value. all extant handler methods, breakpoints, watchpoints, and so on
remain active during the call. if the referent is not callable, throw a typeerror. this function follows the invocation function conventions. apply(this,arguments) if the referent is callable, call it with the giventhis value and the argument values inarguments, and return a completion value describing how the call completed.this should be a debuggee value, or { asconstructor: true } to invokef...
...And 5 more matches
FileSystemEntrySync - Web APIs
warning: this api was never accepted and never became standardized. ...
...es and folders stored the origin of your app. method overview metadata getmetadata () raises (fileexception); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring tourl(); void
remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file system where the entry resides. fullpath readonly domstring the full absolute path from the root to the entry. an absolute path is a relative path from the root directory, prepende...
...olcat.png. the file system url does not expire. because the method describes a location on disk, the url is valid for as long as that location exists. you can delete the file and recreate it, and it's all good. you can supply the mimetype to simulate the optional mime type header associated with http downloads. domstring tourl (); parameter none. ...
...And 5 more matches
Node - Web APIs
uri, if present, and null if not. when multiple prefixes are possible, the result is implementation-dependent. node.lookupnamespaceuri() accepts a prefix and returns the namespace uri associated with it on the given node if found (and null if not). supplying null for the prefix will return the default namespace. node.normalize() clean up all the text nodes under this element (merge adjacent,
remove empty). node.
removechild()
removes a child node from the current element, which must be a child of the current node. node.replacechild() replaces one child node of the current one with the second one given in parameter. obsolete methods node.getuserdata() allows a user to get some domuserdata from the node. node.hasattributes() returns a boolean indicating if the element has an...
...ta() allows a user to get some domuserdata from the node. node.hasattributes() returns a boolean indicating if the element has any attributes, or not. node.issupported() returns a boolean flag containing the result of a test whether the dom implementation implements a specific feature and this feature is supported by the specific node. ...
... from the node. node.hasattributes() returns a boolean indicating if the element has any attributes, or not. node.issupported() returns a boolean flag containing the result of a test whether the dom implementation implements a specific feature and this feature is supported by the specific node. node.setuserdata() allows a user to attach, or
remove, domuserdata to the node. ...
...And 5 more matches
RTCPeerConnection.addIceCandidate() - Web APIs
when a web site or app using rtcpeerconnection receives a new ice candidate from the
remote peer over its signaling channel, it delivers the newly-received candidate to the browser's ice agent by calling rtcpeerconnection.addicecandidate(). this adds this new
remote candidate to the rtcpeerconnection's
remote description, which describes the state of the
remote end of the connection. if the candidate parameter is missing or a value of null is given when calling addicecandidate(), the added ice candidate is an "end-of-candidates" indicator. ...
... during negotiation, your app will likely receive many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list of potential connection methods. ...
...nnection. if the candidate parameter is missing or a value of null is given when calling addicecandidate(), the added ice candidate is an "end-of-candidates" indicator. the same is the case if the value of the specified object's candidate is either missing or an empty string (""), it signals that all
remote candidates have been delivered. the end-of-candidates notification is transmitted to the
remote peer using a candidate with an a-line value of end-of-candidates. during negotiation, your app will likely receive many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list of potential connection methods. this is covered in more detail in the articles webrtc connectivity and signaling and video calling. syntax apromise = pc.addicecandidate(candidate)...
...And 5 more matches
TrackEvent - Web APIs
it's important not to confuse trackevent with the rtctrackevent interface, which is used for tracks which are part of an rtcpeerconnection. ...
...y the dom track object the event is in reference to. if not null, this is always an object of one of the media track types: audiotrack, videotrack, or texttrack). methods trackevent has no methods of its own; however, it is based on event, so it provides the methods available on event objects. ...
...event, so it provides the methods available on event objects. example this example sets up a function, handletrackevent(), which is callled for any addtrack or
removetrack event on the first <video> element found in the document. ...
...And 5 more matches
Cognitive accessibility - Accessibility
y considerations for people with cognition and learning disabilities. this document introduces cognitive accessibility and improving accessibility of the web for people with cognitive and learning differences. cognitive impairment refers to a broad range of disabilities, from people with intellectual disabilities who may have the most-limited capabilities, to age-related issues with thinking and
remembering. the range includes people with mental illnesses, such as depression and schizophrenia. it also includes people with learning disabilities, such as dyslexia and attention deficit hyperactivity disorder (adhd). though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems. these problems include dif...
...with mental illnesses, such as depression and schizophrenia. it also includes people with learning disabilities, such as dyslexia and attention deficit hyperactivity disorder (adhd). though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems. these problems include difficulty with understanding content,
remembering how to complete tasks, and confusion caused by inconsistent or non-traditional web page layouts. in this document, we focus on steps developers should take to improve the cognitive accessibility of their web sites and applications. overview cognitive and intellectual disabilities cover a large spectrum, and may be momentary, temporary, or permanent conditions. for example, dementia and ...
...me or on a periodic basis, such as being logged out after 30 minutes or having 15 minutes to make a purchase. people with cognitive disabilities may require more time to read content, or to perform functions such as filling out forms. solutions include providing users enough additional time to complete tasks or eliminate time constraints altogether. timers options for adjusting time requi
rements include: allowing the user to turn off or adjust the time to at least 10 times the original limit before encountering it. alerting the user and providing a buffer of at least 20 seconds to extend the timeout duration by a factor of 10 with a simple action, such as hitting the space bar. provide a toggle on content that allows users to enable a longer session time limit, or no session t...
...And 5 more matches
Array.prototype.shift() - JavaScript
if the length property is 0, undefined is returned. shift is intentionally generic; this method can be called or applied to objects resembling arrays. ...
...if the length property is 0, undefined is returned. shift is intentionally generic; this method can be called or applied to objects resembling arrays. ...
...hod changes the length of the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.shift() return value the
removed element from the array; undefined if the array is empty. description the shift method
removes the element at the zeroeth index and shifts the values at consecutive indexes down, then returns the
removed value. if the length property is 0, undefined is returned. shift is intentionally generic; this method can be called or applied to objects resembling arrays. objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties ...
...And 5 more matches
SDK API Lifecycle - Archive of obsolete content
apis need to be able to introduce new apis that aren't yet fully proven, and to retire old apis when they're no longer optimal or supported by the underlying platform. the api lifecycle aims to balance these competing demands. ...
... unstable the api is in the process of settling, but has not yet had sufficient real-world testing to be considered stable. backwards-compatibility will be maintained if reasonable. ...
...form users that the module is deprecated. attempts to use a deprecated module at runtime will log an error to the error console. the amo validator will throw errors when deprecated modules are used, and these add-ons will therefore fail amo review. ...
...And 4 more matches
Working with Events - Archive of obsolete content
then we open tw...
... then we open two tabs. var tabs = require("sdk/tabs"); functio...
... then we open two tabs. var tabs = require("sdk/tabs"); function listener1() { c...
...And 4 more matches
Bootstrapped extensions - Archive of obsolete content
ys to apply their user interface to the application, programmatically insert themselves into the application. this is done using a special script file that's included in the extension that contains functions the browser calls to command the extension to install, uninstall, start up, and shut down. all the application does is call into this script file; the extension is responsible for adding and
removing its user interface and handling any other setup and shutdown tasks it requires. this article discusses how bootstrapped extensions work. see this tutorial on converting from an overlay extension to restartless for a practical step by step guide to migrating. the startup and shutdown process a key feature of bootstrapped extensions is that they must be able to start up and shut down on dem...
...or a practical step by step guide to migrating. the startup and shutdown process a key feature of bootstrapped extensions is that they must be able to start up and shut down on demand by the application. when the extension's startup() function is called, it must manually inject its user interface and other behavior into the application. similarly, when its shutdown() function is called, it must
remove anything that it has added to the application, as well as all references to any of its objects. there are several scenarios in which the startup() function may be called; for example: when the extension is first installed, assuming that it's both compatible with the application and is enabled. when the extension becomes enabled using the add-ons manager window. when the application is st...
...register xul overlays from a bootstrapped add-on. see the chrome.manifest documentation for details. in firefox 10 and later the chrome.manifest file located in the root of the add-on's xpi (i.e. a sibling of the install.rdf) is loaded automatically. in firefox 8 and 9 you had to load/unload the manifest manually using nsicomponentmanager.addbootstrappedmanifestlocation() and nsicomponentmanager.
removebootstrappedmanifestlocation(). this feature was unavailable in firefox versions before 8. adding user interface manually if you decide to go ahead and try to develop a bootstrapped extension that modifies the application's user interface, here are a few suggestions to get you started. you need to look up the relevant application ui elements by their id by calling document.getelementbyid(), ...
...And 4 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
ascript than ever before. please consider all of your options carefully before deciding to use native code (c++) in your extension. in addition, binary components need to be recompiled for every major firefox release, which can be frustrating. this article describes how to set up the development environment for a large, complex firefox extension with any or all of the above-mentioned requi
rements. i should also stress that you do not have to build mozilla or use the mozilla build system if you want to create c++ components for mozilla. if you are just looking to create an xpcom component or two, this is probably overkill, and you might want to take a look at this guide instead. on the other hand, if you are an experienced developer or team, and you know that you are going to build a l...
...n particular, the initial step involves building mozilla, which is a huge - nay, gargantuan! - project. many intelligent developers have been driven to the brink of insanity trying to build it for the first time. if you're not an experienced c++ developer, i wouldn't even bother. stick to javascript. on windows platforms the first time i built mozilla i used this guide. i can't even
remember why anymore, but i got stuck in a number of places, and the whole affair ended up taking far longer than i originally expected. much furniture was smashed, much hair torn out by the roots. here's a comprehensive looking guide that's gotten good reviews. follow every step methodically and you'll probably be alright. focus on the fact that once you get the build working, it'll probably work ef...
...key features of this makefile, can be found here. module and xpi_name are both set to the name of your extension; they should be repeated in all project makefiles so that all of the files land in the same place in the xpi staging area (see below). install_extension_id is the unique id of your extension. this can be a guid, but the format shown above is prettier and, let's face it, a lot easier to
remember. you don't have to provide an xpi_pkgname, but if you do an xpi file, suitable for distribution, is automatically created in the root of the xpi staging area (/mozilla/$(moz_objdir)/dist/xpi-stage/). every extension must include an install.rdf file that tells firefox how to install it. this file should be located in the main extension directory and look something like this: <?x...
...And 4 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
plementation. it also provides two implementation examples using the model. the first one looks like a traditional dhtml ticker application and uses hidden iframes and javascript to provide updates inside the webpage's ticker headlines section. this sample was made using iframes to illustrate a possible implementation. an implementation can also use other transport technologies such as soap-based
remote procedure calls, xmlhttprequest interfaces, or dom 3 load. the second example shows a tabbed menu that dynamically loads news headlines into the current web page. this implementation uses xmlhttprequest. extending traditional hypertext navigation the hypertext approach to developing web pages, in which developers format text layouts into pages and link those pages to related content, is analog...
...der to follow links to new pages, the javascript code can act as the mediator for information access. if the user clicks on a link item, the script will be responsible to load the information from the data source and to apply that into the current document. there are basically two steps in this process: data load: acquisition of information data acquisition can be implemented using javascript and
remote procedure calls using soap-based rpc mechanism or using interfaces like xmlhttprequest (currently offered in netscape 7 and internet explorer 6). data bind: mutation in the current document this step takes care of applying the changes into the current document, based on the data loaded, and uses dom interfaces. the mechanism can be as simple as copying new content to the current document, or a...
...ion in a page seamlessly. as a general approach, the main steps to the iframe-based implementation can be represented as follows: create a hidden iframe in the page; when a new content is required, ask for the content to the iframe; the iframe will load the content and callback a function in the main page; update the main page. of course, specific implementations may have different requi
rements, like the use of multiple iframe elements to make multiple requests retrieving different contents at the same time. example using iframes and javascript: stock ticker this section describes a stock ticker application based on the inner-browsing model. the stock ticker is a web page with a stock ticker element that displays updated stock symbol information. the web page receives updates to its...
...And 4 more matches
JXON - Archive of obsolete content
s.keylength > 0; }; */ var myobject = new jxontree(doc); // we got our javascript object! try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "static" nature of an xml document), uncomment the string: /* object.freeze(this); */. the object.freeze() method prevents new properties from being added to it, prevents existing properties from being
removed and prevents existing properties, or their enumerability, configurability, or writability, from being changed. in essence the object tree is made effectively immutable. with this algorithm our example becomes: { "catalog": { "product": { "catalog_item": [{ "item_number": { "keyvalue": "qwz5671" }, "price": { "keyvalue": 39.95 }, ...
...ject.freeze(this); */ } var myobject = new jxontree(doc); // we got our javascript object! try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "static" nature of an xml document), uncomment the string: /* object.freeze(this); */. the object.freeze() method prevents new properties from being added to it, prevents existing properties from being
removed and prevents existing properties, or their enumerability, configurability, or writability, from being changed. in essence the object tree is made effectively immutable. with this algorithm our example becomes: { "catalog": { "product": { "catalog_item": [{ "item_number": { "keyvalue": "qwz5671" }, "price": { "keyvalue": 39.95 }...
... var myobject = getjxontree(doc); // we got our javascript object! try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "static" nature of an xml document), uncomment the string: /* if (nlength > 0) { object.freeze(vresult); } */. the object.freeze() method prevents new properties from being added to it, prevents existing properties from being
removed and prevents existing properties, or their enumerability, configurability, or writability, from being changed. in essence the object tree is made effectively immutable. with this algorithm, our example becomes: { "catalog": { "product": { "@description": "cardigan sweater", "catalog_item": [{ "@gender": "men's", "item_number": "qwz5671", "price": 39...
...And 4 more matches
Editor Embedding Guide - Archive of obsolete content
) docommand no parameters note this is logical style. typically it is displayed with monospace font. cmd_var toggles variable style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters note this is logical style. typically it is displayed with monospace font. ...
... no parameters note this is logical style. typically it is displayed with monospace font. cmd_var toggles variable style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters note this is logical style. typically it is displayed with monospace font. ...
...his is logical style. typically it is displayed with monospace font. cmd_
removelinks
removes the existing link from the selection (if any). getcommandstate "state_enabled"(boolean), ??? docommand no parameters cmd_ol makes ordered list from selection or inserts new list if there is no selection. getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_
removelist cmd_ul makes unordered list from selection or inserts new list if there is no selection. getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_
removelist cmd_dt inserts list item (dt element). getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_
removelist cmd_dd inserts list item (dd element). getcomman...
...And 4 more matches
JavaScript crypto - Archive of obsolete content
though some browsers may still support it, it is in the process of being dropped. ...
...zilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. using the mozilla crypto object from javascript mozilla defines a special javascript object to allow web pages access to certain cryptographic-related services. these services are a balance between the functionality web pages need and the requi
rement to protect users from malicious web sites. most of these services are available via the dom window object as window.crypto. services are provided to enable: smart card events, generating certificate requests, importing user certs, generating random numbers, logging out of your tokens, and signing text. handling smart card events web sites can make themselves more smartcard friendly by liste...
...us web sites. most of these services are available via the dom window object as window.crypto. services are provided to enable: smart card events, generating certificate requests, importing user certs, generating random numbers, logging out of your tokens, and signing text. ...
...And 4 more matches
Mozilla Crypto FAQ - Archive of obsolete content
domain, mozilla crypto development can proceed with minimal restrictions. in the near future the mozilla code base will include a complete open source cryptographic library, and mozilla will include ssl support as a standard feature. after the u.s. government relaxed u.s. export regulations in january 2000 to allow export of source code for open source software implementing encryption, the major
remaining legal obstacle to mozilla crypto development was the fact that rsa security, inc., held a u.s. patent on the rsa public key algorithm. in february 2000 iplanet e-commerce solutions (a sun-netscape alliance) released source code through mozilla.org for the personal security manager and network security services software; this source code included support for the ssl protocol, but due to the ...
..., including contact information for companies and independent developers producing pgp implementations. is information available describing the format of the psm key and certificate database, so that other software can reuse existing user keys and certificates managed by psm? yes, documentation of the database format is available; however we cannot guarantee that the format of the database will
remain unchanged in the future. the initial release of ssl, s/mime, and general pki source code from iplanet e-commerce solutions includes some documentation on the format of the key and certificate database. as with mozilla documentation in general, mozilla.org will be glad to host any other documentation contributed to describe database formats, apis, and other technical aspects of the released ss...
...of the key and certificate database. as with mozilla documentation in general, mozilla.org will be glad to host any other documentation contributed to describe database formats, apis, and other technical aspects of the released ssl, s/mime, and pki source code. however, as with apis internal to mozilla modules, mozilla.org cannot guarantee that the format of the key and certificate database will
remain unchanged over time; in particular, changes may be introduced at some point that break compatibility with existing applications. also, changing the database directly from an application risks causing database corruption and subsequent problems in psm and applications like mozilla using psm. for these reasons we strongly recommend that mozilla developers and others access the key and certificat...
...And 4 more matches
Binding Attachment and Detachment - Archive of obsolete content
s that identify specific bindings. an individual url in the set consists of the binding document's url and the binding's document-unique identifier. in the following example, a binding is referenced that will be attached to all html checkbox elements. input[type="checkbox"] { -moz-binding: url("http://www.mozilla.org/xbl/htmlbindings.xml#checkbox"); } bindings attached through css will only
remain on the bound element as long as the element continues to match the style rule. if at any time a resolution of style on the element determines that a different binding should be attached, the old binding (and all bindings that it explicitly extends in its inheritance chain) will be detached. no bindings will be attached to elements that match the style rule, but are inside an element that has ...
...ch the style rule. if at any time a resolution of style on the element determines that a different binding should be attached, the old binding (and all bindings that it explicitly extends in its inheritance chain) will be detached. no bindings will be attached to elements that match the style rule, but are inside an element that has style display:none set. see bug 307098. whenever an element is
removed from a document, any bindings attached via css loaded by the document will be detached. attachment using element.style property none of the xbl inheritance properties of element.style.mozbinding described here are implemented (if ever). bindings can be attached to elements through the scripting by assigning the element.style.mozbinding property. respectively bindings can be detached by s...
...erty none of the xbl inheritance properties of element.style.mozbinding described here are implemented (if ever). bindings can be attached to elements through the scripting by assigning the element.style.mozbinding property. respectively bindings can be detached by setting element.style.mozbinding to empty string. note: some older papers mentioned dom methods document.addbinding and document.
removebinding; these were subsequently discarded as redundant and not implemented. var checkbox = document.getelementbyid("mycheckbox"); checkbox.style.mozbinding = "url(http://www.mozilla.org/xbl/htmlbindings.xml#checkbox)"; this attachment is not necessarily synchronous. scripts that invoke this method should not assume that the binding is installed immediately after this method returns. see bi...
...And 4 more matches
Filtering - Archive of obsolete content
viousnext » adjusting the query sometimes you may wish to change the query at a later time. for example, you wish the user to be able to select a value from a list, and the template results should be filtered based on that value. this can be done by modifying the dom nodes inside the query and rebuilding the template. for instance, to apply a filter, you might add a new <triple> element. to
remove the filter, the <triple> should be
removed again. let's assume that we've given an id of 'cond' to the query tag. function applyfilter(country) { var cond = document.getelementbyid("cond"); var triple = document.getelementbyid("filtertriple"); if (country) { if (!triple) { triple = document.createelement("triple"); triple.id = "filtertriple"; triple.setattribute("s...
...the code is fairly straightforward. a new <triple> element is created and the object attribute is set to the value to filter by. for example, the resulting triple for the nether...
...the code is fairly straightforward. a new <triple> element is created and the object attribute is set to the value to filter by. ...
...And 4 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
<!-- calendar --> <rdf:li> <rdf:seq about="chrome://calendar/content/calendar.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> </rdf:seq> </rdf:rdf> optionally customize the file by changing the displayname, description and author attributes. change the text between double-quote characters on those three lines. optionally
remove the sections for toolbars where you do not want your button. save the file. explanation: this file contains details of your extension, and specifies how it modifies seamonkey. 6. create a plain text file named button.xul. copy the following content, making sure that you scroll to get all of it. paste it into the new file: <?xml version="1.0" encoding="utf-8"?> <?xml-styl...
...10"/> </toolbar> <!-- button details --> <toolbarbutton id="custom-button-1" label="custom" tooltiptext="my custom toolbar button" oncommand="custombutton[1]()" class="toolbarbutton-1 custombutton" /> </overlay> optionally customize the file by changing the label, accesskey and tooltiptext attributes. change the text between double-quote characters on those lines. optionally
remove the sections for toolbars that you do not need. save the file. explanation: this xul file adds the button to the toolbars. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making sure that you scroll to get all of it. paste it into...
...(if you leave both sections in the file, then your button's appearance will match the classic theme.) save the file. explanation: this css stylesheet specifies how the button is diaplayed. it links to the button image, specifying the dimensions of the six parts of the image. 8. create a...
...And 4 more matches
Manipulating Lists - Archive of obsolete content
n label="add" oncommand="additem();"/> the appenditem() takes two arguments, the label, in this case 'thursday', and a value 'thu'. the two arguments correspond to the label attribute and the value attribute on the listitem element. the value is used only as an extra optional value associated with an item which you might wish to use in a script. similarly, there is also an insertitemat() and a
removeitemat() function which inserts a new item and
removes an existing item respectively. the syntax is as follows: list.insertitemat(3, "thursday", "thu"); list.
removeitemat(3); the insertitemat() function takes an additional argument, the position to insert the new item. the new item is inserted at this index, so, in the example, the new item will be added at position 3 while the item previous...
... these three methods are also available for several other xul elements and work in the same manner. in fact, these methods are part of the nsidomxulselectcontrolelement interface so any xul elements which implement this interface have these methods. ...
... these three methods are also available for several other xul elements and work in the same manner. in fact, these methods are part of the nsidomxulselectcontrolelement interface so any xul elements which implement this interface have these methods. ...
...And 4 more matches
XUL Questions and Answers - Archive of obsolete content
illa-dev-tech-xul summaries the frequently asked questions should be moved to xul faq (make sure they have a clear answer.) where can i get more information about creating mozsearch plugins? creating mozsearch plugins contains more help information about creating mozsearch plugin on firefox 2. more documentation on search plugins is available in the search plugins category. is localizing
remote xul possible? loading
remote dtds for xml documents is currenty not supported in xul. the following bugs were reported on this issue: bug 22942, bug 133698. is there an editor widget in xul that supports syntax highlighting? daniel glazman has been working on this for his projects. he said the code will be open-source, but it is not released yet (as of oct 2006). some teasers are on his b...
...the correct type. using the "icon" attribute on a button from xulplanet.com reference: this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add,
remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. how to use dynamic objects in toolbar there may be a few ways to implement this: by building your menupopup from an rdf datasource, which could be generated on the server. by getting data (e.g. json s...
... tab browswer in xul how can i get uris on open tabs? using the following code sample, // get browsers object var browsers=document.getelementbyid('content').browsers; var numbrowsers=browsers.length; for (var i=0; numbrowsers>i; i++) { var thisuri=browsers[i].currenturi.spec; // do something with it. } the person can get the titles too using the .contenttitle tag. how to add and
remove values to/from, set up inside a <prefwindow> container to handle the preference? <prefwindow> can contain any control, just like a regular window. some of them can be tied to a preference so that the preference is automatically updated as the control is manipulated. others, like <listbox>, cannot be so tied, but one can always write a script that updates preferences explicitly, via nsiprefbra...
...And 4 more matches
browser - Archive of obsolete content
autocompletepopup type: id the...
...the progress listener should impl...
...the progress listener should implement the nsiwebpro...
...And 4 more matches
menu - Archive of obsolete content
he xul tutorial. ...
...you may optionally set a value. the function return...
...you may optionally set a value. the function returns the newly created...
...And 4 more matches
notification - Archive of obsolete content
by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's
removetransientnotifications method does not
remove them. this may be used to close a set of notifications as a group without affecting other notifications. priority type: integer numeric value that specifies the order in which the notifications appear. should be one of the constants described in the notificationbox's appendnotification method. type type: one of the values below ind...
... related elements notificationbox ...
... related elements notificationbox ...
...And 4 more matches
radiogroup - Archive of obsolete content
border or caption for the group. the radiogroup defaults to vertical orientation. more information is available in the xul tutorial. attributes disabled, focused, preference, tabindex, value properties accessibletype, disabled, focuseditem, itemcount, selectedindex, selecteditem, tabindex, value methods appenditem, checkadjacentelement, getindexofitem, getitematindex, insertitemat,
removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is dis...
...you may optionally set a value. the function retur...
...you may optionally set a value. the function returns the newly create...
...And 4 more matches
tab - Archive of obsolete content
oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. pending type: boolean this attribute is set to true if the tab is currently in the process of being restored by the session store service. once the tab is restored, this attribute is
removed. you can determine if a tab is being restored by checking to see if hasattribute("pending") is true. if the user has turned on the "don't load tabs until selected" preference, the pending attribute is set on tabs until they get loaded. pinned type: boolean this attribute is set to true if the tab has been pinned (that is, if it's an app tab). the tabbrowser element's pintab and unpintab...
...s attribute is set to true if the tab is unread; that is, either it has not yet been selected during the current session, or has changed since the last time it was selected. this attribute is not present if the tab is not unread. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored
remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the image will be loaded from the cache if possible. properties accesskey type: character gets and sets the value of the accesskey a...
... also, "unhiding" a tab leads to unpredictable ordering of the tabs. see bug 307088 and b...
...And 4 more matches
tabs - Archive of obsolete content
dindex. more information is available in the xul tutorial. attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selectedindex, tabbox, tabindex, tooltiptextnew, value, properties accessibletype, disabled, itemcount, selectedindex, selecteditem, tabindex, value, methods advanceselectedtab, appenditem, getindexofitem, getitematindex, insertitemat,
removeitemat examples (example needed) attributes closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends. this feature is used by the tabbrowser to provide the facilities for adding and closing tabs. you can set an image to the "new tab" and "close" buttons by applyin...
...if the argument dir is set to -1, the curre...
...if the argument dir is set to -1, the currently selected tab c...
...And 4 more matches
window - Archive of obsolete content
--> <window id="rootwnd" title="register online!" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <hbox> <image src="application_form.png"/> <description>register online!</description> </hbox> <groupbox align="start"> <caption label="your information"/> <radiogroup> <vbox>...
...a fi...
...a filename following th...
...And 4 more matches
Archived Mozilla and build documentation - Archive of obsolete content
if you are a plug-in author, you may find this project saves you a lot of work! ant script to assemble an extension this ant script helps to package an extension archived spidermonkey docs this section contains old spidermonkey documentation. ...
...bal java/packages keywords, in particular in the context of firefox extensions."). these 2 objects let you make use of the standard jdk classes, e.g., javascript crypto mozilla defines a special javascript object to allow web pages access to certain cryptographic-related services. these services are a balance between the functionality web pages need and the requi
rement to protect users from malicious web sites. most of these services are available via the dom window object as window.crypto. jetpack litmus tests litmus tests are (non-automated) tests that are documented in the litmus database. see http://litmus.mozilla.org. makefile.mozextension.2 this makefile is a modification of t...
...ard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way. plugin architecture this page contains some notes on how plugins work internally in gecko. it is mainly of interest to gecko developers. porting nspr to unix platforms last modified 16 july 1998 priority content update: i've
removed documents from this list that have been migrated into the wiki. the list of completed documents is available through the devedge page. prism prism is a simple xulrunner-based browser that hosts web applications without the normal web browser user interface. prism is based on a concept called site-specific browsers (ssb). an ssb is designed to work exclusively with a ...
...And 4 more matches
XForms Input Element - Archive of obsolete content
and change the instance data to which this xforms control is bound (see the spec). attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special inputmode - not supported for this control inc
remental - supported. the default value is 'false'. mozilla extensions labelposition - only for boolean types: show the label before or after the checkbox (see below) type restrictions the input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xforms input element can be repr...
...he input/output of simple text into an instance node. allows for free-form data entry (xhtml/xul). characteristics a text field is presented to the user when there is no type given for the bound node or a type is specified that is not handled by one of the other widgets (as documented below). analogous widgets are <xhtml:input type="text"/> and <xul:textbox/> specific handling of attributes inc
remental - if "true", the bound instance node will be updated on each character typed by the user. if "false", or the inc
remental attribute is omitted on this element then the bound instance node will be updated when the control loses the focus. checkbox most often used when the form author only needs a simple 'true', 'false', '1', or '0' response from the user (xhtml/xul). characteristics used whe...
...or only needs a simple 'true', 'false', '1', or '0' response from the user (xhtml/xul). characteristics used when the instance node is of type xsd:boolean or a type derived from it analogous widgets are <xhtml:input type="checkbox"/> and <xul:checkbox/> the corresponding label can be displayed before or after the checkbox by using the labelposition attribute. specific handling of attributes inc
remental - if "true" or this attribute is omitted from this element, then the instance node will be updated when the user checks or un-checks the checkbox. if "false" then the instance node will be updated when the checkbox loses the focus. labelposition - a mozilla xforms extension in the namespace http://www.mozilla.org/projects/xfor...009/extensions. this attribute is optional, possible values are...
...And 4 more matches
Positioning - Learn web development
this article explains the different position values, and how to use them. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how css positioning works. ...
...e'll explain in the next section. introducing top, bottom, left, and right top, bottom, left, and right are used alongside position to specify exactly where to move the positioned element to. to try this out, add the following declarations to the .positioned rule in your css: top: 30px; left: 30px; note: the values of these properties can take any units you'd logically expect — pixels, mm,
rems, %, etc. if you now save and refresh, you'll get a result something like this: <h1>relative positioning</h1> <p>i am a basic block level element. my adjacent block level elements sit on new lines below me.</p> <p class="positioned">by default we span 100% of the width of our parent element, and we are as tall as our child content. our total width and height is our content + padding + borde...
...due to its transform property being different from none. this means that you can create useful ui items that are fixed in place, like persisting navigation menus that are always visible no matter how much the page scrolls. let's put together a simple example to show what we mean. first of all, delete the existing p:nth-of-type(1) and .positioned rules from your css. now, update the body rule to
remove the position: relative; declaration and add a fixed height, like so: body { width: 500px; height: 1400px; margin: 0 auto; } now we're going to give the <h1> element position: fixed;, and get it to sit at the top of the viewport. add the following rule to your css: h1 { position: fixed; top: 0; width: 500px; margin-top: 0; background: white; padding: 10px; } the top: 0; is...
...And 4 more matches
create fancy boxes - Learn web development
,0,0,0) 75%, #9f8fa4 75%), linear-gradient( 85deg, rgba(0,0,0,0) 83%, #9f8fa4 83%), linear-gradient(175deg, rgba(0,0,0,0) 70%, #74a6ae 70%), linear-gradient( 85deg, rgba(0,0,0,0) 80%, #74a6ae 80%); } gradients can be used in some very creative ways. if you want to see some crazy examples, take a look at lea verou's css patterns. just
remember that such use of gradient is quite expensive, performance wise. if you want to learn more about gradient, feel free to get into our dedicated article. pseudo-elements when styling a single box, you could find yourself limited and could wish to have more boxes to create even more amazing styles. most of the time, that leads to polluting the dom by adding extra html element for the unique p...
... bottom : 0; /* this makes sure our pseudo-elements will be below the box content whatever happens. ...
...*/ border-bottom-left-radius: 0; } blockquote a more practical example of using pseudo-elements is to build a nice formatting for html <blockquote> elements. ...
...And 4 more matches
HTML forms in legacy browsers - Learn web development
input { /* this rule turns off the default rendering for the input types that have a border, including buttons defined with an input element */ border: 1px solid #ccc; } input[type="button"] { /* this does not restore the default rendering */ border: none; } input[type="button"] { /* these do...
...r type looks different in safari, chrome and firefox browser, but the color picker widget is the same in all browsers on a device as it opens up the operating system's native color picker. it's generally a good idea to not alter the default appearance of form control because altering one css property value may alter some input types but not others. for example, if you declare input { font-size: 2
rem; }, it will impact number, date, and text, but not color or range. if you alter a property, that may impact the appearance of the widget in unexpected ways. for example, [value] { background-color: #ccc; } may have been used to target every <input> with a value attribute, but changing the background-color or border radius on a <meter> will lead to likely unexpected results that differ across brow...
... but not color or range. if you alter a property, that may impact the appearance of the widget in unexpected ways. for example, [value] { background-color: #ccc; } may have been used to target every <input> with a value attribute, but changing the background-color or border radius on a <meter> will lead to likely unexpected results that differ across browsers. you can declare appearance: none; to
remove the browser styles, but that generally defeats the purpose: as you lose all styling,
removing the default look and feel your visitors are used to. to summarize, when it comes to styling form control widgets, the side effects of styling them with css can be unpredictable. so don't. as you can see from the complexity of the property compatibility table for form widgets article, it's very diffi...
...And 4 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
set" button to reset the time back to 0. the time display to show the number of seconds elapsed, rather than the actual time. here's a few hints for you: you can structure and style the button markup however you like; just make sure you use semantic html, with hooks to allow you to grab the button references using javascript. you probably want to create a variable that starts at 0, then inc
rements by one every second using a constant loop. it is easier to create this example without using a date() object, like we've done in our version, but less accurate — you can't guarantee that the callback will fire after exactly 1000ms. a more accurate way would be to run starttime = date.now() to get a timestamp of exactly when the user clicked the start button, and then do date.now() - startt...
...t to calculate the number of hours, minutes, and seconds as separate values, and then show them together in a string after each loop iteration. from the second counter, you can work out each of these. how would you calculate them? have a think about it: the number of seconds in an hour is 3600. the number of minutes will be the amount of seconds left over when all of the hours have been
removed, divided by 60. the number of seconds will be the amount of seconds left over when all of the minutes have been
removed. you'll want to include a leading zero on your display values if the amount is less than 10, so it looks more like a traditional clock/watch. to pause the stopwatch, you'll want to clear the interval. to reset it, you'll want to set the counter back to 0, clear the...
... you can aim for is 60 frames per second (fps) when working with web browsers. however, more frames means more processing, which can often cause stuttering and skipping — also known as dropping frames, or jank. if you have a monitor with a 60hz refresh rate and you want to achieve 60 fps you have about 16.7 milliseconds (1000 / 60) to execute your animation code to render each frame. this is a
reminder that you'll need to be mindful of the amount of code that you try to run during each pass through the animation loop. requestanimationframe() always tries to get as close to this magic 60 fps value as possible. sometimes, it isn't possible — if you have a really complex animation and you are running it on a slow computer, your frame rate will be less. in all cases, requestanimationframe()...
...And 4 more matches
Build your own function - Learn web development
the first line uses a dom api function called document.queryselector() to select the <html> element and store a reference to it in a constant called html, so we can do things to it later on: const html = document.queryselector('html'); the next section uses another dom api function called ...
...dler is a property available on the button (or in fact, any element on the page) that can be set to a function to specify what code to run when the button is clicked. you'll learn a lot more about these in our later events article. we are making the onclick handler equal to an anonymous function, which contains the code to run when the button is clicked. ...
...y element on the page) that can be set to a function to specify what code to run when the button is clicked. you'll learn a lot more about these in our later events article. we are making the onclick handler equal to an anonymous function, which contains the code to run when the button is clicked. ...
...And 4 more matches
A first splash into JavaScript - Learn web development
let's imagine your bos...
...ous guesses. next, check whether it is the correct number. if it is correct: display congratulations message. stop the player from being able to enter more guesses (this would mess the game up). display control allowing the player to restart the game. if it is wrong and the player has turns left: tell the player they are wrong. allow them to enter another guess. inc
rement the turn number by 1. if it is wrong and the player has no turns left: tell the player it is game over. stop the player from being able to enter more guesses (this would mess the game up). display control allowing the player to restart the game. once the game restarts, make sure the game logic and ui are completely reset, then go back to step 1. let's now move forward...
...ell them they are wrong, then we perform another conditional test to check whether the guess was higher or lower than the answer, displaying a further message as appropriate to tell them higher or lower. the last three lines in the function (lines 26–28 above) get us ready for the next guess to be submitted. we add 1 to the guesscount variable so the player uses up their turn (++ is an inc
rementation operation — inc
rement by 1), and empty the value out of the form text field and focus it again, ready for the next guess to be entered. events at this point we have a nicely implemented checkguess() function, but it won't do anything because we haven't called it yet. ideally we want to call it when the "submit guess" button is pressed, and to do this we need to use an event. events a...
...And 4 more matches
Basic math in JavaScript — numbers and operators - Learn web development
rs that we use to do sums in javascript: operator name purpose example + addition adds two numbers together. 6 + 9 - subtraction subtracts the right number from the left. 20 - 15 * multiplication multiplies two numbers together. 3 * 7 / division divides the left number by the right. 10 / 5 %
remainder (sometimes called modulo) returns the
remainder left over after you've divided the left number into a number of integer portions equal to the right number. 8 % 3 (returns 2, as three goes into 8 twice, leaving 2 left over). ** exponent raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times. it was firs...
...act (the calculation is always evaluated from left to right). if you want to override operator precedence, you can put parentheses round the parts that you want to be explicitly dealt with first. so to get a result of 6, we could do this: (num2 + num1) / (8 + 2); try it and see. note: a full list of all javascript operators and their precedence can be found in expressions and operators. inc
rement and dec
rement operators sometimes you'll want to repeatedly add or subtract one to or from a numeric variable value. this can be conveniently done using the inc
rement (++) and dec
rement (--) operators. we used ++ in our "guess the number" game back in our first splash into javascript article, when we added 1 to our guesscount variable to keep track of how many guesses the user has left after ...
...k of how many guesses the user has left after each turn. guesscount++; note: these operators are most commonly used in loops, which you'll learn about later on in the course. for example, say you wanted to loop through a list of prices, and add sales tax to each one. you'd use a loop to go through each value in turn and do the necessary calculation for adding the sales tax in each case. the inc
rementor is used to move to the next value when needed. we've actually provided a simple example showing how this is done — check it out live, and look at the source code to see if you can spot the inc
rementors! we'll look at loops in detail later on in the course. let's try playing with these in your console. for a start, note that you can't apply these directly to a number, which might seem str...
...And 4 more matches
Useful string methods - Learn web development
certain length. retrieving a specific string character on a related note, you can return any character inside a string by using square bracket notation — this means you include square brackets ([]) on the end of your variable name. inside the square brackets you include the number of the character you want to return, so for example to retrieve the first letter you'd do this: browsertype[0];
remember: computers count from 0, not 1! you could use this to, for example, find the first letter of a series of strings and order them alphabetically. to retrieve the last character of any string, we could use the following line, combining this technique with the length property we looked at above: browsertype[browsertype.length-1]; the length of "mozilla" is 7, but because the count starts at 0...
...aracter position to start extracting at, and the second parameter is the character position after the last one to be extracted. so the slice happens from the first position, up to, but not including, the last position. in this example, since the starting index is 0, the second parameter is equal to the length of the string being returned. also, if you know that you want to extract all of the
remaining characters in a string after a certain character, you don't have to include the second parameter! instead, you only need to include the character position from where you want to extract the
remaining characters in a string. try the following: browsertype.slice(2); this returns "zilla" — this is because the character position of 2 is the letter z, and because you didn't include a secon...
... note: the second parameter of slice() is optional: if you don't include it, the slice ends at the end of the original string. there are other options too; study the slice() page to see what else you can find out. ...
...And 4 more matches
Componentizing our React app - Learn web development
hould ensure that each <todo /> component renders a unique name. in app.js, give each <todo /> a name prop. let’s use the names of our tasks that we had before: <todo name="eat" /> <todo name="sleep" /> <todo name="repeat" /> when your browser refreshes, you will see… the exact same thing as before. we gave our <todo /> some props, but we aren't using them yet. ...
...using them yet. let's go back to todo.js and
remedy that. first modify your todo() function definition so that it takes props as a parameter. you can console.log() your props as we did before, if you'd like to check that they are being received by the component correctly. once you're confident that your component is getting its props, you can replace every occurrence of eat with your name prop.
remember: when you're in the middle of a jsx expression, you use curly braces to inject the value of a variable. putting all that together, your todo() function should read like this: export default function todo(props) { return ( <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-la...
...lassname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">{props.name}</span> </button> <button type="button" classname="btn btn__danger"> delete <span classname="visually-hidden">{props.name}</span> </button> </div> </li> ); } now your browser should show three unique tasks. another problem
remains though: they're all still checked by default. is it completed? in our original static list, only eat was checked. once again, we want to reuse most of the ui that makes up a <todo /> component, but change one thing. that's a good job for another prop! give each <todo /> call in app.js a new prop of completed. the first (eat) should have a value of true; the rest should be false: <todo ...
...And 4 more matches
Handling common accessibility problems - Learn web development
hat arise around web accessibility, connected with specific technologies, along with best practices to follow, and some quick tests you can do to see if your sites are going in the right direction. note: accessibility is morally the right thing to do, and good for business (numbers of disabled users, users on mobile devices, etc. present significant market segments), but it is also a legal requi
rement in many parts of the world to make web content accessible to people with disabilities. read accessibility guidelines and the law for more information. html semantic html (where the elements are used for their correct purpose) is accessible right out of the box — such content is readable by sighted viewers (provided you don't do anything silly like make the text way too small or hide it us...
...cond subsection of my content. i think it is more interesting than the last one.</p> in addition, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with. as a test, you can turn off a site's css and see how understandable it is without it. you could do this manually by just
removing the css from your code, but the easiest way is to use browser features, for example: firefox: select view > page style > no style from the main menu. safari: select develop > disable styles from the main menu (to enable the develop menu, choose safari > preferences > advanced > show develop menu in menu bar). chrome: install the web developer toolbar extension, then restart the browser.
...usable elements look when focused, using the :focus pseudo-class. it is a good idea to double up focus and hover styles, so your users get that visual clue that a control will do something when activated, whether they are using mouse or keyboard: a:hover, input:hover, button:hover, select:hover, a:focus, input:focus, button:focus, select:focus { font-weight: bold; } note: if you do decide to
remove the default focus styling using css, make sure you replace it with something else that fits in with your design better — it is a very valuable accessiblity tool, and should not be
removed. building in keyboard accessibility sometimes it is not possible to avoid losing keyboard accessibility. you might have inherited a site where the semantics are not very good (perhaps you've ended up wit...
...And 4 more matches
Multiple Firefox profiles
ofile for testing websites, apps, or other projects on different firefox channels. for example, you might want to have some extensions installed for web development, but not for general-purpose web browsing. while using the nightly channel, you may encounter some add-ons that have become temporarily incompatible with new api changes, until the add-on developer has a chance to update them. you can
remove such add-ons from your profile for nightly use while keeping them for use with other profiles. for qa, testing, and bug triaging contributors, you may want to have multiple development versions of firefox installed, each with its own profile. creating new profiles for testing can keep you from losing your preferences, bookmarks, and history. it takes little time to set up a new profile, and o...
...nd enter the name of the profile. use a profile name that is descriptive, such as your personal name. this name is not exposed to the internet. you can also choose where to store the profile on your computer. to select storage location, click choose folder.... if you choose your folder location for the profile, select a new or empty folder. if you choose a folder that isn't empty, and you later
remove the profile and choose the \"delete files\" option, everything inside that folder will be deleted. to create the new profile, click finish. creating a profile through the firefox browser you can create a new firefox profile directly from the browser. type about:profiles into the browser url search bar on the page, click create a new profile button read the introduction, and click next...
...ead the introduction, and click next enter a profile name for your new profile. use a profile name that is descriptive, such as your personal name. this name is not exposed to the internet. optionally, to change where the profile will be stored on your computer, click choose folder... to create the new profile, click finish. deleting a profile in the profile manager, select the profile to
remove, and click delete profile.... confirm that you wish to delete the profile: don't delete files
removes the profile from the profile manager yet retains the profile data files on your computer in the storage folder so that your information is not lost. "don't delete files" is the preferred option, because it saves the old profile's folder, allowing you to recover the files to a new profil...
...And 4 more matches
Storage access policy: Block cookies from trackers
eatures that we don't yet plan to ship to release users; experimental features will not be included in this documentation, but may nevertheless impact the functionality of domains classified as trackers. we recommend sites test with firefox nightly, as this includes the newest version of our protections. as described above, note that nightly may include additional protections that end up getting
removed or changed before they reach our release users. we’ll keep this page updated with the newest information as we strengthen our protections. these protections are on by default in nightly. the cookie policy can be enabled in other versions of firefox through the content blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate...
...on. firefox uses the built-in tracking protection url classifier to determine which resources match the tracking protection list. domains are matched against the list in accordance with the safebrowsing v4 specification. specifically, we check the exact hostname of the resource against the list, as well as the last four hostnames formed by starting with the last five components and successively
removing the leading component. consider the following examples: hostname on the list hostname of resource matched example.com example.com yes example.com a.b.example.com yes blah.example.com example.com no a.b.example.com c.d.example.com no blah.example.com foo.blah.example.com yes what does the sto...
...r access to storage. automatic storage access upon interaction in order to improve web compatibility, firefox currently includes some heuristics to grant storage access automatically to third parties that receive user interaction. these heuristics are intended to allow some third-party integrations that are common on the web to continue to function. they are intended to be temporary and will be
removed in a future version of firefox. they should not be relied upon for current and future web development. third-party storage access may be granted to resources that have been classified as tracking resources when a user gesture triggers a pop-up window that has opener access to the originating document. when that occurs, there are three possible ways a third-party origin can be granted access:...
...And 4 more matches
Introduction to Layout in Mozilla
overview basic data flow key data structures detailed walk-through inc
rementalism future tech-talks wrap-up, q&a basic data flow source document arrives via network apis inc
rementally “pumped” through the single-threaded layout engine parse, compute style, render; repeat css used for rendering all content content theoretically separate from “presentation” key data structures content node elements, attributes, leaves dom frame rectangular formatting primitive geometric information [0..n] per content node 2nd thru nth are “continuations” style context non-geometric information may be shared by adjacent frames reference counted, owned by frame ...
...notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creat...
...ddleaf content sink creates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs here insertchildat, appendchildto,
removechildat frame construction content sink uses nsidocument interface to notify of Δs in content model contentappended, contentinserted, content
removed presshell is registered as document observer receives contentappended, etc. notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creates frames constructframeinternal recursively walks content tree, resolves style and creates frames either created by tag (<select>) or by display type (...
...And 4 more matches
Download
tions. this object is transient, though it can be included in a downloadlist so that it can be managed by the user interface and persisted across sessions. a new download object can be created using the downloads.createdownload() function. method overview promise start(); promise launch(); promise showcontainingdirectory(); promise cancel(); promise
removepartialdata(); promise whensucceeded(); promise finalize([optional] boolean a
removepartialdata); properties attribute type description canceled read only boolean indicates that the download has been canceled. this property can become true, then it can be reset to false when a canceled download is restarted. this property becomes...
...temporary files or part files may still exist even if they are expected to be deleted, until the stopped property becomes true. contenttype string the mime type of the download, for example "text/plain", or null if the mime type is not available. ...
...e retained, to use when restarting a failed or canceled download. the default is false. whether partial data can actually be retained depends on the saver and the download source, and may not be known before the download is started. to have any effect, this property must be set before starting the download. resetting this property to false after the download has already started will not
remove any partial data. note: if this property is set to true, care should be taken that partial data is
removed before the reference to the download is discarded. this can be done using the
removepartialdata() or the finalize() methods. methods start() starts the download for the first time, or restarts a download that failed or has been canceled. calling this method when the dow...
...And 4 more matches
DownloadList
a downloadlist object represents a collection of download objects that can be viewed and managed by the user interface, and persisted across sessions. a reference to a downloadlist object can be obtained using the downloads.getlist() function. ...
...ed and managed by the user interface, and persisted across sessions. a reference to a downloadlist object can be obtained using the downloads.getlist() function. method overview promise<array<download>> getall(); promise add(download adownload); promise
remove(download adownload); promise addview(object aview); promise
removeview(object aview); void
removefinished([optional] function afilterfn); methods getall() retrieves a snapshot of the downloads that are currently in the list. the returned array does not change when downloads are added or
removed, though the download objects it contains are still updated in real time. promise<array<download>> getall(); parameters none. promise resolves...
...nge event is registered by the list, thus it cannot be used to monitor the download. to receive change notifications for downloads that are added to the list, use the addview() method to register for ondownloadchanged notifications. promise add( download adownload ); parameters adownload the download object to add. promise resolves to undefined when the download has been added.
remove()
removes a download from the list. if the download was already
removed, this method has no effect. promise
remove( download adownload ); parameters adownload the download object to
remove. promise resolves to undefined when the download has been
removed. addview() adds a view that will be notified of changes to downloads. the newly added view will receive ondownloadadded no...
...And 4 more matches
QA phase
language pack to install on your local instance. manual & automated builds with the click of a button, some l10n tools (like narro and koala) automatically create language pack builds for you. if you're using one of these tools, feel free to skip ahead to the seeing your work section. if you're not using one of these tools, let's walk you through building your own language pack manually. note:
remember all of those pre-requisite tools we asked you to install in the initial setup? here's where you'll need almost all of them. if you haven't installed them yet, now is the time to do it. preliminary instructions we will be using the following file directories for this example: your working directory (root)/ mozilla-aurora (en-us source, pulled from http://hg.mozilla.org/releases/mozilla...
...0n-central/x-testing/toolkit/defines.inc tah-dah! copied! finally, you will need a file called .mozconfig to proceed with manual builds. this file contains the necessary build instructions. ...
...d-ons by navigating to tools->language->your localization's language code. restart your browser and start testing! now you should be able to see all of your work up to this point. click here for guidelines on how to test your localization. don't lose your work! your work is so important! we would really hate to see you lose any of it. after you test your localization, you should send it to a
remote repository, which will serve as a backup for your work and will let others follow your progress. we're going to go through the process below. the official localization teams use repositories at hg.mozilla.org. before a team becomes official, we like to get the localizers comfortable with the hg commands that allow for cloning, pulling, committing, and pushing work to an experimental repositor...
...And 4 more matches
Activity Monitor, Battery Status Menu and top
this article describes the activity monitor, battery status menu, and top — three related tools available on mac os x. note: the power profiling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. activity monitor this is a built-in os x tool that shows real-time process measu
rements. ...
..."energy impact" measure is likely to be consulted by users to compare the power consumption of different programs. (apple support documentation specifically recommends it for troubleshooting battery life problems.) unfortunately "energy impact" is not a good measure for either users or software developers and it should be avoided. activity monitor can still be useful, however. power-related measu
rements activity monitor has several tabs. they can all be customized to show any of the available measu
rements (by right-clicking on the column strip) but only the "energy" tab groups child processes with parent processes, which is useful, so it's the best one to use. the following screenshot shows a customized "energy" tab. the power-related columns are as follows. energy impact / avg energy...
... use. the following screenshot shows a customized "energy" tab. the power-related columns are as follows. energy impact / avg energy impact: see the separate section below. % cpu: cpu usage percentage. this can exceed 100% if multiple cores are being used. idle wake ups: in mac os 10.9 this measured "package idle exit" wakeups. this is the same value as powermetrics' "pkg idle" measu
rement (i.e. task_power_info::task_platform_idle_wakeups obtained from the task_info function.) in mac os 10.10 it appears to have been changed to measure interrupt-level wakeups (a superset of idle wakeups), which are less interesting. this is the same value as powermetrics' "intr" measu
rement (i.e. task_power_info::task_interrupt_wakeups obtained from the task_info function.) requires high...
...And 4 more matches
Index
roperties, as well as providing a handle for the programmer to use. once the application is done with a handle, it should be released, allowing nss to free the associated resources. when working with handles to private keys it's usually difficult (and undesired) that an application gets access to the raw key data; therefore it may be difficult to extract such data from nss. the usual minimum requi
rement is that private keys must be wrapped using a protective layer (such as password-based encryption). the intention is to make it easier to review code for security. the less code that has access to raw secret keys, the less code that must be reviewed. nss has only limited functionality to look up raw keys. the preferred approach is to use certificates, and to look up certificates by propertie...
...uites. if a programmer wants to influence how nss verifies certificates or how nss verifies the data presented in a ssl connection handshake, it is possible to register application-defined callback functions which will be called by nss at the appropriate point of time, and which can be used to override the decisions made by nss. if you would like to use nss as a toolkit that implements ssl,
remember that you must init nss first. but if you don't care about modifying the default trust permanently (recorded on disk), you can use the no-database init calls. when creating the network socket for data exchange, note that you must use the operating system independent apis provided by nspr and nss. it might be interesting to mention a property of the nspr file descriptors, which are stacked in ...
...entries within the range. * add certificate entries(s) to crl: addcert range date range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. date: revocation date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). *
remove certificate entry(s) from crl rmcert range where: range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. * change range of certificate entry(s) in crl range new-range where: new-range: two integer values separated by dash: range of...
...And 4 more matches
SpiderMonkey 24
evious versions. it's the same language, just not as fast. migrating to spidermonkey 24 spidermonkey now provides a fully c++ interface, so embedders relying on embeddability in c projects will have to convert to c++, or implement their own adapter code. the following features in earlier versions of spidermonkey have been dropped. ...
...many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. ...
...tudio 2010 and later) is only invoked for those compilers. otherwise <stdint.h> is used. the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio. in the long run we anticipate
removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010. in the meantime moz_custom_stdint_h is intended to function as a bridge to always using the standard header. for more information on the fixed-size integer types changes, see this blog post. new c apis js_getarrayprototype provides access to the original value of array.prototype.
...And 4 more matches
Using the Places annotation service
names(aitem, count, result); retrieves a list of all the annotations on a given uri or id. c++ callers will want to use getpageannotationnamestarray which returns a com array, making memory management much easier and reducing the chance of leaks. pagehasannotation(auri, aname); itemhasannotation(aitemid, aname); returns true if the page/item has an annotation with the given name.
removepageannotation(auri, aname);
removeitemannotation(aitemid, aname);
removes a given annotation from a page/item.
removepageannotations(auri);
removeitemannotations(aitemid);
removes all the annotations from a given page/item. copypageannotations(asourceuri, adesturi, aoverwritedest); copyitemannotations(asourceitemid, adestitemid, aoverwritedest); copies all the annotation...
...ifetime of annotations annotation expiration can be explicitly stated when the annotation is created. if no expiration is specified, the annotation is expired when the number of visits to the url is set to zero. valid values for expiration are: expire_with_history : default. annotations live as long as the uri is in history (eg: has >0 visits). expire_never : never expire. must be explictly
removed. expire_session :
removed at application exit. expire_days :
removed at 7 days. expire_weeks :
removed at 30 days. expire_months :
removed at 180 days. annotationservice.setpageannotation(uri, "my_extension/some_annotation", "this is the annotation value", 0, annotationservice.expire_never); annotation observers observers can also be added to the service to watch for changes to ann...
...n :
removed at application exit. expire_days :
removed at 7 days. expire_weeks :
removed at 30 days. expire_months :
removed at 180 days. annotationservice.setpageannotation(uri, "my_extension/some_annotation", "this is the annotation value", 0, annotationservice.expire_never); annotation observers observers can also be added to the service to watch for changes to annotations. to add or
remove an observer use the methods: addobserver(aobserver);
removeobserver(aobserver); where aobserver is an object implementing the nsiannotationobserver interface. ...
...And 4 more matches
Accessing the Windows Registry Using XPCOM
k.open(wrk.root_key_local_machine, "software\\microsoft\\windows\\currentversion\\run", wrk.access_read); for (var i=0; i<wrk.valuecount; i++) { var name = wrk.getvaluename(i); var value = readregistryvalue(wrk, name); // do something interesting here... } wrk.close(); for simplicity, this example assumes the existence of the readregistryvalue() function defined above.
removing registry keys and values to
remove child keys and values from the registry, you can use the
removechild() and
removevalue() methods.
removechild()
removes a child key and all of its values, but will fail if the key has any child keys of its own. in that case you must manually enumerate the children and
remove them individually. this example shows how to recursively delete a registry key and...
...ys and values from the registry, you can use the
removechild() and
removevalue() methods.
removechild()
removes a child key and all of its values, but will fail if the key has any child keys of its own. in that case you must manually enumerate the children and
remove them individually. this example shows how to recursively delete a registry key and all of its children. ...
...movevalue() methods.
removechild()
removes a child key and all of its values, but will fail if the key has any child keys of its own. in that case you must manually enumerate the children and
remove them individually. this example shows how to recursively delete a registry key and all of its children. ...
...And 4 more matches
An Overview of XPCOM
ly, for example—the expensive work to divide things may not be worth the effort. the http component in gecko doesn't expose private classes it uses as separate components. the "stuff" that's internal to the component stays internal, and isn't exposed to xpcom. in the haste of early mozilla development, components were created where they were inappropriate, but there's been an ongoing effort to
remove xpcom from places like this. interfaces how do you decide when to break apart your code? the basic idea is to identify the pieces of functionality that are related and understand how they communicate with each other. the communication channels between different component form boundaries between those components, and when those boundaries are formalized they are known as interfaces. interfac...
...hich provides solutions to both of these issues for xpcom developers. object ownership in xpcom, since components may implement any number of different interfaces, components must be reference counted. when a component gets created, an integer inside the component tracks the number of clients who have an interface to the components -- also known as the reference count. the reference count is inc
remented automatically when the client instantiates the component; over the course of the component's life, the reference count goes up and down. when all clients lose interest in the component, the reference count hits zero, and the component deletes itself. when clients use interfaces responsibly, this can be a very straightforward process. xpcom has tools to make it even easier, as we describe la...
...ence count goes up and down. when all clients lose interest in the component, the reference count hits zero, and the component deletes itself. when clients use interfaces responsibly, this can be a very straightforward process. xpcom has tools to make it even easier, as we describe later. it can raise some real housekeeping problems when, for example, a client uses an interface and forgets to dec
rement the reference count. when this happens, interfaces may never be released and will leak memory. the system of reference counting is, like many things in xpcom, a contract between clients and implementations. it works when people agree to it, but when they don't, things can go wrong. it is the responsibility of the function that creates the interface pointer to add the initial reference, or owni...
...And 4 more matches
mozIStorageConnection
); mozistoragependingstatement executeasync([array, size_is(anumstatements)] in mozistoragebasestatement astatements, in unsigned long anumstatements, [optional] in mozistoragestatementcallback acallback ); void executesimplesql(in autf8string asqlstatement); boolean indexexists(in autf8string aindexname); void preload(); obsolete since gecko 1.9 void
removefunction(in autf8string afunctionname); mozistorageprogresshandler
removeprogresshandler(); void rollbacktransaction(); void setgrowthinc
rement(in print32 ainc
rement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 agranularity, in mozistorageprogresshandler ahandler); boolean tableexists(in autf8string ata...
...saction open on the connection, or have a transaction open on another connection that shares the same pager cache. this cached data will go away when the transaction is closed. this preload operation can dramatically speed up read operations because the data is loaded as one large block. normally, pages are read in on demand, which can cause many disk seeks. void preload(); parameters none. ...
.... this preload operation can dramatically speed up read operations because the data is loaded as one large block. normally, pages are read in on demand, which can cause many disk seeks. void preload(); parameters none.
removefunction() deletes a custom sql function that was created with either mozistorageconnection.createfunction() or mozistorageconnection.createaggregatefunction(). void
removefunction( in autf8string afunctionname ); parameters afunctionname the name of the function to
remove.
removeprogresshandler()
removes the progress handler that was registered with mozistorageconnection.registerprogresshandler(). mozistorageprogresshandler
removeprogresshandler(); parameters none. return value returns the previous registered handler. rollbacktransaction() ...
...And 4 more matches
nsIContentPrefService
iew void addobserver(in astring aname, in nsicontentprefobserver aobserver); nsivariant getpref(in nsivariant agroup, in astring aname, [optional] in nsicontentprefcallback acallback); nsipropertybag2 getprefs(in nsivariant agroup); nsipropertybag2 getprefsbyname(in astring aname); boolean haspref(in nsivariant agroup, in astring aname); void
removegroupedprefs(); void
removeobserver(in astring aname, in nsicontentprefobserver aobserver); void
removepref(in nsivariant agroup, in astring aname); void
removeprefsbyname(in astring aname); void setpref(in nsivariant agroup, in astring aname, in nsivariant avalue); attributes attribute type description dbconnection mozistor...
...specified uri. specify null to check for the preference in the global preference space; those preferences apply to all sites. aname the name of the preference whose existence is to be determined. return value true if the preference exists; otherwise false. exceptions thrown ns_error_illegal_value if agroup is not a string, nsiuri, or null. ...
...y null to check for the preference in the global preference space; those preferences apply to all sites. aname the name of the preference whose existence is to be determined. return value true if the preference exists; otherwise false. exceptions thrown ns_error_illegal_value if agroup is not a string, nsiuri, or null. or if aname is null or an empty string
removegroupedprefs()
remove all grouped prefs. ...
...And 4 more matches
nsIControllers
void appendcontroller( in nsicontroller controller ); parameters controller a controller to be added to ...
...void appendcontroller( in nsicontroller controller ); parameters controller a controller to be added to the list of controllers. exceptions thrown ns_error_out_of_me...
...n by its order, rather than position, of insertion. nsicontroller getcontrollerbyid( in unsigned long controllerid ); parameters controllerid the id (insertion order) of a controller. return value the controller element that was inserted with that id. exceptions thrown ns_error_failure the id is greater than the number of controllers that have been inserted, or the controller has since been
removed. getcontrollercount() returns the current number of controllers. unsigned long getcontrollercount(); parameters none. return value the number of controllers currently in the list of controllers. getcontrollerforcommand() searches for a controller that supports the given command. nsicontroller getcontrollerforcommand( in string command ); parameters command the name of a command, e.g. cm...
...And 4 more matches
nsIMsgHeaderParser
es); void parseheaderswitharray(in wstring aline, [array, size_is(count)] out wstring aemailaddresses, [array, size_is(count)] out wstring anames, [array, size_is(count)] out wstring afullnames, [retval] out unsigned long count); void reformatheaderaddresses(in string line, out string reformattedaddress); wstring reformatunquotedaddresses(in wstring line); void
removeduplicateaddresses(in string addrs, in string other_addrs, in prbool
removealiasestome, out string newaddress); string unquotephraseoraddr(in string line, in boolean preserveintegrity); wstring unquotephraseoraddrwstring(in wstring line, in boolean preserveintegrity); methods extractheaderaddressmailboxes() given a string which contains a list of header addresses, ret...
...ceptions thrown missing exception missing description reformatunquotedaddresses() given a string, will make it safe to use by adding missing quote and escaping needed quote wstring reformatunquotedaddresses( in wstring line ); parameters line the header line to parse. return value safe addresses (?) exceptions thrown missing exception missing description native code only!
removeduplicateaddresses returns a copy of addrs which may have had some addresses
removed. addresses are
removed if they are already in either addrs or other_addrs. (if other_addrs contain addresses which are not in addrs, they are not added. that argument is for passing in addresses that were already mentioned in other header fields.) addresses are considered to be the same if they contain the...
...ddresses are
removed if they are already in either addrs or other_addrs. (if other_addrs contain addresses which are not in addrs, they are not added. that argument is for passing in addresses that were already mentioned in other header fields.) addresses are considered to be the same if they contain the same mailbox part (case-insensitive.) real names and other comments are not compared.
removealiasestome allows the address parser to use the preference which contains regular expressions which also mean 'me' for the purpose of stripping the user's email address(es) out of addrs string
removeduplicateaddresses( in string addrs, in string other_addrs, in prbool
removealiasestome ); parameters addrs the addresses to
remove duplicates from. other_addrs other addresses that ...
...And 4 more matches
nsITreeView
layout/xul/base/src/tree/public/nsitreeview.idlscriptable this interface is used by the tree widget to get information about what and how to display a tree widget. inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) implementing a nsitreeview in lieu of dom methods for tree creation can improve performance dramatically, and
removes the need to make changes to the tree manually when changes to the database occur. further information about creating treeviews is given in the xul tutorial. method overview boolean candrop(in long index, in long orientation, in nsidomdatatransfer datatransfer); boolean candropbeforeafter(in long index, in boolean before); obsolete since gecko 1.8 boolean candropon(in long ...
... long getlevel(in long index); long getparentindex(in long rowindex); long getprogressmode(in long row, in nsitreecolumn col); astring getrowproperties(in long index, in nsisupportsarray properties obsolete since gecko 22); boolean hasnextsibling(in long rowindex, in long afterindex); boolean iscontainer(in long index); boolean iscontaine
rempty(in long index); boolean iscontaineropen(in long index); boolean iseditable(in long row, in nsitreecolumn col); boolean isselectable(in long row, in nsitreecolumn col); boolean isseparator(in long index); boolean issorted(); void performaction(in wstring action); void performactiononcell(in wstring action, in long row, in nsitreeco...
...ided with a properties array. (this is one way of detecting the version at run-time). simply return a string of space-separated property names. for example: getrowproperties: function(index) { return "dummy"; } obsolete since gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. to add properties for a particular row, you must use the nsiatomservice to create an nsiatom string, which can then be appended to the array to alter the style (see also styling a tree) getrowproperties: function(index, properties) { var atomservice = components.classes["@mozilla.org/atom-service;1"].getservice(components.interfaces.nsiatomservice); va...
...And 4 more matches
nsIXPConnect
void reparentscopeawarewrappers(in jscontextptr ajscontext, in jsobjectptr aoldscope, in jsobjectptr anewscope); obsolete since gecko 1.9.1 nsixpconnectjsobjectholder reparentwrappednativeiffound(in jscontextptr ajscontext, in jsobjectptr ascope, in jsobjectptr anewparent, in nsisupports acomobj); void restorewrappedna...
...); parameters ajscontext missing description aobject missing description return value missing description exceptions thrown missing exception missing description native code only!getcowforobject obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. wrap a jsval in a chrome object wrapper. jsval getcowforobject( in jscontextptr ajscontext, in jsobjectptr aparent, in jsobjectptr awrappedobj ); parameters ajscontext a context to use to create objects. aparent the parent to create the wrapper with. awrappedobj the object to wrap. return value missing description exceptions thrown ...
...ng description ascope missing description aclassinfo missing description return value missing description exceptions thrown missing exception missing description native code only!getwrapperforobject obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. returns an xpcnativewrapper, xpcsafejsobjectwrapper, or xpccrossoriginwrapper for the given object based on the principal, scope, and filename flags that are passed in. note: in c++, the out jsval parameter must already be a strong gc root. jsval getwrapperforobject( in jscontextptr ajscontext, in jsobjectptr aobject, in jsobjectptr ascope, in ns...
...And 4 more matches
Using the Multiple Accounts API
etc. it is also responsible for the creation of any new account-related objects. the account manager maintains the main list of accounts. accounts (nsimsgaccount): an account consists of a single incoming server, and one or more identities. an account is merely a container to bind incoming servers and identities together. incoming servers (nsimsgincomingserver): an incoming server represents a
remote message store such as a pop, imap, or nntp server. it holds all the information necessary to retrieve mail from the
remote server, such as hostname, user login name, and biff settings. identities (nsimsgidentity): an identity contains all the information necessary to compose and outgoing mail message. it includes a user's full name and e-mail address. smtp servers (nsismtpserver): an smtp se...
... the keys used here are the account1, server1, id1, etc. these keys are listed in the value of some of these preferences, such as "mail.accountmanager.accounts", and are used to constru...
... the keys used here are the account1, server1, id1, etc. these keys are listed in the value of some of these preferences, such as "mail.accountmanager.accounts", and are used to construct the preference names, such as "mail.account.account1.server...
...And 4 more matches
DevTools API - Firefox Developer Tools
one tab a panel). these tabs are located in a box we call a toolbox. a toolbox can be hosted within a browser tab (at the bottom or on the side), or in its own window (we say that the toolbox is undocked). a toolbox (and all the tools it contains) is linked to a target, which is the object the tools are debugging. a target is usually a web page (a tab), but can be other things (a chrome window, a
remote tab,…). in terms of code, each tool has to provide a tooldefinition object. a definition is a js light object that exposes different information about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool. the gdevtools global object provides methods to register a tool definition and to access tool instances. an instance of a...
... with following snippet const { gdevtools } = require("resource:///modules/devtools/gdevtools.jsm"); methods registertool(tooldefinition) registers a new tool and adds a tab to each existing toolbox. parameters: tooldefinition {tooldefinition} - an object that contains information about the tool. see tooldefinition for details. unregistertool(tool) unregisters the given tool and
removes it from all toolboxes. parameters: tool {tooldefinition|string} - the tool definition object or the id of the tool to unregister. registertheme(themedefinition) registers a new theme. parameters: themedefinition {themedefinition} - an object that contains information about the theme. unregistertheme(theme) unregisters the given theme. parameters: theme {themedefinition|str...
...ing. this.target = target; // do synchronous initialization here. window.document.body.addeventlistener("click", this.handleclick); } mypanel.prototype = { open: function() { // any asynchronous operations should be done here. return this.dosomethingasynchronous() .then(() => this); }, destroy: function() { // synchronous destruction. this.window.document.body.
removeeventlistener("click", this.handleclick); // async destruction. return this.destroysomethingasynchronosly() .then(() => console.log("destroyed")); }, handleclick: function(event) { console.log("clicked", event.originaltarget); }, }; eventemitter eventemitter is an interface many developer tool classes and objects implement and use to notify others about changes in t...
...And 4 more matches
CanvasRenderingContext2D - Web APIs
tinstroke() reports whether or not the specified point is inside the area contained by the stroking of a path. transformations objects in the canvasrenderingcontext2d rendering context have a current transformation matrix and methods to manipulate it. the transformation matrix is applied when creating the current default path, painting text, shapes and path2d objects. the methods listed below
remain for historical and compatibility reasons as svgmatrix objects are used in most parts of the api nowadays and will be used in the future instead. canvasrenderingcontext2d.currenttransform current transformation matrix (svgmatrix object). canvasrenderingcontext2d.gettransform retrieves the current transformation matrix being applied to the context. canvasrenderingcontext2d.rotate() add...
...). canvasrenderingcontext2d.restore() restores the drawing style state to the last element on the 'state stack' saved by save(). canvasrenderingcontext2d.canvas a read-only back-reference to the htmlcanvaselement. might be null if it is not associated with a <canvas> element. hit regions canvasrenderingcontext2d.addhitregion() adds a hit region to the canvas. ...
...ntext2d.restore() restores the drawing style state to the last element on the 'state stack' saved by save(). canvasrenderingcontext2d.canvas a read-only back-reference to the htmlcanvaselement. might be null if it is not associated with a <canvas> element. hit regions canvasrenderingcontext2d.addhitregion() adds a hit region to the canvas. canvasrenderingcontext2d.
removehitregion()
removes the hit region with the specified id from the canvas. canvasrenderingcontext2d.clearhitregions()
removes all hit regions from the canvas. filters canvasrenderingcontext2d.filter applies a css or svg filter to the canvas, e.g., to change its brightness or bluriness. non-standard apis blink and webkit most of these apis are deprecated and were
removed shortly after chrome 36. ...
...And 4 more matches
Element - Web APIs
pseudo-element selector. element.queryselector() returns the first node which matches the specified selector string relative to the element. element.queryselectorall() returns a nodelist of nodes which match the specified selector string relative to the element. element.releasepointercapture() releases (stops) pointer capture that was previously set for a specific pointer event. childnode.
remove()
removes the element from the children list of its parent. element.
removeattribute()
removes the named attribute from the current node. element.
removeattributens()
removes the attribute with the specified name and namespace, from the current node. eventtarget.
removeeventlistener()
removes an event listener from the element. element.requestfullscreen() asynchronously asks the brow...
...current node. element.setattributens() sets the value of the attribute with the specified name and namespace, from the current node. element.setcapture() sets up mouse event capture, redirecting all mouse events to this element. element.setpointercapture() designates a specific element as the capture target of future pointer events. element.toggleattribute() toggles a boolean attribute,
removing it if it is present and adding it if it is not present, on the specified element. obsolete methods element.getattributenode() retrieves the node representation of the named attribute from the current node and returns it as an attr. element.getattributenodens() retrieves the node representation of the attribute with the specified name and namespace, from the current node and re...
...adding it if it is not present, on the specified element. obsolete methods element.getattributenode() retrieves the node representation of the named attribute from the current node and returns it as an attr. element.getattributenodens() retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an attr. element.
removeattributenode()
removes the node representation of the named attribute from the current node. element.setattributenode() sets the node representation of the named attribute from the current node. element.setattributenodens() sets the node representation of the attribute with the specified name and namespace, from the current node. events listen to these events using addeventlisten...
...And 4 more matches
IDBObjectStoreSync - Web APIs
it may however be reintroduced in the future if there is enough demand from web developers. the idbobjectstoresync interface of the indexeddb api provides synchronous access to an object store of a database. ...
... keypath readonly domstring the key path of this object store. if this attribute is s...
... keypath readonly domstring the key path of this object store. if this attribute is set to null, then the application must provide a key for each modi...
...And 4 more matches
Timing element visibility with the Intersection Observer API - Web APIs
ss is defined; it wraps the entire blog, including the header, sidebar, and body content (articles and ads). the wrapper establishes a css grid with two columns and two rows. the first column (sized automatically based on its content) is used for the sidebar and the second column (which will be used for body content) is sized to be at least the width of the contents of the column and at most all
remaining available space. the first row will be used specially for the site header. the rows are sized the same way as the columns: the first one is automatically sized and the one uses the
remaining space, but at least enough space to provide room for all elements within it. the wrapper's width is fixed at 700px so that it will fit in the available space when presented inline on mdn below. the h...
...tself doesn't state whether the document has switched from visible to invisible or vice-versa, the document.hidden property is checked to see if the document is not currently visible. since it's theoretically possible to get called multiple times, we only proceed if we haven't already paused the timers and saved the visibility states of the existing ads. to pause the timers, all we need to do is
remove the ads from the set of visible ads (visibleads) and mark them as inactive. to do so, we begin by saving the set of visible ads into a variable known as previouslyvisibleads to be sure we can restore them when the user tabs back into the document, and we then empty the visibleads set so they won't be treated as visible. then, for each of the ads that are being suspended, we call our updateadti...
...ow it has just transitioned from the obscured state to the visible state. if it's become at least 75% visible, then we consider the ad visible and we start the timer by setting the ad's dataset.lastviewstarted attribute to the transition time in entry.time, then add the ad to the set visibleads so we know to process it as time goes by. if the ad has transitioned to the not-intersecting state, we
remove the ad from the set of visible ads. then we have one special behavior: we look to see if entry.ratio is 0.0; if it is, that means the element has become totally obscured. if that's the case, and the ad has been visible for at least a minute total, we call a function we'll create called replacead() to replace the existing ad with a new one. this way, the user sees a variety of ads over time, bu...
...And 4 more matches
Key Values - Web APIs
wup", and "arrowdown". editing keys keyboardevent.key value description virtual keycode windows mac linux android "backspace" the backspace key. this key is labeled delete on mac keyboards. vk_back (0x08) kvk_delete (0x33) gdk_key_backspace (0xff08) qt::key_backspace (0x01000003) keycode_del (67) "clear" the clear key.
removes the currently selected input. vk_clear (0x0c) vk_oem_clear (0xfe) kvk_ansi_keypadclear (0x47) gdk_key_clear (0xff0b) qt::key_clear (0x0100000b) keycode_clear (28) "copy" the copy key (on certain extended keyboards). appcommand_copy gdk_key_copy (0x1008ff57) qt::key_copy (0x010000cf) "crsel" [3] the cursor select key, crsel. vk_c...
...e display. gdk_key_monbrightnessdown (0x1008ff03) qt::key_monbrightnessdown (0x010000b3) keycode_brightness_down (220) "brightnessup" the brightness up key. typically increases the brightness of the display. gdk_key_monbrightnessup (0x1008ff02) qt::key_monbrightnessup (0x010000b2) keycode_brightness_up (221) "eject" the eject key. ejects
removable media (or toggles an optical storage device tray open and closed). gdk_key_eject (0x1008ff2c) qt::key_eject (0x010000b9) keycode_media_eject (129) "logoff" [2] the logoff key. gdk_key_logoff (0x1008ff61) qt::key_logoff (0x010000d9) "power" the power button or key, to toggle power on and off. note: not all systems pass this key...
... gdk_key_dead_capital_schwa (0xfe8b) Ə gdk_key_dead_greek (0xfe8c) function keys while various platforms support different numbers of the general-purpose function keys, such as f1–f12 (or f1–f10, or f1–f15, etc.), the first few are specifically defined as follows. if more function keys are available, their names continue the pattern here by continuing to inc
rement the numeric portion of each key's name, so that, for example, "f24" is a valid key value. keyboardevent.key value description virtual keycode windows mac linux android "f1" the first general-purpose function key, f1. vk_f1 (0x70) kvk_f1 (0x7a) gdk_key_f1 (0xffbe) gdk_key_kp_f1 (0xff91) qt::key_f1 (0x01000030) keycode_f1 (131) ...
...And 4 more matches
PaymentResponse.onpayerdetailchange - Web APIs
mples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected. const options = { requestshipping: true, requestpaye
remail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, paye
remail: oldpaye
remail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. respons...
...quest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, paye
remail: oldpaye
remail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. response.onpayerdetailchange = async ev => { const promisestovalidate = []; const { payername, paye
remail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which // resolves if the data is valid. ...
...ev => { const promisestovalidate = []; const { payername, paye
remail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which // resolves if the data is valid. ...
...And 4 more matches
PaymentResponse: payerdetailchange event - Web APIs
mples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected. const options = { requestshipping: true, requestpaye
remail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, paye
remail: oldpaye
remail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. respons...
...quest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, paye
remail: oldpaye
remail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. response.onpayerdetailchange = async ev => { const promisestovalidate = []; const { payername, paye
remail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which // resolves if the data is valid. ...
...ev => { const promisestovalidate = []; const { payername, paye
remail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which // resolves if the data is valid. ...
...And 4 more matches
RTCIceTransport.getSelectedCandidatePair() - Web APIs
ent best-choice pair of ice candidates describing the configuration of the endpoints of the transport. syntax candidatepair = rtcicetransport.getselectedcandidatepair(); parameters none. return value a rtcicecandidatepair object describing the configurations of the currently-selected candidate pair's two endpoints. ...
...of ice candidates describing the configuration of the endpoints of the transport. syntax candidatepair = rtcicetransport.getselectedcandidatepair(); parameters none. return value a rtcicecandidatepair object describing the configurations of the currently-selected candidate pair's two endpoints. ...
...from that time forward, the best matching pair of candidates will always be available by calling getselectedcandidatepair(). ...
...And 4 more matches
RTCOutboundRtpStreamStats - Web APIs
ary includes the following properties in addition to those it inherits from rtcsentrtpstreamstats, rtcrtpstreamstats, and rtcstats. averagertcpinterval a floating-point value indicating the average rtcp interval between two consecutive compound rtcp packets. fircount an integer value which indicates the total number of full intra request (fir) packets which this rtcrtpsender has sent to the
remote rtcrtpreceiver. this is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. valid only for video streams. framesencoded the number of frames that have been successfully encoded so far for sending on this rtp stream. only valid for video streams. lastpacketsenttimestamp a domhighrestimestamp indicating the time at which the last packet was s...
... for video streams. lastpacketsenttimestamp a domhighrestimestamp indicating the time at which the last packet was sent for this ssrc. the timestamp property, on the other hand, indicates the time at which the rtcoutboundrtpstreamstats object was generated. ...
...only available for video streams. qpsum a 64-bit value containing the sum of the qp values for every frame encoded by this rtcrtpsender. valid only for video streams. ...
...And 4 more matches
RTCPeerConnection.getStreamById() - Web APIs
syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. ...
... syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. ...
... syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. ...
...And 4 more matches
RTCPeerConnection.setLocalDescription() - Web APIs
nchronously. if setlocaldescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setlocaldescription() does not immediately take effect. instead, the current connection configuration
remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.setlocaldescription(sessiondescription); pc.setlocaldescription(sessiondescription, successcallback, errorcallback); parameters sessiondescription optional an rtcsessiondescriptioninit or rtcsessiondescription which specifies the configuration to be ...
... or rtcsessiondescription which specifies the configuration to be applied to the local end of the connection. if the description is omitted, the webrtc runtime tries to automatically do the right thing. implicit description if you don't explicity provide a session description, the webrtc runtime will try to handle it correctly. if the signaling state is one of stable, have-local-offer, or have-
remote-pranswer, the webrtc runtime automatically creates a new offer and sets that as the new local description. otherwise, setlocaldescription() creates an answer, which becomes the new local description. type of the description parameter the description is of type rtcsessiondescriptioninit, which is a serialized version of a rtcsessiondescription browser object. they're interchangeable: mypeerc...
...o ensure that an active connection can be changed without losing the connection if the change does not succeed. see pending and current descriptions in webrtc connectivity for more details on this process. deprecated parameters in older code and documentation, you may see a callback-based version of this function used. this has been deprecated and its use is strongly discouraged, as it will be
removed in the future. you should update any existing code to use the promise-based version of setlocaldescription() instead. the parameters for the older form of setlocaldescription() are described below, to aid in updating existing code. successcallback a javascript function which accepts no input parameters to be be called once the description has been successfully set. at that time, the off...
...And 4 more matches
SVGLengthList - Web APIs
l...
... domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in svglength newitem) svglength clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. if the inserted item is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long index) ...
...ceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svglength newitem, in unsigned long index) svglength inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the
removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if the index is greater than or equal to numberofitems, then the new item is...
...And 4 more matches
SVGNumberList - Web APIs
dexable and can be accessed like arrays. interface overview also implement none methods void clear() svgnumber initialize(in svgnumber newitem) svgnumber getitem(in unsigned long index) svgnumber insertitembefore(in svgnumber newitem, in unsigned long index) svgnumber replaceitem(in svgnumber newitem, in unsigned long index) svgnumber
removeitem(in unsigned long index) svgnumber appenditem(in svgnumber newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list. ...
... a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in svgnumber newitem) svgnumber clears all existing current items from the list and re-initializes the list to hold the single item specified by newitem. if the inserted item is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long ind...
... a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svgnumber newitem, in unsigned long index) svgnumber inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the
removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if the index is greater than or equal to numberofitems, then the new it...
...And 4 more matches
SVGPathSegList - Web APIs
none methods void clear() svgpathseg initialize(in svgpathseg newitem) svgpathseg getitem(in unsigned long index) svgpathseg insertitembefore(in svgpathseg newitem, in unsigned long index) svgpathseg replaceitem(in svgpathseg newitem, in unsigned long index) svgpathseg
removeitem(in unsigned long index) svgpathseg appenditem(in svgpathseg newitem) properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties ...
...h code no_modification_allowed_err is raised when the list cannot be modified. initialize(in svgpathseg newitem) svgpathseg clears all existing current items from the list and re-initializes the list to hold the single item specified by newitem. if the inserted item is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified. getitem(in unsigned long index)...
...ith code no_modification_allowed_err is raised when the list cannot be modified. insertitembefore(in svgpathseg newitem, in unsigned long index) svgpathseg inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the
removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if the index is greater than or equal to numberofitems, then the...
...And 4 more matches
SVGPointList - Web APIs
also implement none methods void clear() svgpoint initialize(in svgpoint newitem) svgpoint getitem(in unsigned long index) svgpoint insertitembefore(in svgpoint newitem, in unsigned long index) svgpoint replaceitem(in svgpoint newitem, in unsigned long index) svgpoint
removeitem(in unsigned long index) svgpoint appenditem(in svgpoint newitem) properties readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties name type ...
...d_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in svgpoint newitem) svgpoint clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. if the inserted item is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. ...
..._modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svgpoint newitem, in unsigned long index) svgpoint inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the
removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if the index is greater than or equal to numberofitems, then the new item is...
...And 4 more matches
SVGStringList - Web APIs
will result in an exception being thrown. interface overview also implement none methods void clear() domstring initialize(in domstring newitem) domstring getitem(in unsigned long index) domstring insertitembefore(in domstring newitem, in unsigned long index) domstring replaceitem(in domstring newitem, in unsigned long index) domstring
removeitem(in unsigned long index) domstring appenditem(in domstring newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list. ...
...omexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in domstring newitem) domstring clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. if the inserted item is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long ind...
...ions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in domstring newitem, in unsigned long index) domstring inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the
removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if the index is greater than or equal to numberofitems, then the new item is...
...And 4 more matches
SVGTransformList - Web APIs
ssed like arrays interface overview also implement none methods void clear() svgtransform initialize(in svgtransform newitem) svgtransform getitem(in unsigned long index) svgtransform insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform replaceitem(in svgtransform newitem, in unsigned long index) svgtransform
removeitem(in unsigned long index) svgtransform appenditem(in svgtransform newitem) svgtransform createsvgtransformfrommatrix(in svgmatrix) svgtransform consolidate() properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type ...
...ption with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. initialize(in svgtransform newitem) svgtransform clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. if the inserted item is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long ind...
... a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform inserts a new item into the list at the specified position. the first item is number 0. if newitem is already in a list, it is
removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the
removal of the item. if the index is equal to 0, then the new item is inserted at the front of the list. if the index is greater than or equal to numberofitems, then the new item is...
...And 4 more matches
Using DTMF with WebRTC - Web APIs
this article offers a brief high-level overview of how dtmf works over webrtc, then provides a guide for everyday developers about how to send dtmf over an rtcpeerconnection. the dtmf system is often referred to as "touch tone," after an old trade name for the system. webrtc doesn't send dtmf codes as audio data. instead, they're sent out-of-band, as rtp payloads. note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf. ...
...ay to detect or receive incoming dtmf. webrtc currently ignores these payloads; this is because webrtc's dtmf support is primarily intended for use with legacy telephone services that rely on dtmf tones to perform tasks such as: teleconferencing systems menu systems voicemail systems entry of credit card or other payment information passcode entry note: while the dtmf is not sent to the
remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their phone play the tones audibly. sending dtmf on an rtcpeerconnection a given rtcpeerconnection can have multiple media tracks sent or received on it. when you wish to transmit dtmf signals, you first need to decide which track to...
...the connection by chaining the required calls together for both the caller and receiver, as shown below. ...
...And 4 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
this method is defined by the windoworworkerglobalscope mixin. ...
...&& scroll(asheets[nidx], 0, true) && nidx++ === asheets.length - 1) { clean(); return; } ocurrent.nodevalue += spart.charat(0); spart = spart.slice(1); } function sheet (onode) { this.ref = onode; if (!onode.haschildnodes()) { return; } this.parts = array.prototype.slice.call(onode.childnodes); for (var nchild = 0; nchild < this.parts.length; nchild++) { onode.
removechild(this.parts[nchild]); this.parts[nchild] = new sheet(this.parts[nchild]); } } var nintervid, ocurrent = null, btyping = false, bstart = true, nidx = 0, spart = "", asheets = [], amap = []; this.rate = nrate || 100; this.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.
...minate</span> ]</p> <div id="info"> vivamus blandit massa ut metus mattis in fringilla lectus imperdiet. proin ac ante a felis ornare vehicula. fusce pellentesque lacus vitae eros convallis ut mollis magna pellentesque. pellentesque placerat enim at lacus ultricies vitae facilisis nisi fringilla. in tincidunt tincidunt tincidunt. </div> <h1>javascript typewriter</h1> <div id="article"> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nullam ultrices dolor ac dolor imperdiet ullamcorper. suspendisse quam libero, luctus auctor mollis sed, malesuada condimentum magna. quisque in ante tellus, in placerat est. pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. donec a mi magna, quis mattis dolor. etiam sit amet ligula quis urna auctor imp...
...And 4 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
s changes and other events, and it needs to know what objects are contained in the current document or dialog box. using this information, a screen reader will speak out loud important changes to the document or ui, and allow the user to track where they navigate. the screen reader user can navigate the web page using screen reader commands or browser commands, and the two pieces of software must
remain in sync. some screen readers can even show information on a refreshable braille display. screen magnifiers will zoom to the focus, keeping it on the screen at all times, or even allow the user to enter a special low vision document reading mode, with a variety of features such as ticker mode where text is streamed on a single line. finally, voice dictation software needs to know what's in the ...
...for example, gecko support isimpledomnode to provide information about the dom node for an accessible object. a set of system messages that confer accessibility-related events such as focus changes, changes to document content and state changes in ui objects like checkboxes. to really learn about msaa, you need to download the entire msaa sdk. without downloading the sdk, you won't get the ext
remely useful tools, which help a great deal in the learning process. the accessible event watcher shows what accessible events are being generated by a given piece of software. the accessible explorer and inspect object tools show the tree of data nodes the accessible object is exposing through com, and what the screen boundaries of each object are. in addition, msdn has improved their msaa documen...
...ns of this event causes assistive technology crashes] event_object_show [can be important, depending on project] event_object_hide [can be important, depending on project] event_object_reorder [important for mutating docs] event_object_focus [important] event_object_selection [important] event_object_selectionadd [important for multiple selection] event_object_selection
remove [important for multiple selection] event_object_selectionwithin [important for multiple selection] event_object_statechange [important for checkboxes and radio buttons] event_object_locationchange event_object_namechange event_object_descriptionchange event_object_valuechange [important for sliders and progress meters] event_object_parentchange event_object_help...
...And 4 more matches
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
the older versions of flexbox, which are pretty easy to identify due to the change in the way that a flex container is created. if you find something referring to display: box or display: flexbox this is outdated information. status in browsers browser support for flexbox is excellent, and the majority of browsers do not need a prefix at this point. safari was the last of the major browsers to
remove prefixes, with the release of safari 9 in 2015. the two browsers you should still keep in mind for cross-browser compatibility are: internet explorer 10, which implemented the display: flexbox version of the specification with the -ms- prefix. uc browser, which still supports the 2009 display: box version only with the -webkit- prefix. note also that internet explorer 11 supports the mod...
...esource. you will see that many of the listed bugs apply to old browser versions and are fixed in current browsers. each of the bugs has a workaround listed — which can save you many hours of puzzling. if you want to include very old browsers with flexbox support then you can include the vendor prefixes in your css in addition to the unprefixed version. ...
... useful fallback techniques given that flexbox usage is initiated with value of the display property, when needing to support very old browsers which do not support flexbox at all, fallbacks can be created by overwriting one layout method with another. ...
...And 4 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
ms along the main axis — flex-grow, flex-shrink, and flex-basis. fully understanding how these properties work with growing and shrinking items is the real key to mastering flexbox. a first look our three properties control the following aspects of a flex item's flexibility: flex-grow: how much of the positive free space does this item get? flex-shrink: how much negative free space can be
removed from this item? flex-basis: what is the size of the item before growing and shrinking happens? the properties are usually expressed as the shorthand flex property. the following code would set the flex-grow property to 2, flex-shrink to 1 and flex-basis to auto. .item { flex: 2 1 auto; } if you have read the article basic concepts of flexbox, then you will have already had an introduct...
...he second paragraph has a value of max-content and so it does the opposite. it gets as big as it possibly can be, taking no soft-wrapping opportunities. it would overflow the box it is in if that container was too narrow. if your browser does not yet support these keywords both paragraphs will be rendered as normal paragraphs in block flow; the below screenshots show the expected rendering.
remember this behaviour and what effects min-content and max-content have as we explore flex-grow and flex-shrink later in this article. positive and negative free space to talk about these properties we need to understand the concept of positive and negative free space. when a flex container has positive free space, it has more space than is required to display the flex items inside the container.
...between the items if i wanted them to fill the container. we have negative free space when the natural size of the items adds up to larger than the available space in the flex container. if i have a 500 pixel-wide container like the one above, but the three flex items are each 200 pixels wide, the total space i need will be 600 pixels, so i have 100 pixels of negative free space. this could be
removed from the items in order to make them fit the container. it is this distribution of positive free space and
removal of negative free space that we need to understand in order to understand the flex properties. in the following examples i am working with flex-direction set to row, therefore the size of items will always come from their width. we will be calculating the positive and negative...
...And 4 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
s axis and justification of items on the main axis. these properties started life in the flexbox specification, but are now also part of the box alignment specification. this specification details how alignment works in all layout — not just flexbox. box alignment deals with alignment and justification, and also distribution of space along an axis. the reason that the box alignment properties
remain detailed in the flexbox specification as well as being in box alignment is to ensure that completion of the flexbox spec is not held up by box alignment, which has to detail these methods for all layout types. there is a note in the flexbox spec stating that in the future, once it is completed, the definitions in box alignment level 3 will supersede those of flexbox: "note: while the alignme...
...the item will not be taken out of normal flow in the way that floats are. if you have used the vertical-align property, as used with inline-block or table layout for alignment, this will no longer affect the item and you can use the alignment properties of flexbox instead. in this next live example the child elements have been floated, and then their container has had display: flex added. if you
remove display: flex, you should see that the .box element collapses as we have no clearing applied. this demonstrates that the float is happening. re-apply display: flex and the collapsing does not happen. this is because the items no longer have a float applied, as they have been transformed into flex items. flexbox and grid layout css grid layout and flexbox generally act in the same way with ...
...ements still generate boxes as normal. for the purposes of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.” this value of display controls box generation, and whether the element should generate a box that we can style and see on the page, or whether instead the box it would normally create should be
removed and the child elements essentially moved up to participate in whatever layout method the parent would have been part of. this is much easier to see with an example. in the following live example i have a flex container with three child elements. one of these flex items has two elements nested inside it, which would not ordinarily participate in flex layout. flex layout only applies to the di...
...And 4 more matches
border - CSS: Cascading Style Sheets
candidate recommendation ...
...<alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples setting a pink outset border html <div>i have a border, an outline, and a box shadow! ...
... <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples setting a pink outset border html <div>i have a border, an outline, and a box shadow! ...
...And 4 more matches
<length> - CSS: Cascading Style Sheets
es. see <length-percentage>. syntax the <length> data type consists of a <number> followed by one of the units listed below. as with all css dimensions, there is no space between the unit literal and the number. the length unit is optional after the number 0. note: some properties allow negative <length>s, while others do not. ...
... cap represents the "cap height" (nominal height of capital letters) of the element’s font. ch represents the width, or more precisely the advance measure, of the glyph "0" (zero, the unicode character u+0030) in the element's font. ...
...e element's font. on fonts with the "x" letter, this is generally the height of lowercase letters in the font; 1ex ≈ 0.5em in many fonts. ic equal to the used advance measure of the "水" (cjk water ideograph, u+6c34) glyph found in the font used to render it. lh equal to the computed value of the line-height property of the element on which it is used, converted to an absolute length.
rem represents the font-size of the root element (typically <html>). when used within the root element font-size, it represents its initial value (a common browser default is 16px, but user-defined preferences may modify this). rlh equal to the computed value of the line-height property on the root element (typically <html>), converted to an absolute length. when used on the font-size or line-he...
...And 4 more matches
position - CSS: Cascading Style Sheets
right, bottom, and left. the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static. this value creates a new stacking context when the value of z-index is not auto. its effect on table-*-group, table-row, table-column, table-cell, and table-caption elements is undefined. absolute the element is
removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. its final position is determined by the values of top, right, bottom, and left. this value creates a new stacking context when the value of z-index is not auto. the ma...
...it is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. its final position is determined by the values of top, right, bottom, and left. this value creates a new stacking context when the value of z-index is not auto. the margins of absolutely positioned boxes do not collapse with other margins. fixed the element is
removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a transform, perspective, or filter property set to something other than none (see the css transforms spec), in which case that ancestor behaves as the containing block. (note that...
...in contrast, an element that is absolutely positioned is taken out of the flow; thus, other elements are positioned as if it did not exist. the absolutely positioned element is positioned relative to its nearest positioned ancestor (i.e., the nearest ancestor that is not static). if a positioned ancestor doesn't exist, it is positioned relative to the icb (i...
...And 4 more matches
text-transform - CSS: Cascading Style Sheets
ccent on the first vowel lose the accent and gain a diaeresis on the second vowel (άι/ΑΪ). in greek (el), the lowercase sigma character has two forms: σ and ς. ς is used only when sigma terminates a word. when applying text-transform: lowercase to an uppercase sigma (Σ), the browser needs to choose the right lowercase form based on context. in irish (ga), certain prefixed letters
remain in lowercase when the base initial is capitalized, so for example text-transform: uppercase will change ar aon tslí to ar aon tslÍ and not, as one might expect, ar aon tslÍ (firefox only). in some cases, a hyphen is also
removed upon uppercasing: an t-uisce transforms to an tuisce (and the hyphen is correctly reinserted by text-transform: lowercase). the language is defined by the lang ht...
...ble. syntax /* keyword values */ text-transform: none; text-transform: capitalize; text-transform: uppercase; text-transform: lowercase; text-transform: full-width; text-transform: full-size-kana; /* global values */ text-transform: inherit; text-transform: initial; text-transform: unset; capitalize is a keyword that converts the first letter of each word to uppercase. other characters
remain unchanged (they retain their original case as written in the element's text). a letter is defined as a character that is part of unicode's letter or number general categories ; thus, any punctuation marks or symbols at the beginning of a word are ignored. authors should not expect capitalize to follow language-specific title casing conventions (such as skipping articles in english). the c...
...to read. mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenoneapplies toall elements. ...
...And 4 more matches
WAI ARIA Live Regions/API Support - Developer guides
rkup, and for pages where the author did not add any additional markup. please read the aria spec or the live region report to learn about aria live region markup. as always, we're open to questions and suggestions for changes in community forums. ...
... author did not add any additional markup. please read the aria spec or the live region report to learn about aria live region markup. as always, we're open to questions and suggestions for changes in community forums. ...
...about aria live region markup. as always, we're open to questions and suggestions for changes in community forums. ...
...And 4 more matches
<input type="email"> - HTML: Hypertext Markup Language
ze, and type idl attributes list and value methods select() value the <input> element's value attribute contains a domstring which is automatically validated as conforming to e-mail syntax. more specifically, there are three possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was
removed. a single properly-formed e-mail address. this doesn't necessarily mean the e-mail address exists, but it is at least formatted correctly. in simple terms, this means username@domain or username@domain.tld. there's more to it than that, of course; see validation for a regular expression that matches the e-mail address validation algorithm. if and only if the multiple attribute is specified,...
... least formatted correctly. in simple terms, this means username@domain or username@domain.tld. there's more to it than that, of course; see validation for a regular expression that matches the e-mail address validation algorithm. if 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. see validation for details on how e-mail addresses are validated to ensure that they're formatted properly. additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, email inputs support the following attributes: attribute description list the id of the <datalist> element t...
...w many characters wide the input field should be list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the email input. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the email input has no maximum length. this value must also be greater than or equal to the value of minl...
...And 4 more matches
<input type="number"> - HTML: Hypertext Markup Language
s to adjust the value, as well as for validation list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. max the maximum value to accept for this input. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a number, then the element has no maximum value. this value must be greater than or equal to the value of the min attribute. min the mi...
...the proper type value, number, you get automatic validation that the entered text is a number, and usually a set of up and down buttons to step the value up and down. important: bear in mind that, logically, you should not be able to enter characters inside a number input other than numbers. there seems to be some disagreement about this among browsers; see bug 1398528. note: it's crucial to
remember that a user can tinker with your html behind the scenes, so your site must not use simple client-side validation for any security purposes. you must verify on the server side any transaction in which the provided value may have any security implications of any kind. mobile browsers further help with the user experience by showing a special keyboard more suited for entering numbers when the...
...sers don't display generated content very effectively on some types of form inputs. (read, for example, the section on <input type="date"> validation.) important: html form validation is not a substitute for server-side scripts that ensure that the entered data is in the proper format! it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to
remove it entirely. it's also possible for someone to bypass your html and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data is submitted (or data which is too large, is of the wrong type, and so forth). pattern validation <input type="number"> elements do not support use of the pattern at...
...And 4 more matches
<input type="search"> - HTML: Hypertext Markup Language
ault spell checking configuration should be used list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the search field. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the search field has no maximum length. this value must also be greater than or equal to the value of mi...
...hat the pattern is treated as a sequence of unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requi
rements are to match the pattern. you should also include other explanatory text nearby. see the section specifying a pattern for details and an example. placeholder the placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an exp...
...ength of the input data, use the maxlength attribute. spellcheck non-standard attributes the following non-standard attributes are available to search input fields. as a general rule, you should avoid using them unless it can't be helped. attribute description autocorrect whether or not to allow autocorrect while editing this input field. safari only. inc
remental whether or not to send repeated search events to allow updating live search results while the user is still editing the value of the field. webkit and blink only (safari, chrome, opera, etc.). mozactionhint a string indicating the type of action that will be taken when the user presses the enter or return key while editing the field; this is used to determine an appropriate la...
...And 4 more matches
<input type="url"> - HTML: Hypertext Markup Language
selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which is automatically validated as conforming to url syntax. more specifically, there are two possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was
removed. a single properly-formed absolute url. this doesn't necessarily mean the url address exists, but it is at least formatted correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're formatted properly. additional attributes in addition to the attributes that operate on all <input> elements regardless of their ...
...ault spell checking configuration should be used list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the url input. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the url input has no maximum length. this value must also be greater than or equal to the value of minlengt...
...hat the pattern is treated as a sequence of unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requi
rements are to match the pattern. you should also include other explanatory text nearby. see the section pattern validation for details and an example. placeholder the placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an expla...
...And 4 more matches
Regular expressions - JavaScript
his chapter describes javascript regular expressions. creating a regular expression you construct a regular expression in one of two ways: using a regular expression literal, which consists of a pattern enclosed between slashes, as follows: let re = /ab+c/; regular expression literals provide compilation of the regular expression when the script is loaded. if the regular expression
remains constant, using this can improve performance. or calling the constructor function of the regexp object, as follows: let re = new regexp('ab+c'); using the constructor function provides runtime compilation of the regular expression. use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from anot...
...attern and are getting it from another source, such as user input. writing a regular expression pattern a regular expression pattern is composed of simple characters, such as /abc/, or a combination of simple and special characters, such as /ab*c/ or /chapter (\d+)\.\d*/. the last example includes parentheses, which are used as a memory device. the match made with this part of the pattern is
remembered for later use, as described in using groups. note: if you are already familiar with the forms of a regular expression, you may also read the cheatsheet for a quick lookup for a specific pattern/construct. using simple patterns simple patterns are constructed of characters for which you want to find a direct match. for example, the pattern /abc/ matches character combinations in string...
...use /\/example\/[a-z]+/i—the backslashes before each slash make them literal. to match a literal backslash, you need to escape the backslash. for instance, to match the string "c:\" where "c" can be any letter, you'd use /[a-z]:\\/ — the first backslash escapes the one after it, so the expression searches for a single literal backslash. if using the regexp constructor with a string literal,
remember that the backslash is an escape in string literals, so to use it in the regular expression, you need to escape it at the string literal level. /a\*b/ and new regexp("a\\*b") create the same expression, which searches for "a" followed by a literal "*" followed by "b". if escape strings are not already part of your pattern you can add them using string.replace: function escaperegexp(string) ...
...And 4 more matches
Array - JavaScript
nana'] console.log(fruits.length) // 2 access an array item using the index position let first = fruits[0] // apple let last = fruits[fruits.length - 1] // banana loop over an array fruits.foreach(function(item, index, array) { console.log(item, index) }) // apple 0 // banana 1 add an item to the end of an array let newlength = fruits.push('orange') // ["apple", "banana", "orange"]
remove an item from the end of an array let last = fruits.pop() //
remove orange (from the end) // ["apple", "banana"]
remove an item from the beginning of an array let first = fruits.shift() //
remove apple from the front // ["banana"] add an item to the beginning of an array let newlength = fruits.unshift('strawberry') // add to the front // ["strawberry", "banana"] find the index of an it...
...
remove an item from the beginning of an array let first = fruits.shift() //
remove apple from the front // ["banana"] add an item to the beginning of an array let newlength = fruits.unshift('strawberry') // add to the front // ["strawberry", "banana"] find the index of an item in the array fruits.push('mango') // ["strawberry", "banana", "mango"] let pos = fruits.indexof('banana') // 1
remove an item by index position let
removeditem = fruits.splice(pos, 1) // this is how to
remove an item // ["strawberry", "mango"]
remove items from an index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["cabbage", "turnip", "radish", "carrot"] let pos = 1 let n = 2 let
removeditems = vegetables.splice(pos, n) // this is how to
remove items, n...
...
removeditem = fruits.splice(pos, 1) // this is how to
remove an item // ["strawberry", "mango"]
remove items from an index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["cabbage", "turnip", "radish", "carrot"] let pos = 1 let n = 2 let
removeditems = vegetables.splice(pos, n) // this is how to
remove items, n defines the number of items to be
removed, // starting at the index position specified by pos and progressing toward the end of array. ...
...And 4 more matches
delete operator - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax delete expression where expression should evaluate to a property reference, e.g.: delete object.property delete object['property'] parameters object the name of an object, or an expression evaluating to an object. property the property to delete. ...
... throws typeerror in strict mode if the property is an own non-configurable property. description unlike what common belief suggests (perhaps due to other programming languages like delete in c++), the delete operator has nothing to do with directly freeing memory. memory management is done indirectly via breaking references. see the memory management page for more details. the delete operator
removes a given property from an object. on successful deletion, it will return true, else false will be returned. however, it is important to consider the following scenarios: if the property which you are trying to delete does not exist, delete will not have any effect and will return true. if a property with the same name exists on the object's prototype chain, then, after deletion, the objec...
...s scope. as such, delete cannot delete any functions in the global scope (whether this is part from a function definition or a function expression). functions which are part of an object (apart from the global scope) can be deleted with delete. any property declared with let or const cannot be deleted from the scope within which they were defined. non-configurable properties cannot be
removed. this includes properties of built-in objects like math, array, object and properties that are created as non-configurable with methods like object.defineproperty(). the following snippet gives a simple example: var employee = { age: 28, name: 'abc', designation: 'developer' } console.log(delete employee.name); // returns true console.log(delete employee.age); // returns true ...
...And 4 more matches
Digital audio concepts - Web media technologies
e a single second of audio varies depending on the sample rate used when recording the sound. since the sample rate corresponds to the number of "slices" a sound wave is divided into for each second of time, it's sometimes thought of as a frequency (in the sense that it's a description of something that repeats periodically, not in terms of actual audio frequency), and the samples per second measu
rement therefore uses the hertz as its unit. the most common sample rates are: 8000 hz the international g.711 standard for audio used in telephony uses a sample rate of 8000 hz (8 khz). this is enough for human speech to be comprehensible. 44100 hz the 44.1 khz sample rate is used for compact disc (cd) audio. cds provide uncompressed 16-bit stereo sound at 44.1 khz. computer audio also freque...
...dio also frequently uses this frequency by default. 48000 hz the audio on dvd is recorded at 48 khz. this is also often used for computer audio. 96000 hz high-resolution audio. 192000 hz ultra-high resolution audio. not commonly used yet, but this will change over time. there is a reason why 44.1 khz is considered the minimum "high fidelity" sampling rate. the nyquist-shannon sampling theo
rem dictates that to reproduce a sound accurately, it must be sampled at twice the rate of the sound's frequency. since the range of human hearing is from around 20 hz to 20,000 hz, reproducing the highest-pitched sounds people can generally hear requires a sample rate of more than 40,000 hz. to provide additional room for a low-pass filter in order to avoid distortion caused by aliasing, an additio...
...f human hearing is from around 20 hz to 20,000 hz, reproducing the highest-pitched sounds people can generally hear requires a sample rate of more than 40,000 hz. to provide additional room for a low-pass filter in order to avoid distortion caused by aliasing, an additional 2.05 khz transition band is added to the pre-sampling frequency (resulting in 22,050 hz). doubling that per the nyquist theo
rem results in a final minimum frequency of (you guessed it) 44.1 khz. high-resolution (96 khz) audio is used in some high-end audio systems, and it and ultra-high resolution (192 khz) audio are useful for audio mastering, where you need as much quality as possible while manipulating and editing the sound before downsampling to the sample rate you will use for the final product. this is similar to h...
...And 4 more matches
Communicating using "port" - Archive of obsolete content
) {" + " window.alert(message);" + "})"; tabs.on("ready", function(tab) { worker = tab.attach({ contentscript: alertcontentscript }); worker.port.emit("alert", "message from the add-on"); }); tabs.open("http://www.mozilla.org"); in total, the port object defines four functions: emit(): emit a message. on(): listen to a message.
removelistener(): stop listening to a message. once(): listen to only the first occurrence of a message. accessing port accessing port in the content script note that the global self object is completely different from the self module, which provides an api for an add-on to access its data files and id. in the content script the port object is available as a property of the global self object. ...
...this takes the same two parameters as port.on(): the name of the message, and the name of the listener function. this example uses the action button api, which is only available from firefox 29 onwards. for example, here's an add-on that creates a page-worker and ...
...lemymessage(mymessagepayload) { // handle the message }); in the main add-on code (in this case a panel instance), to listen for "mymessage" sent from a a content script: panel.port.on("mymessage", function handlemymessage(mymessagepayload) { // handle the message }); port.
removelistener() you can use port.on() to listen for messages. to stop listening for a particular message, use port.
removelistener(). this takes the same two parameters as port.on(): the name of the message, and the name of the listener function. this example uses the action button api, which is only available from firefox 29 onwards. for example, here's an add-on that creates a page-worker and a button. the page-worker loads http://en.wikipedia.org/wiki/chalk alongside a content script "listener.js". the butt...
...And 3 more matches
page-mod - Archive of obsolete content
criptfile: [data.url("jquery-1.7.min.js"), data.url("my-script.js")] }); from firefox 34, you can use "./my-script.js" as an alias for self.data.url("my-script.js"). so you can rewrite the above code like this: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./my-script.js" }); unless your content script is ext
remely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. a page-mod only attaches scripts to documents loaded in tabs. it will not attach scripts to add-on panels...
...tabs"); pagemod.pagemod({ include: ["*"], onattach: function onattach(worker) { console.log(worker.tab.title); } }); destroying workers workers generate a detach event when their associated document is closed: that is, when the tab is closed or when the associated window's unload event occurs. ...
... belonging to a page-mod, you can use this event to
remove workers that are no longer valid. ...
...And 3 more matches
/loader - Archive of obsolete content
you may still end up with a relative mo...
... loader } = require('toolkit/loader'); let loader = loader({ paths: { // resolve all modules starting with `toolkit/` as follows: // toolkit/foo -> resource://gre/modules/commonjs/toolkit/foo.js // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', // resolev all other non-relative module requi
rements as follows: // devtools/gcli -> resource:///modules/devtools/gcli.js // panel -> resource:///modules/panel.js '': 'resource:///modules/', // allow relative urls and resolve them to add-on root: // ./main -> resource://my-addon/root/main.js './': 'resource://my-addon/root/' } }); the order of keys in paths is irrelevant since they are sorte...
...ion. this feature may also be used to implement specific security constraints. for example, the sdk generates a manifest file at build time representing a dependency graph of all modules used by an add-on. ...
...And 3 more matches
content/mod - Archive of obsolete content
.attachto; var style = require("sdk/stylesheet/style").style; var style = style({ source: "div { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(style, window); parameters modification : object the modification we want to apply to the target. window : nsidomwindow the window to be modified. ...
...iv { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(style, window); parameters modification : object the modification we want to apply to the target. window : nsidomwindow the window to be modified. detachfrom(modification, window) function
removes attached modification from a given window. if window is not specified, modification is
removed from all the windows it's being attached to. ...
...y attachto(style, window); parameters modification : object the modification we want to apply to the target. window : nsidomwindow the window to be modified. detachfrom(modification, window) function
removes attached modification from a given window. if window is not specified, modification is
removed from all the windows it's being attached to. for example, the following code applies and
removes a style to a content window, adding a border to all divs in page: var { attachto, detachfrom } = require("sdk/content/mod"); var style = require("sdk/stylesheet/style").style; var style = style({ source: "div { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(style, window); // ... detachfrom(style, window); parameters modification ...
...And 3 more matches
dev/panel - Archive of obsolete content
enables you to extend the firefox developer tools. most of the firefox developer tools are hosted in a ui component called the toolbox. individual built-in tools, such as the javascript debugger or the web console, occupy "panels" in the toolbox. ...
...box: the panel gets a tab in the toolbox toolbar which enables the user to open it: you specify the panel's content and behavior using html, css, and javascript. when the panel's created, the framework passes it a debuggee: this is a messageport object that you can use to exchange json messages with the browser that the developer tools are currently debugging. the messages follow the
remote debugging protocol. for a simple walkthrough of using the dev/panel api to add a new tool, see adding a panel to the toolbox. basic usage defining the panel constructor to add a new tool you first need to define a constructor that inherits from the panel class, and in that constructor you need to supply values for various properties . you can set the constructor up manually if you like, o...
...e panel document"); console.log(toaddon); }); communicating with the debugger server the firefox developer tools use a client/server protocol: a tool, such as a javascript debugger or style editor, is the client, and the program being debugged, such as firefox, is the server. clients connect to the server and send it messages to examine and modify the state of the program being debugged. the
remote debugging protocol page describes the protocol in detail. when the user opens a panel and the panel is created, the framework calls the panel's setup method. the setup method will be passed a debuggee object, which is a messageport that the add-on can use to exchange messages with the debugger server. for example, here's a main.js which sends the listtabs message to the debugger server, and ...
...And 3 more matches
places/bookmarks - Archive of obsolete content
create, modify, and retrieve bookmarks. usage this module exports: three constructors: bookmark, group, and separator, corresponding to the types of objects, referred to as bookmark items, in the bookmarks database in firefox two additional functions, save() to create, update, and
remove bookmark items, and search() to retrieve the bookmark items that match a particular set of criteria. save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes. each retrieved bookmark item represents only a snapshot of state at a specific time. the module does not automatically sync up a bookmark instance with ongoing changes to that item in the database from the same add-o...
...eted. adding items: if passing in freshly instantiated bookmark items or a duck-typed object, the item is created on the platform. updating items: for an item referenced from a previous save() or from the result of a search() query, changing the properties and calling save() will update the item on the server. deleting items: to delete a bookmark item, pass in a bookmark item with a property
remove set to true. the function returns a placesemitter that emits a data event for each item as it is saved, and an end event when all items have been saved. let { bookmark, group } = require("sdk/places/bookmarks"); let mygroup = group({ title: "my group" }); let mybookmark = bookmark({ title: "moz", url: "http://mozilla.com", group: mygroup }); save(mybookmark).on("data", function (ite...
...te from the platform. invoked with two arguments, mine and platform, where mine is the item that is being saved, and platform is the current state of the item on the item. the object returned from this function is what is saved on the platform. by default, all changes on an outdated bookmark item overwrite the platform's bookmark item. returns placesemitter : returns a placesemitter. ...
...And 3 more matches
JavaScript Daemons Management - Archive of obsolete content
f them. note: a minimalistic version of it (minidaemon) is published here. this more complex version of it is nothing but a big and scalable collection of methods for the daemon constructor. but the daemon constructor itself is nothing but a clone of minidaemon with an added support for init and onstart functions declarable during the instantiation of the daemon. so the minidaemon framework will
remain the recommended way for simple animations, because daemon without its collection of methods is essentially a clone of it. the architecture of the daemon constructor explicitly avoids the use of closures. it also offers an alternative way to pass the this object to the callback functions (see the "this" problem for details). advantages of this approch: abstraction passage of this object t...
...owser for both timers (polyfill), at the end of the daemon.js module. daemon.js what follows is the module that declares the daemon constructor (the core of this framework). the daemon constructor itself is nothing but a clone of the little framework minidaemon with added support for init and onstart functions (declarable during the instantiation of the daemon). so the minidaemon framework will
remain the recommended way for simple animations, because daemon without its collection of methods is essentially a clone of it. /*\ |*| |*| ******************************* |*| * daemon.js * |*| ******************************* |*| |*| ver. 1.0 rev. 2 |*| |*| daemon.js - a javascript highly scalable daemons manager. |*| |*| https://developer.mozilla.org/docs/javas...
...alse, bend = odmn.isatend(), binvert = odmn.reversals > 0; if (bend && !binvert || bbreak) { odmn.pause(); return false; } if (bend && binvert) { odmn.backw = !odmn.backw; odmn.reversals--; } return true; }; /* system not required daemon global object methods */ /** * daemon global object optional methods (shortcuts). you could safely
remove all or some of them, * depending on your needs. if you want to
remove them and are using the daemon.safe subsystem you * should also
remove the daemon.safe global object methods that require them. **/ daemon.construct = function (aargs) { var odmn = new this.blank(); this.apply(odmn, aargs); return odmn; }; daemon.buildaround = function (octx, nrate, nlen) { if (!
...And 3 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
functions for opening files and character-code conversion, among other things. a different mechanism is needed to perform these functions. internet explorer handles this using activex; in firefox, we use the cross-platform component object model, or xpcom. due to deprecation of enableprivilege this functionality can not be used in web pages. enableprivilege is disabled in firefox 15 and will be
removed in firefox 17. about xpcom xpcom is a framework for developing platform-independent components. components developed in line with that framework are referred to as xpcom components, and sometimes the components are simply referred to as xpcoms. firefox itself includes a great number of xpcom components, and they can be used in extensions as well. sometimes an extension will be packaged wit...
...ow see the confirmation dialog shown in figure 1. pressing the "permit" button grants universalxpconnect permission in this execution context, making it possible to run xpconnect temporarily. an xpconnect-wrapped nsiioservice message should appear. if you check “apply these privileges in the future”, all local files will be able to run xpconnect without confirmation in the future. this is ext
remely dangerous, and you should never check this option. editing prefs.js opening test.xul will produce the dialog shown in figure 1. this can get annoying. to run the file's scripts without manual confirmation, add the contents of listing 3 to the prefs.js file in the user profile folder. opening test.xul will show the local file url in the location bar. copy and paste this into the appropriate s...
...ng. listing 6: creating an xpcom object representing a file var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwithpath('c:\\temp\\temp.txt'); creating and deleting files listing 7 shows how to delete a file if it exists, and create a new file with the same name. ...
...And 3 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
itive review and have your add-on made public. if it cannot be easily proven that an eval() call is benign and necessary because there are no viable alternatives, a mozilla add-ons gallery reviewer will generally reject the submission! parsing json mozilla provides native json support since firefox 3. there is simply no need to parse json using eval. ...
...essary because there are no viable alternatives, a mozilla add-ons gallery reviewer will generally reject the submission! parsing json mozilla provides native json support since firefox 3. there is simply no need to parse json using eval. additionally, parsing json retrieved from a
remote location becomes a security vulnerability when parsed with the eval function. basically, you are executing
remote code with full chrome access; that is, introducing a
remote code execution vulnerability. even if you trust the
remote server; for example, because it is one you rent and administer yourself, there is a huge security risk, because of, but not limited to: you might discontinue your project or sell it, so that it is possible another person with malicious intentions takes over your domain. th...
...entations are less efficient and often also contain serious security vulnerabilities. such implementations are meant to be used within a very different security context, namely a website, where the origin of the data is usually known in all instances and where vulnerabilities would have a much smaller impact. what about jsonp? jsonp, which really is just another script tag containing generated,
remotely retrieved code, is generally not secure. it might be possible to execute any retrieved jsonp code in an unprivileged sandbox (which is complicated!), but if you have a choice, just avoid jsonp altogether! passing around functions/code as strings often you'll want to pass functions or code to other functions, most notoriously settimeout and addeventlistener. often this is done passing aroun...
...And 3 more matches
List of Mozilla-Based Applications - Archive of obsolete content
adobe acrobat and adobe reader portable document format (pdf) software uses mozilla spidermonkey adobe flash player popular browser plug-in uses nss in linux version adwatch content management system uses xul and xpcom aicpcu/iia exam app exam delivery software aliwal geocoder geocoding & data on a map amarok xul
remote
remote control for amarok music player ample sdk javascript gui-framework aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with mod_nss ssl module apicawatch site performance monitoring tool uses firefox as part of its monitoring package astyle css...
...chromium and google chrome web browser uses mozilla nss and npapi libraries chromeless browser with html-based interface classilla mozilla browser for mac os 9 clines a clone of color lines (game) standalone version cloud web operating system cloud browse iphone/ipad/ipod touch browser seems to be firefox running
remotely on servers that people access through device conkeror keyboard-oriented browser convertigo enterprise mashup server server tool for transactional web scraping and for web clipping cometbird another firefox mod modified version of firefox correo email couac (fr) web-based email and jabber app couchdb do...
...ient expeditors international of washington, inc. ...
...And 3 more matches
JavaScript Client API - Archive of obsolete content
o invent your own mapping from data objects to guids as long as it's consistent. in this case, it is highly recommended to use the utils.makeguid() helper to generate new guids: let newguid = utils.makeguid(); your store object must implement the following methods: itemexists(id) createrecord(id, collection) changeitemid(oldid, newid) getallids() wipe() create(record) update(record)
remove(record) you may also find it useful to override other methods of the base implementation, for example applyincomingbatch if the underlying storage for your data supports batch operations. createrecord the createrecord( id, collection ) method gets called by the engine to request a new record for an item with a given guid. it's your store's responsibility to instantiate a record object...
...pens to be maintaining; it means the underlying data itself. for instance, bookmarkstore.wipe() deletes all bookmarks from the current firefox profile. how to do this for your particular data type is up to you to figure out. the next three methods are called by the sync algorithm when it determines that the state of the local application needs to be changed to keep it up-to-date with the user's
remote activities. the sync algorithm will call your store object with a record to be created, updated, or
removed, and it is your store object's responsibility to apply this change to the local application using whatever methods are neccessary. create(record) not to be confused with createrecord(), this method (which should probably be renamed for clarity soon) tells your store to create a ne...
...whatever methods are neccessary. create(record) not to be confused with createrecord(), this method (which should probably be renamed for clarity soon) tells your store to create a new item in the local application, based on the data in record. (so for example, bookmarkstore.create() adds a new bookmark to the firefox profile). update(record) the argument is a record which has been
remotely modified; your store should locate the matching local item (presumably using the guid, which is available in record.id) and update it to the new values provided in record.
remove(record) the argument is a record which has been
remotely deleted; your store should locate the matching local item and delete it. (don't rely on the record that is passed in to this method having any of its ...
...And 3 more matches
Menu - Archive of obsolete content
the menu is currently visible and false otherwise. read-only. items array an array of menuitems in the menu. read-only. methods add(items) clear() contexton(node) hide() insertbefore(newitems, target) item(target) popupon(node)
remove(target) replace(target, newitems) reset() set(items) show(anchornode) add(items) adds items to the menu. the position at which the items are added is at jetpack's discretion. this method and set() are the recommended methods of adding items to a menu. parameters items a single menuitem or an array of m...
... replace(target, newitems) reset() set(items) show(anchornode) add(items) adds items to the menu. the position at which the items are added is at jetpack's discretion. this method and set() are the recommended methods of adding items to a menu. parameters items a single menuitem or an array of menuitems. clear()
removes all items from the menu, even items not added by the feature. contexton(node) binds the menu to a given node as its context menu. parameters node the menu is attached to this node, which may be either a raw dom node or a dom node wrapped by jquery. hide() hides the menu if it is showing. insertbefore(newitems, target) inserts new items before an existing item. parameters ...
...changes immediately. parameters target indicates the existing item. see targets. return value a menuitem object, or null if no such target exists. popupon(node) binds the menu to a given node. the menu will be shown when the node is left-clicked. parameters node the menu is attached to this node, which may be either a raw dom node or a dom node wrapped by jquery.
remove(target)
removes an item from the menu. parameters target indicates the existing item to
remove. see targets. if no such target exists, the call silently fails. replace(target, newitems) replaces an item with new items. parameters target indicates the existing item to replace. see targets. if no such target exists, the call silently fails. newitems ...
...And 3 more matches
New Skin Notes - Archive of obsolete content
could be smaller. --dria is it just me or visited links are not marked as such? --nickolay 07:16, 29 aug 2005 (pdt) imho the visited color looks horrible. we're a documentation site. there's no real reason for user to give him info that he already visited xml main page. it's hardly possible that he'll be interested in it. in all other dev centres there is no "visited link color" and we should
remove imho. it looks odd when someone who uses devmo on regular basis sees some violet links just because he already worked with this site yesterday.also, the current color for visited links makes them less visible. --gandalf 00:45, 31 aug 2005 (pdt) i don't like the current color too, but i strongly disagree that we don't need to give visited links different color. this is not what user expects (w...
..., 31 aug 2005 (pdt) ok, so i'm asking just to change this color. --gandalf 04:55, 31 aug 2005 (pdt) fine, changed. --dria the default link color is to bright. it's less readable than the old one. i'd suggest to use the color from cavedish. -- gandalf that was my first thought, too. -- axelhecht ok, i'll tone the main link colour down a bit. --dria page title needs "development skin"
removed. -- dria the skin looks nice, but the links on the right are too small. if this is going to be the default skin used by editors, they are unacceptably small. --nickolay 01:59, 25 aug 2005 (pdt) i'm planning on doing up a special skin for editors in the future (with the edit tools and such closer to the top, etc). in the meantime, i'll bump the font size of those links up. --dria but if th...
...anges i need to make, however, so i'll try to fix it up a bit while i'm digging around in there. --dria how about modifying style for the side-bar to have a :hover class added which modifies (to a slightly lighter shade) the background color of the link, this will help to make items "appear as links" to many users, possibly add a text-decoration: underline as well. --callek is it possible to
remove the blank space on category pages, like category:dom?by the way, it looks like this skin has the same problem as previous - the edit box, category list on category pages, and others are always below the end of the sidebar. the major problem it caused in cavendish skin - that they were out of the screen - is solved by making the sidebar smaller, which is not the right thing to do, imo (see my c...
...And 3 more matches
Tamarin build documentation - Archive of obsolete content
ws the existing acceptance and performance testsuites to be run on a windows mobile device connected to a windows desktop machine by activesync or windows mobile device center (for windows vista and windows 7). setup and run activesync or windows mobile device center. ...
... performance testsuites to be run on a windows mobile device connected to a windows desktop machine by activesync or windows mobile device center (for windows vista and windows 7). setup and run activesync or windows mobile device center. ...
... windows mobile device center (for windows vista and windows 7). setup and run activesync or windows mobile device center. ...
...And 3 more matches
findbar - Archive of obsolete content
open( mode ) return type: no return value opens the fi...
... open( mode ) return type: no return value opens the findbar using the spe...
... open( mode ) return type: no return value opens the findbar using the specified mode, which shou...
...And 3 more matches
MenuModification - Archive of obsolete content
adding items to a menu the appenditem method may be used to append a new item to the end of the popup associated with a menu. this method will create a new menuitem element and insert it into the popup. this method may only be used with the menu element. <script> function addtomenu() { var menu = document.getelementbyid("edit-menu"); menu.appenditem("insert", "insert"); } </script> <menu id="edit-menu"/> <button label="add" oncommand="addtomenu()"/> in this example, the addtomenu function is called when the button is pressed. this function appends a new item to the menu's popup with the label insert. ...
...fect is that a submenu with two items is added dynamically to the menu. the appendchild method is available for all elements, and is used to add new nodes within another node. the appenditem method is specific to menus, as well as some other specific elements, and is simpler to use to append new menuitem elements to a menu. if we were to use the example above, we would also want to make sure to
remove the items again in a popuphiding event listener. otherwise, a new submenu would be added every time the menu is opened, which is clearly not desirable. another possibility is to ensure that the menu is only added once. the following shows how the addsubmenu function above might be rewritten to handle this case. <script> function addsubmenu() { var popup = document.getelementbyid("file-popup...
...endchild(newmenu); newmenu.label = "new"; newmenu.appenditem("document", "doc"); newmenu.appenditem("image", "image"); } </script> the haschildnodes method may be used to check if a node has any children. the first time the function is called, the haschildnodes method will return false, however the second time, the method will return true as the items have already been added to the menu. ...
...And 3 more matches
PopupEvents - Archive of obsolete content
without first opening the parent menu. ...
...nction is called. within this function, a popupshown event listener is attached to the 'file' menu using the addeventlistener method. this will cause the filemenuopened function to be called when the popupshown event is fired on the 'file' menu. the filemenuopened function first checks that the target of the event is the right popup and returns early if not. ...
...the popuphiding event is fired regardless of how the popup was hidden, whether because the user selected an item from a menu, or if the user clicked outside the popup, or if the user pressed escape to cancel the menu. ...
...And 3 more matches
Result Generation - Archive of obsolete content
ure below, you can see that node a at the top has arcs pointing to b, c and d. similarly, c has an arc pointing to d. you could have arcs pointing elsewhere--for example, node d could have an arc pointing back to a. to navigate around, you could start at node a and navigate around the graph following the arrows to b, c or d. or you could start at b and go to a and then go to c and d, etc. no requi
rement exists to follow the arrows in the direction they point; you can easily go the other way (though in only one direction within a given series of iterations). the picture was generated from the w3c's rdf validator, a good place to go to check if your rdf is valid. the text in red are the labels for the arrows, called predicates. in this example, all the arrows have the same label. usually, this...
...m/rdf/a'. query processing a query for an rdf datasource consists of a number of statements, placed as children of the query element. during query processing, the template builder builds up a network of information such as: possible results that are available where content should be generated information that indicates what to do when the rdf datasource changes this network of information
remains for the lifetime of the template, or until it is rebuilt. the template builder uses a method based on the rete algorithm to match data. this allows for a fairly efficient means of updating results when, for instance, a new statement is added to the rdf graph. rather than rebuild the entire template, the algorithm allows only specific parts of the network of information to be re-examined. a si...
...emplate, or until it is rebuilt. the template builder uses a method based on the rete algorithm to match data. this allows for a fairly efficient means of updating results when, for instance, a new statement is added to the rdf graph. rather than rebuild the entire template, the algorithm allows only specific parts of the network of information to be re-examined. a similar method can be used when
removing rdf statements. while the information network created by the template builder contains a number of different pieces of necessary information, for the purposes of this discussion, we will only be interested in the list of possible results. the builder begins with a single possible result, called the seed. the builder processes each of a query's statements in sequence. to do this for a particu...
...And 3 more matches
XUL element attributes - Archive of obsolete content
element within the same document. for instance, the reference '#data' refers to an element with the id 'data'. if you plan on adding a datasource to an element but don't want one to be added right away, set this attribute to 'rdf:null'. this will make the element so that its contents can be generated from a datasource. otherwise, you cannot add one later. when the xul document is contained on a
remote web site, the datasources may only be loaded from the same domain as the document. dir type: one of the values below the direction in which the child elements of the element are placed. normal for scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales) for other elements, the elements are placed left to right...
...er is empty. dont-build-content: this flag may be used on a tree to indicate that content elements should not be generated. this results in a performance enhancement, but you will not be able to use the dom functions to retrieve the tree rows. flex type: string (representing an integer) indicates the flexibility of the element, which indicates how an element's container distributes
remaining empty space among its children. flexible elements grow and shrink to fit their given space. elements with larger flex values will be made larger than elements with lower flex values, at the ratio determined by the two elements. the actual value is not relevant unless there are other flexible elements within the same container. once the default sizes of elements in a box are calculated, the ...
...aining empty space among its children. flexible elements grow and shrink to fit their given space. elements with larger flex values will be made larger than elements with lower flex values, at the ratio determined by the two elements. the actual value is not relevant unless there are other flexible elements within the same container. once the default sizes of elements in a box are calculated, the
remaining space in the box is divided among the flexible elements, according to their flex ratios. specifying a flex value of 0 has the same effect as leaving the flex attribute out entirely. height type: string (representing an integer) the preferred height of the element in pixels. the actual displayed height may be different if the element or its contents have a minimum or maximum height.
...And 3 more matches
columns - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... ...
... ...
...And 3 more matches
grid - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... ...
... ...
...And 3 more matches
image - Archive of obsolete content
style property. if you change the image, the event will fire again when the new image loads. this event will not bubble up the element tree. src type: uri the uri of the content to appear in the element. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored
remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the image will be loaded from the cache if possible. properties accessibletype type: integer a value indicating the type of accessibi...
...this typically looks like an exclamation mark. this and the other icon classes may be used by image elements or other ele...
...this typically looks like an exclamation mark. this and the other icon classes may be used by image elements or other elements which can hav...
...And 3 more matches
label - Archive of obsolete content
these classes should be used instead of changing the style of the element directly since they will fit more naturally with t...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected ...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. header a cl...
...And 3 more matches
prefpane - Archive of obsolete content
. void userchangedvalue(in domelement element); the user changed the value in a widget that the preferences system does not automatically track state changes for (1) and the preference element associated with the widget should be updated based on the state held by the widget. for example, if you are using a listbox and the user changes the contents of the listbox (such as adding or
removing an item) and you want to sync the changes back to a preference, you must write an onsynctopreference handler for your listbox that returns the value to be written to the preference element, and then call the userchangedvalue function every time you edit the list in a way that should cause the preference's value to change. (1) an example of a widget that has state changes tracked for i...
...after the overlay is merged.) you can put the handler for this event in the onpaneload ...
...after the overlay is merged.) you can put the handler for this event in the onpaneload attribute on the el...
...And 3 more matches
row - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... ...
... ...
...And 3 more matches
rows - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... ...
... ...
...And 3 more matches
separator - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selecte...
...And 3 more matches
<statusbarpanel> - Archive of obsolete content
refer to the add-on bar. an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a label or an image but not both. this element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. ...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selecte...
...And 3 more matches
tabpanel - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... ...
... ...
...And 3 more matches
tabpanels - Archive of obsolete content
selectedindex type: integer returns the index of the currently selected item. you may select an item by assigning its...
... ...
... ...
...And 3 more matches
toolbar - Archive of obsolete content
"separator", "spring". an empty toolbar has a currentset value of "__empty". you may change the current set of items by setting this property. be careful, as setting this property doesn't automatically update the currentset attribute. firstpermanentchild not in seamonkey 1.x type: element the first permanent child of the toolbar. a permanent child is one that is not customizable and
remains on the toolbar. items that are placed directly inside the toolbar without being in the toolbarpalette are permanent. lastpermanentchild not in seamonkey 1.x type: element the last permanent child of the toolbar. a permanent child is one that is not customizable and
remains on the toolbar. items that are placed directly inside the toolbar without being in the toolbarpalette are perman...
...otherw...
...otherwise, this option wi...
...And 3 more matches
toolbox - Archive of obsolete content
customtoolbarcount firefox only type: integer the number of custom toolbars currently within the toolbox. e...
...you can supply a comma-separated list of toolbar item id...
...you can supply a comma-separated list of toolbar item ids as the second arg...
...And 3 more matches
treecols - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, cont...
... interfaces nsiaccessibleprovider ...
... interfaces nsiaccessibleprovider ...
...And 3 more matches
treerow - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... ...
... ...
...And 3 more matches
treeseparator - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... ...
... ...
...And 3 more matches
Table Reflow Internals - Archive of obsolete content
d thus not have to continue (split) breaking status (in the case of some inline frames) if there is truncation (it can't fit in the space and can't split). this is just a convience mechanism. kinds of reflows initial - reflowee's first reflow must be of this type (reflower's responsibility). resize - reflowee gets a change in available space only. similar to initial, except it can reoccur. inc
remental - has a reflow path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g. it gains, loses children) style changed - a target changed stylisticly (recall, size is a style property) content changed - a target's content changed (e.g. a text run) user defined - currently only used for fixed positioned frames kinds ...
...eflow path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g. it gains, loses children) style changed - a target changed stylisticly (recall, size is a style property) content changed - a target's content changed (e.g. ...
... (e.g. ...
...And 3 more matches
Game monetization - Game development
r your game up front, you can offer a free game with in-app purchases (iaps.) in this case the game can be acquired without spending a dime — give the game to the players, but offer in-game currency, bonuses or benefits for real money. specific examples can include bonus levels, better weapons or spells, or refilling the energy needed to play. designing a good iap system is an art of it's own.
remember that you need thousands of downloads of your game to make iaps effective — only a small fraction of players will actually pay for iaps. how small? it varies, but around one person in every thousand is about average. the more people that play your game, the higher the chance someone will pay, so your earnings heavily depend on your promotion activities. freemium games that feature iaps ar...
...will actually pay for iaps. how small? it varies, but around one person in every thousand is about average. the more people that play your game, the higher the chance someone will pay, so your earnings heavily depend on your promotion activities. freemium games that feature iaps are often referred to a freemium — a freemium game can be acquired and played for free, but you can pay for extra (p
remium) features, virtual goods or other benefits. the word itself acquired negative connotations after big companies focused on creating games, the main purpose of which was to get as much money from the players as possible instead of delivering a fun experience. the worst cases were when you could use real money to pay for getting advantages over other players, or when they restricted access to the...
...stages of the game unless the players paid. the term "pay to win" was coined and this approach is disliked by many players and devs. if you want to implement iaps try to add value to the game with something players will enjoy instead of taking it out and then charging for it. add-ons and dlcs add-ons and downloadable content are a good way to provide extra value to an already released game, but
remember that you'll have to offer decent, entertaining content to attract people to buy it. a totally new set of levels with new characters, weapons and story is a good material for dlc, but to have enough sales the game itself has to be popular, or else there won't be any players interested in spending their hard earned money on it. advertisements instead of actively selling the games you can als...
...And 3 more matches
Unconventional controls - Game development
previous overview: control mechanisms having different control mechanisms in your game helps reach broader audiences. implementing mobile and desktop controls is recommended is a must, and gamepad controls add that extra experience. but imagine going even further — in this article we will explore various unconventional ways to control your web game, some more unconventional than others. ...
... the earliest demo of captain rogers: battle at andromeda was adjusted to work on a huge tv. ...
... the earliest demo of captain rogers: battle at andromeda was adjusted to work on a huge tv. interestingly enough, the first captain rogers game (asteroid belt of sirius) was optimized for low-end, small-screen, cheap smartphones running firefox os, so you can see the difference three years can make — you can read the whole story in our building games for firefox os tv hacks post. using a tv
remote to control the game ended up being surprisingly easy, because the events fired by the controller are emulating conventional keyboard keys. captain rogers had the keyboard controls implemented already: this.cursors = this.input.keyboard.createcursorkeys(); //... if(this.cursors.right.isdown) { // move player right } it works out of the box. the cursors are the four directional arrow keys ...
...And 3 more matches
Legacy layout methods - Learn web development
filling it with a simple html template, and inserting the below code into it at the appropriate places. at the bottom of the section you can see a live example of what the final code should look like. first of all, we need some content to put into our columns. replace whatever is inside the body currently with the following: <h1>2 column layout example</h1> <div> <h2>first column</h2> <p> lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lo
rem placerat vulputate. duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor imperdiet nunc, at ultricies tellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex ...
...ngue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius commodo et a urna. ut id ornare felis, eget fermentum sapien.</p> </div> <div> <h2>second column</h2> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lo
rem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu urna eget velit cursus viverra quis vestibulum sem. aliquam tincidunt eget purus in interdum. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> each one of the columns needs an outer element to contain its content and let us manipu...
...o act as a gutter between the two columns, giving the content some space to breathe. now we just need to float the columns, like so: div:nth-of-type(1) { width: 48%; float: left; } div:nth-of-type(2) { width: 48%; float: right; } putting this all together should give us a result like so: simple two-column layout <h1>2 column layout example</h1> <div> <h2>first column</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lo
rem placerat vulputate. duis felis orci, pulvinar id metus ut, rutrum luctus orci. cras porttitor imperdiet nunc, at ultricies tellus laoreet sit amet. sed auctor cursus massa at porta. integer ligula ipsum, tristique sit amet orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex ...
...And 3 more matches
Getting started with CSS - Learn web development
browsers display html content by default in pretty much the same way. however, you will often want something other than the choice the browser has made. this can be done by simply choosing the html element that you want to change, and using a css rule to change the way it looks. a good example is our <ul>, an unordered list. it has list bullets, and if i decide i don't want those bullets i can
remove them like so: li { list-style-type: none; } try adding this to your css now. the list-style-type property is a good property to look at on mdn to see which values are supported. take a look at the page for list-style-type and you will find an interactive example at the top of the page to try some different values in, then all allowable values are detailed further down the page. looking a...
... try adding this to your css now. the list-style-type property is a good property to look at on mdn to see which values are supported. take a look at the page for list-style-type and you will find an interactive example at the top of the page to try some different values in, then all allowable values are detailed further down the page. looking at that page you will discover that in addition to
removing the list bullets you can change them — try changing them to square bullets by using a value of square. adding a class so far we have styled elements based on their html element names. this works as long as you want all of the elements of that type in your document to look the same. most of the time that isn't the case and so you will need to find a way to select a subset of the elements ...
...depending on whether it is unvisited, visited, being hovered over, focused via the keyboard, or in the process of being clicked (activated). you can use css to target these different states — the css below styles unvisited links pink and visited links green. ...
...And 3 more matches
Getting started with HTML - Learn web development
class="playable-code" style="min-height: 100px;width: 95%"> this is my text. ...
...a link to your favorite website. add the <a> element. add the href attribute and the title attribute. specify the target attribute to open the link in the new tab. you'll be able to see your changes update live in the output area. you should see a link—that when hovered over—displays the value of the title attribute, and when clicked, navigates to the web address in the href attribute.
remember that you need to include a space between the element name, and between each attribute. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. playable code2 <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move fo...
..."code" class="input" style="min-height: 100px;width: 95%"> <p>a link to my favorite website.</p> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent...
...And 3 more matches
From object to iframe — other embedding technologies - Learn web development
a (tab inserts a tab character).</p> <textarea id="code" class="input" style="width: 95%;min-height: 100px;"> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.
...support iframes </a> </p> </iframe> this example includes the basic essentials needed to use an <iframe>: allowfullscreen if set, the <iframe> is able to be placed in fullscreen mode using the full screen api (somewhat beyond scope for this article.) frameborder if set to 1, this tells the browser to draw a border between this frame and other frames, which is the default behaviour. 0
removes the border. using this isn't really recommended any more, as the same effect can be better achieved using border: none; in your css. src this attribute, as with <video>/<img>, contains a path pointing to the url of the document to be embedded. width and height these attributes specify the width and height you want the iframe to be. fallback content in the same way as other similar eleme...
... never be too cautious. if the content is licensed, you must obey the license terms. for example, the content on mdn is licensed under cc-by-sa. that means, you must credit us properly when you quote our content, even if you make substantial changes. use https https is the encrypted version of http. you should serve your websites using https whenever possible: https reduces the chance that
remote content has been tampered with in transit, https prevents embedded content from accessing content in your parent document, and vice versa. using https requires a security certificate, which can be expensive (although let's encrypt makes things easier) — if you can't get one, you may serve your parent document with http. however, because of the second benefit of https above, no matter what...
...And 3 more matches
Solve common problems in your JavaScript code - Learn web development
style.color = 'red'; elem.style.color = 'red;' functions there are a number of things that can go wrong with functions. one of the most common errors is to declare the function, but not call it anywhere. ...
... in fact, some browsers (like firefox) will give you an error message in the developer console if you have code after a return statement. ...
...to see which one is bigger, or to see if one value is equal to another). strings how do you create a string in javascript? do you have to use single quotes or double quotes? how do you escape characters in strings? how do you join strings together? can you join strings and numbers together? how do you...
...And 3 more matches
Ember app structure and componentization - Learn web development
ture of our todomvc ember app, adding in the html for it, and then breaking that html structure into components. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be ext
remely beneficial, as ember makes heavy use of them. objective: to learn how to structure an ember app, and then break that structure into components. planning out the layout of the todomvc app in the last article we set up a new ember project, then added and configured our css styles. at this point we add some html, planning out the structure and semantics of our todomvc app.
...t, then added and configured our css styles. at this point we add some html, planning out the structure and semantics of our todomvc app. the landing page html of our application is defined in app/templates/application.hbs. this already exists, and its contents currently look like so: {{!-- the following component displays ember's default welcome message. --}} <welcomepage /> {{!-- feel free to
remove this! --}} {{outlet}} <welcomepage /> is a component provided by an ember addon that renders the default welcome page we saw in the previous article, when we first navigated to our server at localhost:4200. however, we don't want this. instead, we want it to contain the todomvc app structure. to start with, delete the contents of application.hbs and replace them with the following: <sect...
...el for="mark-all-complete">mark all as complete</label> <ul class="todo-list"> <li> <div class="view"> <input aria-label="toggle the completion of this todo" class="toggle" type="checkbox" > <label>buy movie tickets</label> <button type="button" class="destroy" title="
remove this todo" ></button> </div> <input autofocus class="edit" value="todo text"> </li> <li> <div class="view"> <input aria-label="toggle the completion of this todo" class="toggle" type="checkbox" > <label>go to movie</label> <button type="button" cla...
...And 3 more matches
Introduction to client-side frameworks - Learn web development
a new task, and delete a task; and it must do this while reliably tracking and updating the data underlying the application. in software development, this underlying data is known as state. each of our goals is theoretically simple in isolation. we can iterate over the data to render it; we can add to an object to make a new task; we can use an identifier to find, edit, or delete a task. when we
remember that the application has to let the user to do all of these things through the browser, however, some cracks start to show. the real problem is this: every time we change our application’s state, we need to update the ui to match. we can examine the difficulty of this problem by looking at just one feature of our todo list app: rendering a list of tasks. the verbosity of dom changes bui...
...yet, but it will later once we decide to implement our delete feature. ...
... later to style our list-items! working directly with the dom, as in this example, requires understanding many things about how the dom works: how to make elements; how to change their properties; how to put elements inside of each other; how to get them on the page. none of this code actually handles user interactions, or addresses adding or deleting a task. if we add those features, we have to
remember to update our ui in the right time and in the right way. javascript frameworks were created to make this kind of work a little easier — they exist to provide a better developer experience. they don't bring brand-new powers to javascript; they give you easier access to javascript's powers so you can build for today's web. if you want to see code samples from this section in action, you ca...
...And 3 more matches
Mozilla's Section 508 Compliance
the united states federal rehabilitation act's section 508 is a new standard for defining accessibility requi
rements for software and other electronic and information technology. part of section 508 (§1194.21) specifically relates to mozilla, and the ability of us government agencies to buy software that contains mozilla software components. here is a detailed list of section 508 bugs in mozilla's seamonkey application suite. some of them are fairly minor. the following is provided for informational purposes only and is not a legally binding voluntary product accessibility template (vpat). ...
...to mozilla, and the ability of us government agencies to buy software that contains mozilla software components. here is a detailed list of section 508 bugs in mozilla's seamonkey application suite. some of them are fairly minor. the following is provided for informational purposes only and is not a legally binding voluntary product accessibility template (vpat). ...
...re components. here is a detailed list of section 508 bugs in mozilla's seamonkey application suite. some of them are fairly minor. the following is provided for informational purposes only and is not a legally binding voluntary product accessibility template (vpat). here are the section 508 requi
rements and how far along mozilla seamonkey rv1.8a4 is with each one: requi
rement windows linux/unix mac os requi
rement windows linux/unix mac os (a) when software is designed to run on a system that has a keyboard, product functions shall be executable from a keyboard where the function itself or the result of performing a function can be discerned textually. ...
...And 3 more matches
Command line options
rofile may not be downwards compatible. adding this option bypasses downgrade protection. -createprofile profile_name create a new profile in the default directory, but do not start the application. the profile will be named profile_name in the profile manager, the profile_name must not contain spaces ( ). do not run profile_name while running an instance of the application, you can use the -no-
remote option to avoid connecting to a running instance. firefox -createprofile joeluser -createprofile "profile_name profile_dir" creates a new profile in the profile_dir directory, but do not start the application. the profile will be named profile_name in the profile manager. note profile_name and profile_dir are quoted together, and are separated by exactly 1 space (as with the previous synta...
...creates a new profile in the profile_dir directory, but do not start the application. the profile will be named profile_name in the profile manager. note profile_name and profile_dir are quoted together, and are separated by exactly 1 space (as with the previous syntax, profile_name must not contain spaces). do not run profile_dir while running an instance of the application. you can use the -no-
remote option to avoid connecting to a running instance. firefox -createprofile "joeluser c:\internet\joelusers-moz-profile" note: profile_dir must not exist and you must not already have a profile called profile_name. -migration start with import wizard. -new-instance open new instance, not a new window in running instance, which allows multiple copies of application to be open at a time. ...
...oelusers-moz-profile" note: profile_dir must not exist and you must not already have a profile called profile_name. -migration start with import wizard. -new-instance open new instance, not a new window in running instance, which allows multiple copies of application to be open at a time. firefox -new-instance -p "another profile" note: not available for windows, see bug 855899. -no-
remote do not accept or send
remote commands. implies -new-instance. firefox -no-
remote -p "another profile" note: since firefox 9, this does really mean what its name implies on all platforms, i.e. instances created with this parameter do not accept or send
remote commands, see bug 650078. that means that such instances won't be re-used. also when using this argument a new instance is created i...
...And 3 more matches
Performance
oat blood rains from the sky sendasyncmessage('my-addon:paragraph-count', {num: content.document.queryselectorall('p').length}) } addmessagelistener("my-addon:request-from-parent", onlyonceinabluemoon) better: // addon.js function ontoolbarbutton(event) { let tabmm = gbrowser.mcurrentbrowser.frameloader.messagemanager; let button = event.target; let callback = (message) => { tabmm.
removemessagelistener("my-addon:paragraph-count", callback) decoratebutton(button, message.data.num) } tabmm.addmessagelistener("my-addon:paragraph-count", callback); tabmm.loadframescript("data:,sendasyncmessage('my-addon:paragraph-count', {num: content.document.queryselectorall('p').length})", false) } function decoratebutton(button, count) { // do stuff with result } this executes t...
...it off and on will load to unload/reload events. not handling those properly can lead to duplicate or conflicting code execution, especially when messages are sent. it can also lead to conflicts between the old and new code. under some circumstances it may even cause exceptions when attempting to register something twice under the same id. ...
...lead to duplicate or conflicting code execution, especially when messages are sent. it can also lead to conflicts between the old and new code. under some circumstances it may even cause exceptions when attempting to register something twice under the same id. ...
...And 3 more matches
Browser API
appear like a top-level browser window to the embedded content. this means that window.top, window.parent, window.frameelement, etc. should not reflect the frame hierarchy. api extensions: the api includes several new methods and events to manipulate and listen for changes to the embedded content's state, interited by the htmliframeelement interface. browser api interfaces to support the requi
rement of a browser <iframe>, the htmliframeelement dom interface has been extended with new methods that give the <iframe> some super powers. navigation methods the following navigation methods allow navigation through the browsing history of the <iframe>. they are necessary to be able to implement back, forward, stop, and reload buttons. htmliframeelement.reload() allows reloading of the <ifr...
... audio playing in the browser <iframe>. htmliframeelement.getmuted() indicates whether the browser <iframe> is currently muted. event-related methods in order to manage the browser <iframe>'s content, many new events were added (see below). the following methods are used to deal with those events: the <iframe> gains support for the methods of the eventtarget interface addeventlistener(),
removeeventlistener(), and dispatchevent(). htmliframeelement.sendmouseevent() sends a mouseevent to the <iframe>'s content. utility methods last, there are some utility methods, useful for apps that host a browser <iframe>. htmliframeelement.getstructureddata() retrieves any structured microdata (and hcard and hcalendar microformat data) contained in the html loaded in the browser <iframe> ...
...iframeelement.sendmouseevent() sends a mouseevent to the <iframe>'s content. utility methods last, there are some utility methods, useful for apps that host a browser <iframe>. htmliframeelement.getstructureddata() retrieves any structured microdata (and hcard and hcalendar microformat data) contained in the html loaded in the browser <iframe> and returns it as json. ...
...And 3 more matches
Extending a Protocol
e file's name and the protocol name must match. include protocol pwindowglobal; namespace mozilla { namespace dom { async refcounted protocol pecho { manager pwindowglobal; parent: async echo(nscstring data) returns (nscstring aresult); async __delete__(); }; } // namespace dom } // namespace mozilla now, edit "./dom/ipc/moz.build" file and add 'pecho.ipdl', to the ipdl_sources array.
remember that it needs to be in alphabetical order or it won't compile. breaking it down: include protocol pwindowglobal; - we include pwindowglobal, because it's going to manage the protocol for us. async refcounted protocol pecho {....} - this protocol is "async", meaning we are going to use mozpromises. it's also "refcounted", meaning it we can use refptr<> for instances that can be cycle co...
...(echochild, final) public: explicit echochild(); protected: void actordestroy(actordestroyreason awhy) override; // we get sendecho(nscstring& astring) from the superclass. private: ~echochild() = default; bool mactoralive; }; } // end of namespace dom } // end of namespace mozilla and add the echochild.h to dom/ipc/moz.build, as part of the exports.mozilla.dom array. again,
remember that this must be in alphabetical order! compiling this will now complain: "fatal error: 'mozilla/dom/echoparent.h' file not found", so let's define echoparent.h. defining echoparent.h like before, create ./dom/ipc/echoparent.h, and code it as follows - the inline comments describe what's going on. note the recvecho(), we finally get to define where a message is received, yay!: #ifndef...
... echoparent::echoresolver&& aresolver); mozilla::ipc::ipcresult recv__delete__() override; void actordestroy(actordestroyreason awhy) override; private: ~echoparent() = default; bool mactoralive; }; } // end of namespace dom } // end of namespace mozilla #endif now, and add the echoparent.h to dom/ipc/moz.build, as part of the exports.mozilla.dom array. again,
remember that this must be in alphabetical order! ok, if we now try to compile, it should complain that "error: no member named 'allocpechoparent' in 'mozilla::dom::windowglobalparent'". this is part of windowglobalparent managing our protocol for us. so let's add that. defining windowglobalparent's alloc/deallocpechoparent() open up dom/ipc/windowglobalparent.h and we are going to add two things...
...And 3 more matches
IPDL Tutorial
he type name. then you can pass a mozilla::maybe object instead of a concrete value. protocol pmaybe { child: async maybe(nscstring? maybe); }; custom primitive types when you need to send data of a type other than one built into ipdl, you can add a using declaration in an ipdl specification. a custom serializer and deserializer must be provided by your c++ code. using mozilla::plugins::np
remoteevent; sync protocol pplugininstance { child: async handleevent(np
remoteevent); }; unions ipdl has built-in support for declaring discriminated unions. using struct mozilla::void_t from "ipc/ipcmessageutils.h"; union variant { void_t; bool; int; double; nscstring; ppluginscriptableobject; }; this union generates a c++ interface which includes the following: struct variant ...
... to initialize a union, simply assign a valid value to it, as follows: avariant = false; structs ipdl has built-in support for arbitrary collections of serializable data types. struct namevaluepair { nscstring name; nscstring value; }; in implementation code, these structs can be created and used like so: namevaluepair entry(astring, ano...
...protocol pplugininstance { child: sync init() returns (bool windowless, bool ok); }; the generated c++ code for this method uses outparam pointers for the returned values: class pplugininstanceparent { ... bool sendinit(bool* windowless, bool* ok) { ... }; }; class pplugininstancechild { ... virtual bool recvinit(bool* windowless, bool* ok) = 0; } rpc semantics "rpc" stands for "
remote procedure call," and this third semantics models procedure call semantics. a quick summary of the difference between rpc and sync semantics is that rpc allows "re-entrant" message handlers: while an actor is blocked waiting for an "answer" to an rpc "call", it can be unblocked to handle a new, incoming rpc call. in the example protocol below, the child actor offers a "callmecallyou()" rpc int...
...And 3 more matches
PopupNotifications.jsm
imported the module, you can then use the popupnotifications object it exports; this object provides methods for creating and displaying popup notification panels. note: this code module is imported by firefox chrome windows, so you don't have to do it yourself in most extensions. method overview void locationchange(); notification getnotification(id, browser); void
remove(notification); notification show(browser, id, message, anchorid, mainaction, secondaryactions, options); properties attribute type description ispanelopen boolean returns true if the notification panel is currently visible, false if it is not. methods locationchange() the consumer can call this method to let the popup notification module ...
...th the browser/id pair. notification getnotification( string id xulelement browser ); parameters id the notification id to search for. browser the xul <xul:browser> element whose notifications should be searched. if null, the currently selected <xul:browser>'s notifications will be searched. return value the corresponding notification object, or null if no such notification exists.
remove()
removes the specified notification. void
remove( notification notification ); parameters notification the notification object representing the notification to
remove. show() adds a new popup notification, displaying it to the user. notification show( browser, id, message, anchorid, mainaction, secondaryactions, options ); parameters browser the xul <xul:brow...
...ay manually dismiss the notification, however. for most use cases, the value of this parameter should be date.now() plus an offset indicating the amount of time the notification should be kept open (for example, date.now() + 30000 for 30 seconds). persistwhilevisible a boolean value indicating whether or not the notification should persist across location changes. if true, the notification will
remain visible even if the browser navigates to a different location. dismissed a boolean value indicating whether or not the notification should be added as a dismissed notification. dismissed notifications can be activated by clicking on their anchor. this lets you create a notification that will appear when the user clicks the anchor. eventcallback a javascript function to be invoked when the ...
...And 3 more matches
Localizing with Mercurial
localizing current versions of firefox, thunderbird and seamonkey includes working with mercurial. if the documentation is incomplete or you have questions, please drop by the #l10n or #hg channels on irc.mozilla.org. ...
...m comm-central, mozilla-central and the other appropriate locations and apply those changes in your working copy. to update your local l10n repo after your first clone, run this command from your local l10n directory: hg pull -u creating l10n patches another thing you can do with hg without needing account priviledges is creating l10n patches of your work for someone else to commit to your
remote l10n repo on the mozilla servers. doing this ensures that your dashboards are always accurate, as they look at your
remote repo. here's how to create a l10n patch with hg and the mq extension: enable mq by adding hg.ext = to your mercurial config file (~/.hgrc on unix-like systems or mercurial.ini on windows) under the [extensions] section. open your command line tool and navigate to you...
.... the commit message should take the form of "bug 123456 - change this thing to work better by doing something; r=reviewers" if you are to fix a bug. make your change. once you finish making your change, run hg qrefresh to commit your changes to the patch. navigate to your <repository>/.hg/patches to find your .patch. you may repeat from step 4 to create another patch. your patches will be inc
remental, i.e. new patches are created based on old patches. if you want to commit all the patches to the repository and cleanup the patch queue, run hg qfinish. please refer to mqtutorial and mq documentation for further uses of mq extension to manage patches. mercurial account priviledges eventually, you or your team leader will need hg account priviledges. let's face it, it's just more conveni...
...And 3 more matches
Mozilla DOM Hacking Guide
sinfo nsdomgenericsh; another example is nswindowsh, which inherits from nseventreceiversh, thus inheriting from nsdomclassinfo. each dom class is mapped to its helper class during the initialization of the sclassinfodata array. each helper class has a public docreate member function that is called by getclassinfoinstance (see also section 1.6) to create a new instance of the class if needed.
remember that the docreate member function is called through a pointer to a function named mconstructorfptr, a member of the nsdomclassinfodata struct. an instance of a helper class is created the first time xpconnect needs access to the flattened set of interfaces of an object. the instance is then cached for further use. most of the helper classes implement one or more nsixpcscriptable methods. th...
... static nsresult wrapnative(...): xpconnect fu, not our problem. static nsresult throwjsexception(jscontext *cx, nsresult aresult);: help me! static nsresult initdomjsclass(jscontext *cx, jsobject *obj);: help me! static jsclass sdomjsclass;: help me! protected section: const nsdomclassinfodata* mdata;: help me! static nsresult init(): called only once, it is used to initialize the
remaining members of the nsdomclassinfodata structure, as mentioned above. once called, init() sets sisinitialized to true, to
remember that the initialization has been performed. the implementation is described in section 1.5. static nsresult registerclassname(print32 adomclassinfoid): help me! static nsresult registerclassprotos(print32 adomclassinfoid): help me! static nsresult registerexternal...
...pconnect. then the script security manager (ssecman) is initialized. getsafejscontext() grabs us a cool js context to run our javascript code in. the part about componentregistrar is designed to allow external modules (in this case xpath) to be included in domclassinfo and as such benefit from the javascript benefits it provides. after that, we fill the blanks in the sclassinfodata array. if you
remember the discussion in the introduction to class info, there is the main array, sclassinfodata, filled with objects of type nsdomclassinfodata. however when the array is created, three data members of the structure are left as null pointers: mcachedclassinfo, mprotochaininterface, and minterfaces. init() uses a set of macros to fill the blanks: the dom_classinfo_map family. each dom class needs t...
...And 3 more matches
Mozilla Quirks Mode Behavior
hat exist between mozilla's standards mode and quirks mode behavior. miscellaneous & style all of the style rules in layout/style/res/quirk.css apply only in quirks mode: orphaned li has an inside bullet (bug 1049). add padding if the very first node in an li is another ul or ol (bug 98636). obsolete since gecko 50 list bullets do not inherit the font size of the list (bug 97351).
removed in firefox 50 (bug 648331). don't inherit font properties into tables except for font-family. make table borders gray rather than using the foreground color. collapse top margin of body and td and bottom margin of td. collapse the bottom or top margins of empty elements (bug 97361). support <pre wrap>, <pre cols>, <pre width>. orphaned dd has generated content :before instea...
...ves a content-type header other than text/css. the css parser accepts colors not beginning with #, except in shorthands. the css parser interprets unitless numbers as px (except for line-height and any other properties where they have distinct meaning, and except in shorthands). in quirks mode, the css parser allows {} around the contents of style attributes (bug 99554). this behavior is being
removed in firefox 27, for interoperability. (bug 915053) an empty string for the background attribute sets the background url to empty only in quirks mode. the topmargin, bottommargin, leftmargin, and rightmargin attributes on body are supported only in quirks mode (bug 9258). obsolete since gecko 35 (firefox 35.0 / thunderbird 35.0 / seamonkey 2.32) (bug 95530) this quirk is now html5 conform a...
... when written in june 2001, but no longer appears accurate. should look into tablequirkcolorrule, re-describe, and figure out when it changed.] obsolete since gecko 37 the empty-cells property defaulted to hide in quirks mode but show (according to css2.1) in standards mode (see bug 33244) (though the correct fix would be to specify it on the html table element in quirk.css). this quirk has been
removed in firefox 37 and empty-cells also defaults to show in quirks mode (bug 1020400). in quirks mode floated tables never move to the next "line" if they don't fit next to other floats, they just keep widening the page (see bug 43086). to correspond, their width is computed as though only the
remaining available space is the containing block width (bug 99461). in quirks mode colspan="0" and ro...
...And 3 more matches
Performance
memory about:memory is the easiest-to-use tool for measuring memory usage in mozilla code, and is the best place to start. it also lets you do other memory-related operations like trigger gc and cc, dump gc & cc logs, and dump dmd reports. about:memory is built on top of firefox's memory reporting infrastructure. dmd dmd is a tool that identifies shortcomings in about:memory's measu
rements, and can also do multiple kinds of general heap profiling. are we slim yet areweslimyet.com (a.k.a. awsy) is a memory usage and regression tracker. bloatview bloatview prints per-class statistics on allocations and refcounts, and provides gross numbers on the amount of memory being leaked broken down by class. it is used as part of mozilla's continuous integration testing.
...eristic. see also the documentation on leak-hunting strategies and tips. profiling and performance tools profiling with the developer tools profiler the profiler built into the developer tools has a high-level waterfall, detailed call tree, allocations and gc profiling, and flame graphs. it is available on all platforms and release channels, and also supports
remote profiling b2g and fennec. profiling with the firefox profiler the firefox profiler is a good tool to start with, particularly for understanding where time is spent within c++ code in firefox. profiling with instruments how to use apple's instruments tool to profile mozilla code. profiling with xperf how to use microsoft's xperf tool to profile mozilla ...
... instruments tool to profile mozilla code. profiling with xperf how to use microsoft's xperf tool to profile mozilla code. profiling with concurrency visualizer how to use visual studio's concurrency visualizer tool to profile mozilla code. ...
...And 3 more matches
NSS 3.12.4 release notes
ces (nss) 3.12.4 is a patch release for nss 3.12. the bug fixes in nss 3.12.4 are described in the "bugs fixed" section below. nss 3.12.4 is tri-licensed under the mpl 1.1/gpl 2.0/lgpl 2.1. distribution information this release is built from the source, at the cvs repository rooted at cvs.mozilla.org:/cvsroot, with the cvs tag nss_3_12_4_rtm. nss 3.12.4 requires nspr 4.8. this is not a hard requi
rement. our qa tested nss 3.12.4 with nspr 4.8, but it should work with nspr 4.7.1 or later. you can check out the source from cvs by cvs co -r nspr_4_8_rtm nspr cvs co -r nss_3_12_4_rtm nss see the documentation section for the build instructions. nss 3.12.4 source is also available on ftp.mozilla.org for secure https download: source tarball: https://ftp.mozilla.org/pub/mozilla.org/security/nss...
...n, where only \ and ] require escaping. new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75. obsolete code for win16 has been
removed. support for openvms has been
removed. bugs fixed the following bugs have been fixed in nss 3.12.4. bug 321755: implement crldistributionpoint extension in libpkix bug 391434: avoid multiple encoding/decoding of pkix_pl_oid to and from ascii string bug 405297: problems building nss/lib/ckfw/capi/ with mingw gcc bug 420991: libpkix returns wrong nss error code bug 427135: add super-h (sh3,...
...bug 488396: dbm needs to be fips certifiable. bug 488550: crash in certutil or pp when printing cert wi...
...And 3 more matches
NSS 3.35 release notes
leformatsql added formally verified implementations of non-vectorized chacha20 and non-vectorized poly1305 64-bit. for stronger security, when creating encrypted pkcs#7 or pkcs#12 data, the iteration count for the password based encryption algorithm has been increased to one million iterations. note that debug builds will use a lower count, for better performance in test environments. ...
...hat debug builds will use a lower count, for better performance in test environments. as a
reminder, debug builds should not be used for production purposes. nss 3.30 had introduced a regression, preventing nss from reading some aes encrypted data, produced by older versions of nss. nss 3.35 fixes this regression and restores the ability to read affected data. ...
...tionsetdefault and ssl_optiongetdefault have been modified, to take a printn argument rather than prbool. this makes it clearer, that options can have values other than 0 or 1. note this does not affect abi compatibility, because prbool is a typedef for printn. experimental apis and functionality the functionality and the apis listed in this section are experimental. any of these apis may be
removed from future nss versions. applications must not rely on these apis to be present. if an application is linked at runtime to a later version of nss, which no longer provides any of these apis, the application must handle the scenario gracefully. in order to ease transitions, experimental functions return secfailure and set the ssl_error_unsupported_experimental_api code if the selected api is...
...And 3 more matches
NSS functions
later cert_filtercertlistbycanames mxr 3.4 and later cert_filtercertlistbyusage mxr 3.4 and later cert_filtercertlistforusercerts mxr 3.6 and later cert_findcertbydercert mxr 3.2 and later cert_findcertbyissuerandsn mxr 3.2 and later cert_findcertbynickname mxr 3.2 and later cert_findcertbynicknameo
remailaddr mxr 3.2 and later cert_findcertbysubjectkeyid mxr 3.7 and later cert_findcertextension mxr 3.4 and later cert_findcertissuer mxr 3.3 and later cert_findkeyusageextension mxr 3.4 and later cert_findsmimeprofile mxr 3.2 and later cert_findsubjectkeyidextension mxr 3.7 and later cert_findu...
... cert_nametoascii mxr 3.2 and later cert_newcertlist mxr 3.2 and later cert_newtempcertificate mxr 3.12 and later cert_nicknamestringsfromcertlist mxr 3.4 and later cert_opencertdbfilename mxr 3.2 and later cert_ocspcachesettings mxr 3.11.7 and later cert_pkixverifycert mxr 3.12 and later cert_
removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsloptime mxr 3.2 and later cert_setocspfailu
remode mxr 3.11.7 and later cert_setocsptimeout mxr 3.12 and later cert_setusepkixforvalidation mxr 3.12 and later cert_sta...
...updated 3.8 with new options. see bug 215186 pk11_listfixedkeysinslot mxr 3.4 a...
...And 3 more matches
Bytecode Descriptions
the enumerable properties of val. implements: forin/ofheadevaluation step 6, enumerateobjectproperties. (the spec refers to an "iterator object" with a next method, but notes that it "is never directly accessible" to scripts. the object we use for this has no public methods.) if val is null or undefined, this pushes an empty iterator. the iter object pushed by this instruction must not be used or
removed from the stack except by jsop::moreiter and jsop::enditer, or by error handling. the script's jsscript::trynotes() must mark the body of the for-in loop, i.e. exactly those instructions that begin executing with iter on the stack, starting with the next instruction (always jsop::loophead). code must not jump into or out of this region: control can enter only by executing jsop::iter and can ex...
...implements: arrayaccumulation, the third algorithm, step 4, in the common case where nextindex is known. format: jof_elem, jof_propinit, jof_ic initeleminc stack: array, index, val ⇒ array, (index + 1) initialize an array element array[index++] with value val. val may be magicvalue(js_elements_hole). if it is, no element is defined, but the array length and the stack value index are still inc
remented. this never calls setters or proxy traps. array must be an array object created by jsop::newarray and never used except by jsop::initelemarray and jsop::initeleminc. index must be an integer, 0 <= index <= int32_max. if index is int32_max, this throws a rangeerror. this instruction is used when an array literal contains a spreadelement. in [a, ...b, c], initelemarray 0 is used to put a into ...
... must be an integer, 0 <= index <= int32_max. if index is int32_max, this throws a rangeerror. this instruction is used when an array literal contains a spreadelement. in [a, ...b, c], initelemarray 0 is used to put a into the array, but initeleminc is used for the elements of b and for c. implements: several steps in arrayaccumulation that call createdataproperty, set the array length, and/or inc
rement nextindex. format: jof_elem, jof_propinit, jof_ic hole stack: ⇒ hole push magicvalue(js_elements_hole), representing an elision in an array literal (like the missing property 0 in the array [, 1]). this magic value must be used only by jsop::initelemarray or jsop::initeleminc. newarraycopyonwrite operands: (uint32_t objectindex) stack: ⇒ array create and push a new array that shares ...
...And 3 more matches
JSClass.flags
hat the mark hook implements the new jstraceop signature instead of the old jsmarkop signature. this is recommended for all new code that needs custom marking. spidermonkey reserves a few other flags for its internal use. they are jsclass_is_anonymous, jsclass_is_global, jsclass_is_proxy, and jsclass_has_cached_proto. jsapi applications should not use these flags. ...
...ature instead of the old jsmarkop signature. this is recommended for all new code that needs custom marking. spidermonkey reserves a few other flags for its internal use. they are jsclass_is_anonymous, jsclass_is_global, jsclass_is_proxy, and jsclass_has_cached_proto. jsapi applications should not use these flags. ...
...e. this is recommended for all new code that needs custom marking. spidermonkey reserves a few other flags for its internal use. they are jsclass_is_anonymous, jsclass_is_global, jsclass_is_proxy, and jsclass_has_cached_proto. jsapi applications should not use these flags. ...
...And 3 more matches
JSPrincipals
rray void * (*)(jscontext *, jsprincipals *) pointer to the function that returns an array of principal definitions. obsolete since jsapi 12 globalprivilegesenabled jsbool (*)(jscontext *, jsprincipals *) flag indicating whether principals are enabled globally. obsolete since jsapi 12 destroy void (*)(jscontext *, jsprincipals *) pointer to the function that dec
rements the reference count and possibly frees the principals if they are no longer in use. obsolete since jsapi 13 methods name description void dump() this is not defined by the js engine but should be provided by the embedding. added in spidermonkey 17 description jsprincipals is the abstract base class of all principals objects, the objects that identify th...
... used to determine its privileges. a principals object is like a java codesource. jsprincipals could be passed into the js engine through the js_newglobalobject function. jsprincipals has refcount property that is the reference count. this is used for memory management. each time an object is referenced, refcount must be increased by one. each time an object is dereferenced, refcount must be dec
remented by one. when refcount reaches zero, the principals are no longer in use and are destroyed. use the js_holdprincipals to inc
rement refcount, and use js_dropprincipals to dec
rement refcount. obsolete. the data content of a principals object is defined by the application, which creates instances of jsprincipals, initializes their refcount fields to 1, and passes them into the engine through ...
...eract. getprincipalarray is a pointer to the function that retrieves the principals for this object or script. globalprivilegesenabled is a flag that indicates whether principals are enabled globally. refcount is the reference count. this is used for memory management. each time an object is referenced, refcount must be increased by one. ...
...And 3 more matches
JS_AddFinalizeCallback
cb jsfinalizecallback pointer to the new callback function to use. data void * passed to data parameter for jsfinalizecallback. ...
... cb jsfinalizecallback pointer to the new callback function to use. data void * passed to data parameter for jsfinalizecallback. ...
... name description jsfinalize_group_start called when preparing to sweep a group of compartments, before anything has been swept. the collector will not yield to the mutator before calling the callback with jsfinalize_group_end status. jsfinalize_group_end called when preparing to sweep a group of compartments. weak references to unmarked things have been
removed and things that are not swept inc
rementally have been finalized at this point. the collector may yield to the mutator after this point. jsfinalize_collection_end called at the end of collection when everything has been swept. description js_addfinalizecallback add a callback function which the garbage collector calls at several points during garbage collection. rt is the r...
...And 3 more matches
JS_Add*Root
try to avoid using it. register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection. these functions are obsoleted, use js::persistentrooted instead. ...
...the name of the new root, or null. description the js_add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable. ...
...note that this means that if the root is meant to live past the end of a function, the address of a local (stack-based) variable may not be used for rp. ...
...And 3 more matches
Avoiding leaks in JavaScript XPCOM components
concepts, and second by describing a number of common javascript patterns that cause leaks. basics of memory management creating objects that are not a fixed size for the lifetime of the program (global variables) or a fixed size for the lifetime of a function (stack variables) requires a system for dynamic memory allocation: a system that allocates memory from a space called the heap. the requi
rements for such a memory allocation system are: memory should be returned to the heap when the program no longer needs it (or soon thereafter) so that the amount of memory consumed by the program does not increase. programs should not dereference pointers pointing to memory that has been returned to the heap (and potentially reused). meeting both requi
rements at the same time can be tricky. ma...
...ntial for crashes just like malloc and free). the potential causes of leaks with garbage collection (the next strategy) also apply to reference counting as well. garbage collection garbage collection is generally used to refer to algorithms that (1) determine which objects are still needed by starting from a set of roots and finding all objects reachable from those objects and (2) returning all
remaining objects to the heap. the roots include things like global variables and variables on the current call stack. mozilla's javascript engine uses one of the most common garbage collection algorithms, mark and sweep, in which the garbage collector clears the mark bit on each object, sets the mark bits on all roots and all objects reachable from them, and then finalizes all objects not marked and...
... when the term is not used to refer to lesser algorithms like reference counting) is pretty good at freeing memory that should be freed. however, in a fully garbage-collected system the programmer can still create leaks by leaving objects reachable that are no longer needed. for example, if an object's constructor adds the object to a list that is reachable from a global variable and nothing ever
removes it from the list, the object will never be destroyed since it is always reachable from the list. memory management in xpcom and javascript javascript code that uses xpcom through xpconnect uses two different memory management models. javascript uses garbage collection. xpcom uses reference counting. authors of javascript code that uses xpcom objects can't depend on all of the benefits of ga...
...And 3 more matches
nsIDOMElement
ring namespaceuri, in domstring localname); domstring getattributens(in domstring namespaceuri, in domstring localname); nsidomnodelist getelementsbytagname(in domstring name); nsidomnodelist getelementsbytagnamens(in domstring namespaceuri, in domstring localname); boolean hasattribute(in domstring name); boolean hasattributens(in domstring namespaceuri, in domstring localname); void
removeattribute(in domstring name) nsidomattr
removeattributenode(in nsidomattr oldattr) void
removeattributens(in domstring namespaceuri, in domstring localname) void setattribute(in domstring name, in domstring value) nsidomattr setattributenode(in nsidomattr newattr) nsidomattr setattributenodens(in nsidomattr newattr) void setattributens(in domstring namespaceuri, in domstring qualifi...
...tring name ); parameters name attribute name return value a boolean, true if the given attribute is set. hasattributens() check if the element for a given namespace have this attribute set. boolean hasattributens( in domstring namespaceuri, in domstring localname ); parameters namespaceuri namespace uri localname attribute name return value a boolean, true if the given attribute is set. ...
...ameters name attribute name return value a boolean, true if the given attribute is set. hasattributens() check if the element for a given namespace have this attribute set. boolean hasattributens( in domstring namespaceuri, in domstring localname ); parameters namespaceuri namespace uri localname attribute name return value a boolean, true if the given attribute is set.
removeattribute()
remove an attribute. ...
...And 3 more matches
nsIDOMMozNetworkStatsManager
val end, [optional] in jsval options /* networkstatsgetoptions */); nsidomdomrequest addalarm(in nsisupports network, in long threshold, [optional] in jsval options /* networkstatsalarmoptions */); nsidomdomrequest getallalarms([optional] in nsisupports network); nsidomdomrequest
removealarms([optional] in long alarmid); nsidomdomrequest clearstats(in nsisupports network); nsidomdomrequest clearallstats(); nsidomdomrequest getavailablenetworks(); nsidomdomrequest getavailableservicetypes(); attributes attribute type description samplerate long minimum time in milliseconds between samples stored in the d...
... statistics. the query may be filtered by connection type and date. nsidomdomrequest getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); parameters network the origin of the data. it can specify wifi, mobile, or null. if null, data measu
rement from both origins are merged. to know in advance which kind of origin is available, the moznetworkstatsmanager.getavailablenetworks method returns an array of interfaces. start a date object representing the beginning of data measu
rement. end a date object representing the end of data measu
rement. options optional filtering options. networkstatsgetoptions is a dictionary object providin...
...alarm" system message is sent to the application, where the optional parameter data must be a cloneable object. nsidomdomrequest addalarm(in nsisupports network, in long threshold, [optional] in jsval options /* networkstatsalarmoptions */); parameters network the origin of the data. it can specify wifi, mobile, or null. if null, data measu
rement from both origins are merged. to know in advance which kind of origin is available, the moznetworkstatsmanager.getavailablenetworks method returns an array of interfaces. threshold the total data usage threshold in bytes. options optional filtering options. networkstatsalarmoptions is a dictionary object providing filtering options. return value an nsidomdomrequest object. if successfu...
...And 3 more matches
nsIHttpServer
ihttpserverstoppedcallback callback); /** * associates the local file represented by the string file with all requests * which match request. * * @param path * the path which is to be mapped to the given file; must begin with "/" and * be a valid uri path (i.e., no query string, hash reference, etc.) * @param file * the file to serve for the given path, or null to
remove any mapping that * might exist; this file must exist for the lifetime of the server */ void registerfile(in string path, in nsifile file); /** * registers a custom path handler. * * @param path * the path on the server (beginning with a "/") which is to be handled by * handler; this path must not include a query string or hash component; it * also should us...
... * * @param prefi...
...x handler. * * @param prefix * the path on the server (beginning and ending with "/") which is to be * handled by handler; this path must not include a query string or hash * component. all requests that start with this prefix will be directed to * the given handler. ...
...And 3 more matches
nsIIdleService
ions exist for windows, mac os x, and linux (via xscreensaver). implemented by: @mozilla.org/widget/idleservice;1. to create an instance, use: var idleservice = components.classes["@mozilla.org/widget/idleservice;1"] .getservice(components.interfaces.nsiidleservice); method overview void addidleobserver(in nsiobserver observer, in unsigned long time); void
removeidleobserver(in nsiobserver observer, in unsigned long time); attributes attribute type description idletime unsigned long the amount of time in milliseconds that has passed since the last user activity. can be 0 if there is no valid idle time to report (this can happen if the user never interacted with the browser at all, and if we are unable to poll for i...
... gecko 16 and later. you can add the same observer twice. most implementations need to poll the os for idle info themselves, meaning your notifications could arrive with a delay up to the length of the polling interval in that implementation. current implementations use a delay of 5 seconds. ...
...otification sent out if the user
remains idle for an extended period: 'idle-daily'. the data parameter for the notification contains the current user idle time. void addidleobserver( in nsiobserver observer, in unsigned long time ); parameters observer the nsiobserver to be notified. time the amount of time in seconds the user should be idle before the observer should be notified.
removeidleobserver()
remove an observer registered with addidleobserver(). note:
removing an observer will
remove it once, for the idle time you specify. if you have added an observer multiple times, you will need to
remove it just as many times. void
removeidleobserver( in nsiobserver observer, in unsigned long time ); parameters observer the nsiobserver to be
removed. time the amount...
...And 3 more matches
nsILoginManager
note: default values for the nsiloginmetainfo ...
... note: default values for the nsiloginmetainfo properties are created if the spe...
...gindata is a nsilogininfo, all of the old login's nsilogininfo properties are changed to the values from newlogindata (but the old login's nsiloginmetainfo properties are unmodified). if newlogindata is a nsipropertybag, only the specified properties will be changed. the nsiloginmetainfo properties of oldlogin can be changed in this manner. ...
...And 3 more matches
nsIMsgDatabase
rtdate, in prtime enddate, in nsmsgkeyarrayptr markedids); native code only! void deletemessages(in nsmsgkeyarrayptr nsmsgkeys, in nsidbchangelistener instigator); native code only! ...
... void listallofflinedeletes(in nsmsgkeyarrayptr offlinedeletes); native code only! void listallofflinemsgs(in nsmsgkeyarrayptr offlinemsgs); native code only! void setattributesonpendinghdr(in nsimsgdbhdr pendinghdr, in st...
...s opened), but the summary file is missing. forcefolderdbclosed() void forcefolderdbclosed(in nsimsgfolder afolder); parameters afolder close() void close(in boolean aforcecommit); parameters aforcecommit commit() void commit(in nsmsgdbcommit committype); parameters committype forceclosed() force closed is evil, and we should see if we can do without it. in 4.x, it was mainly used to
remove corrupted databases. void forceclosed(); clearcachedhdrs() void clearcachedhdrs(); resethdrcachesize() void resethdrcachesize(in unsigned long size); getmsghdrforkey() nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); parameters key getmsghdrformessageid() nsimsgdbhdr getmsghdrformessageid(in string messageid); parameters messageid containskey() returns whether or not this database c...
...And 3 more matches
nsIMsgIncomingServer
in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue); astring getunicharattribute(in string name); astring getunicharvalue(in string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in acstring oldname, in acstring newname); void performbiff(in nsimsgwindow amsgwindow); void performexpand(in nsimsgwindow amsgwindow); void
removefiles(); void setboolattribute(in string name, in boolean value); void setboolvalue(in string attr, in boolean value); void setcharattribute(in string name, in acstring value); void setcharvalue(in string attr, in acstring value); void setdefaultlocalpath(in nsilocalfile adefaultlocalpath); void setfilevalue(in string relpref, in string abspref, in nsilocalfile avalue); void setfi...
... storepassword(); astring tostring(); void writetofoldercache(in nsimsgfoldercache foldercache); attributes attribute type description accountmanagerchrome astring read only. biffminutes long biffstate unsigned long canbedefaultserver boolean read only. cancompactfoldersonserver boolean read only. cancreatefoldersonserver boolean candelete boolean can this server be
removed from the account manager? for instance, local mail is not
removable, but an imported folder is. canemptytrashonexit boolean read only. canfilemessagesonserver boolean canhavefilters boolean read only. cansearchmessages boolean read only. canundodeleteonserver boolean read only. constructedprettyname astring helper function to construct the pretty name in a server type specific w...
...ber variable. read only. performingbiff boolean port long prettyname astring pretty name - should be "userid on hostname" if the pref is not set. realhostname acstring real hostname of the server (if server name is changed it is stored here) realusername acstring real username of the server (if username is changed it is stored here) redirectortype string obsolete since gecko 1.9
rememberpassword boolean retentionsettings nsimsgretentionsettings rootfolder nsimsgfolder rootmsgfolder nsimsgfolder read only. searchscope nsmsgsearchscopevalue read only. serverbusy boolean serverrequirespasswordforbiff boolean read only. serveruri acstring read only. sockettype long spamfilterplugin nsimsgfilterplugin read only. spamsettings nsispamsettings spam setti...
...And 3 more matches
nsINavHistoryContainerResultNode
yresultnode getchild(in unsigned long aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false. read only. ...
...read-only. containeropen boolean set this to true to allow descent into this container. when closed, attempting to call getchild() or access childcount results in an error. when you're done reading the container's children, set this to false. ...
...read-only. containeropen boolean set this to true to allow descent into this container. when closed, attempting to call getchild() or access childcount results in an error. when you're done reading the container's children, set this to false. for host and day groupings, doing this has no performance cost since the children have already been computed. ...
...And 3 more matches
nsITextInputProcessor
true if it has composition. read only. constants constant value ...
...rameters aoffset caret offset in the composition string. this value must be between 0 and the length of astring of setpendingcompositionstring(). setpendingcompositionstring() sets pending composition string. this must be called before every call of flushpendingcomposition(). void setpendingcompositionstring(in astring astring); parameters astring new pending composition string. ...
...if this is null, the instance stops sharing modifier state with other instances and clears all modifier state. startcomposition() this starts composition explicitly. ...
...And 3 more matches
Reference Manual
the work of being an owning reference can be done in the constructor, destructor, and assignment operators of nscomptr. whenever you `point' the nscomptr at a different xpcom object (by assignment or initialization), it must release its old value, if any, and addref the new. at its own destructor time it must release as well. nscomptr only does exactly the work you would have done, if you always
remembered to do the right thing. safety features type safeguards it is an invariant of nscomptr that it holds the xpcom-correct interface pointer for it's underlying type. for example, an nscomptr<nsifoo> will always hold the pointer that would be returned by queryinterface, when querying an xpcom object for its nsifoo interface. in debug builds, if you subvert this invariant with one of the assignm...
...h the dont_addref directive or a synonym any interface pointer (either nscomptr or a raw xpcom interface pointer) of any type, annotated with the do_queryinterface directive a do_queryreferent directive the first three of these are simple and obvious. the fourth (applying the dont_queryinterface directive) is a synonym for just assigning in a raw xpcom interface pointer of the same type. the
remaining directives provide some additional control in special situations. additionally, you can construct an nscomptr without supplying an initial value, in which case it is initialized to 0. just like a primitive pointer, an nscomptr with the value 0 points to no object, and can be tested with expressions like if (foo) and if (!foo). the directives mentioned above may make more sense in this table...
...rface(abarptr, &rv); nscomptr<t> = dont_addref( t* ), nscomptr<t> = getter_addrefs( t* ) sometimes, you happen to have a pointer lying around that's already addrefed, but you want to put it into an nscomptr. this often happens with getters that return the addrefed pointer as their result (rather than an nsresult); or in the efficiency transformations. dont_addref is the perfect
remedy to situations like this. nsifoo* temp; nsresult rv = getfoo(&temp); nscomptr<nsifoo> foo( dont_addref(temp) ); // |temp| has already been |addref|ed, but we want to manage it with an // |nscomptr|. nscomptr<nsifoo> foo( getter_addrefs(createafoo()) ); // |getter_addrefs| is a synonym for |dont_addref| that may look better to // you when applied to functions ...
...And 3 more matches
Debugger - Firefox Developer Tools
ing a target javascript program. allowwasmbinarysource a boolean value indicating whether webassembly sources will be available in binary form. the webassembly text generation will be disabled. collectcoverageinfo a boolean value indicating whether code coverage should be enabled inside each debuggee of this debugger instance. changing this flag value will recompile all jit code to add or
remove code coverage instrumentation. changing this flag when any frame of the debuggee is currently active on the stack will produce an exception. setting this to true enables code coverage instrumentation, which can be accessed via the debugger.script getoffsetscoverage function. in some cases, the code coverage might expose information which pre-date the modification of this flag. code coverage ...
... is about to begin executing code. (naturally,frame is currently the youngest visible frame.) this method should return a resumption value specifying how the debuggee’s execution should proceed. spidermonkey only calls onenterframe to report visible, non-"debugger" frames. onexceptionunwind(frame,value) the exceptionvalue has been thrown, and has propagated toframe;frame is the youngest
remaining stack frame, and is a debuggee frame. this method should return a resumption value specifying how the debuggee’s execution should proceed. if it returns undefined, the exception continues to propagate as normal: if control in frame is in a try block, control jumps to the corresponding catch or finally block; otherwise,frame is popped, and the exception propagates toframe’s caller. whe...
...r, thus imposing capability-based restrictions on a debugger’s reach. however, the addallglobalsasdebuggees method allows the api user to monitor all global object creation that occurs anywhere within the javascript system (the “jsruntime”, in spidermonkey terms), thereby escaping the capability-based limits. for this reason, addallglobalsasdebuggees is only available to privileged code. ...
...And 3 more matches
Index - Firefox Developer Tools
bject.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters. 28 deprecated tools deprecated, tools over the course of devtools development, we have added several experimental panels to try out new ideas. not all of these have had wide adoption, and due to the cost of maintenance, seldom used panels are eventually
removed. 29 devtools api devtools the devtools api provides a way to register and access developer tools in firefox. 30 devtoolscolors css this chart lists colors and css variables as implemented in the dark theme and light theme for developer tools. 31 eyedropper firefox, tools, web development:tools the eyedropper tool enables you to se...
...ass over the page, enabling you to select with pixel precision. underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in settings > inspector > default color unit: 34 index tools found 158 pages: 35 json viewer firefox includes a json viewer. if you open a json file in the browser, or view a
remote url with the content-type set to application/json, it is parsed and given syntax highlighting. arrays and objects are shown collapsed, and you can expand them using the "+" icons. 36 measure a portion of the page design, devtools, developer, firefox, layout, measure, measuring, measuring tool, tools using the measuring tool you can measure a specific area of a web page. ...
...ine the appearance of the element at a particular stage of the animation. the browser creates the animation as a transition from each keyframe to the next. 92 intensive javascript if you want to play along you can find the demo website here. 93 ui tour the performance tool's ui consists of 4 main pieces: 94 waterfall 95
remote debugging tools, l10n:priority you can use the firefox developer tools on your desktop to debug web sites and web apps running in other browsers or runtimes. the other browser might be on the same device as the tools themselves or on a different device, such as a phone connected over usb. 96 debugging firefox desktop debugging, guide, tools this guide explains ho...
...And 3 more matches
Waterfall - Firefox Developer Tools
animations svgattranimations styleattribute styleattribute_animations force forcedescendants layout calculating the position and size of page elements. this operation is sometimes called "reflow". paint drawing pixels to the screen. garbage collection garbage collection event. non-inc
remental gc events are labeled "(non-inc
remental)". reason a string indicating the reason gc was performed. non-inc
remental reason if the gc event was non-inc
remental, the string indicates the reason non-inc
remental gc was performed. new in firefox 46: if the gc event was caused by allocation pressure, a link appears, labeled "show allocation trigge...
... collection (gc) events, in which spidermonkey (the javascript engine in firefox) walks the heap looking for memory that's no longer reachable and subsequently releasing it. gc is relevant to performance because while it's running the javascript engine must be paused, so your program is suspended and will be completely unresponsive. ...
...walks the heap looking for memory that's no longer reachable and subsequently releasing it. gc is relevant to performance because while it's running the javascript engine must be paused, so your program is suspended and will be completely unresponsive. to help reduce the length of pauses, spidermonkey implements inc
remental gc: this means that it can perform garbage collection in fairly small inc
rements, letting the program run in between. sometimes, though, it needs to perform a full non-inc
remental collection, and the program has to wait for it to finish. in trying to avoid gc events, and especially non-inc
remental gc events, it's wise not to try to optimize for the specific implementation of the javascript engine. spidermonkey uses a complex set of heuristics to determine when gc is n...
...And 3 more matches
about:debugging - Firefox Developer Tools
he about:debugging page provides a single place from which you can attach the firefox developer tools to a number of debugging targets. at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. opening the about:debugging page there are two ways to open about:debugging: type about:debugging in the firefox url bar. in the tools > web developer menu, click
remote debugging. when about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your
remote debugging setup: setup use the setup tab to configure the connection to your
remote device. this firefox provides information about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently ...
...irefox provides information about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently have open, and service workers running on firefox. if your about:debugging page is different from the one displayed here, go to about:config, find and set the option devtools.aboutdebugging.new-enabled to true. setup tab connecting to a
remote device firefox supports debugging over usb with android devices, using the about:debugging page. before you connect: enable developer settings on your android device. enable usb debugging in the android developer settings. enable
remote debugging via usb in the advanced settings in firefox on the android device. connect the android device to your computer using a usb cable. if your d...
... wish to debug and then click connect next to the device name to open a connection to it. if the connection was successful, you can now click the name of the device to switch to a tab with information about the device. ...
...And 3 more matches
Animation - Web APIs
n.persist() has been invoked on it. animation.starttime gets or sets the scheduled time when an animation's playback should begin. animation.timeline gets or sets the timeline associated with this animation. event handlers animation.oncancel gets and sets the event handler for the cancel event. animation.onfinish gets and sets the event handler for the finish event. animation.on
remove allows you to set and run an event handler that fires when the animation is
removed (i.e., put into an active replace state). methods animation.cancel() clears all keyframeeffects caused by this animation and aborts its playback. animation.commitstyles() commits the end styling state of an animation to the element being animated, even after that animation has been
removed. it will cau...
... animation.play() starts or resumes playing of an animation, or begins the animation again if it previously finished. animation.reverse() reverses playback direction, stopping at the start of the animation. if the animation is finished or unplayed, it will play from end to beginning. ...
...e to be written to the element being animated, in the form of properties inside a style attribute. animation.finish() seeks either end of an animation, depending on whether the animation is playing or reversing. animation.pause() suspends playing of an animation. animation.persist() explicitly persists an animation, when it would otherwise be
removed due to the browser's automatically
removing filling animations behavior. animation.play() starts or resumes playing of an animation, or begins the animation again if it previously finished. animation.reverse() reverses playback direction, stopping at the start of the animation. if the animation is finished or unplayed, it will play from end to beginning. animation.updateplaybackrate() sets the speed of an animation after f...
...And 3 more matches
AudioBuffer() - Web APIs
are required to support at least 32 channels. samplerate: the sample rate in hz for the buffer. the default is the sample rate of the context used in constructing this object. user agents are required to support sample rates from 8,000 hz to 96,000 hz (but are allowed to go farther outside this range). deprecated parameters context a reference to an audiocontext. this parameter was
removed from the spec. return value a new audiobuffer object instance. exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range). rangeerror there isn't enough memory available to allocate the buffer. specifications specification statu...
...esktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetaudiobuffer() constructorchrome full support 55notes full support 55notes notes the context parameter was supported up until version 57, but has now been
removed.edge full support ≤79firefox full support 53ie no support noopera full support 42notes full support 42notes notes the context parameter was supported up until version ...
... full support ≤79firefox full support 53ie no support noopera full support 42notes full support 42notes notes the context parameter was supported up until version 44, but has now been
removed.safari ? webview android full support 55notes full support 55notes notes the context parameter was supported up until version 57, but has now been
removed.chrome android full support 55notes full support ...
...And 3 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
note: firefox devtools have supported highlighting text nodes since version 52, making ...
...sues that can arise due to whitespace, and what can be done about them. first of all, we'll look at what happens with spaces in between inline and inline-block elements. in fact, we saw this already in our very first example, when we described how whitespace is processed inside inline formatting contexts. we said that there were rules to ignore most characters but that word-separating characters
remain. when you’re only dealing with block-level elements such as <p> that only contain inline elements such as <em>, <strong>, <span>, etc., you don’t normally care about this because the extra whitespace that does make it to the layout is helpful to separate the words in the sentence. it gets more interesting however when you start using inline-block elements. these elements behave like inlin...
...ad of trying an inline-block solution. this handles everything for you, and is definitely the preferred solution: ul { list-style-type: none; margin: 0; padding: 0; display: flex; } if you need to rely on inline-block, you could set the font-size of the list to 0. this only works if your blocks are not sized with ems (based on the font-size, so the block size would also end up being 0). ...
...And 3 more matches
Element.setAttribute() - Web APIs
syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set. ...
... syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set. ...
...ed to be true if they're present on the element at all, regardless of their actual value; as a rule, you should specify the empty string ("") in value (some people use the attribute's name; this works but is non-standard). see the example below for a practical demonstration. since the specified value gets converted into a string, specifying null doesn't necessarily do what you expect. instead of
removing the attribute or setting its value to be null, it instead sets the attribute's value to the string "null". if you wish to
remove an attribute, call
removeattribute(). return value undefined. exceptions invalidcharactererror the specified attribute name contains one or more characters which are not valid in attribute names. example in the following example, setattribute() is used to...
...And 3 more matches
FileSystemEntry - Web APIs
the filesystementry interface of the file and directory entries api represents a single in a file system. the entry can be a file or a directory (directories are represented by the directoryentry interface). it includes methods for working with files—including copying, moving,
removing, and reading files—as well as information about a file it points to—including the file name and its path from the root to the entry. because this is a non-standard api, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. check the browser compatibility section for details. basic concepts you don't create filesystementry objects directly. instead, you will rec...
...se filesystem: scheme for the root directory of the origin of the app. for example, if your app is in http://www.html5rocks.com, open filesystem:http://www.html5rocks.com/temporary/ in a tab. chrome shows a read-only list of all the files and folders stored the origin of your app. example to see an example of how tourl() works, see the method description. ...
... filesystem read only a filesystem object representing the file system in which the entry is located. ...
...And 3 more matches
HTMLTableElement - Web APIs
nt.caption is a htmltablecaptionelement representing the first <caption> that is a child of the element, or null if none is found. when set, if the object doesn't represent a <caption>, a domexception with the hierarchyrequesterror name is thrown. if a correct object is given, it is inserted in the tree as the first child of this element and the first <caption> that is a child of this element is
removed from the tree, if any. htmltableelement.thead is a htmltablesectionelement representing the first <thead> that is a child of the element, or null if none is found. when set, if the object doesn't represent a <thead>, a domexception with the hierarchyrequesterror name is thrown. if a correct object is given, it is inserted in the tree immediately before the first element that is neither a <c...
...e element, or null if none is found. when set, if the object doesn't represent a <thead>, a domexception with the hierarchyrequesterror name is thrown. if a correct object is given, it is inserted in the tree immediately before the first element that is neither a <caption>, nor a <colgroup>, or as the last child if there is no such element, and the first <thead> that is a child of this element is
removed from the tree, if any. htmltableelement.tfoot is a htmltablesectionelement representing the first <tfoot> that is a child of the element, or null if none is found. when set, if the object doesn't represent a <tfoot>, a domexception with the hierarchyrequesterror name is thrown. if a correct object is given, it is inserted in the tree immediately before the first element that is neither a <c...
...or null if none is found. when set, if the object doesn't represent a <tfoot>, a domexception with the hierarchyrequesterror name is thrown. if a correct object is given, it is inserted in the tree immediately before the first element that is neither a <caption>, a <colgroup>, nor a <thead>, or as the last child if there is no such element, and the first <tfoot> that is a child of this element is
removed from the tree, if any. htmltableelement.rowsread only returns a live htmlcollection containing all the rows of the element, that is all <tr> that are a child of the element, or a child of one of its <thead>, <tbody> and <tfoot> children. the rows members of a <thead> appear first, in tree order, and those members of a <tbody> last, also in tree order. the htmlcollection is live and is auto...
...And 3 more matches
RTCIceTransport: selectedcandidatepairchange event - Web APIs
a selectedcandidatepairchange event is sent to an rtcicetransport when the ice agent selects a new pair of candidates that describe the endpoints of a viable connection. the pair of candidates is in turn described by an rtcicecandidatepair object which contains one rtcicecandidate representing the local end of the connection, and another representing the
remote end of the connection. together, the candidates can be used to establish a connection to be used by the rtcicetransport, and, by extension, by an rtcpeerconnection. bubbles no cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user ...
...t handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user information about the progress of the ice negotiation for an rtcpeerconnection called pc. ...
...irchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user information about the progress of the ice negotiation for an rtcpeerconnection called pc. let icetransport = pc.getsenders[0].transport.icetransport; let localprotoelem = document.getelementbyid("local-protocol"); let
remoteprotoelem = document.getelementbyid("
remote-protocol"); icetransport.addeventlistener("selectedcandidatepairchange", ev => { let pair = icetransport.getselectedcandidatepair(); localprotoelem.innertext = pair.local.protocol.touppercase();
remoteprotoelem.innertext = pair.
remote.protocol.touppercase(); }, false) this can also be done by setting the onselectedcandidatepairchange event handler property directly. let icetransport =...
...And 3 more matches
RTCIceTransportState - Web APIs
the rtcicetransportstate enumerated type defines the string values which may be returned by the state property on rtcicetransport objects. the transport state indicates which stage of the candidate gathering process is currently underway. values "new" the rtcicetransport is currently gathering local candidates, or is waiting for the
remote device to begin to transmit the
remote candidates, or both. in this state, checking of candidates to look for those which might be acceptable has not yet begun. "checking" at least one
remote candidate has been received, and the rtcicetransport has begun examining pairings of
remote and local candidates in order to attempt to identify viable pairs that could be used to establish a connection. keep in mind that gathering of local candidates may still...
... "connected" a viable candidate pair has been found and selected, and the rtcicetransport has connected the two peers together using that pair. ...
...es. the transport may revert from the "connected" state to the "checking" state if either peer decides to cancel consent to use the selected candidate pair, and may revert to "disconnected" if there are no candidates left to check but one or both clients are still gathering candidates. "completed" the transport has finished gathering local candidates and has received a notification from the
remote peer that no more candidates will be sent. in addition, all candidate pairs have been considered and a pair has been selected for use. if consent checks fail on all successful candidate pairs, the transport state will change to "failed". "disconnected" the ice agent has determined that connectivity has been lost for this rtcicetransport. this is not a failure state (that's "failed"). a value...
...And 3 more matches
RTCPeerConnection.createOffer() - Web APIs
the sdp offer includes information about any mediastreamtracks already attached to the webrtc session, codec, and options supported by the browser, and any candidates already gathered by the ice agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection. ...
...active connection, set this to true. this will cause the returned offer to have different credentials than those already in place. if you then apply the returned offer, ice will restart. specify false to keep the same credentials and therefore not restart ice. the default is false. offertoreceiveaudio optional (legacy) a legacy boolean option which used to control whether or not to offer to the
remote peer the opportunity to try to send audio. if this value is false, the
remote peer will not be offered to send audio data, even if the local side will be sending audio data. if this value is true, the
remote peer will be offered to send audio data, even if the local side will not be sending audio data. the default behavior is to offer to receive audio only if the local side is sending audio, n...
...lue true, will ensure there is at least one transceiver set to receive audio that has not been stopped, and if there isn't one, one will be created. note: you shouldn't use this legacy property. instead, use rtcrtptransceiver to control whether or not to accept incoming audio. offertoreceivevideo optional (legacy) a legacy boolean option which used to control whether or not to offer to the
remote peer the opportunity to try to send video. if this value is false, the
remote peer will not be offered to send video data, even if the local side will be sending video data. if this value is true, the
remote peer will be offered to send video data, even if the local side will not be sending video data. the default behavior is to offer to receive video only if the local side is sending video, n...
...And 3 more matches
RTCPeerConnection: icecandidate event - Web APIs
an icecandidate event is sent to an rtcpeerconnection when an rtcicecandidate has been identified and added to the local peer by a call to rtcpeerconnection.setlocaldescription(). the event handler should transmit the candidate to the
remote peer over the signaling channel so the
remote peer can add it to its set of
remote candidates. ...
...able no interface rtcpeerconnectioniceevent event handler property rtcpeerconnection.onicecandidate description there are three reasons why the icecandidate event is fired on an rtcpeerconnection. sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. ...
...e are three reasons why the icecandidate event is fired on an rtcpeerconnection. sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. this candidate needs to be delivered to the
remote peer over the signaling channel your code manages. rtcpeerconnection.onicecandidate = (event) => { if (event.candidate) { sendcandidateto
remotepeer(event.candidate) } else { /* there are no more candidates coming during this negotiation */ } } the
remote peer, upon receiving the candidate, will add the candidate to its candidate pool by calling addicecandidate(), passing in the candidate string you have passed along using the signaling server. indicating the end of a generation of candidates when an ice negotiation session...
...And 3 more matches
Touch events - Web APIs
pads. the touch events interfaces are relatively low-level apis that can be used to support application-specific multi-touch interactions such as a two-finger gesture. a multi-touch interaction starts when a finger (or stylus) first touches the contact surface. other fingers may subsequently touch the surface and optionally move across the touch surface. the interaction ends when the fingers are
removed from the surface. during this interaction, an application receives touch events during the start, move, and end phases. touch events are similar to mouse events except they support simultaneous touches and at different locations on the touch surface. the touchevent interface encapsulates all of the touchpoints that are currently active. the touch interface, which represents a single touchpoi...
...n't figure out which touch to continue"); } } } this iterates over the changed touches as well, but it looks in our cached touch information array for the previous information about each touch to determine the starting point for each touch's new line segment to be drawn. this is done by looking at each touch's touch.identifier property. this property is a unique integer for each touch and
remains consistent for each event during the duration of each finger's contact with the surface. this lets us get the coordinates of the previous position of each touch and use the appropriate context methods to draw a line segment joining the two positions together. after drawing the line, we call array.splice() to replace the previous information about the touchpoint with the current information ...
...ther. after drawing the line, we call array.splice() to replace the previous information about the touchpoint with the current information in the ongoingtouches array. handling the end of a touch when the user lifts a finger off the surface, a touchend event is sent. we handle this by calling the handleend() function below. its job is to draw the last line segment for each touch that ended and
remove the touchpoint from the ongoing touch list. function handleend(evt) { evt.preventdefault(); log("touchend"); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouchindexbyid(touches[i].identifier); if (idx >= 0)...
...And 3 more matches
WebGL best practices - Web APIs
in practice, effectively all systems support at least the following: max_cube_map_texture_size: 4096 max_renderbuffer_size: 4096 max_texture_size: 4096 max_viewport_dims: [4096,4096] max_vertex_texture_image_units: 4 max_texture_image_units: 8 max_combined_texture_image_units: 8 max_vertex_attribs: 16 max_varying_vectors: 8 max...
... using highp precision unconditionally in fragment shaders will prevent your content from working on some older mobile hardware. while you can use mediump float instead, but be aware that this often results in corrupted rendering due to lack of precision (particularly mobile systems) though the corruption is not going to be visible on a typical desktop computer. ...
...e on a typical desktop computer. if you know your precision requi
rements, getshaderprecisionformat() will tell you what the system supports. if highp float is available, gl_fragment_precision_high will be defined as 1. ...
...And 3 more matches
WebRTC API - Web APIs
ypes are used to set up, open, and manage webrtc connections. included are interfaces representing peer media connections, data channels, and interfaces used when exchanging information on the capabilities of each peer in order to select the best possible configuration for a two-way media connection. interfaces rtcpeerconnection represents a webrtc connection between the local computer and a
remote peer. it is used to handle efficient streaming of data between the two peers. rtcdatachannel represents a bi-directional data channel between two peers of a connection. rtcdatachannelevent represents events that occur while attaching a rtcdatachannel to a rtcpeerconnection. the only event sent with this interface is datachannel. rtcsessiondescription represents the parameters of a sessio...
... watching for the closing event instead. closing the rtcdatachannel has transitioned to the closing state, indicating that it will be closed soon. you can detect the completion of the closing process by watching for the close event. connectionstatechange the connection's state, which can be accessed in connectionstate, has changed. datachannel a new rtcdatachannel is available following the
remote peer opening a new data channel. this event's type is rtcdatachannelevent. error an rtcerrorevent indicating that an error occurred on the data channel. error an rtcerrorevent indicating that an error occurred on the rtcdtlstransport. this error will be either dtls-failure or fingerprint-failure. gatheringstatechange the rtcicetransport's gathering state has changed. icecandidate an rt...
...for the rtcicetransport on which the event is fired. track the track event, of type rtctrackevent is sent to an rtcpeerconnection when a new track is added to the connection following the successful negotiation of the media's streaming. signalingstatechange sent to the peer connection when its signalingstate has changed. this happens as a result of a call to either setlocaldescription() or set
remotedescription(). statechange the state of the rtcdtlstransport has changed. statechange the state of the rtcicetransport has changed. statechange the state of the rtcsctptransport has changed. types rtcsctptransportstate indicates the state of an rtcsctptransport instance. rtcsessiondescriptioncallback the rtcsessiondescriptioncallback is passed into the rtcpeerconnection object whe...
...And 3 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
player characters for non-player characters. in single-screen 2d games, the camera is not associated directly with the player or any other character in the game, but is instead either fixed above or next to the game play area, or follows the action as the action moves around a scrolling game world. for example, a classic arcade game such as pac-man takes place on a fixed game map, so the camera
remains fixed a set distance above the map, always pointed straight down at the game world. in a side-scrolling or top-scrolling game such as super mario bros., the camera moves along left and right (or up and down, or both) to ensure that the action
remains visible even though the game level is much larger than the viewport. positioning the camera since there are no standard camera objects in we...
...o meters away from the origin point—the result is: [31-2]\left [ \begin{matrix} 3 \\ 1 \\ -2 \end{matrix} \right ] this can also be represented as an array: let directionvector = [3, 1, -2]; for the purposes of performing operations involving both the coordinates and the facing direction vector, the vector needs to include the w component. the value of w is always 0 for vectors, so the afo
rementioned vector can also be represented using [3, 1, -2, 0] or: [31-20]\left [ \begin{matrix} 3 \\ 1 \\ -2 \\ 0 \end{matrix} \right ] webxr automatically normalizes vectors to have a length of 1 meter; however, you may find that it makes sense to do it yourself for various reasons, such as to improve performance of calculations by not having to repeatedly perform normalization. once you've det...
...nsforms simultaneously, such as zooming and panning at the same time, you can multiply the transform matrices together to compose them into a single matrix that applies both changes at once. see multiplying two matrices in the article matrix math for the web for a clear but readable function that does this or use your preferred matrix math library such as glmatrix to do the work. it's crucial to
remember that unlike typical arithmetic, where multiplication is commutative (that is, you get the same answer whether you multiply left to right or right to left), matrix multiplication is not commutative! this is because each transform affects the position of the object and possibly the very coordinate system itself, which can dramatically change the results of the next operation performed. so you ...
...And 3 more matches
Using XMLHttpRequest - Web APIs
rd specification for the xmlhttprequest() constructor. these tell the client making the xmlhttprequest important information about the status of the response. some cases where dealing with non-text response types may involve some manipulation and analysis are outlined in the following sections. analyzing and manipulating the responsexml property if you use xmlhttprequest to get the content of a
remote xml document, the responsexml property will be a dom object containing a parsed xml document. this could prove difficult to manipulate and analyze. there are four primary ways of analyzing this xml document: using xpath to address (or point to) parts of it. manually parsing and serializing xml to strings or objects. using xmlserializer to serialize dom trees to strings or to files. regex...
...t. this could prove difficult to manipulate and analyze. there are four primary ways of analyzing this xml document: using xpath to address (or point to) parts of it. manually parsing and serializing xml to strings or objects. using xmlserializer to serialize dom trees to strings or to files. regexp can be used if you always know the content of the xml document beforehand. you might want to
remove line breaks, if you use regexp to scan with regard to line breaks. however, this method is a "last resort" since if the xml code changes slightly, the method will likely fail. note: xmlhttprequest can now interpret html for you using the responsexml property. read the article about html in xmlhttprequest to learn how to do this. processing a responsetext property containing an html docume...
... to line breaks. however, this method is a "last resort" since if the xml code changes slightly, the method will likely fail. note: xmlhttprequest can now interpret html for you using the responsexml property. read the article about html in xmlhttprequest to learn how to do this. processing a responsetext property containing an html document if you use xmlhttprequest to get the content of a
remote html webpage, the responsetext property is a string containing the raw html. this could prove difficult to manipulate and analyze. there are three primary ways to analyze and parse this raw html string: use the xmlhttprequest.responsexml property as covered in the article html in xmlhttprequest. inject the content into the body of a document fragment via fragment.body.innerhtml and travers...
...And 3 more matches
ARIA Test Cases - Accessibility
operly tracked upon activation. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - checkbox simple checkbox testcases: set aria-checked="false" for unchecked both
remove or set attribute for unchecked case -- also includes an invalid and required checkbox hierarchical (newly added test not in test results yet) dojo nightly build expected at behavior: screen reader should speak the accessible name followed by both the type being checkbox and the state (checked, unchecked). when pressing space, new state should be announced automatically. markup used: ...
...ewly added test not in test results yet) dojo nightly build expected at behavior: screen reader should speak the accessible name followed by both the type being checkbox and the state (checked, unchecked). when pressing space, new state should be announced automatically. ...
...when toggling, new state should be announced (not checked, partially checked, checked). markup used: role="checkbox" aria-checked="true" | "false" | "mixed" notes: results: at firefox ie opera safari jaws 9 - - n/a n/a ...
...And 3 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
mon colors can be open to debate. for example, the color "crimson red" may be described in hex values as #990000 by some and #dc143c by others. for the purposes of this document, we'll use terminlogy as it is defined in the w3c, in the css color module level 3 when working with color, it's important to know which "color space" you are working in, as different color spaces map to different measu
rement systems. currently, the rgb color space predominates as the space web developers work in. hex, rgb and hsl color spaces all are measured differently. conversions between the color spaces are usually needed. because of the current domination of the rgb color space in measuring color output, most calculations in this document are presumed to be in the rgb color space, and very specifically, in...
... of being defined, including rgb, rgb decimal, rgb percent, hsl, cmyk among others. for digital concerns, much of the technology has historically resided in the rgb color space. this is because the companies behind the evolution of digital technology set the standards, and these standards still retain a powerful presence today. this is evolving, and new methods for measuring color involve measu
rements using other color spaces, but color measu
rements in the rgb color space still predominates, and this includes video production. the rgb color model is extended to include “alpha” -- rgba -- to allow specification of the opacity of a color. there's movement towards adopting the use of hsl color values rather than rgb values is css color module 3 (see section 4.2.4), the rationale being t...
... it so happens that these "blue sensitive" cones tend to be located at the rims of our eyeballs, away from the center (fovea centralis) of the back of the eyeball, where the red and green cones tend to cluster. there is software that actually takes advantage of that fact. because we do not perceive the color "blue" as well as other colors, for example, some algorithms for compressing image sizes
remove the parts of the image with "blue" in them more heavily than other parts of an image. this fact is also used by televsion signals to allocate less bandwidth to the yellow-blue part of their signal, thus saving bandwidth. another important point to consider is the ambience of light surrounding the color. the color will appear differently if the background lighting is dark, or light. one of t...
...And 3 more matches
Using multi-column layouts - CSS: Cascading Style Sheets
t, or using heroic scripting. this limitation is solved by adding new css properties to extend the traditional block layout mode. using columns column count and width two css properties control whether and how many columns will appear: column-count and column-width. the column-count property sets the number of columns to a particular number. e.g., example 1 html <div id="col"> <p> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p> <p> ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p> <p> duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </p> <p> ex...
...anim id est laborum. </p> </div> css #col { column-count: 2; } result will display the content in two columns (if you're using a multi-column compliant browser): the column-width property sets the minimum desired column width. if column-count is not also set, then the browser will automatically make as many columns as fit in the available width. example 2 html <div id="wid"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in c...
...rted within columns, as are editing and printing. the columns shorthand most of the time, a web designer will use one of the two css properties: column-count or column-width. as values for these properties do not overlap, it is often convenient to use the shorthand columns. e.g. the css declaration column-width: 12em can be replaced by columns: 12em. example 3 html <div id="col_short"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in c...
...And 3 more matches
Audio and Video Delivery - Developer guides
ing from 'static' media files to adaptive live streams. this article is intended as a starting point for exploring the various delivery mechanisms of web based media and compatibility with popular browsers. the audio and video elements whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements
remains pretty much the same. currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. you can find compatibility information in the guide to media types and formats on the web. to deliver video and audio, the general workflow is usually something like this: check what format the browser suppo...
... more options for fallbacks. javascript audio var myaudio = document.createelement('audio'); if (myaudio.canplaytype('audio/mpeg')) { myaudio.setattribute('src','audiofile.mp3'); } else if (myaudio.canplaytype('audio/ogg')) { myaudio.setattribute('src','audiofile.ogg'); } myaudio.currenttime = 5; myaudio.play(); we set the sou...
...ontrols are not displayed, create custom controls using html and css, then use javascript to link your controls to the audio/video api. if you need something extra, it's possible to add features that are not currently present in default players, such as playback rate, quality stream switches or even audio spectrums. you can also choose how to make your player responsive — for example you might
remove the progress bar under certain conditions. you may detect click, touch and/or keyboard events to trigger actions such as play, pause and scrubbing. it's often important to
remember keyboard controls for user convenience and accessibility. a quick example — first set up your audio and custom controls in html: <audio id="my-audio" src="http://jplayer.org/audio/mp3/miaow-01-tempered-song.m...
...And 3 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
ists around to represent opening or closing the widget is why these are sometimes called "twisties." a <details> widget can be in one of two states. the default closed state displays only the triangle and the label inside <summary> (or a user agent-defined default string if no <summary>). this might look like the following: here we see a standard disclosure widget with the label "system requi
rements", in its default closed state. when the user clicks on the widget or focuses it then presses the space bar, it "twists" open, revealing its contents: from there, you can use css to style the disclosure widget, and you can programmatically open and close the widget by setting/
removing its open attribute. by default when closed, the widget is only tall enough to display the disclosure trian...
...ong-term storage. an input device as well as some form of output device is recommended.</p> </details> in this situation, the browser will use a default summary string (usually "details"). here's what your browser does with it: providing a summary this example adds a summary to the above example by using the <summary> element inside <details>, like this: <details> <summary>system requi
rements</summary> <p>requires a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an input device as well as some form of output device is recommended.</p> </details> the result from this html is this: creating an open disclosure box to start the <details> box in its open state, add the boolean open attribute: <details o...
... a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an input device as well as some form of output device is recommended.</p> </details> the result from this html is this: creating an open disclosure box to start the <details> box in its open state, add the boolean open attribute: <details open> <summary>system requi
rements</summary> <p>requires a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an input device as well as some form of output device is recommended.</p> </details> this results in: customizing the appearance now let's apply some css to customize the appearance of the disclosure box. css details { font: 16px "open s...
...And 3 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
opt-in (requiring a user to specifically enable it). however, this can be useful when creating media elements whose source will be set at a later time, under user control. see our autoplay guide for additional information about how to properly use autoplay. to disable video autoplay, autoplay="false" will not work; the video will autoplay if the attribute is there in the <video> tag at all. to
remove autoplay, the attribute needs to be
removed altogether. in some browsers (e.g. chrome 70.0) autoplay doesn't work if no muted attribute is present. autopictureinpicture a boolean attribute which if true indicates that the element should automatically toggle picture-in-picture mode when the user switches back and forth between this document and another document or application. buffered...
...offer controls to allow the user to control video playback, including volume, seeking, and pause/resume playback. controlslist the controlslist attribute, when specified, helps the browser select what controls to show on the media element whenever the browser shows its own set of controls (e.g. when the controls attribute is specified). the allowed values are nodownload, nofullscreen and no
remoteplayback. use the disablepictureinpicture attribute if you want to disable the picture-in-picture mode (and the control). crossorigin this enumerated attribute indicates whether to use cors to fetch the related image. cors-enabled resources can be reused in the <canvas> element without being tainted. the allowed values are: anonymous sends a cross-origin request without a credential...
... may have a media timeline that doesn't start at 0 seconds, so setting currenttime to a time before that would fail. the getstartdate() method can be used to determine the beginning point of the media timeline's reference frame. disablepictureinpicture prevents the browser from suggesting a picture-in-picture context menu or to request picture-in-picture automatically in some cases. disable
remoteplayback a boolean attribute used to disable the capability of
remote playback in devices that are attached using wired (hdmi, dvi, etc.) and wireless technologies (miracast, chromecast, dlna, airplay, etc). in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which indicates the duration (total length) of the media in...
...And 3 more matches
Evolution of HTTP - HTTP
ext newsgroup is now considered as the official start of the world wide web as a public project. the http protocol used in those early phases was very simple, later dubbed http/0.9, and sometimes as the one-line protocol. http/0.9 – the one-line protocol the initial version of http had no version number; it has been later called 0.9 to differentiate it from the later versions. http/0.9 is ext
remely simple: requests consist of a single line and start with the only possible method get followed by the path to the resource (not the url as both the protocol, server, and port are unnecessary once connected to the server). get /mypage.html the response is ext
remely simple too: it only consisted of the file itself. <html> a very simple html page </html> unlike subsequent evolutions, there we...
... with the help of the new http headers, the ability to transmit other documents than plain html files has been added (thanks to the content-type header). at this point, a typical request and response looked like this: get /mypage.html http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:31 gmt server: cern/3.0 libwww/2.17 content-t...
... bytes) http/1.1 was first published as rfc 2068 in january 1997. more than 15 years of extensions thanks to its extensibility – creating new headers or methods is easy – and even if the http/1.1 protocol was refined over two revisions, rfc 2616 published in june 1999 and the series of rfc 7230-rfc 7235 published in june 2014 in prevision of the release of http/2, this protocol has been ext
remely stable over more than 15 years. using http for secure transmissions the largest change that happened to http was done as early as end of 1994. instead of sending http over a basic tcp/ip stack, netscape communications created an additional encrypted transmission layer on top of it: ssl. ssl 1.0 was never released outside the company, but ssl 2.0 and its successor ssl 3.0 allowed for the crea...
...And 3 more matches
HTTP headers - HTTP
rning information about possible problems. client hints http client hints are a work in progress. actual documentation can be found on the website of the http working group. accept-ch servers can advertise support for client hints using the accept-ch header field or an equivalent html <meta> element with http-equiv attribute ([html5]). accept-ch-lifetime servers can ask the client to
remember the set of client hints that the server supports for a specified period of time, to enable delivery of client hints on subsequent requests to the server’s origin ([rfc6454]). early-data indicates that the request has been conveyed in early data. content-dpr a number that indicates the ratio between physical pixels over css pixels of the selected image response. dpr a number tha...
...ins information about the software used by the origin server to handle the request. range requests accept-ranges indicates if the server supports range requests, and if so in which unit the range can be expressed. range indicates the part of a document that the server should return. if-range creates a conditional range request that is only fulfilled if the given etag or date matches the
remote resource. used to prevent downloading two ranges from incompatible version of the resource. content-range indicates where in a full body message a partial message belongs. security cross-origin-embedder-policy (coep) allows a server to declare an embedder policy for a given document. cross-origin-opener-policy (coop) prevents other domains from opening/controlling a window. cr...
...esources the user agent is allowed to load for a given page. content-security-policy-report-only allows web developers to experiment with policies by monitoring, but not enforcing, their effects. these violation reports consist of json documents sent via an http post request to the specified uri. expect-ct allows sites to opt in to reporting and/or enforcement of certificate transparency requi
rements, which prevents the use of misissued certificates for that site from going unnoticed. when a site enables the expect-ct header, they are requesting that chrome check that any certificate for that site appears in public ct logs. feature-policy provides a mechanism to allow and deny the use of browser features in its own frame, and in iframes that it embeds. strict-transport-security (hsts) ...
...And 3 more matches
Expressions and operators - JavaScript
nd for the operations listed in the following table: compound assignment operators name shorthand operator meaning assignment x = y x = y addition assignment x += y x = x + y subtraction assignment x -= y x = x - y multiplication assignment x *= y x = x * y division assignment x /= y x = x / y
remainder assignment x %= y x = x % y exponentiation assignment x **= y x = x ** y left shift assignment x <<= y x = x << y right shift assignment x >>= y x = x >> y unsigned right shift assignment x >>>= y x = x >>> y bitwise and assignment x &= y x = x & y bitwise xor assignment x ^= y x = x ^ y ...
...ng languages when used with floating point numbers (in particular, note that division by zero produces infinity). for example: 1 / 2; // 0.5 1 / 2 == 1.0 / 2.0; // this is true in addition to the standard arithmetic operations (+, -, *, /), javascript provides the arithmetic operators listed in the following table: arithmetic operators operator description example
remainder (%) binary operator. returns the integer
remainder of dividing the two operands. 12 % 5 returns 2. inc
rement (++) unary operator. adds one to its operand. if used as a prefix operator (++x), returns the value of its operand after adding one; if used as a postfix operator (x++), returns the value of its operand before adding one. if x is 3, then ++x sets x to 4 and retur...
... if x is 3, then --x sets x to 2 and returns 2, whereas x-- returns 3 and, only then, sets x to 2. unary negation (-) unary operator. returns the negation of its operand. if x is 3, then -x returns -3. ...
...And 3 more matches
Indexed collections - JavaScript
// or let myarray = ['mango', 'apple', 'orange'] understanding length at the implementation level, javascript's arrays actually store their elements as standard object properties, using the array index as the property name. the length property is special. it always returns the index of the last element plus one. (in the example below, 'dusty' is indexed at 30, so cats.length returns 30 + 1).
remember, javascript array indexes are 0-based: they start at 0, not 1. this means that the length property will be one more than the highest index stored in the array: let cats = [] cats[30] = ['dusty'] console.log(cats.length) // 31 you can also assign to the length property. writing a value that is shorter than the number of stored items truncates the array. writing 0 empties it entirely: let...
...stored in the array: let cats = [] cats[30] = ['dusty'] console.log(cats.length) // 31 you can also assign to the length property. writing a value that is shorter than the number of stored items truncates the array. writing 0 empties it entirely: let cats = ['dusty', 'misty', 'twiggy'] console.log(cats.length) // 3 cats.length = 2 console.log(cats) // logs "dusty, misty" - twiggy has been
removed cats.length = 0 console.log(cats) // logs []; the cats array is empty cats.length = 3 console.log(cats) // logs [ <3 empty items> ] iterating over arrays a common operation is to iterate over the values of an array, processing each one in some way. the simplest way to do this is as follows: let colors = ['red', 'green', 'blue'] for (let i = 0; i < colors.length; i++) { console.log(c...
..., "a", "b", "c"] join(delimiter = ',') joins all elements of an array into a string. let myarray = new array('wind', 'rain', 'fire') let list = myarray.join(' - ') // list is "wind - rain - fire" push() adds one or more elements to the end of an array and returns the resulting length of the array. let myarray = new array('1', '2') myarray.push('3') // myarray is now ["1", "2", "3"] pop()
removes the last element from an array and returns that element. let myarray = new array('1', '2', '3') let last = myarray.pop() // myarray is now ["1", "2"], last = "3" shift()
removes the first element from an array and returns that element. let myarray = new array('1', '2', '3') let first = myarray.shift() // myarray is now ["2", "3"], first is "1" unshift() adds one or more elements to the ...
...And 3 more matches
Loops and iteration - JavaScript
script are: for statement do...while statement while statement labeled statement break statement continue statement for...in statement for...of statement for statement a for loop repeats until a specified condition evaluates to false. the javascript for loop is similar to the java and c for loop. a for statement looks as follows: for ([initialexpression]; [conditionexpression]; [inc
rementexpression]) statement when a for loop executes, the following occurs: the initializing expression initialexpression, if any, is executed. this expression usually initializes one or more loop counters, but the syntax allows an expression of any degree of complexity. this expression can also declare variables. the conditionexpression expression is evaluated. if the value of conditionexpr...
...pression is evaluated. if the value of conditionexpression is true, the loop statements execute. if the value of condition is false, the for loop terminates. (if the condition expression is omitted entirely, the condition is assumed to be true.) the statement executes. to execute multiple statements, use a block statement ({ ... }) to group those statements. if present, the update expression inc
rementexpression is executed. control returns to step 2. example in the example below, the function contains a for statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, performs the ...
...rol returns to step 2. example in the example below, the function contains a for statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, performs the succeeding if statement, and inc
rements i by after each pass through the loop. <form name="selectform"> <p> <label for="musictypes">choose some music types, then click the button below:</label> <select id="musictypes" name="musictypes" multiple="multiple"> <option selected="selected">r&b</option> <option>jazz</option> <option>blues</option> <option>new age</option> <option>classical</option>...
...And 3 more matches
Operator precedence - JavaScript
evaluating the left side evaluating the middle side evaluating the right side 64 looking at the code snippets above, 6 / 3 / 2 is the same as (6 / 3) / 2 because division is left-associative. exponentiation, on the other hand, is right-associative, so 2 ** 3 ** 2 is the same as 2 ** (3 ** 2). thus, doing (2 ** 3) ** 2 changes the order and results in the 64 seen in the table above.
remember that precedence comes before associativity. so, mixing division and exponentiation, the exponentiation comes before the division. for example, 2 ** 3 / 3 ** 2 results in 0.8888888888888888 because it is the same as (2 ** 3) / (3 ** 2). note on grouping and short-circuiting in the table below, grouping is listed as having the highest precedence. however, that does not always mean the expres...
...n/a ( … ) 20 member access left-to-right … . … computed member access left-to-right … [ … ] new (with argument list) n/a new … ( … ) function call left-to-right … ( … ) optional chaining left-to-right ?. ...
... left-to-right … . … computed member access left-to-right … [ … ] new (with argument list) n/a new … ( … ) function call left-to-right … ( … ) optional chaining left-to-right ?. ...
...And 3 more matches
fill - SVG: Scalable Vector Graphics
sed. for <altglyph>, fill is a presentation attribute that defines the color of the glyph. value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property. animate for <animate>, fill defines the final state of the animation. ...
...f the glyph. value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property. animate for <animate>, fill defines the final state of the animation. ...
... animation frame) |
remove (keep the state of the first animation frame) default value
remove animatable no animatecolor warning: as of svg animation 2 <animatecolor> is deprecated and shouldn't be used. use <animate> instead. for <animatecolor>, fill defines the final state of the animation. value freeze (keep the state of the last animation frame) |
remove (keep the state of the first animation frame) default value
remove animatable no animatemotion for <animatemotion>, fill defines the final state of the animation. ...
...And 3 more matches
Subdomain takeovers - Web security
a subdomain takeover occurs when an attacker gains control over a subdomain of a target domain. typically, this happens when the subdomain has a canonical name (cname) in the domain name system (dns), but no host is providing content for it. this can happen because either a virtual host hasn’t been published yet or a virtual host has been
removed. an attacker can take over that subdomain by providing their own virtual host and then hosting their own content for it. if an attacker can do this, they can potentially read cookies set from the main domain, perform cross-site scripting, or circumvent content security policies, thereby enabling them to capture protected information (including logins) or send malicious content to unsuspecting users. a subdomain is like an electrical outle...
...an do this, they can potentially read cookies set from the main domain, perform cross-site scripting, or circumvent content security policies, thereby enabling them to capture protected information (including logins) or send malicious content to unsuspecting users. a subdomain is like an electrical outlet. if you have your own appliance (host) plugged into it, everything is fine. ...
... during provisioning an attacker sets up a virtual host for a subdomain name you bought on the hosting provider, before you get to do it. ...
...And 3 more matches
page-worker - Archive of obsolete content
create a permanent, invisible page and access its dom. usage the module exports a constructor function page, which constructs a new page worker. a page worker may be destroyed, after which its memory is freed, and you must create a new instance to load another page. you specify the page to load using the contenturl option to the page() constructor. this can point to a
remote file: pageworker = require("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", contenturl: "http://en.wikipedia.org/wiki/internet" }); it can also point to an html file which you've packaged with your add-on. to do this, save the file in your add-on's data directory and create the url using the data.url() method of the self module: pageworker = require("sdk/page-worker").page({ ...
...: script, contentscriptwhen: "ready", onmessage: function(message) { console.log(message); } }); for conciseness, this example creates the content script as a string and uses the contentscript property. in your own add-ons, you will probably want to create your content scripts in separate files and pass their urls using the contentscriptfile property. unless your content script is ext
remely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. to learn much more about content scripts, see the working with content scripts guide. scripting trusted ...
...ripts instead: in the content script: change occurrences of self to addon. for example, self.port.emit("my-event") becomes addon.port.emit("my-event"). in the html page itself: add a <script> tag to load the script. so if your content script is saved under data as "my-script.js", you need a line like <script src="my-script.js"></script> in the page header. in the "main.js" file:
remove the contentscriptfile option in the page() constructor. globals constructors page(options) creates an uninitialized page worker instance. parameters options : object optional options: name type contenturl string the url of the content to load in the panel. allow object an object with keys to configure the permissions o...
...And 2 more matches
event/core - Archive of obsolete content
nt of a specific type may be emitted on any event target object using the emit function. this will call all registered listeners for the given type on the given event target in the same order they were registered. ...
...ey were registered. emit(target, 'message', 'event'); // info: 'hello event' emit(target, 'data', { type: 'data' }, 'second arg'); // info: [object object] 'second arg' registered event listeners may be
removed using off function: off(target, 'message'); emit(target, 'message', 'bye'); // info: 'hello bye' sometimes listener only cares about first event of specific type. ...
... off function: off(target, 'message'); emit(target, 'message', 'bye'); // info: 'hello bye' sometimes listener only cares about first event of specific type. to avoid hassles of
removing such listeners there is a convenient once function: once(target, 'load', function() { console.log('ready'); }); emit(target, 'load') // info: 'ready' emit(target, 'load') there are also convenient ways to
remove registered listeners. ...
...And 2 more matches
ui/toolbar - Archive of obsolete content
experimental add a toolbar to the firefox user interface. a toolbar is a horizontal strip of user interface real estate. like a panel, a toolbar's content is specified using html. unlike a panel, a toolbar: does not overlap with any web content is persistent,
remaining visible until the user chooses to close it is a fixed size, and appears in a fixed location usage creating and destroying toolbars you don't specify toolbar content directly: instead, you create other ui components and supply them to the toolbar constructor. you can supply three sorts of ui components: action buttons toggle buttons frames this add-on builds part of the user interface for a music player using action buttons for the controls and a frame to display art and the currently playing song: var { act...
...listen to. toolbar supports the following events: attach, detach, show, and hide. listener : function the listener function. this may be passed arguments, depending on the particular event. once(event, listener) assign a listener to the first occurrence only of an event emitted by the toolbar. toolbar supports the following events: attach, detach, show, and hide. the listener is automatically
removed after the first time the event is emitted. var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame] }); toolbar.once("show", showing); toolbar.once("hide", hiding); function showing(e) { console.log("showing: " + e.title); } function hiding(e) ...
...oolbar.once("hide", hiding); function showing(e) { console.log("showing: " + e.title); } function hiding(e) { console.log("hiding: " + e.title); } parameters event : string the name of the event to listen to. toolbar supports the following events: attach, detach, show, and hide. listener : function the listener function. this may be passed arguments, depending on the particular event.
removelistener(event, listener)
removes an event listener. for example, this code is equivalent to once(): var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame] }); toolbar.on("show", showing); toolbar.on("hide", hiding); function showing(e) { conso...
...And 2 more matches
HTML to DOM - Archive of obsolete content
although you can now natively parse html using domparser and xmlhttprequest, this is a new feature that is not yet supported by all browsers in use in the wild. the code snippets on this page will let your site work until these new features are more widely available. ...
...yet supported by all browsers in use in the wild. the code snippets on this page will let your site work until these new features are more widely available. safely parsing simple html to dom when using xmlhttprequest to get the html of a
remote webpage, it is often advantageous to turn that html string into dom for easier manipulation. however, there are potential dangers involved in injecting
remote content in a privileged context in your extension, so it can be desirable to parse the html safely. ...
...
remote webpage, it is often advantageous to turn that html string into dom for easier manipulation. however, there are potential dangers involved in injecting
remote content in a privileged context in your extension, so it can be desirable to parse the html safely. the function below will safely parse simple html and return a dom object which can be manipulated like web page elements. this will
remove tags like <script>, <style>, <head>, <body>, <title>, and <iframe>. it will also
remove all javascript, including element attributes that contain javascript. function htmlparser(ahtmlstring){ var html = document.implementation.createdocument("http://www.w3.org/1999/xhtml", "html", null), body = document.createelementns("http://www.w3.org/1999/xhtml", "body"); html.documentelement.appe...
...And 2 more matches
Tabbox - Archive of obsolete content
obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. ...
... obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. ...
...1 / fennec 1.0) this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. ...
...And 2 more matches
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
number can be hard-coded in the first run function, or you can use the add-on manager to dynamically get it. this can get tricky with the firefox 4 addonmanager, so it's probably best to keep it simple. uninstall scripts there are two common cases for needing these: cleaning up local data and presenting an uninstall feedback form. regarding local data, it is debatable if it is good practice to
remove it or not. if an add-on is uninstalled and later installed again, it might be desirable for preferences and other settings to be kept. another argument in favor of keeping that data is that firefox doesn't delete its profile folders after it is uninstalled, so it would be consistent to keep it. on the other hand, local data that is no longer needed takes unnecessary disk space and can contain ...
...elete its profile folders after it is uninstalled, so it would be consistent to keep it. on the other hand, local data that is no longer needed takes unnecessary disk space and can contain private information that users forget is there. it's up to the developer's discretion. uninstalling an add-on happens in 2 stages: first the add-on is flagged to be uninstalled, and then the add-on is actually
removed. in the case of bootstrapped extensions, both steps happen at the same time. in the case of "traditional" extensions, like those explained in the tutorial, both steps happen at different times. in this case the user is told that firefox needs to restart in order for the extension to be completely
removed. then the user has the option to restart right away, wait to restart whenever is convenie...
... so, in order to detect the first stage, you'll need to add an event listener using the addaddonlistener method. ...
...And 2 more matches
Appendix F: Monitoring DOM changes - Archive of obsolete content
for this reason, it is best to avoid using mutation listeners at all costs, especially from extensions. ...
...uest, and considerably more often for some methods), they work very well for certain applications pure css pure css can be more powerful than most people suspect. it is often possible to do things for which people have traditionally resorted to javascript with css alone. in particular, the ::before and ::after pseudo-elements, and pseudo-classes like :hover and :active can be used to achieve ext
remely complex dynamic behavior. late binding and event delegation often times, it suffices to bind event listeners to top-level elements and check for matching elements when the event fires. for instance, rather than watching for the creation of <a> elements and adding event listeners to them as they are created, an event listener can be added to the root <html> element, and when the event fires, ...
... preamble + selector + '{' + properties + '}'; (doc.head || doc.documentelement).appendchild(style); // this will only work in chrome privileged code. content code // should make do without weak references. ...
...And 2 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
many add-ons need to dynamically generate dom content, either xul or html, from their scripts. for security reasons, and to prevent errors, care needs to be taken to avoid evaluating arbitrary text as html. failure to do so can lead to execution or
remote scripts, and in the worst cases to privilege escalation which can leave a user's pc open to
remote attack. building dom trees in most cases, dom trees should be built exclusively with dom creation methods. the following methods will all safely create a dom tree without risk of
remote execution. json templating jsontodom.namespaces = { html: "http://www.w3.org/1999/xhtml", xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" }; jsontodom.defaultnamespace = jsontodom.namespaces.html; function jsontodom(jsontemplate...
...newitem.setattribute("value", "testvalue"); newitem.setattribute("label", "another popup menu item"); menupopup.appendchild(newitem); }; var jsontemplatebtn = ["xul:toolbarbutton", { id: "mytestbutton", class: "toolbarbutton-1", type: "menu", label: "test button label", tooltiptext: "test button tooltip",
removable: true, key: "mytestbutton123" }, [ "menupopup", { onpopupshowing: function(event) { addentrytopopup(this, document, window); } }, null ] ]; var capturednodes = {}; var toolbox = doc.getelementbyid("navigator-toolbox"); var palette = toolbox.palette; var domfragment = jsontodom(jsontemplatebtn, docum...
...rever possible, but is relatively safe and sometimes acceptable. function createscript(href, otherstuff) { var script = function (href, otherstuff) { dostuffwith(href); dootherstuff(); for (var somestuff in otherstuff) dosomemorestuffwith(somestuff); } return script.tosource() + "(" + [string.quote(href), uneval(otherstuff)] + ")"; } safely using
remote html in the above cases, we're working with text content that needs to appear in generated dom. there are cases, however, where we need to safely display formatted html sent by a
remote server. fortunately, there is a safe and simple way to do this. for webextensions the most simple way is sanitize the output about javascript inline declaration and other wrong content. for xul addon based t...
...And 2 more matches
Setting Up a Development Environment - Archive of obsolete content
create shortcuts for every profile you create, using the commands described at http://kb.mozillazine.org/command_line_arguments . for mac os x developers, there is also a way to set up "shortcuts". you can do this by opening the automator application, choosing run shell script and then entering the profile-loading script in the textbox: /applications/firefox.app/contents/macos/firefox-bin -no-
remote -p myprofile > /dev/null & you can change "/dev/null" to a file location, in case you want to see dump output from firefox, or other extensions. the last & prevents automator from waiting for your firefox session to finish. save this as an application, not a workflow. and you probably want to have these on your desktop or dock, for easy access. there are also some configuration changes you...
... to play around with the web developer tools that are included in firefox. some of them can be very useful for add-on development and overlap with the add-ons listed. in this section we'll cover a few that we have found to be very useful. dom inspector the dom inspector used to be part of firefox as an installer option, but since firefox 3 it has been separated as another add-on you can add and
remove. it's a very useful inspection tool that lets you look into the dom of html and xul documents, as well as applied css rules and associated javascript objects. introduction to dom inspector is a good guide on how to get started using it. the dom inspector is particularly useful in finding out how to overlay a window, and how to replace default css style rules. you can see the names of the file...
...of the previously mentioned add-ons. on the other hand, firebug has a very friendly, integrated user interface, and sees much more development that its counterparts. it's definitely worth a try. leak monitor memory leaks have always been a big criticism drawn against firefox. ...
...And 2 more matches
Performance best practices in extensions - Archive of obsolete content
extensions can do almost anything. there is a down side to this: poorly written extensions can have a severe impact on the browsing experience, including on the overall performance of firefox itself. this article offers some best practices and suggestions that can not only improve the performance and speed of your extension, but also of firefox itself. improving startup performance extensions are loaded and run whenever a new browser window opens. that means every time a window opens, your extension can have an impact on how long it takes the user to see the content they're trying to view. ...
... service, don't load the resources for those features until the user actually logs in. use javascript code modules you can create your own javascript code modules incorporating sets of features that are only needed under specific circumstances. this makes it easy to load chunks of your extension on the fly as needed, instead of loading everything all at once. while javascript modules can be ext
remely useful, and provide significant performance benefits, they should be used wisely. loading modules incurs a small cost, so breaking code up to an unnecessary degree can be counter-productive. code should be modularized to the extent that doing so increases clarity, and loading of large or expensive chunks of code fragments can be significantly deferred. defer everything that you can most exte...
...aks. as well as looking for these specific kinds of leaks, it's worth exercising your extension's functionality and checking the contents of about:memory for any excessive memory usage. for example, bug 719601 featured a "system principal" javascript compartment containing 100s of mbs of memory, which is much larger than usual. avoid writing slow css read the "writing efficient css" guide. ...
...And 2 more matches
Security best practices in extensions - Archive of obsolete content
o far in this document apply in this sphere, but here are some additional tips: api providers should use the https protocol, which provides better protection for data passed over the network. json has become a popular data format for return formats for web services. be sure to read using native json to find out the correct way to handle it. apis can't be used with self-signed certificates. ...
...e additional tips: api providers should use the https protocol, which provides better protection for data passed over the network. json has become a popular data format for return formats for web services. be sure to read using native json to find out the correct way to handle it. apis can't be used with self-signed certificates.
remote javascript and content there are a number of ways of
remote scripts being used in extensions. ...
...for more information, refer to the evalinsandbox() section. ...
...And 2 more matches
Using the Stylesheet Service - Archive of obsolete content
the stylesheet service allows extensions to manage user and ua stylesheets without having to touch usercontent.css or userchrome.css files. the api is defined in nsistylesheetservice.idl. the stylesheets registered with this api apply to all documents; firefox 18 extended nsidomwindowutils with loadadditionalstylesheet() and
removeadditionalstylesheet() to manage stylesheets for a specific document (bug 737003). the examples in this document are all written in javascript using xpcom. using the api the string "chrome://myext/content/myext.css" in the examples below is just an example. replace it with the url of the css file you want to load. you can replace user_sheet with agent_sheet or author_sheet, depending where in the css cascade you want the sheet to be placed. see the css ...
... var sss = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(c...
... var sss = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var u = ios.newuri("chro...
...And 2 more matches
Style System Overview - Archive of obsolete content
e'll see what this does later.) the main argument to rulesmatching is a structure of enumeration data that implementations use to determine more quickly which rules match. has a separate rulesmatching method for pseudo-elements. cssruleprocessor one cssruleprocessor per origin (ua, user, author) css rule processor sorts all the rules in cascade order, and then puts them in rulehash, which
remembers order and then hashes by first of id, class, tag, namespace, or unhashed. to match rules, we do lookups in the rulehash's tables,
remerge the lists of rules using stored indices, and then call selectormatchestree to find which selectors really match. matching of class and id selectors is much faster than, say, attribute selectors. (important advice for chrome css authors.) pseudo-element...
...s from the style context's rule node towards the root rule node. to fill in the data, we call nsistylerule::mapruleinfointo on the rules. mapruleinfointo implementations must check that the property is not filled in before filling it in. walkruletree stops walking up when it finds either a none bit, a cached struct, a dependent bit, or all the properties have been filled in. walkruletree also
remembers the first rule that contributed non-empty data. style data computation after walkruletree stops walking up, it calls nsrulenode::compute*data to turn the specified values into the mostly-computed style data in the style struct. compute*data use either a default or a start struct as the basis for the computation. a start struct is a cached struct in the rule tree that we can just copy ...
...parent style contexts correctly (sibling sharing may not be the same) rather than just changing data. [design flaw, again] any specially-parented style contexts (not along frame parents, which need not be content parents) are reconstructed using nsiframe::getparentstylecontextframe. can return same style context due to sibling sharing unless we're destroying the rule tree for a style sheet/rule
removal. dynamic changes to content reresolvestylecontext calculates differences (repaint, reflow, reframe, etc.) between style old and new style contexts and does appropriate cleanup it uses nsistylecontext::calcstyledifference, which only computes differences for structs that have been requested. (i'll call this the data-struct-based hint mechanism.) caller of nsiframemanager::computestylech...
...And 2 more matches
Anonymous Content - Archive of obsolete content
neath the bound element. the binding responsible for the generation is referred to as the primary generating binding. whenever the primary generating binding changes on a bound element, all anonymous nodes in the scope of the bound element are destroyed. attribute forwarding attributes on anonymous content elements can be tied to attributes on the bound element. whenever the attribute is set or
removed on the bound element, the corresponding attribute on the anonymous content is also set or
removed. on any anonymous content element in a template, an inherits attribute can be used to specify a comma-separated list of attributes that should be inherited. attributes with namespaces can be defined using a namespace prefix and the attribute name separate by a colon. for example, on the html fil...
...ric and will match on all content. the insertion point used for a given piece of content is the first encountered with a selector whose node set matches the element when doing a depth-first walk of the content template. note that children elements are never cloned when content is generated from a template. handling dom changes insertion points continuing to be used as elements are inserted or
removed from the dom. whenever an element is inserted or appended, all insertion points are checked following all the same rules that applied when first placing explicit children during anonymous content generation. if no insertion point is found for the newly-inserted child, then the binding is no longer a fit for the bound element, and all anonymous content will be destroyed. whenever an element i...
...ed from the dom. whenever an element is inserted or appended, all insertion points are checked following all the same rules that applied when first placing explicit children during anonymous content generation. if no insertion point is found for the newly-inserted child, then the binding is no longer a fit for the bound element, and all anonymous content will be destroyed. ...
...And 2 more matches
Template Builder Interface - Archive of obsolete content
ble via the element's 'builder' property both for content builders and for tree builders. an element that does not have a builder will have this property set to null. the processes of creating a builder for an element applies both when an element is created when the window is loaded and when an element is inserted dynamically. templates can only be used in xul documents, however, there is no requi
rement that the templates generate xul elements. they could also be used, for example, to generate html elements. this isn't a very common technique, however, here is an example of how this can be used: <html:div id="photoslist" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:html="http://www.w3.org/1999/xhtml"> <html:h1>my photos</html...
... so all xul elements will have this property, although, as mentioned earlier, is will be set to null for most elements. for non-xul elements, the template builder will be assigned to a builder property on the element using a custom javascript property instead. rebuilding and refreshing a template the main purpose of accessing the builder for an element is to call its 'rebuild' method. this method
removes any existing generated content and deletes all data in the rule network. then, the method recompiles the query and the rules and regenerates the content. essentially, the rebuild method instructs the builder to
remove any existing information and reconstruct it from the beginning. the only difference is that the datasource has already loaded so the data will be the same. however, this is ofte...
...les. for rdf datasources, the builder's refresh method, however, will reload the datasources. it will not rebuild the template, but we'll see in a later section why this is not usually necessary. to summarize, the refresh method reloads the data, whereas the rebuild method reconstructs the content. the builder is accessible to unprivileged code, so the rebuild and refresh methods may be called by
remote code. changing the datasource you can modify the datasource that is used for a template by setting the value of the datasources attribute on the root element. changing this attribute causes the new datasource to be retrieved and the template to be rebuilt. the rdf datasource associated with the template can be retrieved using the element's 'database' property. it implements the nsirdfcomposite...
...And 2 more matches
Custom toolbar button - Archive of obsolete content
="0.2.9" em:maxversion="99" /> </em:targetapplication> <em:file> <description about="urn:mozilla:extension:custombutton" em:package="content/custombutton/" /> </em:file> </description> </rdf> optionally customize the file by changing the name, description and creator. change the text between double-quote characters on these three lines. optionally
remove the sections for target applications that you do not want. save the file. explanation: this file contains information used by the application's extension manager. sections for target applications specify the versions where the extension works. the last section in the file specifies that this extension adds content to the application. 4. create a plain text file named chrome.manifest. copy...
... save the file. explanation: this file defines the extension's content. it adds a stylesheet to the toolbar customization window. then it specifies an overlay for each toolbar. 5. create a directory named chrome. perform the following steps in that directory, creating five files there. explanation: the chrome directory contains files that s...
...ton details --> <toolbarbutton id="custom-button-1" label="custom" tooltiptext="my custom toolbar button" oncommand="custombutton[1]()" class="toolbarbutton-1 chromeclass-toolbar-additional custombutton" /> </overlay> optionally customize the file by changing the label and tooltiptext in the last section. change the text between double-quote characters on these two lines. optionally
remove the sections for toolbars that you do not need. save the file. explanation: this xul file adds the button to the application's toolbar customization palette. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making sure that you scroll to get ...
...And 2 more matches
colorpicker - Archive of obsolete content
you may use onclick when you are working with a plain colorpicker and ...
...you may use onclick when you are working with a plain colorpicker and need the currently ...
...you may use onclick when you are working with a plain colorpicker and need the currently selected color for exam...
...And 2 more matches
description - Archive of obsolete content
typically, this will cause the text to appear bold. indent this class causes the text to be indented on its left side. monospace this...
...typically, this will cause the text to appear bold. indent this class causes the text to be indented on its left side. monospace this class causes the t...
...typically, this will cause the text to appear bold. indent this class causes the text to be indented on its left side. monospace this class causes the text to be displayed in ...
...And 2 more matches
dialog - Archive of obsolete content
canceldialog() return type: no return value cancels the dialog a...
... canceldialog() return type: no return value cancels the dialog and closes it, simil...
... canceldialog() return type: no return value cancels the dialog and closes it, similar to pressing the canc...
...And 2 more matches
listcell - Archive of obsolete content
specify the image using the image attribute. note that both an image and a label are added when this st...
...specify the image using the image attribute. note that both an image and a label are added when this style is set. the lab...
...specify the image using the image attribute. note that both an image and a label are added when this style is set. the label will take up extra s...
...And 2 more matches
listitem - Archive of obsolete content
these classes should be used instead of changing the style of the element directly since they will fit more naturally with...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selecte...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. listitem-ic...
...And 2 more matches
menupopup - Archive of obsolete content
moveto( x, y ) return type: no return value moves the popup to a new location...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen ...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not cl...
...And 2 more matches
panel - Archive of obsolete content
moveto( x, y ) return type: no return value moves the popup to a new location...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen ...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not cl...
...And 2 more matches
preference - Archive of obsolete content
you can handle this if you wish to. related preferences system documentati...
...you can handle this if you wish to. related preferences system documentation: introducti...
...you can handle this if you wish to. related preferences system documentation: introduction: getting started | e...
...And 2 more matches
prefwindow - Archive of obsolete content
addpane( prefpane ) return type: no return v...
... addpane( prefpane ) return type: no return value append ...
... addpane( prefpane ) return type: no return value append a prefpane to a list of...
...And 2 more matches
scrollbar - Archive of obsolete content
ntainer to allow the user to scroll around in the container. the scroll bar may also be used independently when a numeric value or percentage needs to be selected by the user. the user can adjust the position of the scroll bar by clicking arrows on either end of the scroll bar or by dragging the scroll bar thumb around. more information is available in the xul tutorial. ...
...er to scroll around in the container. the scroll bar may also be used independently when a numeric value or percentage needs to be selected by the user. the user can adjust the position of the scroll bar by clicking arrows on either end of the scroll bar or by dragging the scroll bar thumb around. more information is available in the xul tutorial. ...
...nd of the scroll bar or by dragging the scroll bar thumb around. more information is available in the xul tutorial. attributes curpos, inc
rement, maxpos, pageinc
rement examples <scrollbar curpos="5" maxpos="50"/> attributes curpos type: integer the current position of the scrollbar, which ranges from 0 to the value of the maxpos attribute. the default value is 0. inc
rement type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). the default value is 1. ...
...And 2 more matches
splitter - Archive of obsolete content
these classes should be used instead of changing the style of the element directly since they will fit more naturally with...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selecte...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. tree-splitt...
...And 2 more matches
tooltip - Archive of obsolete content
moveto( x, y ) return type: no return value moves the popup to a new location d...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen co...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not clie...
...And 2 more matches
treecol - Archive of obsolete content
this class should be used instead of changing the style of the element directly since it will fit more naturally with the us...
...this class should be used instead of changing the style of the element directly since it will fit more naturally with the user's selected theme...
...this class should be used instead of changing the style of the element directly since it will fit more naturally with the user's selected theme. treecol-imag...
...And 2 more matches
wizard - Archive of obsolete content
this is equivalent to pressing the next button. the canadvance property ...
...this is equivalent to pressing the next button. the canadvance property must be set to true...
...this is equivalent to pressing the next button. the canadvance property must be set to true for the page to be cha...
...And 2 more matches
XULRunner tips - Archive of obsolete content
zapps/content/extensions/extensions.xul?type=extensions"); pref("xpinstall.dialog.progress.type.skin", "extension:manager-themes"); pref("xpinstall.dialog.progress.type.chrome", "extension:manager-extensions"); pref("extensions.update.enabled", true); pref("extensions.update.interval", 86400); pref("extensions.dss.enabled", false); pref("extensions.dss.switchpending", false); pref("extensions.igno
remtimechanges", false); pref("extensions.logging.enabled", false); pref("general.skins.selectedskin", "classic/1.0"); // nb these point at amo pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties"); pref("extensions.getmoreextensionsurl", "chrome://mozapps/locale/extensions/extensions.properties"); pref("extensions.getmorethemesurl", "chrome://mozapps/locale/extens...
...le/extensions/extensions.properties"); pref("extensions.getmorethemesurl", "chrome://mozapps/locale/extensions/extensions.properties"); if your application is based on gecko 2.0, you need to register a component through the new component registration because the extension manager uses fuel, namely application.restart(), to restart your xulrunner-based application after any change (installation,
removal, enabling, disabling) in the extensions' list: copy files fuelapplication.js and fuelapplication.manifest from browser/fuel/src for instance into your components/ directory tweak the line #include ../../../toolkit/components/exthelper/extapplication.js in your copy of fuelapplication.js as needed make sure to declare the fuel module and the two files in your components/makefile.in as in ...
...rval", 2000); pref("browser.download.manager.retention", 2); pref("browser.download.manager.showwhenstarting", true); pref("browser.download.manager.usewindow", true); pref("browser.download.manager.closewhendone", true); pref("browser.download.manager.opendelay", 0); pref("browser.download.manager.focuswhenstarting", false); pref("browser.download.manager.flashcount", 2); // pref("alerts.slideinc
rement", 1); pref("alerts.slideinc
rementtime", 10); pref("alerts.totalopentime", 4000); pref("alerts.height", 50); if you are missing preferences that a dialog requires, you will get the following errors: component returned failure code: 0x8000ffff (ns_error_unexpected) [nsiprefbranch.getboolpref] error: dialog has no properties source file: chrome://mozapps/content/downloads/u...ontenttype.xul l...
...And 2 more matches
XForms Select1 Element - Archive of obsolete content
) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - 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 (see #representations section to refer if the attribute is supported for every representation). inc
remental - supported, default value is true properties selection - see corresponding attribute inc
remental - see corresponding attribute type restrictions the select1 element can be bound to a node containing simple content. 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. th...
...values: combobox - default representation (xhtml/xul) listbox - used when appearance = 'compact' (xhtml/xul) radio group - used when appearance = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). ...
...loses focus), otherwise it is updated upon item selection listbox the select1 is represented as listbox (xhtml/xul). ...
...And 2 more matches
Game distribution - Game development
if you truly want to succeed. mobile devices are where html5 technology can truly shine and show its advantages. there's no flash, and html5 is fully multiplatform. trying to compete with desktop games directly is very difficult. you can put your html5 games into the same arena (see native desktop, later on) and you should because it's good to diversify the platforms you support, but you have to
remember that developers creating desktop games have years of experience, great tools and stable distribution channels. many html5 games will target different market segments than native desktop games, e.g. simple time killer games to be played while on the move rather than huge immersive experiences. such games are often designed to be played with two, or even one finger, so you can hold the device,...
...ovide desktop controls for your games even if you're mostly targeting mobile. players are enjoying your games on any platform available, and desktop is one of them. plus, it is usually easier to build and test the game first on desktop, and then move on to debugging mobile. publishing the game there are three main options when it comes to publishing a game: self-hosting publishers stores
remember that the name of your game should be unique enough to be quickly promoted later on, but also catchy enough, so people don't forget it. self-hosting if you are a front-end developer, you may already know what to do. an html5 game is just another website. you can upload it to a
remote server, grab a catchy domain name, and host it yourself. if you want to make money out of game dev, you sho...
...their store is another available option. native mobile stores when it comes to the mobile market, there's the apple app store for ios, google play for android and all the rest of the competition. native stores are already filled with established devs selling great games, so you have to be talented and lucky to get noticed. the ios app store is quite hard to get into as there are strict requi
rements games have to meet, and you'll have to wait a week or two to get accepted. plus, it's the most prominent mobile store, with hundreds of thousands of apps, so it's ext
remely hard to stand out from the crowd. google play's requi
rements are less strict, so the store is polluted with low quality games. it's still quite hard to be noticed there as the number of apps submitted daily is huge. it's ...
...And 2 more matches
Game promotion - Game development
ns generally require games to follow a mandatory theme, so you can get creative around a theme if you are stuck for ideas. website and blog you should definitely create your own website containing all the information about your games, so people can see what you've worked on. the more information you can include the better — you should include screenshots, description, trailer, press kit, requi
rements, available platforms, support details and more. you'll get bonus points for allowing your users to directly play your games online — at least in demo form. also, you should do some work on seo to allow people to find your games more easily. you should also blog about everything related to your gamedev activities. write about your development process, nasty bugs you encounter, funny stories...
...essons learned, and the ups and downs of being a game developer. continually publishing information about your games will help educate others, increase your reputation in the community, and further improve seo. a further option is to publish monthly reports that summarize all your progress — it helps you see what you've accomplished throughout the month and what's still left to do, and it keeps
reminding people that your game is coming out soon — building buzz is always good. while you can create your website from scratch, there are also tools that can help make the process easier. manakeep is a website builder made for indie game developers and provides a great starting point to create your website. presskit() is a press kit builder that helps you create a press page to share with the...
... nobody likes boring press releases or pushy advertisements. when the time comes your community will help you spread the word about your shiny little game. you should use at least twitter and facebook and be active on appropriate forums — the most popular one is html5gamedevs.com. share your gamedev news and answer questions, so people will value what you're doing and will know that you're ok.
remember to not be too pushy on telling everyone about your games — you're not a walking advertisement. grow your fanbase by talking to them, sharing tips, offering discounts, giving away prizes in competitions, or just complaining at the weather or buggy browser you have to deal with. act cool, be generous, be yourself and be there for others, and you'll get treated with respect. game portals u...
...And 2 more matches
The box model - Learn web development
line flex container and paragraphs all run together on one line rather than breaking onto new lines as they would do if they were displaying as block-level elements. in the example, you can change display: inline to display: block or display: inline-flex to display: flex to toggle between these display modes. you will encounter things like flex layout later in these lessons; the key thing to
remember for now is that changing the value of the display property can change whether the outer display type of a box is block or inline, which changes the way it displays alongside other elements in the layout. in the rest of the lesson, we will concentrate on the outer display type. what is the css box model? the full css box model applies to block boxes, inline boxes only use some of the beha...
...margin is always added after the size of the visible box has been calculated. we can control all margins of an element at once using the margin property, or each side individually using the equivalent longhand properties: margin-top margin-right margin-bottom margin-left in the example below, try changing the margin values to see how the box is pushed around due to the margin creating or
removing space (if it is a negative margin) between this element and the containing element. margin collapsing a key thing to understand about margins is the concept of margin collapsing. if you have two elements whose margins touch, and both margins are positive, those margins will combine to become one margin, which is the size of the largest individual margin. if one or both margins are negat...
...in between the two paragraphs will not change — it retains the 50 pixels set in the bottom-margin of paragraph one. if you set it to -10px, you'll see that the overall margin becomes 40px — it subtracts from the 50px. there are a number of rules that dictate when margins do and do not collapse. for further information see the detailed page on mastering margin collapsing. the main thing to
remember for now is that margin collapsing is a thing that happens. if you are creating space with margins and don't get the space you expect, this is probably what is happening. borders the border is drawn between the margin and the padding of a box. if you are using the standard box model, the size of the border is added to the width and height of the box. if you are using the alternative box mod...
...And 2 more matches
Grids - Learn web development
inibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius commodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lo
rem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu urna eget velit cursus viverra quis vestibulum sem. aliquam tincidunt eget purus in interdum. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </article> <aside> <h2>other things</h2> <p>nam vulputate diam nec tempor bibendum.
...e value -1 to target the end column or row line, and count inwards from the end using negative values. however this only works for the explicit grid. the value -1 will not target the end line of the implicit grid. positioning with grid-template-areas an alternative way to place items on your grid is to use the grid-template-areas property and giving the various elements of your design a name.
remove the line-based positioning from the last example (or re-download the file to have a fresh starting point), and add the following css. .container { display: grid; grid-template-areas: "header header" "sidebar content" "footer footer"; grid-template-columns: 1fr 3fr; grid-gap: 20px; } header { grid-area: header; } article { grid-area: content; } aside { grid-a...
...inibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius commodo et a urna. ut id ornare felis, eget fermentum sapien.</p> <p>nam vulputate diam nec tempor bibendum. donec luctus augue eget malesuada ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lo
rem. vivamus tristique elit dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu urna eget velit cursus viverra quis vestibulum sem. aliquam tincidunt eget purus in interdum. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </article> <aside><h2>other things</h2> <p>nam vulputate diam nec tempor bibendum. done...
...And 2 more matches
Responsive design - Learn web development
is indicates how many columns you want your content to be split into. the browser then works out the size of these, a size that will change according to the screen size. .container { column-count: 3; } if you instead specify a column-width, you are specifying a minimum width. the browser will create as many columns of that width as will comfortably fit into the container, then share out the
remaining space between all the columns. therefore the number of columns will change according to how much space there is. .container { column-width: 10em; } flexbox in flexbox, flex items will shrink and distribute space between the items according to the space in their container, as their initial behavior. by changing the values for flex-grow and flex-shrink you can indicate how you want the...
...u can find a detailed guide to responsive images in the learn html section here on mdn. responsive typography an element of responsive design not covered in earlier work was the idea of responsive typography. essentially, this describes changing font sizes within media queries to reflect lesser or greater amounts of screen real estate. ...
...you can see how the heading switches sizes as the layout goes to the two column version. ...
...And 2 more matches
How can we design for all types of users? - Learn web development
s as 16 pixels. in this case, zooming did nothing, even as late as internet explorer 8, which we still have to cater to because it's still around. relative units also called proportional units, relative units are computed relative to a parent element. relative units are friendlier to accessibility because they respect the settings on the user's system. relative units are expressed in em, % and
rem: percent-based sizes: % this unit tells your browser that an element's font size must be n% of the previous element whose font size was expressed. if no parent can be found, the default font size within the browser is considered as the base size for the calculation (usually the equivalent of 16 pixels). em-based sizes: em this unit is calculated the same way as percents, except that you com...
...e found, the default font size within the browser is considered as the base size for the calculation (usually the equivalent of 16 pixels). em-based sizes: em this unit is calculated the same way as percents, except that you compute in portions of 1 and not portions of 100. it is said that "em" is the width of a capital “m” in the alphabet (roughly speaking, an “m” fits into a square).
rem-based sizes:
rem this unit is proportional to the root element's font size and is expressed as portions of 1, like em. suppose we wanted a base font size of 16px and an h1 (main heading) at the equivalent of 32px, yet if within the h1 we find a span with the subheading class, it too must be rendered at the default font size (usually 16px). here is the html we're using: <!doctype html> <html ...
...hus 32 pixels */ span.subheading { font-size:0.5em; } /* half the size of the h1, thus 16 pixels to come back to the original size */ as you can see, the math quickly gets daunting when you have to keep track of the parent, the parent's parent, the parent's parent's parent, and so on. (most designs are done in pixel-based software, so the math has to be done by the person coding the css). enter
rem. ...
...And 2 more matches
How do you upload your files to a web server? - Learn web development
then fill in your provided username and password in the relevant fields. fill in the correct port and other information. your window should look something like this: now press connect to connect to the sftp server. note: make sure your hosting provider offers sftp (secure ftp) connection to your hosting space. ftp is inherently insecure, and you shouldn't use it. here and there: local and
remote view once connected, your screen should look something like this (we've connected to an example of our own to give you an idea): let's examine what you're seeing: on the center left pane, you see your local files. navigate into the directory where you store your website (e.g. mdn). on the center right pane, you see
remote files. we are logged into our distant ftp root (in this case, us...
...eraction between your sftp client and the server. uploading to the server our example host instructions told us "to publish on the web, put your files into the public/htdocs directory." you need to navigate to the specified directory in your right pane. this directory is effectively the root of your website — where your index.html file and other assets will go. once you've found the correct
remote directory to put your files in, to upload your files to the server you need to drag-and-drop them from the left pane to the right pane. are they really online? so far, so good, but are the files really online? you can double-check by going back to your website (e.g. http://demozilla.examplehostingprovider.net/) in your browser: and voilà! our website is live! rsync rsync is a local-to-...
...ote directory to put your files in, to upload your files to the server you need to drag-and-drop them from the left pane to the right pane. are they really online? so far, so good, but are the files really online? you can double-check by going back to your website (e.g. http://demozilla.examplehostingprovider.net/) in your browser: and voilà! our website is live! rsync rsync is a local-to-
remote file synchronizing tool, which is generally available on most unix-based systems (like macos and linux), but windows versions exist too. it is seen as a more advanced tool than sftp, beause by default it is used on the command line. a basic command looks like so: rsync [-options] source user@x.x.x.x:destination -options is a dash followed by a one or more letters, for example -v for verbo...
...And 2 more matches
The HTML5 input types - Learn web development
orm of a spinner to increase and decrease the value of the control. on devices with dynamic keyboards, the numeric keyboard is generally displayed. the following screenshot (from firefox for android) provides an example: with the number input type, you can constrain the minimum and maximum values allowed by setting the min and max attributes. you can also use the step attribute to set the inc
rement increase and decrease caused by pressing the spinner buttons. by default, the number input type only validates if the number is an integer. to allow float numbers, specify step="any". if omitted, the step value defaults to 1, meaning only whole numbers are valid. let's look at some examples. the first one below creates a number control whose value is restricted to any value between 1 and 10, ...
... the second one creates a number control whose value is restricted to any value between 0 and 1 inclusive, and whose increase and decrease buttons change its value by 0.01. <input type="number" name="change" id="pennies" min="0" max="1" step="0.01"> the number input type makes sense when the range of valid values is limited, for example a person's age or height. if the range is too large for inc
remental increases to make sense (such as usa zip codes, which range from 00001 to 99999), the tel type might be a better option; it provides the numeric keypad while forgoing the number's spinner ui feature. note: number inputs are not supported in versions of internet explorer below 10. slider controls another way to pick a number is to use a slider. you see these quite often on sites like hou...
...umber whose precise value is not necessarily important. a slider is created using the <input> with its type attribute set to the value range. the slider-thumb can be moved via mouse or touch, or with the arrows of the keypad. it's important to properly configure your slider. to that end, it's highly recommended that you set the min, max, and step attributes which set the minimum, maximum and inc
rement values, respectively. let's look at the code behind the above example, so you can see how its done. first of all, the basic html: <label for="price">choose a maximum house price: </label> <input type="range" name="price" id="price" min="50000" max="500000" step="100" value="250000"> <output class="price-output" for="price"></output> this example creates a slider whose value may range betwee...
...And 2 more matches
Styling web forms - Learn web development
r overall site design more than ever, and the web platform has changed to make this more possible. for some form widgets, it is still difficult to rebuild controls to make them stylable, but we can now use css to style many form features, though we do need to take extra care to ensure we don't break usability. not all widgets are created equal when css is involved at present, some difficulties
remain when using css with forms. these problems can be divided into three categories: the good some elements can be styled with few if any problems across platforms. these include the following elements: <form> <fieldset> and <legend> single-line text <input>s (e.g. type text, url, email...), except for <input type="search">. multi-line <textarea>s buttons (both <input> and <button>s) <lab...
...t tricky to control placement of it. by default it is always positioned over the top border of its <fieldset> parent, near the top left corner. to position it somewhere else, for example inside the fieldset somewhere, or near the bottom left corner, you need to rely on positioning. ...
...bfont.woff2') format('woff2'), url('fonts/journal-webfont.woff') format('woff'); font-weight: normal; font-style: normal; } @font-face { font-family: 'typewriter'; src: url('fonts/veteran_typewriter-webfont.woff2') format('woff2'), url('fonts/veteran_typewriter-webfont.woff') format('woff'); font-weight: normal; font-style: normal; } body { font : 1.3
rem sans-serif; padding : 0.5em; margin : 0; background : #222; } form { position : relative; width : 740px; height : 498px; margin : 0 auto; padding: 1em; box-sizing: border-box; background : #fff url(background.jpg); /* we create our grid */ display : grid; grid-gap : 20px; grid-template-columns : repeat(2, 1fr); grid-template-rows : 10em 1em 1em 1em; } notice...
...And 2 more matches
Document and website structure - Learn web development
splaying a fullscreen video or game, is part of some kind of art project, or is just badly structured: header: usually a big strip across the top with a big heading, logo, and perhaps a tagline. this usually stays the same from one webpage to another. navigation bar: links to the site's main sections; usually represented by menu buttons, links, or tabs. ...
...inks to the site's main sections; usually represented by menu buttons, links, or tabs. like the header, this content usually
remains consistent from one webpage to another — having inconsistent navigation on your website will just lead to confused, frustrated users. many web designers consider the navigation bar to be part of the header rather than an individual component, but that's not a requi
rement; in fact, some also argue that having the two separate is better for accessibility, as screen readers can read the two features better if they are separate. main content: a big area in the center that contains most of the unique content of a given webpage, for example, the video you want to watch, or the main story you're reading, or the map you want to view, or the news headlines, etc. this...
... <!-- a search form is another commmon non-linear way to navigate through a website. ...
...And 2 more matches
Images in HTML - Learn web development
roof that the image is, in fact, in the public domain. copyright violations are illegal and unethical. in addition, never point your src attribute at an image hosted on someone else's website that you don't have permission to link to. this is called "hotlinking". again, stealing someone's bandwidth is illegal. it also slows down your page, leaving you with no control over whether the image is
removed or replaced with something embarrassing. our above code would give us the following result: note: elements like <img> and <video> are sometimes referred to as replaced elements. this is because the element's content and size are defined by an external resource (like an image or video file), not by the contents of the element itself. note: you can find the finished example from this s...
... inserts a tab character).</p> <textarea id="code" class="input" style="min-height: 100px; width: 95%"> <img> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent...
...information supporting the main text. a figure could be several images, a code snippet, audio, video, equations, a table, or something else. active learning: creating a figure in this active learning section, we'd like you to take the finished code from the previous active learning section, and turn it into a figure: wrap it in a <figure> element. copy the text out of the title attribute,
remove the title attribute, and put the text inside a <figcaption> element below the image. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see an answer: playable code 2 <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus...
...And 2 more matches
Manipulating documents - Learn web development
content = 'we hope you enjoyed the ride.'; you can now append the new paragraph at the end of the section using node.appendchild(): sect.appendchild(para); finally for this part, let's add a text node to the paragraph the link sits inside, to round off the sentence nicely. first we will create the text node using document.createtextnode(): const text = document.createtextnode(' — the p
remier source for web development knowledge.'); now we'll grab a reference to the paragraph the link is inside, and append the text node to it: const linkpara = document.queryselector('p'); linkpara.appendchild(text); that's most of what you need for adding nodes to the dom — you'll make a lot of use of these methods when building dynamic interfaces (we'll look at some examples later). mo...
...e for web development knowledge.'); now we'll grab a reference to the paragraph the link is inside, and append the text node to it: const linkpara = document.queryselector('p'); linkpara.appendchild(text); that's most of what you need for adding nodes to the dom — you'll make a lot of use of these methods when building dynamic interfaces (we'll look at some examples later). moving and
removing elements there may be times when you want to move nodes, or delete them from the dom altogether. this is perfectly possible. if we wanted to move the paragraph with the link inside it to the bottom of the section, we could simply do this: sect.appendchild(linkpara); this moves the paragraph down to the bottom of the section. you might have thought it would make a second copy of it, but t...
... it to the bottom of the section, we could simply do this: sect.appendchild(linkpara); this moves the paragraph down to the bottom of the section. you might have thought it would make a second copy of it, but this is not the case — linkpara is a reference to the one and only copy of that paragraph. if you wanted to make a copy and add that as well, you'd need to use node.clonenode() instead. ...
...And 2 more matches
Third-party APIs - Learn web development
ur url variable to fetch(), convert the response body to json using the json() function, then pass the resulting json to the displayresults() function so the data can be displayed in our ui. displaying the data ok, let's look at how we'll display the data. add the following function below your fetchresults() function. ...
...child(para1); article.appendchild(para2); article.appendchild(clearfix); section.appendchild(article); } } } there's a lot of code here; let's 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...
... block (if(current.multimedia.length > 0) { ... }) to check whether each article has any images associated with it (some stories don't.) we display the first image only if it exists (otherwise an error would be thrown). we gave our <div> element a class of "clearfix", so we can easily apply clearing to it. wiring up the pagination buttons to make the pagination buttons work, we will inc
rement (or dec
rement) the value of the pagenumber variable, and then re-rerun the fetch request with the new value included in the page url parameter. this works because the nytimes api only returns 10 results at a time — if more than 10 results are available, it will return the first 10 (0-9) if the page url parameter is set to 0 (or not included at all — 0 is the default value), the next 10 (10...
...And 2 more matches
Accessibility in React - Learn web development
ll see this dashed focus indicator move between each of the filter buttons. keep going until the focus indicator is around the first "edit" button. press enter. the <todo /> component will switch templates, as we designed, and you'll see a form that lets us edit the name of the task. but where did our focus indicator go? when we switch between templates in our <todo /> component, we completely
remove the elements that were there before to replace them with something else. that means the element that we were focused on vanishes, and nothing is in focus at all. this could confuse a wide variety of users — particularly users who rely on the keyboard, or users who use a screen reader. to improve the experience for keyboard and screen-reader users, we should manage the browser’s focus ours...
...ars first in the code. main render (3) todo.js:100 side effect (3) todo.js:98 that's it for our experimentation for now. delete console.log("main render") now, and lets move on to implementing our focus management. focusing on our editing field now that we know our useeffect() hook works, we can manage focus with it. as a
reminder, we want to focus on the editing field when we switch to the editing template. update your existing useeffect() hook so that it reads like this: useeffect(() => { if (isediting) { editfieldref.current.focus(); } }, [isediting]); these changes make it so that, if isediting is true, react reads the current value of the editfieldref and moves browser focus to it. we also pass an arra...
...rn similar to our previous changes: we'll make a new ref, and utilize our useprevious() hook, so that we can focus on the list heading whenever a user deletes a task. why the list heading? sometimes, the place we want to send our focus to is obvious: when we toggled our <todo /> templates, we had an origin point to "go back" to — the "edit" button. in this case however, since we're completely
removing elements from the dom, we have no place to go back to. the next best thing is an intuitive location somewhere nearby. the list heading is our best choice because it's close to the list item the user will delete, and focusing on it will tell the user how many tasks are left. creating our ref import the useref() and useeffect() hooks into app.js — you'll need them both below: import react...
...And 2 more matches
React interactivity: Events and state - Learn web development
in the above example, we're adding an onclick attribute to the <button> element. the value of that attribute is a function that triggers a simple alert. the onclick attribute has special meaning here: it tells react to run a given function when the user clicks on the button. there are a couple of other things to note: the camel-cased nature...
...as a matter of good practice, you should clear the input after your form submits, so we'll call setname() again with an empty string to do so: function handlesubmit(e) { e.preventdefault(); props.addtask(name); setname(""); } at last, you can type s...
...x todo- plus a unique string generated by nanoid. update your newtask constant declaration to this: const newtask = { id: "todo-" + nanoid(), name: name, completed: false }; save everything, and try your app again — now you can add tasks without getting that warning about duplicate ids. detour: counting tasks now that we can add new tasks, you may notice a problem: our heading reads 3 tasks
remaining, no matter how many tasks we have! we can fix this by counting the length of tasklist and changing the text of our heading accordingly. add this inside your app() definition, before the return statement: const headingtext = `${tasklist.length} tasks
remaining`; hrm. this is almost right, except that if our list ever contains a single task, the heading will still use the word “tasks”.
...And 2 more matches
Deployment and next steps - Learn web development
ons for deploying our svelte applications, further resources, and more. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/08-next-steps or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/08-next-steps
remember to run npm install && npm run dev to start your app in development mode. compiling our app so far we've been running our app in development mode with npm run dev. as we saw earlier, this instruction tells svelte to compile our components and javascript files into a public/build/bundle.js file and all the css sections of our components into public/build/bundle.css. it also starts a developm...
...nges to a git repository. most of them involve setting up a deployment pipeline that gets triggered on every git push, and takes care of building and deploying your web site. to demonstrate this, we will deploy our todos app to gitlab pages. first you'll have to register at gitlab and then create a new project. give you new project a short, easy name like "mdn-svelte-todo". you will have a
remote url that points to your new gitlab git repository, like git@gitlab.com:[your-user]/[your-project].git. before you start to upload content to your git repository, it is a good practice to add a .gitignore file to tell git which files to exclude from source control. in our case we will tell git to exclude files in the node_modules directory by creating a .gitignore file in the root folder ...
...ore file in the root folder of your local project, with the following content: node_modules/ now let's go back to gitlab. after creating a new repo gitlab will greet you with a message explaining different options to upload your existing files. follow the steps listed under the push an existing folder heading: cd your_root_directory # go into your project's root directory git init git
remote add origin https://gitlab.com/[your-user]/mdn-svelte-todo.git git add . git commit -m "initial commit" git push -u origin master note: you could use the git protocol instead of https, which is faster and saves you from typing your username and password every time you access your origin repo. to use it you'll have to create an ssh key pair. your origin url will be like this: git@gitlab.co...
...And 2 more matches
Focus management with Vue refs - Learn web development
features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to handle focus management using vue refs. the focus management problem while we do have working edit functionality, we aren't providing a great experience for non-mouse users. specifically, when a user activates the "edit" button, we
remove the "edit" button from the dom, but we don't move the user's focus anywhere, so in effect it just disappears. this can be disorienting for keyboard and non-visual users. to understand what's currently happening: reload your page, then press tab. you should see a focus outline on the input for adding new to-do items. press tab again. the focus should move to the "add" button. hit it again...
...d then saving/cancelling a to-do item via your keyboard. you'll notice that focus isn’t being set, so we still have a problem to solve. if you open your console, you'll see an error raised along the lines of "can't access property "focus", editbuttonref is undefined". this seems weird. your button ref was defined when you activated the "edit" button, but now it’s not. what is going on? well,
remember that when we change isediting to true, we no longer render the section of the component featuring the "edit" button. this means there's no element to bind the ref to, so it becomes undefined. you might now be thinking "hey, don’t we set isediting=false before we try to access the ref, so therefore shouldn't the v-if now be displaying the button?” this is where the virtual dom comes into...
...r changes via the keyboard, focus should be returned to the "edit" button. success! vue lifecycle methods next, we need to move focus to the edit form’s <input> element when the "edit" button is clicked. however, because our edit form is in a different component to our "edit" button, we can't just set focus inside the "edit" button’s click event handler. instead, we can use the fact that we
remove and re-mount our todoitemeditform component whenever the "edit" button is clicked to handle this. so how does this work? well, vue components undergo a series of events, known as a lifecycle. this lifecycle spans from all the way before elements are created and added to the vdom (mounted), until they are
removed from the vdom (destroyed). vue lets you run methods at various stages of this li...
...And 2 more matches
Mozilla accessibility architecture
rride nsiaccessible::getaccchildcount(), ::getaccfirstchild() and ::getacclastchild(). in this way we avoid the normal nsaccessibletreewalker traversal methods and create whatever child accessibles we want. when there is no dom node for each accessible, as is the case for nshtmlcomboboxaccessible and nsxultreeitemaccessible, we also need to override the shutdown() method, so that the children get
removed from memory when the parent is shutdown. in that case we also override ::getaccnextsibling(), ::getaccprevioussibling() for the dom-less children; otherwise they do not know how to find each other. it is also useful to override these the child getters to return nothing, as we do in nsleafaccessible, nstextaccessible and other accessible implementations where we want to be sure to avoid childr...
...ibility event focus, select standard html dom event event_focus dommenuitemactive, dommenubaractive mozilla dom event_focus domnodeinserted w3c dom mutation event event_create (atk) event_reorder (msaa) domsubtreemodified w3c dom mutation event event_reorder domnode
removed w3c dom mutation event event_destroy (atk) event_reorder (msaa) checkboxstatechange, radiostatechange mozilla dom event_state_change popupshowing mozilla dom event_menustart popuphiding mozilla dom event_menuend nsdocaccessible::scrollpositiondidchange(), then nsdocaccessible::scrol...
... creates instability when mozilla wants to shut down but an assistive technology client still holds onto accessibles. these crashes occur when the assistive techology releases after some gecko modules have already been unloaded, when the necessary destructors no longer exist in memory. performance: by caching the accessible node for each dom node in a hash table, we can hand back accessibles ext
remely quickly, and avoid recalculating and creating new accessibles every time one is requested for a certain dom node. we also avoid calculating the children of an accessible twice, once for getaccchildcount() and again when the specific children are requested. events: we must ensure that the accessible for an event is not released before the accessible client has a chance to review its data. als...
...And 2 more matches
Gecko info for Windows accessibility vendors
ications that process user requests, user actions immediately in real time, unlike an http request, during which users must wait for a whole page to reload or for a new page to load. data is therefore stored and retrieved dynamically much faster. roles, states and events: please read the msaa documentation on msdn if you are unfamiliar with these. in general we abbreviate by
removing redundant words. for example, we may say event_alert instead of the full event_system_alert. msaa tree vs. dom tree - what's the relation? the msaa tree and the dom tree are parallel structures, although the msaa tree is a subset of the dom tree. queryservice() can be used to switch between the interfaces (iaccessible, isimpledomdocument, isimpledomnode and isimpledomtext). ...
...er to read the contents of the alert (it may be a container who's descendents should be read). event_selection is fired on children of single selection containers along with the event_focus as selection/focus move together in that case. event_selectionwithin is fired on multi selection containers when the current selection changes within. in addition, event_selectionadd and event_selection
remove are fired on the the child who's selection changed. how to track where the event happened, within your own offscreen model ordinary zero-indexed child ids are not practical for representing events. the problem is that the child id system that is used by msaa doesn't work well when you have a deep tree of objects in a window. it would be impractical to number all of the nodes in a d...
...ow to track where the event happened, within your own offscreen model ordinary zero-indexed child ids are not practical for representing events. the problem is that the child id system that is used by msaa doesn't work well when you have a deep tree of objects in a window. it would be impractical to number all of the nodes in a document starting at 0, because whenever a node is inserted or
removed it would be computationally very expensive to renumber things. so, the firefox childid handed back from events is based on an algorithm that uses the pointer value of the related internal dom node. this computed child id for events is always a negative value, unique to the iaccessible firing the event these negative childid's from events can be used with accessibleobjectfromevent(), or on...
...And 2 more matches
Obsolete Build Caveats and Tips
veats and tips being added to the mdn documentation for building older versions of the code base or dealing with older build tools. these tips, while helpful, are jarring and superfluous to the majority of new mozilla builders who are mainly interested in building the latest version of firefox. therefore, instead of deleting all these nuggets of information, it's best to collect them all here and
remove them from the majority happy path documentation. each piece of information should mention the page and the section it originally came from. you can copy in the original text and bold out what has been
removed. obsolete caveats and tips from simple_firefox_build install a version of visual studio that supports c++ development: vs 2012 for windows desktop pro or express (free), or vc++ 2010 p...
... is the current version available), your build will fail, often while building cairo with "ocidl.h" errors. in order to fix this issue, you need to use the latest version of mozillabuild. windows vista sdk obsolete since gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. this is the sdk that mozilla-1.9.1 (firefox 3.5) builds used to be built against. features that depend on this sdk include: windows vista parental controls file associations and application registration on vista and above ability to display the uac shield icon in the ui thunderbird windows search integration text services framework support there a...
...k. use visual studio 2008 professional. gecko 1.9.2 through 11: if you would like to use this sdk, add ac_add_options --with-windows-version=600 to your .mozconfig. windows server 2003 r2 platform sdk obsolete since gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. this is your only option if you're on windows 2000. this also used to be necessary for building a default gecko 1.9.2 through 8 with visual c++ express editions (see atlbase.h for more). you can download the sdk from the microsoft download center. you need to install at least the "windows core sdk", "web workshop (ie) sdk", and the "data access service...
...And 2 more matches
Message manager overview
rtant functions and attributes are: childcount : contains the number of children (typically, browser windows) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in the browser broadcastasyncmessage() : send a message to frame scripts addmessagelistener() : start listening to a specific message from all frame scripts
removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster how to access access it using components.classes: // chrome script let globalmm = cc["@mozilla.org/globalmessagemanager;1"] .getservice(ci.nsimessagelistenermanager); you can also access it as th...
...ons and attributes are: childcount : contains the number of children (typically, browser tabs) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in this window broadcastasyncmessage() : send a message to all frame scripts in this window addmessagelistener() : start listening to a specific message from frame scripts
removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster how to access you can access it as a property of the browser window: // chrome script let windowmm = window.messagemanager; browser message manager note that in this context, "browser" refe...
...but then send a message to the script instance loaded into a specific tab by using the browser message manager. ...
...And 2 more matches
Performance best practices for Firefox front-end engineers
yle flushes? when css is applied to a document (html or xul, it doesn’t matter), the browser does calculations to figure out which css styles will apply to each element. this happens the first time the page loads and the css is initially applied, but can happen again if javascript modifies the dom. javascript code might, for example, change dom node attributes (either directly or by adding or
removing classes from elements), and can also add,
remove, or delete dom nodes. because styles are normally scoped to the entire document, the cost of doing these style calculations is proportional to the number of dom nodes in the document (and the number of styles being applied). it is expected that over time, script will update the dom, requiring us to recalculate styles. normally, the changes to...
...e a lot of flashing / colors? that means a lot of painting is going on. the worst case is called over-painting. this is when you draw multiple times over the same space. unless transparency is involved, all but the last painting will be overwritten, becoming unnecessary. if you can find ways to avoid doing this, you can save substantial time. keep in mind that painting occurs on the main thread.
remember, too, that the goal is to have as little happen on the main thread as possible. that means that finding and
removing (when possible) over-painting is a good place to start reducing your burden on the main thread, which will in turn improve performance. perhaps you’re animating something that requires a repaint? for example, transitioning the background-color of a dom node from red to blue...
...that can be accelerated by the gpu. these gpu-accelerated animations occur off of the main thread, and have a much higher probability of running at 60 fps (see the section below called use the compositor for animations for further details). perhaps you’re touching some dom nodes in such a way that unexpected repaints are occurring in an area that don’t need it. best to investigate and try to
remove those as best you can. sometimes, our graphics layer invalidates regions in ways that might not be clear to you, and a section outside of the thing that just repainted will also repaint. sometimes this can be addressed by ensuring that the thing changing is on its own layer (though this comes at a memory cost). you can put something on its own layer by setting its z-index, or by setting the wi...
...And 2 more matches
AddonInstall
instances can be created using the getinstallforfile() or getinstallforurl() methods on the addonmanager. once you have an instance the install() method is used to start automatic download and installation. this can be canceled at any time with the cancel() method. method overview void install() void cancel() void addlistener(in installlistener listener) void
removelistener(in installlistener listener) properties attribute type description name string the name of the add-on being installed. version string the version of the add-on being installed. iconurl string the icon of the add-on being installed. releasenotesuri nsiuri the uri of release notes for this install. ...
... or the process is canceled by a call to the cancel() method. void install( ) cancel() cancels the install process, it cannot be restarted after this. ...
... canceled by a call to the cancel() method. void install( ) cancel() cancels the install process, it cannot be restarted after this. ...
...And 2 more matches
Downloads.jsm
ject, or an object with the following properties: path: string containing the path of the target file. saver: optional string representing the class of the download operation. if omitted, defaults to "copy". alternatively, may be the serializable representation of a downloadsaver object. promise resolves to the newly created download object. fetch() downloads data from a
remote network location to a local file. this download method does not provide user interface or the ability to cancel or restart the download programmatically. for that, you should obtain a reference to a download object using the createdownload() function. since the download cannot be restarted, any partially downloaded data will not be kept in case the download fails. promise fetch( asource, ...
... "example-download.html")); console.log("example-download.html has been downloaded."); }).then(null, components.utils.reporterror); observing downloads this example logs a message every time a change occurs in one of the global download lists. to demonstrate the logging, a new download is started while a message box is being shown. the download is stopped and
removed from the list when the message box is closed, regardless of whether it has been completed or not. components.utils.import("resource://gre/modules/downloads.jsm"); components.utils.import("resource://gre/modules/osfile.jsm") components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function () { let list = yield downloads.getlist(downloads.all); let view = { ondownload...
...close the message to stop.
...And 2 more matches
Intel Power Gadget
this document easier to understand. the main strengths of this tool are (a) it works on windows, unlike most other power-related tools, and (b) it shows this data in graph form, which is occasionally useful. on mac and linux, tools/power/rapl is probably a better tool to use. ...
...demonstrates the available measu
rements. the three panes display the following information: power: shows power estimates for the package and the cores ("ia"). these are reasonably useful for power profiling purposes, but mozilla's rapl utility provides these along with gpu and ram estimates, and in a command-line format that is often easier to use. frequency: shows operating frequency measu
rements for the cores ("ia") and the gpu ("gt"). these measu
rements aren't particularly useful for power profiling purposes. temperature: shows the package temperature. this is interesting, but again not useful for power profiling purposes. ...
... intel power gadget can also log these results to a file. ...
...And 2 more matches
powermetrics
powermetrics is a mac-only command-line utility that provides many high-quality power-related measu
rements. it is most useful for getting cpu, gpu and wakeup measu
rements in a precise and easily scriptable fashion (unlike activity monitor and top) especially in combination with rapl via the mach power command. this document describes the version of powermetrics that comes with mac os 10.10. the one that comes with 10.9 is less powerful. note: the power profiling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. quick start powermetrics provides a vast number of measu
rements. the following command encompasses the most useful ones: sudo powermetrics --samplers tasks --show-process-coalition --show-process-gpu -...
...ling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. quick start powermetrics provides a vast number of measu
rements. the following command encompasses the most useful ones: sudo powermetrics --samplers tasks --show-process-coalition --show-process-gpu -n 1 -i 5000 --samplers tasks tells it to just do per-process measu
rements. --show-process-coalition tells it to group coalitions of related processes, e.g. the firefox parent process and child processes. --show-process-gpu tells it to show per-process gpu measu
rements. -n 1 tells it to take one sample and then stop. -i 5000 tells it to use a sample length of 5 seconds (5000 ms). change this number to get shorter or longer samples. the following is example out...
...ts "package idle exit" wakeups, which wake up the entire package as opposed to just a single core; such wakeups are particularly expensive, and this count is a subset of the first column's count. gpu ms/s: gpu time used by the coalition/process, per second, during the sample period. other things to note. smaller is better — i.e. results in lower power consumption — for all of these measu
rements. there is some overlap between the two "deadlines" columns and the two "wakeups" columns. for example, firing a single sub-2ms deadline can also cause a package idle exit wakeup. many of these measu
rements are also obtainable by passing the task_power_info flag and a task_power_info struct to the task_info function. by default, the coalitions/processes are sorted by a composite value compu...
...And 2 more matches
NSS 3.45 release notes
nss 3.45 requires nspr 4.21 or newer. ...
... with a given subject on a given slot bug 1546229 - add ipsec ike support to softoken bug 1554616 - add support for the elbrus lcc compiler (<=1.23) bug 1543874 - expose an external clock for ssl this adds new experimental functions: ssl_settimefunc, ssl_createantireplaycontext, ssl_setantireplaycontext, and ssl_releaseantireplaycontext. ...
...t. the experimental function ssl_initantireplay is
removed. bug 1546477 - various changes in response to the ongoing fips review note: the source package size has increased substantially due to the new fips test vectors. this will likely prompt follow-on work, but please accept our apologies in the meantime. ...
...And 2 more matches
NSS 3.47 release notes
tended master secret will be enabled by default, where possible. see bug 1575411 for details. ...
... armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stanpcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf outputs bug 1508776 -
remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls exporter in tstclnt and selfserv bug 1581024 - heap overflow in nss utility "derdump" bug 1582343 - soft token mac verification not constant time bug 1578238 - handle invald tag sizes for ckm_aes_gcm bug 1576295 - check all bounds when encrypting with seed_cbc bug 1580286 - nss rejects tls 1.2 records with large...
... bug 1577038 - add pk11_getcertsfromprivatekey to return all certificates with public keys ma...
...And 2 more matches
NSS_3.12.3_release_notes.html
bugs fixed the following bugs have been fixed in nss 3.12.3. bug 159483: cert name matching: rfc 2818 vs. backwards compatibility (wildcards) bug 334678: prng_fips1861.c redefines the macro bsize on hp-ux bug 335016: mpp_pprime (miller-rabin probabilistic primality test) may choose 0 or 1 as the random integer bug 347037: make shl...
...h) nss_getalgorithmpolicy (see secoid.h) nss_setalgorithmpolicy (see secoid.h) for the 2 functions above see also (in secoidt.h): nss_use_alg_in_cert_signature nss_use_alg_in_cms_signature nss_use_alg_reserved support for the watcom c compiler is
removed the file watcomfx.h is
removed. bugs fixed the following bugs have been fixed in nss 3.12.3. bug 159483: cert name matching: rfc 2818 vs. backwards compatibility (wildcards) bug 334678: prng_fips1861.c redefines the macro bsize on hp-ux bug 335016: mpp_pprime (miller-rabin probabilistic primality test) may choose 0 or 1 as the random integer bug 347037: make shlibsign depend on the softoken only bug 3...
... bug 483113: add environment variable to disable/enable hash algorithms in cert/crl signatures bug 483168: nss callback api for looking up a default ocsp responder url bug 483963: assertion failure in ocsp tests. bug 484425: need accessor function...
...And 2 more matches
JS::Add*Root
try to avoid using it. this article covers features introduced in spidermonkey 31 register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection. these functions are obsoleted, use js::persistentrooted instead. ...
...he name of the new root, or null. description the js::add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable. ...
...note that this means that if the root is meant to live past the end of a function, the address of a local (stack-based) variable may not be used for vp/rp. ...
...And 2 more matches
JS_DeleteProperty2
renamed to js_deleteproperty from jsapi 39. ...
... renamed to js_deleteproperty from jsapi 39. ...
...r16_t or js::handleid name of the property to delete. namelen size_t (only in js_deleteucproperty2) the length of name in characters; or -1 to indicate that name is null-terminated. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise. description js_deleteproperty2
removes a specified property, name, from an object, obj, and stores true or false in *succeeded. it behaves like the javascript expression delete obj[name]. js_deleteucproperty2 is the unicode version of the function. js_deletepropertybyid2 is the same but takes a js::handleid for the property name. first, a property lookup is performed. then one of the following cases applies: if obj has no prop...
...And 2 more matches
JS_GetGCParameter
ocated by the gc. jsgc_number / "gcnumber" number of times gc has been invoked. includes both major and minor gc. jsgc_mode / "mode" select gc mode: jsgc_mode_global (0) the gc runs all objects are visited in a singleslice. jsgc_mode_zone (1) the gc runs only the objects that belong to somezones are visited in a singleslice. jsgc_mode_inc
remental (2) the gc runs all objects are visited in multipleslices. jsgc_mode_zone_inc
remental (3) the gc runs only the objects that belong to somezones are visited in multipleslices. this does not affect generational gc, see jsgc_max_nursery_bytes jsgc_unused_chunks / "unusedchunks" number of cached empty gc chunks. jsgc_total_chunks / "totalchunks" ...
...e objects that belong to somezones are visited in multipleslices. this does not affect generational gc, see jsgc_max_nursery_bytes jsgc_unused_chunks / "unusedchunks" number of cached empty gc chunks. jsgc_total_chunks / "totalchunks" total number of allocated gc chunks. jsgc_slice_time_budget / "slicetimebudget" max milliseconds to spend in an inc
remental gc slice. 0 for infinite. jsgc_mark_stack_limit / "markstacklimit" maximum size the gc mark stack can grow to (units: entries). jsgc_high_frequency_time_limit / "highfrequencytimelimit" gcs less than this far apart in time will be considered 'high-frequency gcs'. jsgc_high_frequency_low_limit / "highfrequencylowlimit" controls for dynamic heap growth.
...cy gcs'. jsgc_high_frequency_low_limit / "highfrequencylowlimit" controls for dynamic heap growth. when the gc is in "high frequency" mode (see above) then, the heap will be allowed to grow between collections according to these four parameters. see zoneheapthreshold::computezoneheapgrowthfactorforheapsize in gc.cpp for the details. the first two parameters are in mb and the
remaining two are in percentage of heap size. jsgc_high_frequency_high_limit / "highfrequencyhighlimit" jsgc_high_frequency_heap_growth_max / "highfrequencyheapgrowthmax" jsgc_high_frequency_heap_growth_min / "highfrequencyheapgrowthmin" jsgc_low_frequency_heap_growth / "lowfrequencyheapgrowth" heap growth percentage for low frequency gcs. jsgc_dyna...
...And 2 more matches
jsint
try to avoid using it. aliases for c/c++ integer types. syntax typedef ... jsint; typedef ... jsuint; typedef ... jsword; typedef ... jsuword; typedef ... intn; typedef ... uintn; // following types are still provides in js/public/legacyinttypes.h, // but should not use them. typedef ... int8; typedef ... uint8; typedef ... int16; typedef ... uint16; typedef ... int32; typedef ... uint32; typedef ... int64; typedef ... uint64; description jsint and jsuint are 32-bit integer types. ...
...h, // but should not use them. typedef ... int8; typedef ... uint8; typedef ... int16; typedef ... uint16; typedef ... int32; typedef ... uint32; typedef ... int64; typedef ... ...
... ... int8; typedef ... uint8; typedef ... int16; typedef ... uint16; typedef ... int32; typedef ... uint32; typedef ... int64; typedef ... ...
...And 2 more matches
SpiderMonkey 45
y be used from c++ code. if you are compiling with microsoft's visual studio, note the minimum supported version is msvc 2013. spidermonkey 45 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on several other platforms (sparc, mips), the jit is provided but not supported. on
remaining platforms the jit is disabled; javascript code runs in an interpreter, as it has in previous versions. it's the same language, just not as fast. migrating to spidermonkey 45 spidermonkey 45 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types; functions, and callback signatures, have changed though most functions that have retain their previo...
... known issues detail any known issues here... future direction jscontext and jsruntime are merging. (jscontext will be the only thing visible from within the api, there will be just one per runtime...
... known issues detail any known issues here... future direction jscontext and jsruntime are merging. (jscontext will be the only thing visible from within the api, there will be just one per runtime, and inheriting from jsruntime.) spidermonke...
...And 2 more matches
Redis Tips
ey float getset key value get and set are fairly obvious. setnx sets a value on a key only if there is no existing value. this is so useful. and it is a single, atomic command. redis> get foo (nil) redis> setnx foo 17 (integer) 1 redis> get foo "17" redis> setnx foo 42 (integer) 0 the return value from setnx is 1 if the value was set, 0 otherwise. incr, incrby, and incrbyfloat all inc
rement counters. they are also atomic operations. they return the post-inc
rement value of your key. redis> set foo 42 ok redis> incr foo (integer) 43 redis> incrby foo 17 (integer) 60 notice that these results come back as numbers, not strings. incrbyfloat is in redis 2.6. getset is awesome. it sets the value of a key, and returns the value the key had before you changed it. redis> del f...
...lets you pop something off of one queue and stick it on another. publish / subscribe that's right, redis comes with pub/sub functionality. how awesome is that. check this out: publish subscribe unsubscribe psubscribe punsubscribe publish publishes a message to a channel. you get to make up names of channels on the fly just like variable names. subscribe and unsubscribe attach and
remove listeners to or from a channel. again, the channel does not have to exist or be predefined in any way. by naming it, you cause it to exist. psubscribe and punsubscribe are like subscribe and unsubscribe, but they let you use wildcards for pattern matching. that means you can subscribe to a bunch of channels at once. this is useful for, say, log routing. ok, enough of the jibba jabba.
...ull, 2)) } whenever someone logs into my site, i record them in my 'last-login' zset. i'll simulate some logins like so: > r.zadd('last-login', now(), 'lloyd'); > r.zadd('last-login', now(), 'jparsons'); > r.zadd('last-login', now(), 'zarter'); > r.zadd('last-login', now(), 'lloyd'); // he logged in again! w00t! here's what the zset contains now: > r.zrange('last-login', 0, -1, print); //
remember, i defined 'print' above ["jparsons", "zcarter", "lloyd"] since this is a set, lloyd only appears once, with updated login timestamp. zrange gives you everything in the zset, in order of score, from the beginning offset to the end offset. (0 from the front, -1 from the end.) as you can see, the scores are sorted smallest to biggest. to get the most recent, you can use zrevrange: >...
...And 2 more matches
Handling Mozilla Security Bugs
treated as special and handled differently than "normal" bugs. in particular, the mozilla.org bugzilla system will allow bug reports related to security vulnerabilities to be marked as "security-sensitive," and will have special access control features specifically for use with such bug reports. however, a security bug can revert back to being a normal bug by having the "security-sensitive" flag
removed, in which case the access control restrictions will no longer be in effect. full information about security bugs will be restricted to a known group of people, using the bugzilla access control restrictions described above. however, that group can and will be expanded as necessary and appropriate. as noted above, information about security bugs can be held confidential for some period of ti...
... and appropriate. as noted above, information about security bugs can be held confidential for some period of time; there is no pre-determined lmit on how long that time period might be. however, this is offset by the fact that the person reporting a bug has visibility into the activities (if any) being taken to address the bug, and has the power to open the bug report for public scrutiny. the
remaining sections of this document describe in more detail how these general policies have been implemented in practice. organizational structure for handling security bugs we are organizing the investigation and fixing of mozilla security vulnerabilities similar to the way mozilla project activities are handled in general: there will be a security module owner, a small core of active contributors...
...ibed, the mozilla security module owner can select one or more peers to share the core work of coordinating investigation and resolution of mozilla security vulnerabilities, and will work with them to create some agreed-upon ground rules for how this work can be most effectively shared among themselves. as with other mozilla modules, we intend that this core group (module owner plus peers) should
remain small. its membership should change infrequently and only after consultation with the mozilla.org staff. the security module owner and peers will also work with mozilla.org to populate the initial security bug group. we expect that the mozilla security bug group will initially be significantly larger than the core group of module owners and peers, and that it may grow further over time. new m...
...And 2 more matches
Signing Mozilla apps for Mac OS X
to the code signing. when you're signing mozilla applications with v1 signatures, you'll need to specify a custom coderesources file here. -f forces codesign to overwrite an existing signature on the application. -v increases the verbosity of the codesign tool's output. --deep for v2 signing, sign all nested executables with the same settings. note that you cannot specify an identifier requi
rement if you do this, or otherwise you need to sign the outer application again with the identifier requi
rement. --requi
rement 'designated requi
rement' adds additional requi
rements for verifying the signature and application metadata. at a minimum you'll need to provide: identifier: this must be the same as the value of the cfbundleidentifier specified in your application's info.plist file. l...
...e. leaf[subject.ou]: this needs to be the subject ou of your developer id. you can find it by running this command in the terminal: openssl x509 -text -noout -inform der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a command similar to the one below to sign your app. ...
...ubject putting it all together, you'll wind up using a command similar to the one below to sign your app. you'll of course need to change the signing id, keychain, bundle path, and requi
rements. ...
...And 2 more matches
Animated PNG graphics
onents are all set to zero. for purposes of chunk descriptions, an unsigned int shall be a 32-bit unsigned integer in network byte order limited to the range 0 to (2^32)-1; an unsigned short shall be a 16-bit unsigned integer in network byte order with the range 0 to (2^16)-1; and a byte shall be an 8-bit unsigned integer with the range 0 to (2^8)-1. error handling apng is designed to allow inc
remental display of frames before the entire image has been read. this implies that some errors may not be detected until partway through the animation. it is strongly recommended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image. a decoder which detects an error before the animation has started should disp...
.... chunk sequence numbers the 'fctl' and 'fdat' chunks have a 4 byte sequence number. both chunk types share the sequence. the purpose of this number is to detect (and optionally correct) sequence errors in an animated png, since the png specification does not impose ordering restrictions on ancillary chunks. the first 'fctl' chunk must contain sequence number 0, and the sequence numbers in the
remaining 'fctl' and 'fdat' chunks must be in order, with no gaps or duplicates. the tables below illustrates the use of sequence numbers for images with more than one frame and more than one 'fdat' chunk. if the default image is the first frame: sequence number chunk (none) 'actl' 0 'fctl' (first frame) (none) 'idat' (first frame -- used as the defa...
...action with other chunks in section 3.2. changed 'fram' chunk offsets and delay into signed integers. from 0.2 changed 'fram' chunk to 'afra' to avoid conflict with mng 'fram' chunk. changed format: instead of sequences of ihdr..idat..iend, frames other than frame 0 are stored in 'afra' chunks. added start_frame to 'anim' to indicate which frame the animation should start on. ...
...And 2 more matches
Finishing the Component
ath your code can cause havoc. the danger of using unfrozen interfaces suppose that you need to use the interface nsifoo that isn't frozen. you build your component using this interface, and it works great with the version of gecko that you have tested against. however, some point in the future, the nsifoo interface requires a major change, and methods are reordered, some are added, others are
removed. moreover, since this interface was never supposed to be used by clients other than gecko or mozilla, the maintainers of the interface don't know that it's being used, and don't change the iid of the interface. when your component runs in a version of gecko in which this interface is updated, your method calls will be routed through a different v-table than the one the component expected, mos...
...es all of the methods defined in the interface nsicontentpolicy. the updated weblock class looks as follows: class weblock: public nsiobserver, public iweblock, public nsicontentpolicy { public: weblock(); virtual ~weblock(); ns_decl_isupports ns_decl_nsiobserver ns_decl_iweblock ns_decl_nsicontentpolicy private: urlnode* mrooturlnode; prbool mlocked; };
remember to change the nsisupports implementation macro to include nsicontentpolicy so that other parts of gecko will know weblock supports the nsicontentpolicy interface without modifying this macro. ns_impl_isupports3(weblock, nsiobserver, iweblock, nsicontentpolicy); receiving notifications to receive notifications, you must register as a new category. you have already registered as a category...
...ock on every page load, and this prevents pages from displaying by returning the proper value when the load method is called. the web locking policy that we are going to put into place is quite simple: for every load request that comes through, we will ensure that the uri is in the list of "good" urls on the white list. if you care to extend this implementation so that the list of urls is held
remotely on a server somewhere - as might be the case when the weblock component is used in a corporate intranet, for example - there are networking apis in gecko that will support this. or you could implement the web lock so that instead of blocking any site, the component would simply log all urls that are loaded. in any case, the process to make the xpcom component is the same. the method that h...
...And 2 more matches
Introduction to XPCOM for the DOM
com and nscomptr's described in this document covers about 80% of what you need to know to read the dom code, and even write some. for more advanced topics, please see the xpcom page. the tracking bug for this document is bug 99592. target audience: people who would like a quick introduction to the use of c++ and xpcom in the dom code. the understanding of the content of this document is a requi
rement to read the rest of the dom hacking guide. important note: this document assumes some knowledge of c++, specially the object-oriented part of it. i learned c++ by reading "c++ primer" from stanley lippman and josee lajoie, then experimenting on the dom code. i recommend that book to all the beginners out there. introduction to the introduction the dom makes extensive use of xpcom. in fact...
...of interfaces is to have a single ... interface to a set of methods that manipulate an object (often represented by a class), without worrying about the details of the implementation. if you know a class implements an interface, just use the methods in the interface, and you don't have to care if the implementation of the interface (the concrete class) changes. xpcom pushes this concept to the ext
reme. pure virtual methods are declared with the following syntax: virtual nsresult functionfoo() = 0; an interface is thus simply a c++ class where all the member functions are declared as pure virtual functions. an interface can also be defined using xpidl. this is described in section 1.e, "how to add an interface". since an interface doesn't have any implementation, it has to be implemented b...
...er to an interface implemented by an instance of a concrete c++ class". the important thing to note is that a pointer to nsifoo can only call the methods defined on the nsifoo interface, and on its parents. for instance, if nsfoo implements two different interfaces, nsifoo and nsibar, a pointer to nsifoo cannot call the methods defined on nsibar and vice-versa. note: the previous paragraph is ext
remely important. if you haven't grasped it completely, there is no need to read further. reference counting basics xpcom uses a reference counting mechanism (refcount in short) to make sure that no object is deleted while interface pointers still point at that object. indeed, dereferencing a pointer that points to a deleted object can have bad consequences. that is why each time a pointer to an in...
...And 2 more matches
Components.utils.Sandbox
ean: if true, then createobjectin(), evalinwindow(), and exportfunction() are available in the sandbox. default: false. wantglobalproperties an array of strings. each string is the name of an object that you want to make available as a global to code running in the sandbox. ...
... and exportfunction() are available in the sandbox. default: false. wantglobalproperties an array of strings. each string is the name of an object that you want to make available as a global to code running in the sandbox. the exception is "-promise": the promise constructor is available by default for sandboxes, and you use this option to
remove it from the sandbox. note that "-promise" is
removed in firefox 37. ...
...rties an array of strings. each string is the name of an object that you want to make available as a global to code running in the sandbox. the exception is "-promise": the promise constructor is available by default for sandboxes, and you use this option to
remove it from the sandbox. note that "-promise" is
removed in firefox 37. ...
...And 2 more matches
imgIRequest
modules/libpr0n/public/imgirequest.idlscriptable please add a summary to this article. inherits from: nsirequest last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void cancelandforgetobserver(in nsresult astatus); imgirequest clone(in imgidecoderobserver aobserver); void dec
rementanimationconsumers(); imgirequest getstaticrequest(); void inc
rementanimationconsumers(); void lockimage(); void requestdecode(); void unlockimage(); attributes attribute type description corsmode long the cors mode that this image was loaded with. read only. decoderobserver imgidecoderobserver read only. image imgicontainer the image container. read only. imageprincipal nsiprincipal the principal gotten from the channel the...
...etobserver( in nsresult astatus ); parameters astatus clone() clone this request; the returned request will have aobserver as the observer. aobserver will be notified synchronously (before the clone call returns) with all the notifications that have already been dispatched for this image load. ...
...uest will have aobserver as the observer. aobserver will be notified synchronously (before the clone call returns) with all the notifications that have already been dispatched for this image load. imgirequest clone( in imgidecoderobserver aobserver ); parameters aobserver return value dec
rementanimationconsumers() tell the image it can forget about a request that the image animate. void dec
rementanimationconsumers(); parameters none. ...
...And 2 more matches
nsIComponentManager
a "bootstrapped" chrome manifest supports some of the instructions allowed in a regular chrome manifest, see the chrome registration documentation for details. this method was introduced in gecko 8 to ...
...ied directory or xpi file. a "bootstrapped" chrome manifest supports some of the instructions allowed in a regular chrome manifest, see the chrome registration documentation for details. this method was introduced in gecko 8 to let bootstrapped add-ons provide content at chrome:// uris. until gecko 10 you had to call this method manually from within the add-on's startup() method (with a matching
removebootstrappedmanifestlocation() call in the add-on's shutdown() method). if you're targeting gecko 10 or higher there should be no need to call this method, since the bootstrapped add-on's chrome.manifest is loaded automatically now. void addbootstrappedmanifestlocation( in interface nsilocalfile alocation ); parameters alocation the directory or xpi from which to load the chrome.manif...
...tclassobjectbycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the factory that is being requested. aiid the interface type to be returned. result the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered. ...
...And 2 more matches
nsIDBFolderInfo
ring propertyname ); parameters propertyname missing description return value missing description exceptions thrown missing exception missing description native code only!getlocale obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. void getlocale( in nsstring result ); parameters result missing description exceptions thrown missing exception missing description native code only!getmailboxname obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete. although it may still work in some browsers, its use is disc...
...void using it. void getlocale( in nsstring result ); parameters result missing description exceptions thrown missing exception missing description native code only!getmailboxname obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. void getmailboxname( in nsstring boxname ); parameters boxname missing description exceptions thrown missing exception missing description getproperty() astring getproperty( in string propertyname ); parameters propertyname missing description return value missing description exceptions thrown mi...
...boolean force ); parameters highwater missing description force missing description exceptions thrown missing exception missing description native code only!setlocale obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. void setlocale( in nsstring locale ); parameters locale missing description exceptions thrown missing exception missing description native code only!setmailboxname obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete. although it may still work in some browsers, its use is disc...
...And 2 more matches
nsIEditor
ast changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void
removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content
removal void deleteselection(in short action, in short stripwrappers); document info and file methods void resetmodificationcount(); long g...
...t element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content
removal void deleteselection(in short action, in short stripwrappers); document info and file methods void resetmodificationcount(); long getmodificationcount(); void inc
rementmodificationcount(in long amodcount); void inc
rementmodificationcount(in long amodcount); transaction methods void dotransaction(in nsitransaction txn); void enableundo(in boolean enable); void undo(in unsigned long count); void canundo(out boolean isenabled, out boolean canundo); void redo(in unsigned long count); void can...
...boolean candrag(in nsidomevent aevent); void dodrag(in nsidomevent aevent); void insertfromdrop(in nsidomevent aevent); node manipulation methods void setattribute(in nsidomelement aelement, in astring attributestr,in astring attvalue); boolean getattributevalue(in nsidomelement aelement, in astring attributestr, out astring resultvalue); void
removeattribute(in nsidomelement aelement, in astring aattribute); void cloneattribute(in astring aattribute, in nsidomnode asourcenode); void cloneattributes(in nsidomnode destnode, in nsidomnode sourcenode); nsidomnode createnode(in astring tag, in nsidomnode parent, in long position); void insertnode(in nsidomnode node, in nsidomnode parent, in long aposition); ...
...And 2 more matches
nsIEditorIMESupport
y); native code only! obsolete since gecko 2.0 attributes attribute type description composing boolean whether this editor has active ime transaction. read only. methods native code only!begincomposition obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. handles the start of inline input composition. void begincomposition( in nstexteventreplyptr areply ); parameters areply endcomposition() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) handles the end of inline input composition. void endcomposition(); parameters none. forcecompositionend() force the ...
...ameters none. native code only!getpreferredimestate get preferred ime status of current widget. void getpreferredimestate( out unsigned long astate ); parameters astate native code only!getquerycaretrect obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete. ...
...it could be
removed at any time. try to avoid using it. get the query caret rect. void getquerycaretrect( in nsquerycaretrecteventreplyptr areply ); parameters areply native code only!getreconversionstring obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. get the reconversion string. void getreconversionstring( in nsreconversioneventreplyptr areply ); parameters areply notifyimeonblur() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avo...
...And 2 more matches
nsIEditorSpellCheck
st([array, size_is(count)] out wstring dictionarylist, out pruint32 count); wstring getnextmisspelledword(); void getpersonaldictionary(); wstring getpersonaldictionaryword(); wstring getsuggestedword(); void ignorewordalloccurrences(in wstring word); void initspellchecker(in nsieditor editor, in boolean enableselectionchecking); void
removewordfromdictionary(in wstring word); void replaceword(in wstring misspelledword, in wstring replaceword, in boolean alloccurrences); void savedefaultdictionary(); obsolete since gecko 9.0 void setcurrentdictionary(in astring dictionary); void setfilter(in nsitextservicesfilter filter); void uninitspellchecker(); void updatecurrentdictionary...
...pelled. the first call returns the first (best) suggestion. subsequent calls iterate through all suggestions, allowing you to build a list. when there are no more suggestions, an empty string (not a null pointer) is returned. wstring getsuggestedword(); parameters none. return value the next best suggestion for the last word that was checked and was misspelled, or an empty string if there are no
remaining suggestions. ignorewordalloccurrences() tells the spell checker to ignore all occurrences of the specified word when spell checking the document. void ignorewordalloccurrences( in wstring word ); parameters word the word to ignore when spell checking. initspellchecker() turns on the spell checker for the given editor. void initspellchecker( in nsieditor editor, in boolean e...
... editor the nsieditor on which to enable spell checking. enableselectionchecking if true, the spell checker is initialized only for checking the current selection; otherwise, it's initialized for checking the entire document. this affects the behavior of getnextmisspelledword()). for spell checking clients with no modal ui (such as inline spell checkers), this flag is not relevant.
removewordfromdictionary()
removes a word from the current personal dictionary. void
removewordfromdictionary( in wstring word ); parameters word the word to
remove from the current personal dictionary. replaceword() call this function to modally replace one (or all) occurrences of a word with another word. void replaceword( in wstring misspelledword, in wstring replaceword, in boo...
...And 2 more matches
nsIFile
each element in the enumeration is an nsifile. read only. exceptions thrown ns_err...
... unlike filesize, this attribute corresponds to the size of the symbolic link referenced by this nsifile. if this nsifile does not reference a symbolic link, then the value of this attribute is undefined. the value of this attribute is the number of bytes corresponding to the data represented by the symbolic link. any meta data, such as a resource fork on the mac, is not included in the measu
rement of the file size. read only. followlinks prbool determines whether or not the nsifile will automatically resolve symbolic links. by default, this value is false on all non-unix systems. as of mozilla 1.7, this attribute is ignored on unix systems. lastmodifiedtime print64 this attribute exposes the time when the file referenced by this nsifile was la...
... that is not empty. ns_error_file_access_denied indicates that an attempt was made to move a directory to the location of an existing directory that is not writable. ns_error_file_destination_not_dir indicates that "newparentdir" exists and is not a directory. normalize() this method is used to canonicalize the path represented by this nsifile. (for example by resolving symlinks as well as
removing .. and . components on unix). as of gecko 1.7, this method is only implemented under unix builds (except for mac osx). this method will fail if the path does not exist. void normalize(); parameters none. exceptions thrown ns_error_file_target_does_not_exist indicates that the file path does not exist. ns_error_file_destination_not_dir indicates that a component of the path prefix...
...And 2 more matches
nsIHttpChannelInternal
uri. forceallowthirdpartycookie boolean force relevant cookies to be sent with this load even if normally they would not be. localaddress autf8string the local ip address to which the channel is bound, in the same format produced by pr_netaddrtostring(). this may be either an ipv4 or ipv6 address. note: if network address translation (nat) is in effect, this may not be the same address the
remote host thinks it is talking to. this may throw an ns_error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false. see bug 534698 and bug 526207. read only. localport print32 the local port number to which the channel is bound. this may throw an ns_error_not_available exception if acces...
...rint32 the local port number to which the channel is bound. this may throw an ns_error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false. see bug 534698 and bug 526207. read only. proxyinfo nsiproxyinfo get the proxy info in use by the channel. read only. ...
...l is bound. this may throw an ns_error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false. see bug 534698 and bug 526207. read only. proxyinfo nsiproxyinfo get the proxy info in use by the channel. read only. ...
...And 2 more matches
nsILoadGroup
netwerk/base/public/nsiloadgroup.idlscriptable a load group maintains a collection of nsirequest objects. inherits from: nsirequest last changed in gecko 1.7 method overview void addrequest(in nsirequest arequest, in nsisupports acontext); void
removerequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatus); attributes attribute type description activecount unsigned long returns the count of "active" requests (that is requests without the load_background bit set). read only. defaultloadrequest nsirequest accesses the default load request for the group. each time a number of requests are added to a group, the defaultloadrequest ...
...ed to a group, the defaultloadrequest may be set to indicate that all of the requests are related to a base request. the load group inherits its load flags from the default load request. if the default load request is null, then the group's load flags are not changed. groupobserver nsirequestobserver the group observer is notified when requests are added to and
removed from this load group. the groupobserver is weak referenced. notificationcallbacks nsiinterfacerequestor notification callbacks for the load group. requests nsisimpleenumerator returns the requests contained directly in this group. enumerator element type: nsirequest. read only. methods addrequest() adds a new request to the grou...
...ill be called. if the request is the default load request or if the default load request is null, then the load group will inherit its load flags from the request. void addrequest( in nsirequest arequest, in nsisupports acontext ); parameters arequest the request to be added to the load group. acontext the context to be passed to the onstartrequest notification. ...
...And 2 more matches
nsINavHistoryObserver
essionid, in long long areferringid, in unsigned long atransitiontype, in acstring aguid, out unsigned long aadded); constants constant value description attribute_favicon 3 the page's favicon changed. methods onbeforedeleteuri() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was
removed in gecko 21.0 as part of bug 826409. the specified page and all its visits are about to be deleted. note: the page does not necessarily have to have ever existed for this function to be called. delete notifications aren't quite 100% accurate. batch delete operations take place in two steps; the notifications come first, followed by a bulk delete. if an error occurs in between these two ste...
...e 100% accurate. batch delete operations take place in two steps; the notifications come first, followed by a bulk delete. if an error occurs in between these two steps (for example, an out of memory error), then you may get a notification even though the page doesn't wind up getting deleted. note: the page does not necessarily have to have ever existed for this function to be called. notes the
removepagesbyhost() and
removepagesbytimeframe() functions call beginupdatebatch() and endupdatebatch() rather than onclearhistory() or ondeleteuri(). void ondeleteuri( in nsiuri auri, in acstring aguid ); parameters auri the uri of the page that was deleted. aguid the unique id associated with the page. ondeletevisits() called when some visits of an history entry are expired.
...deleteuri( in nsiuri auri, in acstring aguid ); parameters auri the uri of the page that was deleted. aguid the unique id associated with the page. ondeletevisits() called when some visits of an history entry are expired. note: when all visits for a page are expired and also the full page entry is expired, you will only get an ondeleteuri notification. if a page entry is
removed, then you can be sure that we don't have anymore visits for it. void ondeletevisits( in nsiuri auri, in prtime avisittime, in acstring aguid ); parameters auri the uri of the page whose visits have been expired. avisittime the largest visit time in microseconds that has been expired. we guarantee that we do not have any visit older than this date. aguid the un...
...And 2 more matches
nsIPrefBranch2
on preference changes, the following arguments will be passed to nsiobserver.observe(): asubject - the nsiprefbranch object (this). ...
... 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. ...
...xample 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 preference change observer. note: you must call
removeobserver method on the same nsiprefbranch2 instance on which you called addobserver() method in order to
remove aobserver; otherwise, the observer will not be
removed. void
removeobserver( in string adomain, in nsiobserver aobserver ); parameters adomain the preference which is being observed for changes. aobserver ...
...And 2 more matches
Performance
good performance for a small embedded database. however, many things cause various database operations to be slow. transactions there is overhead associated with each transaction. when you execute a sql statement in isolation, an implicit transaction is created around that statement. when transactions are committed, sqlite does journaling which requires syncing data to disk. this operation is ext
remely slow. therefore, if you are doing many transactions in a row, you will get significant performance improvements by surrounding them in a transaction. the asynchronous writes discussed below
removes most of the immediate penalty of a commit, so you will not notice the problem as much. however, there is still overhead, and using a transaction will still be faster. one major problem is that the q...
...eservice.opendatabase(). disk writes sqlite provides the basic acid rules of database theory: atomicity: each transaction is atomic and cannot be "partially" committed. consistency: the database won't get corrupted. isolation: multiple transactions do not affect each other. durability: once a commit has gone through, the data is guaranteed to be committed. the problem is that these requi
rements make some operations, especially commits, very slow. for each commit, sqlite does two disk syncs among many other file operations (see the "atomic commit" section of http://www.sqlite.org/php2004/slides-all.html for more information on how this works). these disk syncs are very slow and limit the speed of a commit to the rotational speed of the mechanical disk. vacuuming and zero-fill sqlite ...
.../php2004/slides-all.html for more information on how this works). these disk syncs are very slow and limit the speed of a commit to the rotational speed of the mechanical disk. vacuuming and zero-fill sqlite has a vacuum command to compress unused space from the database. sqlite works like a memory manager or a file system. when data is deleted, the associated bytes are marked as free but are not
removed from the file. this means that the file will not shrink, and some data may still be visible in the file. the way to work around this is to run the vacuum command to
remove this space. vacuuming is very slow. the vacuum command is essentially the same as the command line sqlite3 olddb .dump | sqlite3 newdb; mv newdb olddb. on some networked drives, vacuuming a 10mb database has been timed at o...
...And 2 more matches
pyxpidl
pyxpidl has been in use for a while, but replaced xpidl in the gecko sdk starting in gecko 9.0. using pyxpidl pyxpidl is in the sdk in the sdkdir/sdk/bin/ directory. ...
...h> <filename.idl> generating typelibs generating typelib files is done using the typelib.py utility: sdkdir/sdk/bin/typelib.py --cachedir=<path> -o <outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table provides a mapping of old xpidl options to pyxpidl. ...
... -o <outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table provides a mapping of old xpidl options to pyxpidl. ...
...And 2 more matches
Mail event system
ases. the folder pane needs to know that this changed so that it can update the message count so the user can see it. interfaces the key interfaces here are: nsifolder.idl is an interface for storing a hierarchy of objects with properties. this interface is not (should not be) mail-related. nsifolders each store individual lists of folder listeners which are maintained with addlistener() and
removelistener(). when a notification is fired on a folder, all of the folder's folder listeners and the mail session itself is notified. nsifolderlistener.idl is an interface that an object can implement if it is interested in listening to changes on single folder or on all folders. if the object just needs to be notified about one folder, it should call that folder's addlistener method. if the obj...
... wants to know about all notifications on all folders, then it should register with the mail session. nsimsgmailsession.idl is a service that acts as a broadcaster for folder notifications. the mail session receives all notifications from all folders, and then forwards it on to any nsifolderlisteners that have registered themselves. the nsimsgmailsession interface actually only allows adding and
removal of listeners - the notifications happen through the nsifolderlistener interface as well. methods each event type has a two methods associated with it: notify*<event> - in the nsifolder interface, and nsimsgmailsession interface. onitem*<event> - in the nsifolderlistener interface. the mail session implements this interface. where <event> is the type of event, such as boolpropertyc...
...in its implementation of onintpropertychanged, it notifies rdf (via the nsirdfobserver system) that the message count has changed. rdf handles the notification by updating the message counts in the folder pane. ...
...And 2 more matches
Streams - Plugins
e a stream, find out how much data the plug-in can handle, push data into the stream, and delete it. the plug-in instance selects a transmission mode for streams produced by the browser. stream data can be pushed by the browser, pulled by the plug-in, or saved to a local file and passed to the plug-in. normal mode: the browser uses the npp_write method to "push" stream data to the instance inc
rementally as it is available. random-access mode: the plug-in calls the npn_requestread method to "pull" stream data. in general, this mode is more expensive, because the entire stream must be downloaded to a temporary file before use unless the stream comes from a local file or an http server that supports the byte-range extension to http. file mode: the browser saves the entire stream to a local...
...e the entire stream must be downloaded to a temporary file before use unless the stream comes from a local file or an http server that supports the byte-range extension to http. file mode: the browser saves the entire stream to a local file and passes the file path to the plug-in instance through the npp_streamasfile method. use this feature only as a last resort; plug-ins should implement an inc
remental stream-based interface wherever possible. streams sent by the plug-in to the browser are like normal-mode streams produced by the browser, but in reverse. in normal-mode streams, the browser calls the plug-in to tell it when a stream is created and to push more data. in contrast, for streams produced by the plug-in, the plug-in calls the plug-in api methods npp_newstream, npp_write, and np...
...quested a normal-mode stream, the browser delivers the data in the stream progressively in a series of calls to npp_writeready and npp_write. the npp_write function should return the number of bytes consumed by the instance. if this is a negative number, the browser calls npp_destroystream to destroy the stream. if the number returned is smaller than the size of the buffer, the browser sends the
remaining data in the buffer to the plug-in through repeated calls to npp_writeready and npp_write. int32 npp_write(npp instance, npstream *stream, int32 offset, int32 len, void *buf); the instance parameter is the current plug-in instance; the stream parameter specifies the current stream. the offset parameter specifies the offset, in bytes, of buf from the beginning of the data in the stream. t...
...And 2 more matches
Debugger.Object - Firefox Developer Tools
otype.makedebuggeevalue to create debugger.object instances for given debuggee objects, or use debugger.object.prototype.copy and debugger.object.prototype.create to create new objects in debuggee compartments, allocated as if by particular debuggee globals. debugger.object instances protect their referents from the garbage collector; as long as the debugger.object instance is live, the referent
remains live. this means that garbage collection has no visible effect on debugger.object instances. accessor properties of the debugger.object prototype a debugger.object instance inherits the following accessor properties from its prototype: proto the referent’s prototype (as a new debugger.object instance), or null if it has no prototype. this accessor may throw if the referent is a script...
...e object.defineproperty, except that the target object is implicit, and in a different compartment from the function and descriptor.) defineproperties(properties) add the properties given byproperties to the referent. (this function behaves like object.defineproperties, except that the target object is implicit, and in a different compartment from theproperties argument.) deleteproperty(name)
remove the referent’s property namedname. return true if the property was successfully
removed, or if the referent has no such property. return false if the property is non-configurable. seal() prevent properties from being added to or deleted from the referent. return this debugger.object instance. (this function behaves like the standard object.seal function, except that the object to be sealed...
...referent is callable, call it with the giventhis value andargument values, and return a completion value describing how the call completed.this should be a debuggee value, or { asconstructor: true } to invoke the referent as a constructor, in which case spidermonkey provides an appropriate this value itself. eachargument must be a debuggee value. all extant handler methods, breakpoints, and so on
remain active during the call. if the referent is not callable, throw a typeerror. this function follows the invocation function conventions. apply(this,arguments) if the referent is callable, call it with the giventhis value and the argument values inarguments, and return a completion value describing how the call completed.this should be a debuggee value, or { asconstructor: true } to invokefunct...
...And 2 more matches
Examine and edit CSS - Firefox Developer Tools
is also gets the target icon: , giving you a convenient way to highlight the currently selected element in the page. filtering rules there's a box at the top of the rules view labeled "filter styles": as you type: any rules which don't contain the typed string at all are hidden any declarations which contain the typed string are highlighted click the "x" at the end of the search box to
remove the filter. while in the rules view, you can press ctrl / cmd + f to focus the search field. once you've typed in a filter, you can press esc to
remove it again. strict search by default, the search box highlights all declarations which contain any part of the string. for example, searching for "color" will highlight declarations containing border-bottom-color and background-color as we...
...ted settings, you can type "font" in the search box, and only properties with "font" in the name will be listed. you can also search for the values of properties: to find the rule responsible for setting the font to "lucida grande", type that in the search box. while in the computed view, you can press ctrl / cmd + f to focus the search field. once you've typed in a filter, you can press esc to
remove it again. edit rules if you click on a declaration or a selector in the rules view you can edit it and see the results immediately. you can also tab through the different existing properties and values, and start editing them by pressing enter or space. to add a new declaration to a rule, click on the last line of the rule (the line occupied by the closing brace). as you start typing a pro...
... a color swatch so you can see exactly what color each variable choice is storing (bug 1451211). in addition, hovering over a css variable name brings up a tooltip showing what color value is stored in that variable (bug 1431949). editing keyboard shortcuts you can use the arrow and page up/down keys (along with others) to increase/decrease numeric rules while editing: the up arrow inc
rements values by 1 — for example, "1px" changes to "2px". shift + up/down inc
rements or dec
rements values by 10. ctrl + up/down (on linux and windows) or alt + up/down (on mac) inc
rements or dec
rements values by 0.1. shift + page up/page down inc
rements or dec
rements values by 100. track changes when you are editing the rules in the rules view, you can see the changes you have made in the ch...
...And 2 more matches
AudioTrackList - Web APIs
length read only the number of tracks in the list. event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new audio track has been added to the media element. onchange an event handler to be called when the change event occurs. this occurs when one or more tracks have been enabled or disabled by their enabled flag being changed. on
removetrack an event handler to call when the
removetrack event is sent, indicating that an audio track has been
removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the audiotrack found within the audiotracklist whose id matches the specified string. if no match is found, null is returned. events addt...
...venttarget. gettrackbyid() returns the audiotrack found within the audiotracklist whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new audio track has been added to the media element. also available via the onaddtrack property. change fired when a track has been enabled or disabled. also available via the onchange property. ...
...ck found within the audiotracklist whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new audio track has been added to the media element. also available via the onaddtrack property. change fired when a track has been enabled or disabled. also available via the onchange property.
removetrack fired when a new audio track has been
removed from the media element. ...
...And 2 more matches
CSSStyleSheet - Web APIs
on for the various ways a cssstylesheet object can be obtained. properties inherits properties from its parent, stylesheet. cssrules read only returns a live cssrulelist which maintains an up-to-date list of the cssrule objects that comprise the stylesheet. this is normally used to access individual rules like this: stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or
remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods. ownerrule read only if this stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent, stylesheet. deleterule() deletes the rule at the specified ind...
...methods from its parent, stylesheet. deleterule() deletes the rule at the specified index into the stylesheet's rule list. insertrule() inserts a new rule at the specified position in the stylesheet, given the textual representation of the rule. ...
...kely to be
removed anytime soon. rules read only the rules property is functionally identical to the standard cssrules property; it returns a live cssrulelist which maintains an up-to-date list of all of the rules in the style sheet. legacy methods these methods are legacy methods first introduced by microsoft; they should not be used if they can be avoided, but are not in danger of being
removed anytime soon. addrule() adds a new rule to the stylesheet given the selector to which the style applies and the style block to apply to the matching elements. this differs from insertrule(), which simply takes the textual representation of the entire rule as a single string. ...
...And 2 more matches
Using the CSS Typed Object Model - Web APIs
returned is a csskeywordvalue. if the value is numeric, a cssunitvalue is returned. csskeywordvalue is a class that defines keywords like inherit, initial, unset, and other strings you don't quote, such as auto and grid. this subclass gives you a value property via csskeywordvalue.value. cssunitvalue is returned if the value is a unit type. it is a class that defines numbers with units of measu
rement like 20px, 40%, 200ms, or 7. it is returned with two properties: a value and a unit. with this type we can access the numeric value — cssunitvalue.value — and its unit — cssunitvalue.unit. let's write a plain paragraph, apply no styles, and inspect a few of its css properties by returning a table with the unit and value: <p> this is a paragraph with some content. open up this exampl...
...herited cssstylevalue.parse() and cssstylevalue.parseall() methods. let's examine a css example with several custom properties, transforms, calc()s, and other features. ...
...nd image. we grab our stylepropertymapreadonly with the following javascript: const allcomputedstyles = document.queryselector('button').computedstylemap(); the following examples reference allcomputedstyles: cssunparsedvalue the cssunparsedvalue represents custom properties: // cssunparsedvalue let unit = allcomputedstyles.get('--unit'); console.log( unit ) // cssunparsedvalue {0: " 1.2
rem", length: 1} console.log (unit[0] ) // " 1.2
rem" when we invoke get(), a custom property of type cssunparsedvalue is returned. note the space before the 1.2
rem. to get a unit and value, we need a cssunitvalue, which we can retrieve using the cssstylevalue.parse() method on the cssunparsedvalue. let parsedunit = cssnumericvalue.parse( unit ); console.log( parsedunit ); // cssunitvalue ...
...And 2 more matches
DirectoryEntrySync - Web APIs
this interface has been abandonned: it was on a standard track and it proves not a good idea. do not use it anymore. about this document this document was last updated on march 2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. this specification is pretty much abandoned, having failed to reach any substantial traction. ...
...oot directory. var direntry = fs.root.getdirectory('superseekrit', {create: true}); method overview directoryreadersync createreader () raises (fileexception); fileentrysync getfile (in domstring path, in optional flags options) raises (fileexception); directoryentrysync getdirectory (in domstring path, in optional flags options) raises (fileexception); void
removerecursively () raises (fileexception); methods createreader() creates a new directoryreadersync to read entries from this directory. directoryreadersync createreader ( ) raises (fileexception); returns directoryreadersync represents a directory in a file system. parameter none exceptions this method can raise a fileexception with the following codes: exception ...
...the file already exists. you cannot create another one with the same path. quota_exceeded_error the operation would cause the application to exceed its storage quota. security_err the application does not have permission to access the element referred to by path. [ todo: explain why ] type_mismatch_err the path supplied exists, but it is not a directory. ...
...And 2 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
the dom methods presented here are not specific to html; they also apply to xml. the demonstrations provided here will work fine in any modern browser, including all versions of firefox and ie 5+. the dom methods presented here are part of the document object model (core) level 1 specification. ...
...you will use it frequently in programming for the w3c dom. first, you create elements from the top down; then you attach the children to the parents from the bottom up. here's the html markup generated by the javascript code: ... <table border="2"> <tbody> <tr><td>cell is row 0 column 0</td><td>cell is row 0 column 1</td></tr> <tr><td>cell is row 1 column 0</td><td>cell is ...
...ipt code: ... <table border="2"> <tbody> <tr><td>cell is row 0 column 0</td><td>cell is row 0 column 1</td></tr> <tr><td>cell is row 1 column 0</td><td>cell is row 1 column 1</td></tr> </tbody> </table> ... here's the dom object tree generated by the code for the <table> element and its child elements: you can build this table and its internal child elements by using just a few dom methods.
remember to keep in mind the tree model for the structures you are planning to create; this will make it easier to write the necessary code. in the <table> tree of figure 1 the element <table> has one child: the element <tbody>. <tbody> has two children. each <tbody>'s child (<tr>) has two children (<td>). finally, each <td> has one child: a text node. example: setting the background color of a para...
...And 2 more matches
Element: cut event - Web APIs
tion through the browser's user interface. if the user attempts a cut action on uneditable content, the cut event still fires but the event object contains no data. bubbles yes cancelable yes interface clipboardevent event handler property oncut the event's default action is to copy the current selection (if any) to the system clipboard and
remove it from the document. a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action fo...
...odify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action for "cut" while modifying the clipboard must also manually
remove the selection from the document. the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents. examples live example html <div class="source" contenteditable="true">try cutting text from this box...</div> <div class="target" contenteditable="true">...and pasting it into ...
...ossible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents. ...
...And 2 more matches
Element.getElementsByClassName() - Web APIs
at the element on which the function was called. as new elements that match names are added to the subtree, they immediately appear in the collection. similarly, if an existing element that doesn't match names has its set of classes adjusted so that it matches, it immediately appears in the collection. the opposite is also true; as elements no longer match the set of names, they are immediately
removed from the collection. in quirks mode, the class names are compared in a case-insensitive fashion. otherwise, they're case sensitive. examples matching a single class to look for elements that include among their classes a single specified class, we just provide that class name when calling getelementsbyclassname(): element.getelementsbyclassname('test'); this example finds all elements...
...ents whose class lists include both the red and test classes: element.getelementsbyclassname('red test'); examining the results you can use either the item() method on the returned htmlcollection or standard array syntax to examine individual elements in the collection. ...
...you can use either the item() method on the returned htmlcollection or standard array syntax to examine individual elements in the collection. however the following code will not work as one might expect because "matches" will change as soon as any "colorbox" class is
removed. ...
...And 2 more matches
Element.scrollHeight - Web APIs
the scrollheight value is equal to the minimum height the element would require in order to fit all the content in the viewport without using a vertical scrollbar. the height is measured in the same way as clientheight: it includes the element's padding, but not its border, margin or horizontal scrollbar (if present). it can also include the height of pseudo-elements such as ::before or ::after. if the element's content can fit without a need for vertical scrollbar, its scrollheight is equal to clientheight this property will round the value to an integer. ...
...fter. if the element's content can fit without a need for vertical scrollbar, its scrollheight is equal to clientheight this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). syntax elemscrollheight = element.scrollheight; value an integer corresponding to the scrollheight pixel value of the element. example padding-top lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui of...
...ndow.getcomputedstyle(element).overflowy === 'visible' window.getcomputedstyle(element).overflowy !== 'hidden' scrollheight demo associated with the onscroll event, this equivalence can be useful to determine whether a user has read a text or not (see also the element.scrolltop and element.clientheight properties). for example: html <form name="registration"> <p> <textarea id="rules">lo
rem ipsum dolor sit amet, consectetur adipiscing elit. vestibulum at laoreet magna. aliquam erat volutpat. praesent molestie, dolor ut eleifend aliquam, mi ligula ultrices sapien, quis cursus neque dui nec risus. duis tincidunt lobortis purus eu aliquet. quisque in dignissim magna. aenean ac lo
rem at velit ultrices consequat. nulla luctus nisi ut libero cursus ultrices. pellentesque nec dignissim eni...
...And 2 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
eturn greeting; } outputelem.innerhtml += localgreeting(user) + "<br>\r"; } greetuser("mike"); greetuser("teresa"); greetuser("veronica"); this short program contains three execution contexts, some of which are created and destroyed several times over the course of the program's execution. as each context is created, it is placed on the execution context stack. when it exits, the context is
removed from the context stack. upon starting the program, the global context is created. when greetuser("mike") is reached, a context is created for the greetuser() function; this execution context is pushed onto the execution context stack. when greetuser() calls localgreeting(), another context is created to run that function. when this function returns, the context for localgr...
...e context stack. upon starting the program, the global context is created. when greetuser("mike") is reached, a context is created for the greetuser() function; this execution context is pushed onto the execution context stack. when greetuser() calls localgreeting(), another context is created to run that function. when this function returns, the context for localgreeting() is
removed from the execution stack and destroyed. program execution resumes with the next context found on the stack, which is greetuser(); this function resumes execution where it left off. the greetuser() function returns and its context is
removed from the stack and destroyed. when greetuser("teresa") is reached, a context is created for it and pushed onto the stack. when ...
... when greetuser("veronica") is reached, a context is created for it and pushed onto the stack. ...
...And 2 more matches
Drag Operations - Web APIs
th the text/uri-list and text/plain contain the same data in this example. this will often be true, but doesn't need to be the case. if you attempt to add data twice with the same format, the new data will replace the old data, but in the same position within the list of types as the old data. you can clear the data using the cleardata() method, which takes one argument: the type of the data to
remove. event.datatransfer.cleardata("text/uri-list"); the type argument to the cleardata() method is optional. if the type is not specified, the data associated with all types is
removed. if the drag contains no drag data items, or all of the items have been subsequently cleared, then no drag will occur. setting the drag feedback image when a drag occurs, a translucent image is generated from t...
...opy"; in this example, copy is the effect that is performed. you can use the value none to indicate that no drop is allowed at this location, although it is preferred not to cancel the event in this case. within the drop and dragend events, you can check the dropeffect property to determine which effect was ultimately chosen. if the chosen effect were "move", then the original data should be
removed from the source of the drag within the dragend event. specifying drop targets a listener for the dragenter and dragover events are used to indicate valid drop targets, that is, places where dragged items may be dropped. most areas of a web page or application are not valid places to drop data. thus, the default handling of these events is not to allow a drop. if you want to allow a drop, y...
...gover event will fire at the element the mouse is pointing at. naturally, you may need to move the insertion marker around a dragover event as well. you can use the event's clientx and clienty properties as with other mouse events to determine the location of the mouse pointer. finally, the dragleave event will fire at an element when the drag leaves the element. this is the time when you should
remove any insertion markers or highlighting. you do not need to cancel this event. any highlighting or other visual effects specified using the :-moz-drag-over pseudoclass will be
removed automatically. the dragleave event will always fire, even if the drag is cancelled, so you can always ensure that any insertion point cleanup can be done during this event. performing a drop when the user release...
...And 2 more matches
IDBDatabaseSync - Web APIs
important: the synchronous version of the indexeddb api was originally intended for use only with web workers, and was eventually
removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the databasesync interface in the indexeddb api represents a synchronous connection to a database. ...
...d was eventually
removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the databasesync interface in the indexeddb api represents a synchronous connection to a database. ...
...nc interface in the indexeddb api represents a synchronous connection to a database. ...
...And 2 more matches
Using the MediaStream Recording API - Web APIs
n't we have this before? why was css2 layout so awkward?" it allows you do a calculation to determine the computed value of a css unit, mixing different units in the process. for example, in web dictaphone we have three main ui areas, stacked vertically. we wanted to give the first two (the header and the controls) fixed heights: header { height: 70px; } .main-controls { padding-bottom: 0.7
rem; height: 170px; } however, we wanted to make the third area (which contains the recorded samples you can play back) take up whatever space is left, regardless of the device height. flexbox could be the answer here, but it's a bit overkill for such a simple layout. instead, the problem was solved by making the third container's height equal to 100% of the parent height, minus the heights and pa...
...dless of the device height. flexbox could be the answer here, but it's a bit overkill for such a simple layout. instead, the problem was solved by making the third container's height equal to 100% of the parent height, minus the heights and padding of the other two: .sound-clips { box-shadow: inset 0 3px 4px rgba(0,0,0,0.7); background-color: rgba(0,0,0,0.1); height: calc(100% - 240px - 0.7
rem); overflow: scroll; } note: calc() has good support across modern browsers too, even going back to internet explorer 9. checkbox hack for showing/hiding this is fairly well documented already, but we thought we'd give a mention to the checkbox hack, which abuses the fact that you can click on the <label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the inform...
...he <label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. ...
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
specified. this object contains zero or more individual constraints, as well as an optional sub-object named advanced, which contains another set of zero or more constraints which the user agent must satisfy if at all possible. the user agent attempts to satisfy constraints in the order specified in the constraint set. the most important thing to understand is that most constraints aren't requi
rements; instead, they're requests. there are exceptions, and we'll get to those shortly. requesting a specific value for a setting most simply, each constraint may be a specific value indicating a desired value for the setting. for example: let constraints = { width: 1920, height: 1080, aspectratio: 1.777777778 }; mytrack.applyconstraints(constraints); in this case, the constraints indica...
...ided. simple constraints like these, specifying a single value, are always treated as non-required. the user agent will try to provide what you request but will not guarantee that what you get will match. however, if you use simple values for properties when calling mediastreamtrack.applyconstraints(), the request will always succeed, because these values will be considered a request, not a requi
rement. specifying a range of values sometimes, any value within a range is acceptable for a property's value. you can specify ranges with either or both minimum and maximum values, and you can even specify an ideal value within the range, if you choose. if you provide an ideal value, the browser will try to get as close as possible to matching that value, given the other constraints specified. le...
...ch uses one or more of those can't be met when calling applyconstraints(), the promise will be rejected. advanced constraints so-called advanced constraints are created by adding an advanced property to the constraint set; this property's value is an array of additional constraint sets which are considered optional. there are few if any use cases for this feature, and there is some interest in
removing it from the specification, so it will not be discussed here. if you wish to learn more, see section 11 of the media capture and streams specification, past example 2. checking capabilities you can call mediastreamtrack.getcapabilities() to get a list of all of the supported capabilities and the values or ranges of values which each one accepts on the current platform and user agent. this f...
...And 2 more matches
Notification.close() - Web APIs
the user already read the notification on the webpage in the case of a messaging app or the following song is already playing in a music app). ...
...the user already read the notification on the webpage in the case of a messaging app or the following song is already playing in a music app). ...
...the user already read the notification on the webpage in the case of a messaging app or the following song is already playing in a music app). ...
...And 2 more matches
Using the Notifications API - Web APIs
xample — a to-do list app — to give more of an idea of how web notifications can be used. it stores data locally using indexeddb and notifies users when tasks are due using system notifications. download the to-do list code, or view the app running live. requesting permission before an app can send a notification, the user must grant the application the right to do so. this is a common requi
rement when an api tries to interact with something outside a web page — at least once, the user needs to specifically grant that application permission to present notifications, thereby letting the user control which apps/sites are allowed to display notifications. because of abuses of push notifications in the past, web browsers and developers have begun to implement strategies to help mitigate ...
...text body. for example, in the to-do-list example we use the following snippet to create a notification when required (found inside the createnotification() function): var img = '/to-do-notifications/img/icon-128.png'; var text = 'hey! your task "' + title + '" is now overdue.'; var notification = new notification('to do list', { body: text, icon: img }); closing notifications used close() to
remove a notification that is no longer relevant to the user (e.g. the user already read the notification on the webpage, in the case of a messaging app, or the following song is already playing in a music app to notifies upon song changes). most modern browsers dismiss notifications automatically after a few moments (around four seconds) but this isn't something you should generally be concerned abo...
...in the case of a messaging app, or the following song is already playing in a music app to notifies upon song changes). most modern browsers dismiss notifications automatically after a few moments (around four seconds) but this isn't something you should generally be concerned about as it's up to the user and user agent. the dismissal may also happen at the operating system level and users should
remain in control of this. old versions of chrome didn't
remove notifications automatically so you can do so after a settimeout() only for those legacy versions in order to not
remove notifications from notification trays on other browsers. var n = new notification('my great song'); document.addeventlistener('visibilitychange', function() { if (document.visibilitystate === 'visible') { // the ...
...And 2 more matches
Using Pointer Events - Web APIs
else { log("can't figure out which touch to continue: idx = " + idx); } } this function looks in our cached touch information array for the previous information about each touch to determine the starting point for each touch's new line segment to be drawn. this is done by looking at each touch's pointerevent.pointerid property. this property is a unique integer for each pointer event, and
remains consistent for each event during the duration of each finger's contact with the surface. this lets us get the coordinates of the previous position of each touch and use the appropriate context methods to draw a line segment joining the two positions together. after drawing the line, we call array.splice() to replace the previous information about the touch point with the current information...
...after drawing the line, we call array.splice() to replace the previous information about the touch point with the current information in the ongoingtouches array. handling the end of a touch when the user lifts a finger off the surface, a pointerup event is sent. we handle this event by calling the handleend() function below. its job is to draw the last line segment for the touch that ended and
remove the touch point from the ongoing touch list. function handleend(evt) { log("pointerup"); var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); if (idx >= 0) { ctx.linewidth = 4; ctx.fillstyle = color; ctx.beginpath(); ctx.moveto(ongoingtouches[idx].pagex, ...
...the result is that we stop tracking that touch point...
...And 2 more matches
RTCIceCandidatePairStats - Web APIs
nt value indicating the total time, in seconds, that elapsed elapsed between the most recently-sent stun request and the response being received. this may be based upon requests that were involved in confirming permission to open the connection. firstrequesttimestamp optional a domhighrestimestamp value which specifies the time at which the first stun request was sent from the local peer to the
remote peer for this candidate pair. lastpacketreceivedtimestamp optional a domhighrestimestamp value indicating the time at which the last packet was received by the local peer from the
remote peer for this candidate pair. timestamps are not recorded for stun packets. lastpacketsenttimestamp optional a domhighrestimestamp value indicating the time at which the last packet was sent from the local...
...this candidate pair. lastpacketreceivedtimestamp optional a domhighrestimestamp value indicating the time at which the last packet was received by the local peer from the
remote peer for this candidate pair. timestamps are not recorded for stun packets. lastpacketsenttimestamp optional a domhighrestimestamp value indicating the time at which the last packet was sent from the local peer to the
remote peer for this candidate pair. timestamps are not recorded for stun packets. lastrequesttimestamp optional a domhighrestimestamp value which specifies the time at which the last (most recent) stun request was sent from the local peer to the
remote peer for this candidate pair. lastresponsetimestamp optional a domhighrestimestamp value that specifies the time at which the last (most recent) ...
...ed for stun packets. lastrequesttimestamp optional a domhighrestimestamp value which specifies the time at which the last (most recent) stun request was sent from the local peer to the
remote peer for this candidate pair. lastresponsetimestamp optional a domhighrestimestamp value that specifies the time at which the last (most recent) stun response was received by the local candidate from the
remote candidate in this pair. localcandidateid optional the unique id string corresponding to the rtcicecandidate from the data included in the rtcicecandidatestats object providing statistics for the candidate pair's local candidate. nominated optional a boolean value which, if true, indicates that the candidate pair described by this object is one which has been proposed for use, and will be (...
...And 2 more matches
RTCIceTransport.onselectedcandidatepairchange - Web APIs
rchange event, which is fired when the ice agent selects a new candidate pair to be used for the connection. syntax rtcicetransport.onselectedcandidatepairchange = candidatepairhandler; value this propoerty should be set to reference an event handler function to be called by the ice agent when it discovers a new candidate pair that the rtcicetransport will be using for communication with the
remote peer. this event will occur at least once, and may occur more than once if the ice agent continues to identify candidate pairs that will work better, more closely match the requested parameters, and so forth. the event handler can determine the current state by calling the transport's getselectedcandidatepair() method, which returns a rtcicecandidatepair whose rtcicecandidatepair.local and rt...
...continues to identify candidate pairs that will work better, more closely match the requested parameters, and so forth. ...
...idate objects describing the local and
remote candidates that are currently being used. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. ...
...And 2 more matches
RTCIceTransport.state - Web APIs
tes whether or not ice gathering is currently underway. syntax icestate = icetransport.state; value a domstring, whose value is one of those found in the enumerated type rtcicetransportstate, which indicates the stage of ice gathering that's currently underway. ...
...rently underway. syntax icestate = icetransport.state; value a domstring, whose value is one of those found in the enumerated type rtcicetransportstate, which indicates the stage of ice gathering that's currently underway. its value will be one of the following: "new" the rtcicetransport is currently gathering local candidates, or is waiting for the
remote device to begin to transmit the
remote candidates, or both. in this state, checking of candidates to look for those which might be acceptable has not yet begun. "checking" at least one
remote candidate has been received, and the rtcicetransport has begun examining pairings of
remote and local candidates in order to attempt to identify viable pairs that could be used to establish a connection. keep in mind that gathering of local ...
... "connected" a viable candidate pair has been found and selected, and the rtcicetransport has connected the two peers together using that pair. ...
...And 2 more matches
RTCPeerConnection.canTrickleIceCandidates - Web APIs
ideally, your signaling protocol provides a way to detect trickling support, so that you don't need to rely on this property. a webrtc browser will always support trickle ice. ...
... ideally, your signaling protocol provides a way to detect trickling support, so that you don't need to rely on this property. a webrtc browser will always support trickle ice. ...
...ickle ice. if trickling isn't supported, or you aren't able to tell, you can check for a falsy value for this property and then wait until the value of icegatheringstate changes to "completed" before creating and sending the initial offer. that way, the offer contains all of the candidates. syntax var cantrickle = rtcpeerconnection.cantrickleicecandidates; value a boolean that is true if the
remote peer can accept trickled ice candidates and false if it cannot. if no
remote peer has been established, this value is null. note: this property's value is determined once the local peer has called rtcpeerconnection.set
remotedescription(); the provided description is used by the ice agent to determine whether or not the
remote peer supports trickled ice candidates. example var pc = new rtc...
...And 2 more matches
RTCStatsReport - Web APIs
he rtcpeerconnection. csrc an rtccontributingsourcestats object which contains statistics related to a contributing source (csrc) that contributed to an inbound rtp stream. data-channel an rtcdatachannelstats object which contains statistics about each rtcdatachannel on the connection. inbound-rtp an rtcinboundrtpstreamstats object providing statistics about inbound data being received from
remote peers. since this only provides statistics related to inbound data, without considering the local peer's state, any values that require knowledge of both, such as round-trip time, is not included. this report isn't available if there are no connected peers. local-candidate an rtcicecandidatestats object giving statistics about an ice local candidate; these candidates are found in the output ...
...ving statistics about an ice local candidate; these candidates are found in the output from rtcicetransport.getlocalcandidates(). outbound-rtp the report is an rtcoutboundrtpstreamstats object providing statistics based on the local peer's outgoing data being sent to its peers. this information considers only the outbound rtp stream, so any data which requires information about the state of the
remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers' states. peer-connection a rtcpeerconnectionstats object provides statistics related to the overall peer connection's rtcpeerconnection. receiver provides statistics about a specific rtcrtpreceiver. the statistics object is an rtcaudioreceiverstats object if kind is au...
...can't be computed without knowing about the other peers' states. peer-connection a rtcpeerconnectionstats object provides statistics related to the overall peer connection's rtcpeerconnection. receiver provides statistics about a specific rtcrtpreceiver. the statistics object is an rtcaudioreceiverstats object if kind is audio; if kind is video, the object is an rtcvideoreceiverstats object. ...
...And 2 more matches
RTCStatsType - Web APIs
he rtcpeerconnection. csrc an rtccontributingsourcestats object which contains statistics related to a contributing source (csrc) that contributed to an inbound rtp stream. data-channel an rtcdatachannelstats object which contains statistics about each rtcdatachannel on the connection. inbound-rtp an rtcinboundrtpstreamstats object providing statistics about inbound data being received from
remote peers. since this only provides statistics related to inbound data, without considering the local peer's state, any values that require knowledge of both, such as round-trip time, is not included. this report isn't available if there are no connected peers. local-candidate an rtcicecandidatestats object giving statistics about an ice local candidate; these candidates are found in the output ...
...ving statistics about an ice local candidate; these candidates are found in the output from rtcicetransport.getlocalcandidates(). outbound-rtp the report is an rtcoutboundrtpstreamstats object providing statistics based on the local peer's outgoing data being sent to its peers. this information considers only the outbound rtp stream, so any data which requires information about the state of the
remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers' states. peer-connection a rtcpeerconnectionstats object provides statistics related to the overall peer connection's rtcpeerconnection. receiver provides statistics about a specific rtcrtpreceiver. the statistics object is an rtcaudioreceiverstats object if kind is au...
...can't be computed without knowing about the other peers' states. peer-connection a rtcpeerconnectionstats object provides statistics related to the overall peer connection's rtcpeerconnection. receiver provides statistics about a specific rtcrtpreceiver. the statistics object is an rtcaudioreceiverstats object if kind is audio; if kind is video, the object is an rtcvideoreceiverstats object. ...
...And 2 more matches
Text.wholeText - Web APIs
one for t...
...one for the first sentence...
...one for the first sentence, and one for the first word of the last. ...
...And 2 more matches
TextTrackList - Web APIs
r example. properties this interface also inherits properties from its parent interface, eventtarget. length read only the number of tracks in the list. event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new text track has been added to the media element. onchange an event handler to be called when the change event occurs. on
removetrack an event handler to call when the
removetrack event is sent, indicating that a text track has been
removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the texttrack found within the texttracklist whose id matches the specified string. if no match is found, null is returned. events addtrack...
...rget. gettrackbyid() returns the texttrack found within the texttracklist whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new text track has been added to the media element. also available via the onaddtrack property. change fired when a text track has been made active or inactive. also available via the onchange property. ...
...nd within the texttracklist whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new text track has been added to the media element. also available via the onaddtrack property. change fired when a text track has been made active or inactive. also available via the onchange property.
removetrack fired when a new text track has been
removed from the media element. ...
...And 2 more matches
VideoTrackList - Web APIs
track, if any, or −1 otherwise. event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new video track has been added to the media element. onchange an event handler to be called when the change event occurs — that is, when the value of the selected property for a track has changed, due to the track being made active or inactive. on
removetrack an event handler to call when the
removetrack event is sent, indicating that a video track has been
removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the videotrack found within the videotracklist whose id matches the specified string. if no match is found, null is returned. events addtr...
.... gettrackbyid() returns the videotrack found within the videotracklist whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new video track has been added to the media element. also available via the onaddtrack property. change fired when a video track has been made active or inactive. also available via the onchange property. ...
...ithin the videotracklist whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new video track has been added to the media element. also available via the onaddtrack property. change fired when a video track has been made active or inactive. also available via the onchange property.
removetrack fired when a new video track has been
removed from the media element. ...
...And 2 more matches
WebRTC Statistics API - Web APIs
rtpreceiver and the media associated with that receiver. the specific type of object representing the statistics depends on the media kind. ...
...th that receiver. the specific type of object representing the statistics depends on the media kind. ...
... rtcaudiohandlerstats or rtcvideohandlerstats rtcmediahandlerstats rtcstats
remote-candidate statistics about a
remote ice candidate associated with the connection's rtcicetransports. rtcicecandidatestats rtcstats
remote-inbound-rtp statistics describing the state of the inbound data stream from the perspective of the
remote peer. ...
...And 2 more matches
Inputs and input sources - Web APIs
inputsources; due to the fact that the contents of the xrinputsource objects representing each input source in the list are read-only, changes to these inputs are made by the webxr system by deleting the source's record and adding a new one to replace it. an inputsourceschange event is sent to your xrsession whenever one or more of the input sources change, or when an input source is added to or
removed from the list. for example, if you need to keep up with which controller is held in each of the player's hands, you might do something like this: let inputsourcelist = null; let lefthandsource = null; let righthandsource = null; xrsession.addeventlistener("inputsourceschange", event => { inputsourcelist = event.session.inputsources; inputsourcelist.foreach(source => { switch(sourc...
...xecution, so you can use it to fetch the input source list as soon as it's available at startup time. the event is delivered as an xrinputsourcechangeevent, which includes three properties of interest: session the xrsession for which the input sources have changed. added an array of zero or more xrinputsource objects indicating the input sources that have been newly added to the xr system.
removed an array of zero or more xrinputsource objects indicating any input sources that have been
removed from the xr system. identifying the input's profile each input source has a profiles property, which contains a live list of the webxr input profiles which apply to the input source, in order of specificity from most-specific to least. in order to do anything meaningful involving scanning o...
...an object is found along the targeting ray, picks it up. picking up an object involves first looking to see if the hand represented by dropping any object already being held in the hand represented by avatar.heldobject[hand]. if an object is already held in that hand, it's dropped by calling the dropobject() function. then pickupobject() is called, specifying the targeted object as the object to
remove from the scene and place into the specified hand. pickupobject() also records the original position of the object so it can be returned to that spot if the squeeze is canceled or aborted. dropping the object: the squeeze event handler the squeeze event is received when the user ends the squeeze action by releasing their grip. in this example, we interpret that as releasing the currently-hel...
...And 2 more matches
Using the Web Storage API - Web APIs
utomatically converted to strings). you can access these values like an object, or with the storage.getitem() and storage.setitem() methods. these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's recommended to use the web storage api (setitem, getitem,
removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores. the two mechanisms within web storage are as follows: sessionstorage maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and restores). localstorage does the same thing, but per...
...a different storage object is used for the sessionstorage and localstorage for each origin — they function and are controlled separately. so, for example, initially calling localstorage on a document will return a storage object; calling sessionstorage on a document will return a different storage object. both of these can be manipulated in the same way, but separately. feature-detecting...
...used up all available storage space, but storage is actually available. our feature detection should take these scenarios into account. ...
...And 2 more matches
Using Web Workers - Web APIs
in order to achieve that we first implement a sendquery method which queries if ...
...in order to achieve that we first implement a sendquery method which queries if the worker actually has the corresponding methods to do what we want. /* this functions takes at least on...
...script type="text/javascript"> /* queryableworker instances methods: * sendquery(queryable function name, argument to pass 1, argument to pass 2, etc. ...
...And 2 more matches
Window.open() - Web APIs
be specified. return value a windowproxy object, which is basically a thin wrapper for the window object representing the newly created window, and has all its features available. if the window couldn't be opened, the returned value is instead null. the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security requi
rements. description the open() method creates a new secondary browser window, similar to choosing new window from the file menu. the url parameter specifies the url to be fetched and loaded in the new window. if url is an empty string, then a new blank, empty window (url about:blank) is created with the default toolbars of the main window. note that
remote urls won't load immediately. when window...
... been closed, then use the focus() method. there is no other reliable way. you can examine an example explaining how to use the focus() method. how do i force a maximized window? you cannot. all browser manufacturers try to make the opening of new secondary windows noticed by users and noticeable by users to avoid confusion, to avoid disorienting users. how do i turn off window resizability or
remove toolbars? you cannot force this. users with mozilla-based browsers have absolute control over window functionalities like resizability, scrollability and toolbars presence via user preferences in about:config. since your users are the ones who are supposed to use such windows (and not you, being the web author), the best is to avoid interfering with their habits and preferences. we recommend ...
...the rare scripts that do not abuse such feature are often wrong, inaccurate when resizing the window. 99% of all those scripts disable window resizability and disable scrollbars when in fact they should enable both of these features to allow a cautious and sane fallback mechanism if their calculations are wrong. the window method sizetocontent() can also be disabled. moving and resizing a window
remotely on the user's screen via script will very often annoy the users, will disorient the user, and will be wrong at best. the web author expects to have full control of (and can decide about) every position and size aspects of the users' browser window ... which is simply not true. how do i open a referenced resource of a link in a new tab? or in a specific tab? to open a resource in a new tab ...
...And 2 more matches
ARIA: feed role - Accessibility
a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads. <section role="feed" aria-busy="false"> ... <article aria-posinset="427" aria-setsize="-1">...</article> <article aria-posinset="428" aria-setsize="-1">...</article> <article aria-posinset="429" aria-setsize="-1">...</article> ... ...
...ould be focusable, with tabindex of 0 or -1. an article should be scrolled into view when it, or a descendant element, receives focus. if the addition of articles occupies the main browser thread, make sure to set aria-busy="true" on the feed itself, and make sure to set it back to false when processing ends, or the user may not see the updates. ...
...ce, avoid inserting or
removing articles in the middle of a feed, load new articles before the user has reached the end of the feed, and provide keyboard commands for moving focus among articles so that keyboard users can navigate through your feed. see keyboard interactions below. if the number of articles is known, set aria-setsize on the articles themselves. however, if the total number is ext
remely large, indefinite, or changes often, set aria-setsize="-1" to indicate that the size of the feed is not known. another feature of the feed pattern is skim reading: articles within a feed can contain both an accessible name with the aria-label and a description with an aria-describedby, suggesting to screen readers which elements to speak after the label when navigating by article. by identify...
...And 2 more matches
Alerts - Accessibility
...
...llows for them continue modifying the form without losing focus (caused by the “onblur” handler in javascript's default ‘alert’ function). ...
... (caused by the “onblur” handler in javascript's default ‘alert’ function). ...
...And 2 more matches
Web accessibility for seizures and physical reactions - Accessibility
that is imperceptible to the human eye. in other words, eric's techniques address the refresh-rate problem. the css below is from the article, css-tricks revisiting prefers-reduced-motion, the reduced motion media query. @media screen and (prefers-reduced-motion: reduce), (update: slow) { * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; /* hat tip nick/css
remedy (https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/#comment-1700170) */ transition-duration: 0.001ms !important; } } from w3.org's page on media queries 4: the update media feature is used to query the ability of the output device to modify the appearance of content once it has been rendered. it has the values of "none", "slow", and "fast". develop...
...nvironmentmq (planned in media queries level 5) light-level has three valid values: dim, normal, and washed. interestingly, the specification refrains from actually defining the three levels in terms of a measurment of lux, because devices with a light sensor usually adjust the brightess of the screen automatically. the specifications also note the difference in technology, such as e-ink, which
remains readable in bright daylight, versus liquid crystals, which do not. environment-blending from w3c's draft document, media queries level 5: "the environment-blending media feature is used to query the characteristics of the user’s display so the author can adjust the style of the document. an author might choose to adjust the visuals and/or layout of the page depending on the display techno...
...ncy media feature is used to detect if the user has requested the system minimize the amount of transparent or translucent layer effects it uses. mediaquerylist interface section 4.2 from the csswg.org drafts integrates with the event loop defined in html. [html] for the mediaquerylist object. see the mdn document, mediaquerylist for more information. personalization help and support the requi
rement for the literal property is taken from section 23 non-literal text and images requi
rement: some users cannot understand non-literal text and icons such as metaphors, idioms etc. the literal property is intended to identify text or images as non-literal and allows the author to explain non-literal text and images to users. transitions (for css and svg) the following is from the web animation...
...And 2 more matches
CSS Animations tips and tricks - CSS: Cascading Style Sheets
which is called when the user clicks on the "run" button. ...
...however, changes to the class list don't take effect until the style recomputation is complete and a refresh has occurred to reflect the change. ...
...t it knows you've done that, then add the animation effect back to the element. to make that happen, we have to be creative. here's what happens when the play() function gets called: the box's list of css classes is reset to simply "box". this has the effect of
removing any other classes currently applied to the box, including the "changing" class that handles animation. in other words, we're
removing the animation effect from the box. however, changes to the class list don't take effect until the style recomputation is complete and a refresh has occurred to reflect the change. to be sure that the styles are recalculated, we use window.requestanimationframe(), specifying a callback. our callback gets executed just before the next repaint of the document. the problem for us is that becaus...
...And 2 more matches
Mastering margin collapsing - CSS: Cascading Style Sheets
of the largest positive margin and the smallest (most negative) negative margin. when all margins are negative, the size of the collapsed margin is the smallest (most negative) margin. this applies to both adjacent elements and nested elements. ...
... the size of the collapsed margin is the smallest (most negative) margin. this applies to both adjacent elements and nested elements. ...
... recommendation initial definition. ...
...And 2 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
to center our box we use the align-items property to align our item on the cross axis, which in this case is the block axis running vertically. we use justify-content to align the item on the main axis, which in this case the inline axis running horizontally. you can take a look at the code of this example below. change the size of the container or nested element and the nested element always
remains centered. properties that control alignment the properties we will look at in this guide are as follows. justify-content — controls alignment of all items on the main axis. align-items — controls alignment of all items on the cross axis. align-self — controls alignment of an individual flex item on the cross axis. align-content — described in the spec as for “packing flex ...
...e available space after displaying the items is distributed between the items. the left and right item line up flush with the start and end. if the main axis is in the block direction because flex-direction is set to column, then justify-content will distribute space between items in that dimension as long as there is space in the flex container to distribute. alignment and writing modes
remember that with all of these alignment methods, the values of flex-start and flex-end are writing mode-aware. if the value of justify-content is start and the writing mode is left-to-right as in english, the items will line up starting at the left side of the container. however if the writing mode is right-to-left as in arabic, the items will line up starting at the right side of the container.
...alue of justify-content is start and the writing mode is left-to-right as in english, the items will line up starting at the left side of the container. however if the writing mode is right-to-left as in arabic, the items will line up starting at the right side of the container. the live example below has the direction property set to rtl to force a right-to-left flow for our items. you can
remove this, or change the values of justify-content to see how flexbox behaves when the start of the inline direction is on the right. alignment and flex-direction the start line will also change if you change the flex-direction property — for example using row-reverse instead of row. in this next example i have items laid out with flex-direction: row-reverse and justify-content: flex-end. i...
...And 2 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
od at dealing with text direction, and you don’t even need to be working in a rtl language to take a look. in the example below, i have two paragraphs. one has no text-align property set, the second has text-align set to left. i have added dir="rtl" to the html element, which switches the writing mode from the default for an english language document of ltr. you can see that the first paragraph
remains left to right, due to the text-align value being left . the second however, switches direction and the text runs from right to left . this is a very simple example of the problem with physical values and properties being used in css. they prevent the browser being able to do the work to switch writing mode, as they make the assumption that the text is flowing left to right and top to botto...
.../div> </div> logical values for alignment with the block and inline axis able to change direction, the logical values for the alignment properties start to make more sense. in this next example, i am using alignment to align items inside a grid that is set to writing-mode: vertical-lr. the start and end properties work in exactly the same way that they do in the default writing mode, and
remain logical in a way that using left and right, top and bottom to align items would not do. this occurs once we've flipped the grid onto the side, like this: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; pad...
...ning from right to left. auto-placement and writing modes in the example already shown, you can see how writing mode changes the direction in which items place themselves onto the grid. items will, by default, place themselves along the inline axis then move onto a new row. however, that inline axis may not always run from left to right. line-based placement and writing modes the key thing to
remember when placing items by line number, is that line 1 is the start line, no matter which writing mode you are in. line -1 is the end line, no matter which writing mode you are in. in this next example, i have a grid which is in the default ltr direction. i have positioned three items using line-based placement. item 1 starts at column line 1, spanning one track. item 2 starts at column line...
...And 2 more matches
Using CSS counters - CSS: Cascading Style Sheets
css counters let you adjust the appearance of content based on its location in a document. for example, you can use counters to automatically number the headings in a webpage. counters are, in essence, variables maintained by css whose values may be inc
remented by css rules to track how many times they're used. using counters manipulating a counter's value to use a css counter, it must first be initialized to a value with the counter-reset property (0 by default). the same property can also be used to change its value to any specific number. once initialized, a counter's value can be increased or decreased with counter-inc
rement. the counter's name must not be "none", "inherit", or "initial"; otherwise the declaration is ignored. displaying a counter the value of a counter can be displa...
...nt, from outermost to innermost, separated by the specified string. the counters are rendered in the specified style (decimal by default). basic example this example adds "section [the value of the counter]:" to the beginning of each heading. css body { counter-reset: section; /* set a counter named 'section', and its initial value is 0. ...
...d by the specified string. the counters are rendered in the specified style (decimal by default). basic example this example adds "section [the value of the counter]:" to the beginning of each heading. css body { counter-reset: section; /* set a counter named 'section', and its initial value is 0. ...
...And 2 more matches
all - CSS: Cascading Style Sheets
body { font-...
...d direction) formal syntax initial | inherit | unset | revert examples html <blockquote id="quote"> lo
rem ipsum dolor sit amet, consectetur adipiscing elit. </blockquote> phasellus eget velit sagittis. css body { font-size: small; background-color: #f0f0f0; color: blue; } blockquote { background-color: skyblue; color: red; } result no all property <blockquote id="quote">lo
rem ipsum dolor sit amet, consectetur adipiscing elit.</blockquote> phasellus eget velit sagittis. body { font-size: small; background-color: #f0f0f0; color:blue; } blockquote { background-color: skyblue; color: red; } the <blockquote> uses the browser's default styling together with a specific background and text color. it also behaves as a block element: the text that follows it is beneath it. ...
...iscing elit.</blockquote> phasellus eget velit sagittis. body { font-size: small; background-color: #f0f0f0; color:blue; } blockquote { background-color: skyblue; color: red; } the <blockquote> uses the browser's default styling together with a specific background and text color. it also behaves as a block element: the text that follows it is beneath it. all:unset <blockquote id="quote">lo
rem ipsum dolor sit amet, consectetur adipiscing elit.</blockquote> phasellus eget velit sagittis. body { font-size: small; background-color: #f0f0f0; color:blue; } blockquote { background-color: skyblue; color: red; } blockquote { all: unset; } the <blockquote> doesn't use the browser default styling: it is an inline element now (initial value), its background-color is transparent (initial value...
...And 2 more matches
clamp() - CSS: Cascading Style Sheets
esponsive example that makes use of min(), max(), and clamp() for some of the sizes. the <body> element's width is set as min(1000px, calc(70% + 100px)). this means that the width will be set at 1000px, unless the result of calc(70% + 100px) is less than 1000px, in which case it will be set to that value instead. min() allows you set a maximum value. the <p> element's font-size is set as max(1.2
rem, 1.2vw). this means that the font-size will be set at 1.2
rem, unless the computed value of 1.2vw is greater than that of 1.2
rem, in which case it will be set to that value instead. max() allows you set a minimum value, which in cases like this is useful for accessibility purposes. the <h1> element's font-size is set as clamp(1.8
rem, 2.5vw, 2.8
rem). this means that the font-size will be set at 1.
...clamp() allows you to set a minimum and maximum value. ...
...e computed value of 1.2vw is greater than that of 1.2
rem, in which case it will be set to that value instead. max() allows you set a minimum value, which in cases like this is useful for accessibility purposes. the <h1> element's font-size is set as clamp(1.8
rem, 2.5vw, 2.8
rem). this means that the font-size will be set at 1.8
rem, until the computed value of 2.5vw becomes greater than that of 1.8
rem. at this point, font-size will be set at 2.5vw, until 2.5vw's computed value becomes greater than that of 2.8
rem. at this point, the font-size will be set at 2.8
rem. clamp() allows you to set a minimum and maximum value. you find this example live on github, if you want to play around with it. html <h1>simple responsive test</h1> <p> lo
rem ipsum dolor sit amet, consectetur adipiscing elit. in ...
...And 2 more matches
clear - CSS: Cascading Style Sheets
o clear floats on end side of its containing block, that is the right floats on ltr scripts and the left floats on rtl scripts. ...
...tial valuenoneapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | left | right | both | inline-start | inline-end examples clear: left html <div class="wrapper"> <p class="black">lo
rem ipsum dolor sit amet, consectetuer adipiscing elit. phasellus sit amet diam. duis mattis varius dui. ...
...raph clears left.</p> </div> css .wrapper{ border:1px solid black; padding:10px; } .left { border: 1px solid black; clear: left; } .black { float: left; margin: 0; background-color: black; color: #fff; width: 20%; } .red { float: left; margin: 0; background-color: pink; width:20%; } p { width: 50%; } clear: right html <div class="wrapper"> <p class="black">lo
rem ipsum dolor sit amet, consectetuer adipiscing elit. phasellus sit amet diam. duis mattis varius dui. suspendisse eget dolor.</p> <p class="red">lo
rem ipsum dolor sit amet, consectetuer adipiscing elit.</p> <p class="right">this paragraph clears right.</p> </div> css .wrapper{ border:1px solid black; padding:10px; } .right { border: 1px solid black; clear: right; } .black { float:...
...And 2 more matches
color-adjust - CSS: Cascading Style Sheets
and carefully crafted to use colors, images, and styles in a thoughtful and/or important way, such that being altered by the browser might actually make things worse rather than better. the appearance of the content should not be changed except by the user's request. for example, a page might include a list of information with rows whose background colors alternate between white and a light grey. ...
... when printing a page, the browser might want to replace light-colored text on a dark background with dark text on a white background. any options the user agent offers the user to allow them to control the use of color and images will take priority over the value of color-adjust. ...
...ckground color would decrease the legibility of the content. usage notes there are a number of reasons a browser might wish to deviate from the specified appearance, such as: the content uses text and background colors that will be too similar on the output device for legibility purposes. if the output device is a printer, and to save ink, dark or ext
remely dense background images might be
removed. when printing a page, the browser might want to replace light-colored text on a dark background with dark text on a white background. any options the user agent offers the user to allow them to control the use of color and images will take priority over the value of color-adjust. in other words, there isn't any guarantee that color-adjust will do anything. not only can the user override t...
...And 2 more matches
transition-delay - CSS: Cascading Style Sheets
ch delay will be applied to the corresponding property as specified by the transition-property property, which acts as a master list. if there are fewer delays specified than in the master list, the list of delay values will be repeated until there are enough. if there are more delays, the list of delay values will be truncated to match the number of properties. in both cases, the css declaration
remains valid. syntax /* <time> values */ transition-delay: 3s; transition-delay: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect. formal definition initial value0sapplies toall elements, ::before and ::afte...
... unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect. ...
...s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 1s <div class="parent"> <div class="box">lo
rem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top color; -webkit-transition-duration:2s; -webkit-transition-delay:1s; -webkit-transition-timing-function: ...
...And 2 more matches
white-space - CSS: Cascading Style Sheets
uding between white space characters. such preserved spaces take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size). ...
... take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size). ...
...ous white-space values: new lines spaces and tabs text wrapping end-of-line spaces normal collapse collapse wrap
remove nowrap collapse collapse no wrap
remove pre preserve preserve no wrap preserve pre-wrap preserve preserve wrap hang pre-line preserve collapse wrap
remove break-spaces preserve preserve wrap wrap formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | pre | nowrap | pre-wrap | pre-line | break-spaces examples basic example code { white-space: pre; } line breaks inside <pre> elements pre { word-wrap: break-word; /* i...
...And 2 more matches
Mutation events - Developer guides
roposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. the practical reasons to avoid the mutation events are performance issues and cross-browser support. performance adding dom mutation listeners to a document profoundly degrades the performance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover,
removing the listeners does not reverse the damage. the performance effect is limited to the documents that have the mutation event listeners. cross-browser support these events are not implemented consistently across different browsers, for example: ie prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, domnodein...
... in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. ...
...of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. ...
...And 2 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
and dates outside june can't be scrolled to in the datepicker widget. depending on what browser you are using, you might find that times outside the specified values might not be selectable in the time picker (e.g. edge), or invalid (see validation) but still available (e.g. chrome). note: you should be able to use the step attribute to vary the number of days jumped each time the date is inc
remented (e.g. maybe you only want to make saturdays selectable). however, this does not seem to work effectively in any implementation at the time of writing. controlling input size <input type="datetime-local"> doesn't support form control sizing attributes such as size. you'll have to resort to css for customizing the sizes of these elements. setting timezones one thing the datetime-local inp...
...input type="datetime-local"> doesn't support form control sizing attributes such as size. you'll have to resort to css for customizing the sizes of these elements. setting timezones one thing the datetime-local input type doesn't provide is a way to set the time zone and/or locale of the date/time control. this was available in the datetime input type, but this type is now obsolete, having been
removed from the spec. the main reasons why this was
removed are a lack of implementation in browsers, and concerns over the user interface/experience. it is easier to just have a control (or controls) for setting the date/time and then deal with the locale in a separate control. for example, if you are creating a system where the user is likely to already be logged in, with their locale already set...
...; width: 300px; } input:invalid+span:after { content: '✖'; padding-left: 5px; } input:valid+span:after { content: '✓'; padding-left: 5px; } important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to
remove it entirely. it's also possible for someone to simply bypass your html entirely and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data is submitted (or data which is too large, is of the wrong type, and so forth). handling browser support as mentioned above, the major problem with usi...
...And 2 more matches
Closures - JavaScript
eclared. this environment consists of any local variables that were in-scope at the time the closure was created. in this case, myfunc is a reference to the instance of the function displayname created when makefunc is run. the instance of displayname maintains a reference to its lexical environment, within which the variable name exists. for this reason, when myfunc is invoked, the variable name
remains available for use, and "mozilla" is passed to alert. here's a slightly more interesting example—a makeadder function: function makeadder(x) { return function(y) { return x + y; }; } var add5 = makeadder(5); var add10 = makeadder(10); console.log(add5(2)); // 7 console.log(add10(2)); // 12 in this example, we have defined a function makeadder(x), that takes a single argument x...
...ess to code. they also provide a powerful way of managing your global namespace. the following code illustrates how to use closures to define public functions that can access private functions and variables. note that these closures follow the module design pattern. var counter = (function() { var privatecounter = 0; function changeby(val) { privatecounter += val; } return { inc
rement: function() { changeby(1); }, dec
rement: function() { changeby(-1); }, value: function() { return privatecounter; } }; })(); console.log(counter.value()); // 0. counter.inc
rement(); counter.inc
rement(); console.log(counter.value()); // 2. counter.dec
rement(); console.log(counter.value()); // 1. in previous examples, each closure had its own lex...
... the shared lexical environment is created in the body of an anonymous function, which is executed as soon as it has been defined (also known as an iife). ...
...And 2 more matches
Details of the object model - JavaScript
, specifying the name and dept properties. next, you define the manager constructor function, calling the employee constructor and specifying the reports property. finally, you assign a new object derived from employee.prototype as the prototype for the manager constructor function. then, when you create a new manager, it inherits the name and dept properties from the employee object. adding and
removing properties in class-based languages, you typically create a class at compile time and then you instantiate instances of the class either at compile time or at run time. you cannot change the number or the type of properties of a class after you define the class. in javascript, however, at run time you can add or
remove properties of any object. if you add a property to an object that is use...
... constructor function. inheritance model inherit properties by following the class chain. inherit properties by following the prototype chain. extension of properties class definition specifies all properties of all instances of a class. cannot add properties dynamically at run time. constructor function or prototype specifies an initial set of properties. can add or
remove properties dynamically to individual objects or to the entire set of objects. the employee example the
remainder of this chapter uses the employee hierarchy shown in the following figure. a simple object hierarchy with the following objects: employee has the properties name (whose value defaults to the empty string) and dept (whose value defaults to "general"). manager is ba...
...nd this value overrides the value inherited from employee. because base is a method of engineer, within the call to base, javascript binds the this keyword to the object created in step 1. thus, the workerbee function in turn passes the "doe, jane" and "engineering" arguments to the employee constructor function. upon return from the employee constructor function, the workerbee function uses the
remaining argument to set the projects property. upon return from the base method, the engineer constructor initializes the object's machine property to "belau". upon return from the constructor, javascript assigns the new object to the jane variable. you might think that, having called the workerbee constructor from inside the engineer constructor, you have set up inheritance appropriately for e...
...And 2 more matches
Introduction - JavaScript
upports a runtime system based on a small number of data types representing numeric, boolean, and string values. javascript has a prototype-based object model instead of the more common class-based object model. the prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. javascript also supports functions without any special declarative requi
rements. functions can be properties of objects, executing as loosely typed methods. javascript is a very free-form language compared to java. you do not have to declare all variables, classes, and methods. you do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces. variables, parameters, and function return types are not expli...
...age designed for fast execution and type safety. type safety means, for instance, that you can't cast a java integer into an object reference or access private memory by corrupting java bytecodes. java's class-based model means that programs consist exclusively of classes and their methods. java's class inheritance and strong typing generally require tightly coupled object hierarchies. these requi
rements make java programming more complex than javascript programming. in contrast, javascript descends in spirit from a line of smaller, dynamically typed languages such as hypertalk and dbase. these scripting languages offer programming tools to a much wider audience because of their easier syntax, specialized built-in functionality, and minimal requi
rements for object creation. javascript com...
...eb hypertext application technology working group). the dom defines the way in which html document objects are exposed to your script. to get a better idea about the different technologies that are used when programming with javascript, consult the article javascript technologies overview. javascript documentation versus the ecmascript specification the ecmascript specification is a set of requi
rements for implementing ecmascript. it is useful if you want to implement standards-compliant language features in your ecmascript implementation or engine (such as spidermonkey in firefox, or v8 in chrome). the ecmascript document is not intended to help script programmers. use the javascript documentation for information when writing scripts. the ecmascript specification uses terminology and syn...
...And 2 more matches
Deprecated and obsolete features - JavaScript
regexp properties the following properties are deprecated. this does not affect their use in replacement strings: property description $1-$9 parenthesized substring matches, if any. warning: using these properties can result in problems, since browser extensions can modify them. ...
... regexp properties the following properties are deprecated. this does not affect their use in replacement strings: property description $1-$9 parenthesized substring matches, if any. warning: using these properties can result in problems, since browser extensions can modify them. ...
... by one, two, or three octal digits) are deprecated in string and regular expression literals. the escape and unescape functions are deprecated. use encodeuri, encodeuricomponent, decodeuri or decodeuricomponent to encode and decode escape sequences for special characters. string methods html wrapper methods like string.prototype.fontsize and string.prototype.big. ...
...And 2 more matches
Array.prototype.pop() - JavaScript
pop is intentionally generic; this method can be called or applied to objects resembling arrays. ...
... pop is intentionally generic; this method can be called or applied to objects resembling arrays. ...
...hod changes the length of the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arrname.pop() return value the
removed element from the array; undefined if the array is empty. description the pop method
removes the last element from an array and returns that value to the caller. pop is intentionally generic; this method can be called or applied to objects resembling arrays. objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner. if you call pop() on an empty array, it returns undefined. ...
...And 2 more matches
Object.freeze() - JavaScript
in addition, freezing an object also prevents its prototype from being changed. freeze() returns the same object that was passed in. the source for this interactive example is stored in a github repository. ...
.... the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.freeze(obj) parameters obj the object to freeze. return value the object that was passed to the function. description nothing can be added to or
removed from the properties set of a frozen object. any attempt to do so will fail, either silently or by throwing a typeerror exception (most commonly, but not exclusively, when in strict mode). for data properties of a frozen object, values cannot be changed, the writable and configurable attributes are set to false. accessor properties (getters and setters) work the same (and still give the illus...
...not be changed, the writable and configurable attributes are set to false. accessor properties (getters and setters) work the same (and still give the illusion that you are changing the value). note that values that are objects can still be modified, unless they are also frozen. as an object, an array can be frozen; after doing so, its elements cannot be altered and no elements can be added to or
removed from the array. freeze() returns the same object that was passed into the function. it does not create a frozen copy. in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror. in es2015, a non-object argument will be treated as if it were a frozen ordinary object, and be simply returned. > object.freeze(1) typeerror: 1 is not an object // es5 ...
...And 2 more matches
Performance fundamentals - Web Performance
ll user states. intelligently allocating memory to user state is an important concern that we go over in more detail below. power usage the final metric discussed here is power usage. like memory usage, users perceive power usage only indirectly, by how long their devices can maintain all other upp goals. in service of meeting upp goals, the system must use only the minimum power required. the
remainder of this document will discuss performance in terms of these metrics. platform performance optimizations this section provides a brief overview of how firefox/gecko contributes to performance generally, below the level of all applications. from a developer's or user's perspective, this answers the question, "what does the platform do for you?" web technologies the web platform provides m...
...app's look-and-feel, using a standardized syntax. css animations give you very granular control over your effects using keyframes, and you can even watch events fired during the animation process in order to handle other tasks that need to be performed at set points in the animation process. you can easily trigger these animations with the :hover, :focus, or :target, or by dynamically adding and
removing classes on parent elements. if you want to create animations on the fly or modify them in javascript, james long has written a simple library for that called css-animations.js. use css transforms instead of tweaking absolute positioning and fiddling with all that math yourself, use the transform css property to adjust the position, scale, and so forth of your content. the reason is, once ...
...especially when they feature lots of gradients and drop shadows. it helps a lot to simplify your look-and-feel and move a proxy element around when you drag and drop. when, for example, you have a long list of elements (let’s say tweets), don’t move them all. instead, keep in your dom tree only the ones that are visible and a few on either side of the currently visible set of tweets. hide or
remove the rest. keeping the data in a javascript object instead of accessing the dom can vastly improve your app's performance. think of the display as a presentation of your data rather than the data itself. that doesn’t mean you can't use straight html as the source; just read it once and then scroll 10 elements, changing the content of the first and last accordingly to your position in the resu...
...And 2 more matches
Web Performance
the longer it takes for a site to respond, the more users will abandon the site. ...
... the longer it takes for a site to respond, the more users will abandon the site. ...
...zy loadinglazy loading is a strategy to identify resources as non-blocking (non-critical) and load these only when needed. it is a way of shorten the critical rendering path length, what would translate into improved page load times. navigation and resource timingsnavigation timings are metrics measuring a browser's document navigation events. resource timings are detailed network timing measu
rements regarding the loading of an application's resources.optimizing startup performanceregardless of platform, it's always a good idea to start up as quickly as possible. since that's a universal issue, we won't be focusing on it too much here. instead, we're going to look at a more important issue when building web apps: starting up as asynchronously as possible. that means not running all your s...
...And 2 more matches
How to turn off form autocompletion - Web security
this article explains how a website can disable autocomplete for form fields. by default, browsers
remember information that the user submits through <input> fields on websites. this enables the browser to offer autocompletion (that is, suggest possible completions for fields that the user has started typing in) or autofill (that is, pre-populate certain fields upon load). these features are usually enabled by default, but they can be a privacy concern for users, so browsers can let users disable them. ...
...ese features are usually enabled by default, but they can be a privacy concern for users, so browsers can let users disable them. however, some data submitted in forms either are not useful in the future (for example, a one-time pin) or contain sensitive information (for example, a unique government identifier or credit card security code). as website author, you might prefer that the browser not
remember the values for such fields, even if the browser's autocomplete feature is enabled. note that the wcag 2.1 success criterion 1.3.5: identify input purpose does not require that autocomplete/autofill actually work - merely that form fields that relate to specific personal user information are programmatically identified. this means that the criterion can be passed (by adding the relevant auto...
...rm and clicked the back button to go back to the original form page. if a browser keeps on making suggestions even after setting autocomplete to off, then you have to change the name attribute of the input element. ...
...And 2 more matches
Using custom elements - Web Components
ust a simple example, but there is more you can do here. it is possible to define specific lifecycle callbacks inside the class, which run at specific points in the element's lifecycle. for example, connectedcallback is invoked each time the custom element is appended into a document-connected element, while attributechangedcallback is invoked when one of the custom element's attributes is added,
removed, or changed. you'll learn more about these in the using the lifecycle callbacks section below. there are two types of custom elements: autonomous custom elements are standalone — they don't inherit from standard html elements. you use these on a page by literally writing them out as an html element. for example <popup-info>, or document.createelement("popup-info"). customized built-in...
... note: connectedcallback may be called once your element is no longer connected, use node.isconnected to make sure. disconnectedcallback: invoked each time the custom element is disconnected from the document's dom. adoptedcallback: invoked each time the custom element is moved to a new document. attributechangedcallback: invoked each time one of the custom element's attributes is added,
removed, or changed. which attributes to notice change for is specified in a static get observedattributes method let's look at an example of these in use. the code below is taken from the life-cycle-callbacks example (see it running live). this is a trivial example that simply generates a colored square of a fixed size on the page. the custom element looks like this: <custom-square l="100" c="red...
...as you can see from its properties, it is possible to act on attribut...
...And 2 more matches
event/target - Archive of obsolete content
adcast events. users of the object can listen to the events using the standard on() and once() functions. usage many objects in the sdk can broadcast events. for example, a panel instance emits an show event when the panel is shown. with this module you can create your own objects that emit events. this module provides an exemplar eventtarget object, that implements an interface for adding and
removing event listeners of a specific type. eventtarget is the base class for all objects in sdk on which events are emitted. also see the tutorial on implementing event targets to get started with this api. instantiation it's easy to create event target objects, no special arguments are required. const { eventtarget } = require("sdk/event/target"); let target = eventtarget(); for a convenience...
...verridden via `.bind()`. console.log(message); }); sometimes event listener may care only about very first event of specific type. eventtarget interface defines convenience method for adding one shot event listeners via method once. such listeners are called only once next time event of the specified type is emitted: target.once('ready', function onready() { // do the thing once ready! });
removing listeners eventtarget interface defines api for unregistering event listeners, via
removelistener method: target.
removelistener('message', onmessage); emitting events eventtarget interface intentionally does not define an api for emitting events. in majority of cases party emitting events is different from party registering listeners. in order to emit events one needs to use event/core m...
... info: caught an error: boom! if there is no listener registered for error event or if it also throws exception then such exceptions are logged into a console. chaining emitters can also have their methods chained: target.on('message', handlemessage) .on('data', parsedata) .on('error', handleerror); eventtarget eventtarget is an exemplar for creating an objects that can be used to add /
remove event listeners on them. events on these objects may be emitted via emit function exported by event/core module. methods initialize() method initializes this event source. it goes through properties of a given options and registers listeners for the ones that look like event listeners. on(type, listener) registers an event listener that is called every time events of specified type are em...
...unction that processes the event. returns eventtarget : returns the eventtarget instance once(type, listener) registers an event listener that is called only once: the next time an event of the specified type is emitted. parameters type : string the type of event. listener : function the listener function that processes the event. returns eventtarget : returns the eventtarget instance
removelistener(type, listener)
removes an event listener for the given event type. parameters type : string the type of event. listener : function the listener function that processes the event. returns eventtarget : returns the eventtarget instance off() an alias for
removelistener. ...
ui/frame - Archive of obsolete content
r window.postmessage(). you can use this to communicate only with the specific frame instance that generated the event, and not to any frame instance attached to other browser windows. once(event, listener) assign a listener to the first occurrence only of an event emitted by the frame. frame supports the following events: attach, detach, load, ready, and message. the listener is automatically
removed after the first time the event is emitted. var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.once("message", pong) function pong(e) { if (e.data == "ping") { // message only the sender, and not any frames attached to other browser windows e.source.postmessage("pong", "*"); } } parameters event : string the name of the event to ...
...vents: attach, detach, load, ready, and message. listener : function the listener function. this is passed an event object which always contains a source property, which has a postmessage() function modeled after window.postmessage(). you can use this to communicate only with the specific frame instance that generated the event, and not to any frame instance attached to other browser windows. ...
...y, and message. listener : function the listener function. this is passed an event object which always contains a source property, which has a postmessage() function modeled after window.postmessage(). you can use this to communicate only with the specific frame instance that generated the event, and not to any frame instance attached to other browser windows.
removelistener(event, listener)
removes an event listener. for example, this code is equivalent to once(): var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("message", pong) function pong(e) { if (e.data == "ping") { e.source.postmessage("pong", "*"); } frame.
removelistener("message", pong) } parameters event : string the event the listener is listening for. frame s...
..."); var frame = new frame({ url: "./frame.html" }); frame.on("message", pong) function pong(e) { if (e.data == "ping") { e.source.postmessage("pong", "*"); } frame.
removelistener("message", pong) } parameters event : string the event the listener is listening for. frame supports the following events: attach, detach, load, ready, and message. listener : function the listener to
remove. off(event, listener) this function is an alias for
removelistener(). parameters event : string the event the listener is listening for. frame supports the following events: attach, detach, load, ready, and message. listener : function the listener to
remove. destroy() destroy the frame. after calling this function, the frame will no longer appear in the ui, and accessing any of its p...
util/array - Archive of obsolete content
alse. let { add } = require('sdk/util/array'); let a = ['alice', 'bob', 'carol']; add(a, 'dave'); // true add(a, 'dave'); // false add(a, 'alice'); // false console.log(a); // ['alice', 'bob', 'carol', 'dave'] parameters array : array the array to add the element to. element : * the element to add returns boolean : a boolean indicating whether or not the element was added to the array. ...
...dd(a, 'dave'); // true add(a, 'dave'); // false add(a, 'alice'); // false console.log(a); // ['alice', 'bob', 'carol', 'dave'] parameters array : array the array to add the element to. element : * the element to add returns boolean : a boolean indicating whether or not the element was added to the array.
remove(array, element) if the given array contains the given element, this function
removes the element from the array and returns true. otherwise, this function does not alter the array and returns false. let {
remove } = require('sdk/util/array'); let a = ['alice', 'bob', 'carol'];
remove(a, 'dave'); // false
remove(a, 'bob'); // true
remove(a, 'bob'); // false console.log(a); // ['alice', 'carol'] parameters array : array the array to
remove the element from. element : * ...
... unique(array) produces a duplicate-free version of the given array. ...
... unique(array) produces a duplicate-free version of the given array. ...
util/list - Archive of obsolete content
experimental building blocks for composing lists. globals constructors list(element1, element2, ...) constructor can takes any number of elements and creates an instance of list populated with the specified elements. parameters element1 : object|string|number element2 : object|string|number ... : object|string|number functions addlistitem(list, item) function adds a item to a list.
removelistitem(list, item) function
removes an item from a list list an ordered collection (also known as a sequence) disallowing duplicate elements. list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the list). list is a base trait and is meant to be part of a composition, since all of its api is privat...
...ior that is similar to array (enumerates only on the elements of the list). list is a base trait and is meant to be part of a composition, since all of its api is private except for the length property. ...
...ar to array (enumerates only on the elements of the list). list is a base trait and is meant to be part of a composition, since all of its api is private except for the length property. ...
...it and is meant to be part of a composition, since all of its api is private except for the length property. examples: var { list } = require("sdk/util/list"); var mylist = list.compose({ add: function add(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._add.bind(this)); },
remove: function
remove(item1, item2, /*item3...*/) { array.slice(arguments).foreach(this._
remove.bind(this)); } }); mylist('foo', 'bar', 'baz').length == 3; // true new mylist('new', 'keyword').length == 2; // true mylist.apply(null, [1, 2, 3]).length == 3; // true let list = mylist(); list.length == 0; // true list.add(1, 2, 3) == 3; // true properties length number of elements in this list. ...
cfx to jpm - Archive of obsolete content
her rename your "main.js" to "index.js" and move it from "lib" to the top level or add a main field to package.json with the value "lib/main.js". loading modules the jpm tool uses the same logic as node.js to determine how to resolve the argument to require(). in most respects this is the same as the old cfx logic. however there are a few differences, because old compatibility shims have been
removed. requiring local modules suppose your add-on is structured into separate modules: my-addon lib main.js utils.js when you want to use the "utils" module in "main.js", you should use a path relative to "main.js", and prefix the path with "./" to indicate that it's a relative path: var utils = require("./utils"); however, with cfx you are also allowed ...
...tutorial on using third-party modules with jpm. mobile development jpm does not support the "--force-mobile" option, instead you will need to define engines in package.json and add "fennec" there. ...
...e "--force-mobile" option, instead you will need to define engines in package.json and add "fennec" there. there is a known bug in simple options handling which may require the workaround described in https://bug635044.bugzilla.mozilla.org/show_bug.cgi?id=1243467 commands and command options permanently
removed commands jpm has dropped support for all the "internal" cfx commands. ...
...profiledir --overload-modules --static-args --app --no-run --addons --e10s --logfile --dependencies --force-mobile --test-runner-pkg instead of --profiledir and --overload-modules, use --profile and --overload. instead of using --force-mobile, explicitly add fennec to engines section of your package.json. package.json fields many package.json fields are implicit commands to cfx. in jpm, we've
removed support for some of these fields, and are still working on supporting some others. permanently
removed fields data fullname - use title instead lib packages tests icon64 package.json escaping where with cfx you might have had to escape with 2 upto 3 backslashes ( \ ), jpm only needs one now. ...
Displaying web content in an extension without security issues - Archive of obsolete content
a typical example is an rss reader extension that would take the content of the rss feed (html code), format it nicely and insert into the extension window. the issue that is commonly overlooked here is that the rss feed could contain some malicious javascript code and it would then execute with the privileges of the extension — meaning that it would get full access to the browser (cookies, history etc) and to user’s files. these issues can easily be avoided by making use of the existing security mechanisms in the mozilla codebase. ...
...your extension opens as a tab in the browser — so displaying your extension in a browser tab is a bad choice. note: dynamic changes of the "type" attribute have no effect, the frame type is read out when the frame element is inserted into the document and never again. so the usual rule is: don’t change the value of the "type" attribute. but if you really have to do this, you will also have to
remove the frame element from the document and insert it back. not giving privileges to documents that contain untrusted data the privileges that a document gets depend on where it comes from. for example, "chrome://foo/content/foo.xhtml" will have full privileges, "http://example.com/foo.xhtml" will be allowed to access example.com, "file:///c:/foo.xhtml" will be allowed to read files from disk (wit...
...///c:/foo.xhtml" will be allowed to read files from disk (with some restrictions). as for the document that displays untrusted data, you don’t want it to have any privileges at all. here the "data:" protocol is useful. this protocol is special because it inherits the privileges from its parent document. however, if a "data:" document is the topmost content document, there is no parent document (
remember, content documents have no access to the chrome documents above them) and consequently no privileges. so in the simplest case you would have: <iframe type="content" src="data:text/html,%3chtml%3e%3cbody%3e%3c/body%3e%3c/html%3e"/> but usually you don’t want to start with an empty document, you would rather want to load some template into the frame: var request = new xmlhttprequest(); requ...
...e-effects. for example, your template document might have this code: <style type="text/css"> #entrytemplate { display: none; } </style> <div id="entrytemplate"> <div class="title"></div> <div class="description"></div> </div> now to insert a new entry in the document you would do the following: var template = doc.getelementbyid("entrytemplate"); var entry = template.clonenode(true); entry.
removeattribute("id"); entry.getelementsbyclassname("title")[0].textcontent = title; entry.getelementsbyclassname("description")[0].textcontent = description; template.parentnode.appendchild(entry); the important difference here is that the result will always have the same structure as the template tag. clonenode() always creates a copy and textcontent only manipulates text. so there is no chance of...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
d, which take boolean values, setting disabled="false" in xul can have unintended consequences. this is because there may be cases where a script or css rule will be written in such a way that they treat the value as true unconditionally if any value has been set. so when changing the attribute’s value using a dom function for example, do not use setattribute('disabled', false) — instead, use
removeattribute('disabled'). tooltiptext use the tooltiptext attribute to display a brief explanatory tooltip above the element. the text entered as the value for this attribute is what gets displayed as the tooltip. persist the persist attribute is an easy way to record and store a xul element’s state after it has been changed by a user operation. enter the names of the other attributes whose ...
... <menuitem label="open project page" oncommand="loaduri(this.value)" value="http://mozilla.org/"/> listing 10: the oncommand event handler because the gecko engine implements dom level 2 event handlers, you can define dynamic event listeners such as the one in listing 11. var item = document.getelementbyid('menu-item-custom'); function handlecommandevent(aevent) { alert('ok'); item.
removeeventlistener('command', handlecommandevent, false); item.parentnode.
removechild(item); } item.addeventlistener('command', handlecommandevent, false); listing 11: additions and deletions using a dynamic event listener special menu items much like input elements in html, menuitem elements can operate like checkboxes and radio buttons by setting their type attributes. checkbox adding typ...
...der as the xul document. using the icon attribute instead of the image attribute allows you to display buttons with icons that are standard for the platform. possible values for the icon attribute are given in table 2. figure 8: a button with an image icon attribute value icon attribute value accept close cancel print help add open
remove save refresh find go-forward clear go-back yes properties no select-font apply select-color table 2: values for the icon attribute toolbar buttons the toolbarbutton element is the element used to define toolbar buttons. this is typically placed inside a toolbar element, which defines a toolbar, but it can be used ...
...//stock/gtk-button name?size=button. note, however, that this does not work in linux environments. spin buttons you can add a type="number" declaration to a textbox element, making it a textbox specifically for entering numeric values. this will cause the spin buttons seen in figure 21 to appear. additional attributes that accompany this are min and max to set minimum and maximum values, and inc
rement, which sets the amount by which one click on the spin buttons will change the displayed value. figure 21: a textbox for numeric input sliders the scale element is used similarly to the volume slider in windows, allowing the user to vary a value by moving a slider up/down or left/right (see listing 28 and figure 22). note: although this control is also known as a slider, the slider elemen...
Adding sidebars - Archive of obsolete content
he tab strip on the top and the content of the largest panel. you should try to balance the content in the tab panels so that you don't end up with uneven and mostly empty panels. decks and stacks sometimes you'll need finer grained control than the one provided by a tabbox. in these cases the « xul reference « and « xul reference « elements are probably what you're looking for. they are ext
remely useful, and you'll find yourself using them in many situations besides sidebars. a deck is like a tabbbox without the tabs. it only displays one of its child nodes at a time, depending on its selectedindex value. in the following example, the second child will be displayed, not the first which would be the default. <deck selectedindex="2"> <hbox> <!-- content for the first child. -->...
...alue in one case and something else in another. using a .properties file and a string bundle is a viable option, but it involves a lot of code for something so simple, specially if that's the only case where you need dynamic text. the alternative is to use a deck with the two labels, and change the selected index depending on the purpose of the window. this way you can still use dtd, and the code
remains simple. a stack is like a deck, except that all of its children are always on display, one of top of the other. it allows you to decompose complex ui into individual layers, broadening the layout possibilities. one common use for a stack is to have an image background that stretches horizontally and vertically depending on the size of the foreground object: <stack> <hbox flex="1"> <...
...se the left and top attributes on its children in order to have absolute positioning for the content on the layers. this kind of positioning can be useful for various artistic effects, as well as some type of desktop-like or dashboard-like interface, where items are located in positions determined by the user, and they can overlap with each other. this can become complicated very easily, though.
remember that you can't have flexibility and absolute positioning at the same time. trees the bookmarks and history sidebars in firefox use the « xul reference « element to show their content. trees are another strong option when you need to show a great amount of information in a compact presentation. with a tree you can show a rather small amount of root nodes, giving the user the possibility t...
...what's up?" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="john"/> <treecell label="good evening, how are you doing?" /> </treerow> </treeitem> </treechildren> </tree> the text in the rows of the tree is hardcoded because we wouldn't generally use text from locale files. we would use data from a datasource such as a database or a
remote api. this tree is not much of a tree because it only has one level of depth. a more elaborate tree would look like this: <tree flex="1"> <treecols> <treecol label="&xulschoolhello.namecolumn.label;" flex="1" /> <treecol label="&xulschoolhello.greetingcolumn.label;" flex="3" /> </treecols> <treechildren> <treeitem> <treerow> <treecell label="peter" /> ...
Custom XUL Elements with XBL - Archive of obsolete content
operson element name to the binding defined in the xbl file. since you can have more than one binding per file, the "#person" part points to the id of the one we want. this css file is located in the content because it's not something we would normally want to be replaced by a skin, and it's not really defining style; it defines content behavior instead. if you use bindings on toolbar elements,
remember to include the css file in the customize dialog, using the style directive in the chrome.manifest file. with those 2 files properly defined, we can now use the new element. if you look at file bindingdialog.xul, you'll see that the css stylesheet is included, which means that the xshelloperson tag can now be used just like any xul tag. in this case we're adding the "persons" dynamically, so...
...content under the content tag you define the xul content that will be displayed for your element. <content> <xul:hbox> <xul:image class="xulshoolhello-person-image" xbl:inherits="src=image" /> <xul:vbox flex="1"> <xul:label xbl:inherits="value=name" /> <xul:description xbl:inherits="value=greeting" /> </xul:vbox> <xul:vbox> <xul:button label="&xulshoolhello.
remove.label;" accesskey="&xulshoolhello.
remove.accesskey;" oncommand="document.getbindingparent(this).
remove(event);" /> </xul:vbox> </xul:hbox> </content> our element is very simple, displaying an image, a couple of text lines and a button. here are a couple of important things to notice: the "xul:" namespace must be used for all xul tags you have in your content. the x...
...rited" to the content nodes that have this special attribute. the value attribute of the xul:label element would be "pete". the oncommand attribute of the button has some code you've probably never seen before: document.getbindingparent(this). this code gets the dom object that corresponds to the xshelloperson tag, allowing you access to its methods and properties. in this case we're calling the
remove method, which we will discuss later on. if you need to create a container element, or any other element that has child nodes, you can use the xbl children tag in your content to indicate the place where the child nodes will be inserted. the includes attribute gives you a little more flexibility with children, but it's rarely needed. one important thing to take into account is that you shoul...
... it around, delete it or clone it. but there is one thing you need to know about moving or cloning your node: all internal state in the node will be lost. this means that all your properties and fields will be reset. if you want some value to be preserved after such dom operations, you must set it as an attribute and not an internal value. methods our "person" binding has a single method that
removes the item from the list: <method name="
remove"> <parameter name="aevent" /> <body><![cdata[ this.parentnode.
removechild(this); ]]></body> </method> as you can see, it's very easy to define a method and the parameters it takes. you can also have a return value using the return keyword, just like on regular js code. the method uses the parent node to
remove the person node. simpl...
Local Storage - Archive of obsolete content
finally, there's the issue of deleting local files when the extension is going to be uninstalled. whether this is necessary or not is a matter of preference. some extension developers prefer to leave the data there, so that if the user chooses to install the extension again, all the previous data will be recovered. this is the default behavior when firefox is uninstalled: the profile information
remains intact and it will be there waiting for you if firefox is installed again. others feel concerned about privacy and storing private information locally without deleting it. a good argument can be done for both, so it is up to you to choose what to do in this case. the fuel library has an uninstall event you can use to perform these operations. logging good logging is essential in all kinds o...
...mplemented as a javascript code module, so it only works on firefox 3 and above. to use this logger, you need to copy the log4moz.js file to your modules directory. in the initialization method of your one of your "common" or startup objects, add the following code: let formatter = new log4moz.basicformatter(); let root = log4moz.repository.rootlogger; let logfile = this.getlocaldirectory(); //
remember this? let appender; logfile.append("log.txt"); // loggers are hierarchical, lowering this log level will affect all // output. root.level = log4moz.level["all"]; // this appender will log to the file system. appender = new log4moz.rotatingfileappender(logfile, formatter); appender.level = log4moz.level["all"]; root.addappender(appender); after that, you can create a logger object for an...
... extensions. the storage page has a good explanation on how to use the sqlite api, so we won't go over that again. if you're unfamiliar with sql or if you're interested in knowing the restrictions in the syntax used by sqlite, you can read more at the sqlite site. you should carefully design your database structure, taking into account features you're planning on adding in the future. adding or
removing columns, or making other changes to your db structure from one version of your extension to the next will probably cause breakage of user data in older versions. you'll need to carefully add migration code that moves the data from the old db format to the new, and this becomes increasingly complex as you add new versions and new structure changes. so, be careful and plan for the future. the...
...d extensions. packed extensions have appear with gecko 2.0 (firefox 4.0). this approach has the downside of being less stable. rdf rdf used to be the preferred storage mechanism for firefox. if was used for most of its datasources, and you can still see it in use here and there, like in the install.rdf file. it is being phased out, with sqlite taking its place in most cases. the rdf api may be
removed at some point in the future because it requires a great deal of code even for the simplest tasks, and it currently sees little maintenance, so we don't recommend using it unless you really have to. you'll still need to understand at least a little about rdf when you read the documentation about templates. templates templates are a very powerful tool in firefox. they allow you to automatica...
Observer Notifications - Archive of obsolete content
otification. this example code shows you what an implementation of the nsiobserver interface looks like: let testobserver = { observe : function(asubject, atopic, adata) { if (atopic == "xulschoolhello-test-topic") { window.alert("data received: " + adata); } } } in order for this observer to work, you need to use the observer service that provides methods for you to add,
remove, notify and enumerate observers. adding an observer to the observer service is simple, invoking the addobserver method with three parameters. the first parameter is an observer object, the second parameter is a notification topic, and the third parameter is a boolean which indicates whether the observer service should hold a weak reference to the observer. you should normally set the third pa...
...ly set the third parameter to false. let observerservice = components.classes["@mozilla.org/observer-service;1"]. getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(testobserver, "xulschoolhello-test-topic", false); you should come up with a notification topic that is unique so you know it will not conflict with firefox or other extensions topics. to
remove an observer for a specific topic, you use the
removeobserver method. the method takes the observer object and notification topic as parameters. observerservice.
removeobserver(testobserver, "xulschoolhello-test-topic"); after you have registered some observers to listen to a notification topic, you can then use the notifyobservers method to send a notification to all of them. the method t...
...l is used to notify all registered observers about the notification topic "xulschoolhello-test-topic". the input parameter is an instance of nsisupportsstring with some text and the last input parameter is a string "hello". in a chrome browser overlay file, we register an observer to listen to the notification topic "xulschoolhello-test-topic" when the window loads. keep in mind that you have to
remove observers that are not longer needed. not doing so will result in memory leaks. therefore, the registered observer is unregistered when the browser window is unloaded. /** * controls the browser overlay for the hello world extension. */ xulschoolchrome.browseroverlay = { /* observer service. */ _observerservice : null, /** * initializes this object. */ init : function() { ...
...ice : null, /** * initializes this object. */ init : function() { this._observerservice = components.classes["@mozilla.org/observer-service;1"]. getservice(components.interfaces.nsiobserverservice); this._observerservice.addobserver(this, "xulschoolhello-test-topic", false); }, /** * unitializes this object. */ uninit : function() { this._observerservice.
removeobserver( this, "xulschoolhello-test-topic"); }, /** * observes the registered notification topics. * @param asubject the nsisupports object associated with the notification. * @param atopic the notification topic. * @param adata the additional string associated with the notification. */ observe : function(asubject, atopic, adata) { if (atopic == "xulschoolhello-...
Signing an XPI - Archive of obsolete content
c:\projects\codesigning\> signtool -d . -k mytestcert -p "password" signed/ using certificate directory: . generating signed//meta-inf/manifest.mf file.. --> chrome/fsb.jar --> chrome.manifest --> install.rdf generating zigbert.sf file.. tree "signed/" signed successfully re-package xpi change to the signed/ folder, create a new zip with the meta-inf/zigbert.rsa file listed first, then add the
remaining files. c:\projects\certs\> cd signed c:\projects\codesigning\signed\> zip fsb.xpi meta-inf/zigbert.rsa adding: meta-inf/zigbert.rsa (deflated 35%) c:\projects\codesigning\signed> zip -r -d fsb.xpi * -x meta-inf/zigbert.rsa adding: meta-inf/manifest.mf (deflated 37%) adding: meta-inf/zigbert.sf (deflated 40%) adding: chrome/fsb.jar (deflated 74%) adding: chrome.manifest (deflate...
... "certum level iii ca.cer" c:\projects\codesigning> certutil -l -d . mytestcert u,u,cu certum root ca ct,c,c certum level iii ca ct,c,c the name given to the newly issued certificate in the mozilla firefox keystore is not the easiest key alias in the world to
remember, so i've added an additional step here that lets you rename it (its not just a simple rename operation, unfortunately). to find the name, in mozilla firefox navigate to the certificate manager (described in step 11), choose your certificates, select the new certificate, press view, choose details and look at the first entry in the certificate fields tree-view. my unizeto certum certificate...
...the certificate fields tree-view. my unizeto certum certificate is named "tj's unizeto sp. z o.o. id" but i want it to be called "code signing (certum)". the trick is to install the certificate (without the key) first and give your chosen nickname at that point. when the key/certificate pair is imported from mozilla firefox afterwards, the private key will be added but the certificate name will
remain the same. c:\projects\codesigning> certutil -a -n "code signing (certum)" -t "u,u,u" -d . -i "certum code signing.cer" c:\projects\codesigning> certutil -l -d . mytestcert u,u,cu certum root ca ct,c,c certum level iii ca ct,c,c code signing (certum) ...
....jar" * >> %x%\build.log move "%x%.jar" ..\build\chrome >> %x%\build.log cd .. copy install.rdf build >> %x%\build.log copy chrome.manifest build >>%x%\build.log signtool.exe -d c:\projects\codesigning -k "code signing (certum)" -p "password" build/ >> %x%\build.log cd build zip "%x%.xpi" meta-inf/zigbert.rsa >> %x%\build.log zip -r -d "%x%.xpi" * -x meta-inf/zigbert.rsa >> %x%\build.log
rem copy "%x%.xpi" ..\..\..\http\fsb.xpi >> %x%\build.log move "%x%.xpi" ..\ >> %x%\build.log cd .. rd build /s/q echo done. make sure to replace password with your nss certificate database password. alternatives to nss/signtool there are several alternatives to using signtool that might suit your needs better, however please note that these alternatives are unofficial third party products. ...
Updating addons broken by private browsing changes - Archive of obsolete content
yncfavicons/nsifaviconservice: setandfetchfaviconforpage/setandloadfaviconforpage now take a required privacy status argument, either nsifaviconservice.favicon_load_private or nsifaviconservice.favicon_load_non_private. nsiwebbrowserpersist: saveuri gained a new argument; see the nsiwebbrowserpersist docs for more information. nsicontentprefservice: getpref, setpref, haspref, hascachedpref,
removepref,
removegroupedprefs,
removeprefsbyname, getprefs, and getprefsbyname all take a required nsiloadcontext argument to indicate the privacy status of the pref in question. use privatebrowsingutils.getprivacycontextfromwindow(win) to obtain it from the relevant window. nsidownloadmanager/nsidownload: integer download ids (and specifically the id property of nsidownload) are deprecated, a...
...cy status of the pref in question. use privatebrowsingutils.getprivacycontextfromwindow(win) to obtain it from the relevant window. nsidownloadmanager/nsidownload: integer download ids (and specifically the id property of nsidownload) are deprecated, and don't allow access to private downloads. all downloads now use guids, and contain a new guid property. nsidownload now has retry, cancel,
remove, pause, and resume methods which should be used instead of deprecated similarly-named nsidownloadmanager methods. nsidownload's getdownload method is deprecated; use the asynchronous getdownloadbyguid method instead. nsidownloadmanager now has activeprivatedownloads, activeprivatedownloadcount, and privatedbconnection members to complement the existing public ones. nsidownloadmanager's addl...
...the asynchronous getdownloadbyguid method instead. nsidownloadmanager now has activeprivatedownloads, activeprivatedownloadcount, and privatedbconnection members to complement the existing public ones. nsidownloadmanager's addlistener method is deprecated. addprivacyawarelistener should be used instead, or no notifications will be received for private downloads. ...
...otifications will be received for private downloads. there is a new download-manager-
remove-download-guid notification, which passes an nsisupportscstring subject for the guid or null. nsihttpauthmanager: setauthidentity and getauthidentity now take an optional boolean parameter to indicate whether the identity is classified as private. nsistricttransportsecurityservice: processstsheader,
removestsstate, isstshost, and isstsuri now take a flags parameter that understands nsisocketprovider.no_permanent_storage or nothing. nsiprivatebrowsingservice: this service is deprecated, and as of firefox 20 it is now an empty interface. if your code depends on this interface, it will break. the global private browsing service is actively being
removed, and may not even exist as of firefox 21. ...
Index of archived content - Archive of obsolete content
/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/favicon places/history platform/xpcom preferences/event-target preferences/service
remote/child
remote/parent stylesheet/style stylesheet/utils system/child_process system/environment system/events system/runtime system/unload system/xul-app tabs/utils test/assert test/harness test/httpd t...
...adding sidebars adding windows and dialogs appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and insertion (html & xul) appendix f: monitoring dom changes connecting to
remote content custom xul elements with xbl getting started with firefox extensions handling preferences intercepting page loads introduction javascript object management local storage mozilla documentation roadmap observer notifications setting up a development ...
... blogposts build bundlelibrary bundles configuration extensions faq hostwindow installer scripting styling proxy ui pydom rdf api rdf datasource how-to reading textual data
remote xul
remote debugging rsyncing the cvs repository running windows debug builds downloaded from tinderbox sxsw 2007 presentations safe browsing safe browsing: design documentation safely loading uris same origin policy for xbl space manager detailed design space manager high level design ...
...fier npn_invalidaterect npn_invalidateregion npn_invoke npn_invokedefault npn_memalloc npn_memflush npn_memfree npn_pluginthreadasynccall npn_posturl npn_posturlnotify npn_releaseobject npn_releasevariantvalue npn_reloadplugins npn_
removeproperty npn_requestread npn_retainobject npn_setexception npn_setproperty npn_setvalue npn_setvalueforurl npn_status npn_utf8fromidentifier npn_useragent npn_version npn_write npobject npp nppvariable npp_destroy ...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
nnot assume that users have a modern browser, such as for html-based e-mail messages. almost no matter when you started creating web pages, odds are pretty high you have one or more designs based on the classic "convoluted tables and lots of images" paradigm. whether you've sliced up a logo so it fits in well with the design, or used tons of single-pixel spacer gifs, the principles (and perils)
remain largely the same. back in the early days, this approach worked, because browsers would usually make a table cell exactly as wide and tall as an image it contained. fast forward to 2001, and the rise of standards-based browsers that lay out pages using html and css instead of their own private layout algorithms. thanks to an obscure corner of the css specification, every design based on a prec...
...purposes. one image, one cell-- that's all it takes. there's nothing apparently wrong with that example. there isn't supposed to be, since it's an example of how browsers have traditionally behaved. now let's see what that same simple table looks like in a modern browser when the page has a strict doctype. notice the added space beneath the image in figure 2. the markup of both table and cell
remains unchanged-- it's the rendering mode that's different. instead of "shrinkwrapping" the image itself, the browser is now wrapping around the line in which the image sits. the image is sitting in a line because images are, by default, inline content. that's all it takes. how inline content is constructed in order to understand what just happened, let's take a look at the construction of a line...
...d><img src="nav1.gif"><img src="nav2.gif"><img src="nav3.gif"><img src="nav4.gif"><img src="nav5.gif"></td></tr> <tr><td style="background: red;"> <img src="smallred.gif" height="1" width="1"></td></tr> <tr><td> <p style="margin: 0.5em;">this is text in another cell of the table. within the textthere is an icon <img src="icon2.gif"> that indicates a link to another site. it's very worldly. lo
rem ipsum, dolor sit amet...</p></td></tr></table> as we see in figure 8, that works well in some cases but not so well in others. the thin red line shows that the single-pixel spacer gif is now only making the cell one pixel tall, as the designer intended. unfortunately, the buttons in the top cell are all now block-level and so end up stacked on top of one another instead of being shown side-by...
...n for a given document will greatly depend on its structure. if your document uses transitional markup, make sure your doctype reflects that fact and does not trigger "standards" mode. this will prevent browsers from using standards-based rendering, and thus all the image-layout problems are avoided. if you're using strict markup, or you need for other reasons to be in "standards" rendering, then
remember these guidelines: any image alone in a table cell (e.g., single-pixel spacer images) should be made block-level. any image in a table cell with other images should be vertically aligned with the bottom of the line box. any image in a table cell with other images and text should have its vertical alignment changed as necessary, if at all. with a judicious mixture of approaches and a re...
Mozilla Application Framework in Detail - Archive of obsolete content
nner provides, xulrunner hall of fame ui in mozilla mozilla's philosophy of using "the right tool for the right job" is manifested most prominently in the design of the user interface. we provide an xml-based language called xul for defining the user interface of your application. css is used to style these ui's and dtd's are used to localize the textual information - making your application ext
remely flexible and able to be utilized across the globe. javascript, considered by many to be the best scripting language ever designed is ideal for specifying the behavior of your interface widgets. where speed is the fo
remost consideration, we provide c++ libraries with multi-language interfaces for comprehensive, performant access to networking, filesystem, content, rendering, and much more. what...
...xml-based languages and convert them into a form that you might display in your user interface. the gecko rendering engine gecko is the revolutionary rendering engine that offers advanced features for internet browsing anywhere across applications, computing platforms and devices. this innovation in browser technology offers small size, speed and industry leading standards support. gecko is the p
remier cross-platform, full-featured, mature and well-tested layout engine available, providing robust and high quality support for a massive array of standards. its ability to render web content correctly is exceptional. gecko consists roughly of an html parser and xml parser, a dom implementation, a css parser and style system, and the code for css-based and html-based layout and rendering. as pers...
...b-based applications that look and run as intended across a variety of platforms and devices. this saves developers time and money while allowing them to deliver state-of-the-art content and web applications. gecko features full support for open internet standards such as css1, html 4.0, dom1, rdf, xml and javascript. modular, embeddable: gecko's modular architecture enables developers to add or
remove modules with little effort, fitting the software to the available hardware and adjusting functionality to match product requi
rements. gecko is implemented as a collection of xpcom components that can be easily added or
removed. flexible programming interfaces such as the web shell api, the java wrapper api and the gecko activex control make gecko easily embeddable into applications and devices...
...e code and freedom to freely license the source, make changes and build customized versions to accommodate their individual needs. free: gecko is free of charge. there is no charge for using the gecko browser engine or gecko technologies, including distributing gecko inside another product. furthermore, when embedding gecko, developers are free to choose what modules to include. there is no requi
rement for distribution of any other software. the necko network library mozilla's network library (aka necko) provides an extensible, platform-independent api for several layers of networking from transport to presentation layers. its provides a generic and extensible framework for fetching urls with support for common protocols (http, ftp, file, etc.) and a way to plug in custom protocol handlers.
Dynamically modifying XUL-based user interface - Archive of obsolete content
ugh dom apis. a logical structure of every document is a tree, with nodes being elements, attributes, processing instructions, comments, etc. use the dom inspector tool to see the tree representation of any document. todo: simple example of a xul document and a tree you can think of a document as an in-memory representation of valid html or well-formed xml such as xhtml or xul. it is important to
remember that different web pages (and even different instances of the same web page) correspond to different documents. each xul window has its own distinct document, and there may even be a few different documents in a single window, when there is an <iframe>, <browser>, or a <tabbrowser> element. you must be sure to always manipulate the correct document. (read more about this in working with wind...
...ser>, or a <tabbrowser> element. you must be sure to always manipulate the correct document. (read more about this in working with windows in chrome code.) when your script is included using a <script> tag, the document property references the dom document that includes the script. examples: using dom methods this section demonstrates the use of appendchild(), createelement(), insertbefore(), and
removechild() dom methods.
removing all children of an element this example
removes all children of an element with id=someelement from the current document, by calling
removechild() method to
remove the first child, until there are no children
remaining. note, that haschildnodes() and firstchild are also part of the dom api. var element = document.getelementbyid("someelement"); while(element.hasch...
...it uses document.createelementns() method to create the items, and insertbefore() with appendchild() to insert the created xml elements within the document. ...
...emenuitem("first item"); var last = createmenuitem("last item"); popup.insertbefore(first, popup.firstchild); popup.appendchild(last); you can also use appendchild() and insertbefore() to move existing elements. for example you could move the item labeled "first item" to the end of popup by adding this statement as a last line to the snippet above: popup.appendchild(first); this statement would
remove the node from its current position in the document and re-insert it at the end of the popup. anonymous content (xbl) xbl is the language used in mozilla to define new widgets. widgets defined in xbl may choose to define some content which is inserted to the bound element, when the binding is attached. this content, called anonymous content, is not accessible through normal dom methods. you nee...
OpenClose - Archive of obsolete content
b cannot open a menu or popup. closing menus menus will close automatically once the user has made a selection from the menu. when an menu item is selected, it fires a command event so that code may be used to perform an action. the user may cancel selecting a command from a menu by pressing the escape key. this will close a single menu, but if this menu has a parent menu, the parent menu will
remain open. a user may also cancel selecting from a menu by clicking outside the menu. in this case, not only will that menu close, but all parent menus will close as well. a menu may be closed by a script by setting the open property to false, the reverse of what would be done to open the menu. the open property applies to the menu or button, not to the menupopup. somemenu.open = false; this co...
...parent menus will need to be closed with a similar command if desired. however, any child menus of 'somemenu' in the example will be closed, as 'somemenu' will no longer be open. for instance, let's say that a file menu has a submenu containing a list of recent files. if both menus are open and the open property on the submenu is set to false, the submenu will close, yet the parent file menu will
remain open. on the other hand, if the open property on the file menu is set to false, both menus will close. this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context attributes, see closing a popup below. when a menu is closed, the popuphiding event is fired at the menupopup.
...both menus will close. this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context attributes, see closing a popup below. when a menu is closed, the popuphiding event is fired at the menupopup. attaching an event listener which listens for the popuphiding event can be used to
remove any commands that were adding during the popupshowing event. menus and popups are also closed when the document or window they are contained within is closed, or if the menupopup element is
removed from the document. these are situations when the popuphiding or popuphidden events may not fire as the element the events would be fired on are no longer available. if you need to perform uninitial...
...e right or downwards and negative values to adjust the popup to the left or upwards. in the following example, the popup is anchored below an element, yet is offset by 10 pixels to the right and 2 pixels upwards. somepopup.openpopup(anchor, "after_start", 10, -2, false, false); note that the anchor and positioning only specifies the position when the popup is opened. if the anchor is moved or
removed while the popup is open, the popup does not follow it. however, it is possible to move a popup while it is open, see moving and resizing a popup. the fifth argument to openpopup, iscontextmenu, is a flag which indicates whether a popup is being opened as a context menu. pass true if so, or false if not. it should be obvious from how you are calling openpopup what to set this argument to. not...
Focus and Selection - Archive of obsolete content
xt displayed element. you only need to set tab indices if you wish to use a different order. here is an example: example 1 : source view <button label="button 1" tabindex="2"/> <button label="button 2" tabindex="1"/> <button label="button 3" tabindex="3"/> the focus event the focus event is used to respond when the focus is given to an element. the blur event is used to respond when the focus is
removed from an element. you can respond to focus changes by adding an onfocus or onblur attribute on an element. they work just like their html counterparts. you might use these event handlers to highlight the element or display text on a status bar. the following example can be used to apply a function to handle a focus event. example 2 : source view <script> function displayfocus(){ var elem=do...
...nction displayfocus(){ var elem=document.getelementbyid('sbar'); elem.setattribute('value','enter your phone number.'); } </script> <textbox id="tbox1"/> <textbox id="tbox2" onfocus="displayfocus();"/> <description id="sbar" value=""/> the focus event, when it occurs, will call the displayfocus function. this function will change the value of the text label. we could extend this example to
remove the text when the blur event occurs. typically, you will use focus and blur events to update parts of the interface as the user selects elements. for instance, you might update a total as the user enters values in other fields, or use focus events to validate certain values. don't display an alert during a focus or blur event as this will be distracting for the user and is poor user interface ...
...we want to use a capturing event handler, so the addeventlistener method needs to be used. it registers a capturing event handler with the window which will call the setfocusedelement method. this method gets the focused element from the command dispatcher and...
.... once the label in the example is focused, it can respond to key presses. naturally, the label gives no indication that it is focused, since it isn't normally expected to ever be focused. changing the focus there are several ways to change the currently focused element. the simplest is to call the focus method of a the xul element that you wish to set the focus to. the blur method can be used to
remove the focus from an element. the following example demonstrates this: example 5 : source view <textbox id="addr"/> <button label="focus" oncommand="document.getelementbyid('addr').focus()"/> or, you can use the methods advancefocus and rewindfocus on the command dispatcher. these methods move the focus to the next element in sequence or the previous element respectively. this is what happens w...
XUL accessibility guidelines - Archive of obsolete content
use} combobox." if the screen reader only read the label, then the user would have to guess what the "exceptions" button or the "keep until" combobox was referring to. groupboxes are essential for radiogroups or groups of checkboxes with a similar theme (e.g. check all that apply). if you find nested groupboxes visually unappealing, use css to hide the border of the inner groupbox so that it can
remain in the code to benefit users of assistive technologies. complex forms sometimes require a more advanced labeling system than is possible with the standard xul attributes. for example, the first item in the privacy panel in the firefox option dialog (discussed and shown above) is [checkbox]
remember visited pages for the last [textbox] days. the difficulty here arises from the fact that the co...
...s of assistive technologies. complex forms sometimes require a more advanced labeling system than is possible with the standard xul attributes. for example, the first item in the privacy panel in the firefox option dialog (discussed and shown above) is [checkbox]
remember visited pages for the last [textbox] days. the difficulty here arises from the fact that the correct label for the checkbox ("
remember visited pages for the last x days.") includes three different pieces, the second of which is the current value entered into the textbox. the correct label for textbox is actually the same, but we don't want assistive technologies to read or show it twice. we need a way of specifying in the source that the checkbox, editbox, and nearby text labels are all part of a single entity, and that the...
... nearby text labels are all part of a single entity, and that they essentially label each other. to solve this problem, we use the aria-labelledby attribute on both controls (note the double l—aria uses uk-style spelling) to specify that the checkbox and the textbox are both labeled by the the entire group of components. put into xul, this looking something like the following. ...
...e the aria-labelledby attribute on both controls (note the double l—aria uses uk-style spelling) to specify that the checkbox and the textbox are both labeled by the the entire group of components. put into xul, this looking something like the following. <checkbox id="
rememberhistorydays" aria-labelledby="historydaysprelabel historybox historydayspostlabel"> <label id="historydaysprelabel">
remember visited pages for the last</label> <textbox id="historydays" aria-labelledby="historydaysprelabel historybox historydayspostlabel"/> <label id="historydayspostlabel" >days.</label> the aria-labelledby attribute comes in handy for controls embedded within controls (usually embedded within a checkbox or a radio button). however, in all other cases using <label control="[id]"> is enough. ...
arrowscrollbox - Archive of obsolete content
gh the contents of the box. the user only needs to hover the mouse over the arrows to scroll the box. this element is typically used for large popup menus. hovering the mouse over one of the (active) arrows triggers a scroll event. more information is available in the xul tutorial. ...
...if false, the mouse must be hovered over the arrows to scroll automatically. disabled type: boolean indicates whether the element i...
...rsist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width disabled type: boolean gets and sets the value of the disabled attribute. 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. scrollinc
rement type: integer a read only property that lets you retrieve the number of pixels by which scrolling will occur when the arrowscrollbox is clicked. smoothscroll type: boolean can be set to enable or disable smooth scrolling for the corresponding arrowscrollbox. if not set explicitly, it will fall back to the smoothscroll attribute and then to the toolkit.scrollbox.smoot...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
timepicker - Archive of obsolete content
in mozilla bug #799219, a change event handler may encounter erratic behavior when the time is changed using the keyboard instead of the mouse. to avoid this, you can use the workaround described here, i.e., use window.settimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers. attributes disabled, hideseconds, inc
rement, readonly, tabindex, value properties amindicator, datevalue, disabled, hideseconds, hour, hourleadingzero, inc
rement, is24hourclock, ispm, minute, minuteleadingzero, pmindicator, readonly, second, secondleadingzero, tabindex, value examples <timepicker value="12:05"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this att...
... which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. hideseconds type: boolean indicates whether to show the seconds field. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. inc
rement type: integer indicates the number of minutes to skip each time the arrows are pressed. this should be used in combination with setting hideseconds to true. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. ...
...onds type: boolean indicates whether the seconds field is visible or not. hour type: integer the currently selected hour from 0 to 23. set this property to change the selected hour. hourleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the hour when it is less than 10. inc
rement type: integer gets and sets the value of the inc
rement attribute. is24hourclock type: boolean a read only value indicating whether a 12-hour or 24-hour clock is used to display times. with a 12-hour clock, an extra field allows the user to pick between am and pm. this value is determined from the user's locale. ispm type: boolean if...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
Gecko Compatibility Handbook - Archive of obsolete content
if you're new to standards, you may find using web standards in your web pages a helpful introduction. ...
... if you're new to standards, you may find using web standards in your web pages a helpful introduction. ...
...tivity of class id's correctly and will display this example correctly. however internet explorer treats all css id's as case-insensitive and will not display this example correctly. <style type="text/css"> #id1 { text-decoration: line-through; } #id1 { text-decoration: underline; } </style> <div id="id1"> should be line-through </div> <div id="id1"> should be underline </div> -(example
removed)- note that the w3c's html validator will flag html id attributes as duplicates if they only differ due to case. there appears to be some inconsistency between the actual html 4.01 recommendation and the sgml declaration for html on whether id attributes are case sensitive or not. this is unfortunate since the html validator is one of the primary vehicles web developers have for learning abo...
...nsitive in quirks mode only. if you are invoking standards mode, you should still code your css to be consistent with respect to case. css class names should be case-sensitive <style type="text/css"> .class1 { font-size: 1em; } .class1 { font-size: 2em; } </style> <div> <div class="class1"> should be font-size: 1em; </div> <div class="class1"> should be font-size: 2em; </div> -(example
removed)- gecko implements the case sensitivity of class names correctly and will display this example correctly while internet explorer treats all css classnames's as case-insensitive and will not display this example correctly. due to the common nature of this error by web authors, netscape 6.2 began treating css class attributes as case-insensitive in quirks mode only. if you are invoking standa...
Mozilla release FAQ - Archive of obsolete content
[number] (no longer used) i'm wondering how to do xxx with navigator 3.x... the mozilla newsgroups are intended to be used by people who will be working with mozilla, either in an organizational fashion, suggesting features, or coding. visit netscape's website for help on that software. i went and made a suggestion and people were rude to me. why? if you posted it to the mailing list/newsgroups,
remember that on usenet, people are not always polite to each other. some people are just rude, and some people have a low tolerance for uninformed people. if you're new to the mozilla newsgroups, you probably should be reading the newsgroup for a few days regularly before you post anything. reading this faq might help as well. i did all that, and people were still rude to me. why? if you're proposin...
...build problems: cc1: invalid option 'foo' cc: no such file or directory 'foo' these are almost always caused by your platform-specific makefile being incorrect for your system, either because you're not using the compiler that you're expected to (i.e. gcc instead of the sun workshop compiler), or because you're not using a recognized version of your os. go dig through the makefiles in config and
remove the offending portions, and see if that fixes things. if not, post to netscape.public.mozilla.builds problems of this sort are currently most likely to happen in nspr, as it still uses the classic build system. it's doubtful that this will happen in the main tree. /usr/include/stdlib.h:196: previous declaration of `seed48' see section 3.7 nothing looks much like an error, except something ret...
...rguments it's passing to ld, or whatever, and thus perhaps enlighten you as to the problem. on gcc, try gcc -v (rest of command line). how long will mozilla take to build? a long time, but this will depend quite a bit on your system. ram will probably be the bottleneck in most cases, at least until you are well over 128m ram. here are a few representative systems (please send your specs in to me)
removed because the tree has changed enough that we'll probably need new times for all the builds. please send stats to me in the following format: cpu/mhz, architecture, ram, disk type, os version, compiler version, build type, tree date -- build time example: 21164/533, alpha, 512m edo, ultra2 scsi, linux kernel 2.2.11, gcc 2.95, non-debug, 19 august 1999 cvs -- 25 minutes how do i run the binary o...
...u probably have gcc 2.8.1, which currently won't work with mozilla. get 2.8.0 or 2.7.2+ (2.8.0 has some problems, 2.7.2 would be best, at least until the problems with 2.8.1 are ironed out) where can i get the sources to netscape 4.x or lower? these sources are not available. much of the old code cannot be released due to legal concerns, and at the time of mozilla's initial release, that code was
removed from the tree. the 'classic' branch of the current cvs tree is as close to the 4.x source as the public will ever see, although that branch has been abandoned in the move to the modern codebase. how do i tweak the interface (replace the logo, etc)? the xptoolkit docs might help in writing the needed xul. you can find replacement themes in preferences, under appearance->themes, using the 'get ...
Extentsions FAQ - Archive of obsolete content
ta how to creating an extension that can replace html code on a specific page that does not use greasemonkey? var newnode = document.createelement(" ... html content here ... "); var replaceme = document.getelementbyid("replaceme"); replaceme.parentnode.replacechild(newnode, replaceme); is it possible to place an image in the window that can be moved to anywhere in the window, and always
remain on top of everything else?(similiar to using position:absolute and-index:100000 in html) you can almost do this with a stack: <window ...> <stack flex="1"> <image top="40" left="80"/> <vbox> other content here </vbox> </stack> </window> the only restriction is that your image can't overlap the right or bottom of the window. there are workarounds to th...
...nce with a firefox tab isn't quite the same as having a completely separate explorer window. however, it's functional and does allow for the explorer to be handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my needs. what is the valid location and things needed to to release a mozilla extension on mozallia site? you must
remove updateurl from the install.rdf and use a known to amo minversion/maxversion. no confirmation that the answer given worked yet. is it possible to open the url in a new tab? var tab = gbrowser.addtab( url ); // and if you want it to load in the foreground: gbrowser.selectedtab = tab; is it possible to read the html-code of the current url/site? yes, this is possible. use the dom api (ht...
...ring(). however, i'm not sure how/if that works if the user hasn't defined a master password in options->security->use a master password. you can aes-128 or aes-256 symmetric encryption via aes.js (http://tinyurl.com/pp79t). no confirmation from the question asker on whether this answer was helpful in solving their problem. friday, october 06 - 13, 2006 (↑ top) any suggestions to
remove tool tip appears on the menu it when it should not? what you described was a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=147670). it looks like it has been fixed for firefox version 2. what do i need to do to avoid deadlocks? do i need to marshalinvokations to a particular thread? if so, how? are there any fundamental rules related to threading in xpcom, and if so, where are these d...
.../so...ents/nsbrowser... firefox will clean all those preferences which are still "default", that is not changed by the user or the application/extension. to provide those default preferences to your extension see: http://kb.mozillazine.org/dev_:_usin...lt_preferences btw: resetting prefences to default will clear them in case no default prefence is (still) available. those will be completely
removed upon next application launch. is it possible to create a sidebar on the top of the page? not unless you make it a separate window. there's a bug in bugzilla about stacking other widgets on top of browser/iframe, which hopefully will be fixed for gecko 1.9. could someone write an extension that zaps the google analytics cookie, the urchin cookie, switches gmail and google calender to ht...
Archive of obsolete content
sites or apps for modern browsers. it's here for historical reference only. see the complete index of archived content note to writers: we need to try to keep the subpages here organized instead of all dumped into one large folder. try to create subtrees for categories of material. also, only move pages here that are ext
remely obsolete. if anyone might realistically need the information in a living product, it may not be appropriate to move it here. in general, it may be best to discuss it in the mdn web docs room on matrix before moving content here. .htaccess ( hypertext access ) file accessing : htaccess files can be opened using any text editor, like windows not...
... events archived event pages firefox developer tools these are articles related to the firefox developer tools, which are no longer current. gecko compatibility handbook ** notes ** - the solution quick reference needs more attention. - i'm also looking for a way to organize all that information. - some inline examples were
removed because of technical limitations. they are actually replaced by ''-(example
removed)-'' the goal of this handbook is to help you update websites to work with standards-based browsers and properly detect gecko. getting the page url in npapi plugin sometimes, you want to restrict an npapi plugin to be loadable only from a certain u...
...ugins for more information about plugin roadmap, see non-archived plugin information. rss really simple syndication (rss) is a popular html-like xml-based data format used for syndication. rss has a sordid history and a multitude of different incompatible rss versions. (some being based on rdf, but most only being based on xml.) nonetheless, rss is an ext
remely popular format that is used for syndicating news, blog posts, ipradio, and iptv, with an amazing amount of momentum. sax sax, short forsimple api for xml, is a parsing api. sax was the first widely adopted api for xml in java, and later implemented in several other programming language environments. starting with firefox 2, a sax parser is a...
...netscape 7.1, how to control the windows media player activex control using javascript and provides working examples. this article deals uniquely with netscape 7.1 running on the windows operating system. xquery xquery is a w3c standard language which is meant to be for xml what sql is for relational data--i.e., the ability to search, sort, extract, and
remold data. it offers powerful and yet intuitive searching based on xpath, has sql-like syntax for the query portion, and has scripting features such as function and variable definitions, xml-inclusion, etc. xul booster xul booster is a third party eclipse / webtools build that offers some support for xul editing and awesome support for extension packaging. ...
Anatomy of a video game - Game development
ame.stopmain = window.requestanimationframe( main ); update( tframe ); // call your update method. in our case, we give it raf's timestamp. render(); } main(); // start the cycle })(); if the maximum refresh rate cannot be reached, quality settings could be adjusted to stay under your time budget. the most famous example of this concept is the game from id software, rage. this game
removed control from the user in order to keep its calculation time at roughly 16ms (or roughly 60fps). if computation took too long then rendered resolution would decrease, textures and other assets would fail to load or draw, and so forth. this (non-web) case study made a few assumptions and tradeoffs: each frame of animation accounts for user input. no frame needs to be extrapolated (guessed) ...
...could accidentally * think this whole example continues from the previous line. the leading semicolon * marks the beginning of our new line if the previous one was not empty or terminated. * * let us also assume that mygame is previously defined. * * mygame.lastrender keeps track of the last provided requestanimationframe timestamp. * mygame.lasttick keeps track of the last update time. always inc
rements by ticklength. * mygame.ticklength is how frequently the game state updates. it is 20 hz (50ms) here. * * timesincetick is the time between requestanimationframe callback and last update. * numticks is how many updates should have happened between these two rendered frames. * * render() is passed tframe because it is assumed that the render method will calculate * how long it has bee...
...d have happened between these two rendered frames. * * render() is passed tframe because it is assumed that the render method will calculate * how long it has been since the most recently passed update tick for * extrapolation (purely cosmetic for fast devices). it draws the scene. * * update() calculates the game state as of a given point in time. it should always * inc
rement by ticklength. it is the authority for game state. it is passed * the domhighrestimestamp for the time it represents (which, again, is always * last update + mygame.ticklength unless a pause feature is added, etc.) * * setinitialstate() performs whatever tasks are leftover before the mainloop must run. * it is just a generic example function that you might h...
...ncern. summary i want to be clear that any of the above, or none of them, could be best for your game. the correct decision entirely depends on the trade-offs that you are willing (and unwilling) to make. the concern is mostly with switching to another option. fortunately, i do not have any experience with this, but i have heard it is an excruciating game of whack-a-mole. an important thing to
remember for managed platforms, like the web, is that your loop may stop execution for significant periods of time. this could occur when the user unselects your tab and the browser sleeps (or slows) its requestanimationframe callback interval. you have many ways to deal with this situation and this could depend on whether your game is single player or multiplayer. some choices are: consider the g...
Accessible multimedia - Learn web development
lems with these controls: they are not keyboard accessible in most browsers, i.e. you can't tab between the controls inside the native player. opera and chrome provide this to some degree, but it still isn't ideal. different browsers give the native controls differing styling and functionality, and they aren't stylable, meaning that they can't be easily made to follow a site style guide. to
remedy this, we can create our own custom controls. let's look at how. creating custom audio and video controls html5 video and audio share an api — html media element — which allows you to map custom functionality to buttons and other controls — both of which you define yourself. let's take the video example from above and add custom controls to them. basic setup first, grab a copy of our...
...; next, we need to grab a reference to the video/audio player itself — add this line below the previous lines: const player = document.queryselector('video'); this holds a reference to a htmlmediaelement object, which has several useful properties and methods available on it that can be used to wire up functionality to our buttons. before moving onto creating our button functionality, let's
remove the native controls so they don't get in the way of our custom controls. add the following, again at the bottom of your javascript: player.
removeattribute('controls'); doing it this way round rather than just not including the controls attribute in the first place has the advantage that if our javascript fails for any reason, the user still has some controls available. wiring up our buttons...
...virtual reality app, it really is quite difficult to provide text alternatives for such an experience, and you might argue that blind users are not really in the target audience bracket for such apps. you can however make sure that such an app has good enough color contrast and clear presentation so it is perceivable to those with low vision/color blindness, and also make it keyboard accessible. ...
...ke sure that such an app has good enough color contrast and clear presentation so it is perceivable to those with low vision/color blindness, and also make it keyboard accessible.
remember that accessibility is about doing as much as you can, rather than striving for 100% accessibility all the time, which is often impossible. test your skills! you've reached the end of this article, but can you
remember the most important information? we've not written a new set of assessments for this article, because there are already assessments available in our html multimedia and embedding module that test your knowledge of the information presented here. if you haven't already, go and try out the assessments at test your skills: html images and test your skills: multimedia and embedding. summary th...
Cascade and inheritance - Learn web development
lists a number of data points about that property, including whether it is inherited or not. see the color property specifications section, for example. understanding how the concepts work together these three concepts together control which css applies to what element; in the below sections we'll see how they work together. it can sometimes seem a little bit complicated, but you will start to
remember them as you get more experienced with css, and you can always look up the details if you forget! even experienced developers don't
remember all the details. the below video shows how you can use the firefox devtools to inspect a page's cascade, specificity, and more: understanding inheritance we'll start with inheritance. in the example below we have a <ul>, with two levels of unordered...
...ork. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> element nested inside to inherit. if you
remove the rule how does it change the color of the link? do you understand why the third and fourth links are the color that they are? check the description of the values above if not. which of the links will change color if you define a new color for the <a> element — for example a { color: red; }? resetting all property values the css shorthand property all can be used to apply one of th...
... css that you can use to overrule all of the above calculations, however you should be very careful with using it — !important. this is used to make a particular property and value the most specific thing, thus overriding the normal rules of the cascade. take a look at this example where we have two paragraphs, one of which has an id. let's walk through this to see what's happening — try
removing some of the properties to see what happens if you are finding it hard to understand: you'll see that the third rule's color and padding values have been applied, but the background-color hasn't. why? really all three should surely apply, because rules later in the source order generally override earlier rules. however, the rules above it win, because class selectors have higher specifici...
... style sheets important declarations in user style sheets it makes sense for web developers' stylesheets to override user stylesheets, so the design can be kept as intended, but sometimes users have good reasons to override web developer styles, as mentioned above — this can be achieved by using !important in their rules. test your skills! we have covered a lot in this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: the cascade. what's next if you understood most of this article, then well done — you've started getting familiar with the fundamental mechanics of css. next up, we'll look at selectors in detail. if you didn't fully understand the ...
Debugging CSS - Learn web development
ate something known as a reduced test case. being able to "reduce an issue" is a really useful skill. it will help you find problems in your own code and that of your colleagues, and will also enable you to report bugs and ask for help more effectively. a reduced test case is a code example that demonstrates the problem in the simplest possible way, with unrelated surrounding content and styling
removed. this will often mean taking the problematic code out of your layout to make a small example which only shows that code or feature. to create a reduced test case: if your markup is dynamically generated — for example via a cms — make a static version of the output that shows the problem. a code sharing site like codepen is useful for hosting reduced test cases, as then they are access...
...output that shows the problem. a code sharing site like codepen is useful for hosting reduced test cases, as then they are accessible online and you can easily share them with colleagues. you could start by doing view source on the page and copying the html into codepen, then grab any relevant css and javascript and include it too. after that, you can check whether the issue is still evident. if
removing the javascript does not make the issue go away, don't include the javascript. if
removing the javascript does make the issue go away, then
remove as much javascript as you can, leaving in whatever causes the issue.
remove any html that does not contribute to the issue.
remove components or even main elements of the layout. again, try to get down to the smallest amount of code that still sho...
...it is worth adding some comments to your code as you discover things. ...
...it is worth adding some comments to your code as you discover things. if you need to ask for help, they will show the person helping you what you have already tried. this may well give you enough information to be able to search for likely sounding problems and workarounds. ...
Organizing your CSS - Learn web development
ound-color: red; /* fallback for older browsers that don't support gradients */ background-image: linear-gradient(to right, #ff0000, #aa0000); } perhaps you followed a tutorial to achieve something, and the css is a little non-obvious. in that case you could add the url of the tutorial to the comments. you will thank yourself when you come back to this project in a year or so, and can vaguely
remember there was a great tutorial about that thing, but where is it? create logical sections in your stylesheet it is a good idea to have all of the common styling first in the stylesheet. this means all of the styles which will generally apply unless you do something special with that element. you will typically have rules set up for: body p h1, h2, h3, h4, h5 ul and ol the table properti...
... h1, h2, h3, h4, h5 ul and ol the table properties links in this section of the stylesheet we are providing default styling for the type on the site, setting up a default style for data tables and lists and so on. /* || general styles */ body { ... } h1, h2, h3, h4 { ... } ul { ... } blockquote { ... } after this section we could define a few utility classes, for example a class that
removes the default list style for lists we're going to display as flex items or in some other way. if you have a few things you know you will want to apply to lots of different elements, they can come in this section. /* || utilities */ .nobullets { list-style: none; margin: 0; padding: 0; } ... then we can add everything that is used sitewide. that might be things like the basic page la...
...lled list-item with almost the same rules as the comment class except for some tiny differences. the differences between these two components is that the list-item has a bottom border, and images in comments have a border whereas list-item images do not. .comment { display: grid; grid-template-columns: 1fr 3fr; } .comment img { border: 1px solid grey; } .comment .content { font-size: .8
rem; } .list-item { display: grid; grid-template-columns: 1fr 3fr; border-bottom: 1px solid grey; } .list-item .content { font-size: .8
rem; } in oocss, you would create one pattern called media that would have all of the common css for both patterns — a base class for things that are generally the shape of the media object. then we'd add an additional class to deal with those tiny differ...
...in oocss, you would create one pattern called media that would have all of the common css for both patterns — a base class for things that are generally the shape of the media object. then we'd add an additional class to deal with those tiny differences, thus extending that styling in specific ways. ...
Styling tables - Learn web development
">no. of albums</th> <th scope="col">most famous song</th> </tr> </thead> <tbody> <tr> <th scope="row">buzzcocks</th> <td>1976</td> <td>9</td> <td>ever fallen in love (with someone you shouldn't've)</td> </tr> <tr> <th scope="row">the clash</th> <td>1976</td> <td>6</td> <td>london calling</td> </tr> ... ...
...h-child selector being used to select specific child elements. it can also be given a formula as a parameter, so it will select a sequence of elements. the formula 2n-1 would select all the odd numbered children (1, 3, 5, etc.) and the formula 2n would select all the even numbered children (2, 4, 6, etc.) we've used the odd and even keywords in our code, which do exactly the same things as the afo
rementioned formulae. in this case we are giving the odd and even rows different (lurid) colors. we've also added a repeating background tile to all the body rows, which is just a bit of noise (a semi-transparent .png with a bit of visual distortion on it) to provide some texture. lastly, we've given the entire table a solid background color so that browsers that don't support the :nth-child select...
...on't have to be boring and academic. styling the caption there is one last thing to do with our table — style the caption. to do this, add the following to the bottom of your style.css file: /* caption */ caption { font-family: 'rock salt', cursive; padding: 20px; font-style: italic; caption-side: bottom; color: #666; text-align: right; letter-spacing: 1px; } there is nothing
remarkable here, except for the caption-side property, which has been given a value of bottom. this causes the caption to be positioned on the bottom of the table, which along with the other declarations gives us this final look (see it live at punk-bands-complete.html): table styling quick tips before moving on, we thought we'd provide you with a quick list of the most useful points illustrate...
...body>, and <tfoot> to break up your table into logical chunks and provide extra places to apply css to, so it is easier to layer styles on top of one another if required. use zebra striping to make alternative rows easier to read. use text-align to line up your <th> and <td> text, to make things neater and easier to follow. test your skills! we have covered a lot in this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: tables. summary with styling tables now behind us, we need something else to occupy our time. the next article explores debugging css — how to solve problems such as layouts not looking like they should, or properties not applying wh...
Styling lists - Learn web development
these are inherited by everything on the page. rules 2 and 3 set relative font sizes for the headings, different list types (the children of the list elements i...
...these are inherited by everything on the page. rules 2 and 3 set relative font sizes for the headings, different list types (the children of the list elements inherit these), and paragraphs. this m...
...r.svg); } however, this property is a bit limited in terms of controlling the position, size, etc. of the bullets. you are better off using the background family of properties, which you've learned in the backgrounds and borders article. for now, here's a taster! in our finished example, we have styled the unordered list like so (on top of what you've already seen above): ul { padding-left: 2
rem; list-style-type: none; } ul li { padding-left: 2
rem; background-image: url(star.svg); background-position: 0 0; background-size: 1.6
rem 1.6
rem; background-repeat: no-repeat; } here we've done the following: set the padding-left of the <ul> down from the default 40px to 20px, then set the same amount on the list items. this is so that overall the list items are still lined up wit...
...d-position: this defines where in the background of the selected element the image will appear — in this case we are saying 0 0, which means the bullet will appear in the very top left of each list item. background-size: this sets the size of the background image. we ideally want the bullets to be the same size as the list items (or very slightly smaller or larger). we are using a size of 1.6
rem (16px), which fits very nicely with the 20px padding we've allowed for the bullet to sit inside — 16px plus 4px of space between the bullet and the list item text works well. background-repeat: by default, background images repeat until they fill up the available background space. we only want one copy of the image inserted in each case, so we set this to a value of no-repeat. this gi...
How much does it cost to do something on the Web? - Learn web development
, you can either embed online services (for example youtube, vimeo, or dailymotion), or include your own videos (see below for bandwidth costs). for audio files, you can find free software (audacity, wavosaur), or paying up to a few hundred dollars (sony sound forge, adobe audition). likewise, video-editing software can be free (pitivi, openshot for linux, imovie for mac), less than $100 (adobe p
remiere elements), or several hundred dollars (adobe p
remiere pro, avid media composer, final cut pro). the software you received with your digital camera may cover all your needs. publishing tools you also need a way to upload files: from your hard drive to a distant web server. to do that you should use a publishing tool such as an (s)ftp client, rsync, or git/github. each operating system inclu...
...from your hard drive to a distant web server. to do that you should use a publishing tool such as an (s)ftp client, rsync, or git/github. each operating system includes an (s)ftp client, as part of its file manager. windows explorer, nautilus (a common linux file manager), and the mac finder all include this functionality. however, people often choose dedicated (s)ftp clients to display local or
remote directories side-by-side and store server passwords. if you want to install an (s)ftp client, there are several reliable and free options: for example, filezilla for all platforms, winscp for windows, cyberduck for mac or windows, and more. because ftp is inherently insecure, you should make sure to use sftp — the secure, encrypted version of ftp that most hosting sites you'll deal with th...
...e, you should make sure to use sftp — the secure, encrypted version of ftp that most hosting sites you'll deal with these days will offer by default — or another secure solution like rsync over ssh. browsers you either already have a browser or can get one for free. if necessary, download firefox here or google chrome here. web access computer / modem you need a computer. ...
...your isp can rent internet connectivity to you for a few dollars per month, though your budget might vary, depending on your location. isp access make sure that you have sufficient bandwidth: low-bandwidth access may be adequate to support a 'simple' website: reasonably-sized images, texts, some css and javascript. ...
HTML Cheatsheet - Learn web development
it's always possible to totally change the look and feel of a given tag using css so, when using html, take the time to focus on the meaning rather than the appearance. inline elements an "element" is a single part of a webpage. ...
...it's always possible to totally change the look and feel of a given tag using css so, when using html, take the time to focus on the meaning rather than the appearance. inline elements an "element" is a single part of a webpage. ...
... a line break line 1<br>line 2 line 1 line 2 suggesting a line break it is used to suggest the browser to cut the text on t...
... a line break line 1<br>line 2 line 1 line 2 suggesting a line break it is used to suggest the browser to cut the text on this site if </wbr>ther...
Tips for authoring fast-loading HTML pages - Learn web development
eed to perform error-correction when parsing the html (this is aside from the philosophical issue of whether to allow format variation in user input and then programmatically "correct" or normalize it; or whether, instead, to enforce a strict, no-tolerance input format). moreover, valid markup allows for the free use of other tools which can pre-process your web pages. for example, html tidy can
remove whitespace and optional ending tags; however, it will refuse to run on a page with serious markup errors. chunk your content tables for layouts are a legacy method that should not be used anymore. layouts utilizing floats, positioning, flexbox, or grids should be used instead. tables are still considered valid markup but should be used for displaying tabular data. to help the browser render...
...n deeply nesting tables as in: <table> <table> <table> ... </table> </table> </table> use non-nested tables or divs as in <table>...</table> <table>...</table> <table>...</table> see also: css flexible box layout and css grid layout specifications. minify and compress svg assets svg produced by most drawing applications often contains unnecessary metadata which can be
removed. configure your servers, apply gzip compression for svg assets. minify and compress your images large images cause your page to take more time to load. consider compressing your images before adding them to your page, using compression features built into image-manipulation tools such as photoshop, or using a specialized tool such as compress jpeg or tiny png,. specify sizes for images and...
... specify its loading attribute with a value of lazy. with this set, the image will only be loaded when it's needed. <img href="./images/footerlogo.jpg" loading="lazy"> note that lazily-loaded images may not be available when the load event is fired. you can determine if a given image is loaded by checking to see if the value of its boolean complete property is true. choose your user-agent requi
rements wisely to achieve the greatest improvements in page design, make sure that reasonable user-agent requi
rements are specified for projects. do not require your content to appear pixel-perfect in all browsers, especially not in down-version browsers. ideally, your basic minimum requi
rements should be based on the consideration of modern browsers that support the relevant standards. this can in...
... use async and defer, if possible make the javascript scripts such that they are compatible with both the async and the defer attributes, and use async whenever possible, especially if you have multiple script tags. with that, the page can stop rendering while javascript is still loading. ...
Advanced text formatting - Learn web development
that binds the cake together. coffee the drink that gets the world running in the morning. ...
...inking, and the need to eliminate negative self talk (as mentioned in affirmations for positive thinking.)</p> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); const code = textarea.value; const userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } re...
...xtarea id="code" class="input" style="min-height: 50px; width: 95%"> <p>nasa sure does some exciting work.</p> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); const code = textarea.value; const userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } re...
... summary that marks the end of our study of html text semantics. bear in mind that what you have seen during this course is not an exhaustive list of html text elements — we wanted to try to cover the essentials, a...
Choosing the right approach - Learn web development
we'll probably add to this resource as time goes on. prerequisites: basic computer literacy, a reasonable understanding of javascript fundamentals. ...
...l.createobjecturl(myblob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }) .catch(e => { console.log('there has been a problem with your fetch operation: ' + e.message); }); pitfalls promise chains can be complex and hard to parse. if you nest a number of promises, you can end up with similar troubles to callback hell. ...
...cs: true, attachments: true }).then(function (result) { let docs = result.rows; docs.foreach(function(element) { localdb.put(element.doc).then(function(response) { alert("pulled doc with id " + element.doc._id + " and added to local db."); }).catch(function (err) { if (err.name == 'conflict') { localdb.get(element.doc._id).then(function (resp) { localdb.
remove(resp._id, resp._rev).then(function (resp) { // et cetera... it is better to use the chaining power of promises to go with a flatter, easier to parse structure:
remotedb.alldocs(...).then(function (resultofalldocs) { return localdb.put(...); }).then(function (resultofput) { return localdb.get(...); }).then(function (resultofget) { return localdb.put(...); }).catch(function (err) { con...
...function (resp) { // et cetera... it is better to use the chaining power of promises to go with a flatter, easier to parse structure:
remotedb.alldocs(...).then(function (resultofalldocs) { return localdb.put(...); }).then(function (resultofput) { return localdb.get(...); }).then(function (resultofget) { return localdb.put(...); }).catch(function (err) { console.log(err); }); or even:
remotedb.alldocs(...) .then(resultofalldocs => { return localdb.put(...); }) .then(resultofput => { return localdb.get(...); }) .then(resultofget => { return localdb.put(...); }) .catch(err => console.log(err)); that covers a lot of the basics. for a much more complete treatment, see the excellent we have a problem with promises, by nolan lawson. browser compatibility desktopmobileserverchro...
Making decisions in your code — conditionals - Learn web development
ue="show solution"> </div> .output * { box-sizing: border-box; } .output ul { padding-left: 0; } .output li { display: block; float: left; width: 25%; border: 2px solid white; padding: 5px; height: 40px; background-color: #4a2db6; color: white; } html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code;...
...ld equal one of the possible values that can be selected, that is, white, black, purple, yellow, or psychedelic. note that the values are case sensitive, and should equal the <option> element value values rather than the visual labels. for each case, the update() function should be run, and be passed two color values, the first one for the background color, and the second one for the text color.
remember that color values are strings, so need to be wrapped in quotes. if you make a mistake, you can always reset the example with the "reset" button. if you get really stuck, press "show solution" to see a solution. playable code 2 <h2>live output</h2> <div class="output" style="height: 300px;"> <label for="theme">select theme: </label> <select id="theme"> <option value="white">whit...
...unction update(bgcolor, textcolor) { html.style.backgroundcolor = bgcolor; html.style.color = textcolor; }</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7
rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code;...
... conclusion and that's all you really need to know about conditional structures in javascript right now! if there is anything you didn't understand, feel free to read through the article again, or contact us to ask for hel...
Aprender y obtener ayuda - Learn web development
as you'll discover, learning web development is more about problem-solving and le...
...cs is very good for both types — the area you are currently in is great for learning techniques and concepts, and we also have several giant reference sections allowing you to look up any syntax you can't
remember. there are also several other great resources on the web, some of which we'll mention below. note: the above text should have given you an important fact — you aren't expected to
remember everything! professional web developers use tools like mdn web docs to look up things they have forgotten all the time. as you'll discover, learning web development is more about problem-solving and learning patterns than it is about learning lots of syntaxes. videos there are also a number of sites that have video learning content on them. youtube is an obvious one, with channels such as...
...ic site typography work out a basic color scheme implement a high-level layout — header, horizontal navigation menu, main content area with main and side columns, and footer. implement a horizontal navigation menu etc. then you could break it down further, for example, "implement horizontal navigation menu" could be written out as: make a list of menu items sit horizontally in a line.
remove unneeded defaults, like list spacing and bullet points. style hover/focus/active states of menu items appropriately. make the menu items equally spaced along the line. give the menu items enough vertical spacing. make sure the text is centered inside each menu item etc. each of these problems doesn't seem nearly as difficult to solve as the one big problem you had initially. now you've ...
...ts of horizontal navigation menus, so they'll immediately start thinking of a solution like this: a nav menu is usually created from a list of links, something like: <ul> <li>first menu item</li> <li>second menu item</li> <li>third menu item</li> <li>etc.</li> </ul> to make all the items sit horizontally on a line, the easiest modern way is to use flexbox: ul { display: flex; } to
remove unneeded spacing and bullet points, we can do this: ul { list-style-type: none; padding: 0; } etc. if you are a complete beginner to web development, you'll have to do some study and web searches and lookup solutions to such problems. if you are a professional web developer you'll probably
remember the last time you solved a similar problem, and only have to look up a few bits of the sy...
What is web performance? - Learn web development
re involved in web optimization. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to gain basic familiarity of what is involved with web performance. * versus subjective, perceived performance, covered in the next article what is web performance? web performance is the objective measu
rement and perceived user experience of a web site or application. this includes the following major areas: reducing overall load time: how long does it take the files required to render the web site to download on to the user's computer? this tends to be affected by latency, how big your files are, how many files there are, and other factors besides. a general strategy is to make your files as sm...
...s available sooner. making the site usable as soon as possible: this basically means loading your web site assets in a sensible order so that the user can start to actually use it really quickly. any other assets can continue to load in the background while the user gets on with primary tasks, and sometimes we only load assets when they are actually needed (this is called lazy loading). the measu
rement of how long it takes the site to get to a usable start after it has started loading is called time to interactive. smoothness and interactivity: does the application feel reliable and pleasurable to use? is the scrolling smooth? are buttons clickable? are pop-ups quick to open up, and do they animate smoothly as they do so? there are a lot of best practices to consider in making apps feel smo...
... or whatever), it is possible to keep the user engaged while they wait by showing a loading spinner, or a series of useful hints and tips (or jokes, or whatever else you think might be appropriate). such an approach is much better than just showing nothing, which will make it feel like it is taking a lot longer and possibly lead to your users thinking it is broken and giving up. performance measu
rements: web performance involves measuring the actual and perceived speeds of an application, optimizing where possible, and then monitoring the performance, to ensure that what you've optimized stays optimized. this involves a number of metrics (measurable indicators that can indicate success or failure) and tools to meaure those metrics, which we will discuss throughout this module. to summarize...
... number of resource requests made, javascript performance, cpu load, and more. it is important to minimize the loading and response times, and add additional features to conceal latency by making the experience as available and interactive as possible, as soon as possible, while asynchronously loading in the longer tail parts of the experience. note: web performance includes both objective measu
rements like time to load, frames per second, and time to interactive, and subjective experiences of how long it felt like it took the content to load. how content is rendered to effectively understand web performance, the issues behind it, and the major topic areas we mentioned above, you really should understand some specifics about how browsers work. this includes: how the browser works. whe...
Multimedia: video - Learn web development
while serving the smallest video file size based on each browsers file type support. why optimize your multimedia? for the average website, 25% of bandwidth comes from video. optimizing video has the potential for very large bandwidth savings that translate into better website performance. optimizing video delivery it's best to compress all video, optimize <source> order, set autoplay,
remove audio from muted video, optimize video preload, and consider streaming the video. the sections below describe each of these optimization techniques. compress all videos most video compression work compares adjacent frames within a video, with the intent of
removing detail that is identical in both frames. compress the video and export to multiple video formats, including webm, mpeg-4/h.264, ...
...d several attributes to the video tag: autoplay, muted, and playsinline. <video autoplay="" loop="" muted="true" playsinline="" src="backgroundvideo.mp4"> while the loop and autoplay make sense for a looping and autoplaying video, the muted attribute is required for autoplay in mobile browsers. playsinline is required for mobile safari, allowing videos to play without forcing fullscreen mode.
remove audio from muted hero videos for hero-video or other video without audio,
removing audio is smart. <video autoplay="" loop="" muted="true" playsinline="" id="hero-video"> <source src="banner_video.webm" type='video/webm; codecs="vp8, vorbis"'> <source src="web_banner.mp4" type="video/mp4"> </video> this hero-video code (above) is common to conference websites and corporate hom...
...urce src="web_banner.mp4" type="video/mp4"> </video> this hero-video code (above) is common to conference websites and corporate home pages. it includes a video that is auto-playing, looping, and muted. there are no controls, so there is no way to hear audio. the audio is often empty, but still present, and still using bandwidth. there is no reason to serve audio with video that is always muted. ...
... websites and corporate home pages. it includes a video that is auto-playing, looping, and muted. there are no controls, so there is no way to hear audio. the audio is often empty, but still present, and still using bandwidth. there is no reason to serve audio with video that is always muted.
removing audio can save 20% of the bandwidth. depending on your choice of software, you might be able to
remove audio during export and compression. if not, a free utility called ffmpeg can do it for you. this is the ffmpeg command string to
remove audio: ffmpeg -i original.mp4 -an -c:v copy audiofreeversion.mp4 video preload the preload attribute has three available options: auto|metadata|none. the default setting is metadata. these settings control how much of a video file downloads with page loa...
Framework main features - Learn web development
ct is ultimately the same. angular calls this process dependency injection; vue has provide() and inject() component methods; react has a context api; ember shares state through services. lifecycle in the context of a framework, a component’s lifecycle is a collection of phases a component goes through from the time it is rendered by the browser (often called mounting) to the time that it is
removed from the dom (often called unmounting). each framework names these lifecycle phases differently, and not all give developers access to the same phases. all of the frameworks follow the same general model: they allow developers to perform certain actions when the component mounts, when it renders, when it unmounts, and at many phases in between these. the render phase is the most crucial to u...
......
...g. you can read more about the virtual dom in the react docs. the inc
remental dom is similar to the virtual dom in that it builds a dom diff to decide what to render, but different in that it doesn't create a complete copy of the dom in javascript memory. it ignores the parts of the dom that do not need to be changed. angular is the only framework discussed so far in this module that uses an inc
remental dom. you can read more about the inc
remental dom on the auth0 blog. the glimmer vm is unique to ember. it is not a virtual dom nor an inc
remental dom; it is a separate process through which ember's templates are transpiled into a kind of "byte code" that is easier and faster to read than javascript. routing as mentioned in the previous chapter, routing is an important part of the web exp...
...ort { render, fireevent } from "@testing-library/react"; import "@testing-library/jest-dom/extend-expect"; import counterbutton from "./counterbutton"; it("renders a semantic with an initial state of 0", () => { const { getbyrole } = render(<counterbutton />); const btn = getbyrole("button"); expect(btn).tobeinthedocument(); expect(btn).tohavetextcontent("clicked 0 times"); }); it("inc
rements the count when clicked", () => { const { getbyrole } = render(<counterbutton />); const btn = getbyrole("button"); fireevent.click(btn); expect(btn).tohavetextcontent("clicked 1 times"); fireevent.click(btn); expect(btn).tohavetextcontent("clicked 2 times"); }); summary at this point you should have more of an idea about the actual languages, features, and tools you'll be usin...
React interactivity: Editing, filtering, conditional rendering - Learn web development
bind this function to the form’s submit event by adding the following onsubmit handler to the editingtemplate's <form>: <form classname="stack-small" onsubmit={handlesubmit}> you should now be able to edit a task in your browser! back to the filter buttons now that our main features are c...
... /> component re-renders, and we don’t want that. this information will never change no matter what our application does. rendering the filters now that we have the filter_names array, we can use it to render all three of our filters. inside the app() function we can create a constant called filterlist, which we will use to map over our array of names and return a <filterbutton /> component.
remember, we need keys here, too. add the following underneath your tasklist constant declaration: const filterlist = filter_names.map(name => ( <filterbutton key={name} name={name}/> )); now we'll replace the three repeated <filterbutton />s in app.js with this filterlist. replace the following: <filterbutton /> <filterbutton /> <filterbutton /> with this: {filterlist} this won't work yet. ...
...f our setfilter hook. update your filterlist constant as follows: const filterlist = filter_names.map(name => ( <filterbutton key={name} name={name} ispressed={name === filter} setfilter={setfilter} /> )); in the same way as we did earlier with our <todo /> component, we now have to update filterbutton.js to utilize the props we have given it. do each of the following, and
remember to use curly braces to read these variables! replace all with {props.name}. set the value of aria-pressed to {props.ispressed}. add an onclick handler that calls props.setfilter() with the filter’s name. with all of that done, your filter() function should read like this: function filterbutton(props) { return ( <button type="button" classname="btn toggle-btn" ...
... toggletaskcompleted={toggletaskcompleted} deletetask={deletetask} edittask={edittask} /> )); in order to decide which callback function to use in array.prototype.filter(), we access the value in filter_map that corresponds to the key of our filter state. when filter is all, for example, filter_map[filter] will evaluate to () => true. choosing a filter in your browser will now
remove the tasks that do not meet its criteria. the count in the heading above the list will also change to reflect the list! summary so that's it — our app is now functionally complete. however, now that we’ve implemented all of our features, we can make a few improvements to ensure that a wider range of users can use our app. our next article rounds things off for our react tutorials by loo...
Getting started with Svelte - Learn web development
through the svelte tutorial for a really quick introduction to the basic concepts, before returning to this tutorial series to learn how to build something slightly more in-depth. it should take you about 30 minutes to complete. use cases svelte can be used to develop small pieces of an interface or whole applications. you can either start from scratch letting svelte drive your ui or you can inc
rementally integrate it into an existing application. nevertheless, svelte is particularly appropriate to tackle the following situations: web applications intended for low power devices: applications built with svelte have smaller bundle sizes, which is ideal for devices with slow network connections and limited processing power. less code means less kb to download, parse, execute, and keep hang...
...nguage are minimal and carefully picked in order to not break javascript syntax nor alienate developers. in fact, you will be mostly working with vanilla javascript. first steps with svelte being a compiler, you can't just add a <script src="svelte.js"> tag to your page and import it into your app. you'll have to set up your development environment in order to let the compiler do its job. requi
rements in order to work with svelte you need to have node.js installed. it's recommended that you use the long-term support (lts) version. node includes npm (the node package manager), and npx (the node package runner). note that you can also use the yarn package manager in place of npm, but we'll assume you are using npm in this set of tutorials. see package management basics for more information ...
...ming languages provide a repl. svelte's repl is much more than that. it's an online tool that allows you to create complete apps, save them online, and share with others. it's the easiest way to start playing with svelte from any machine, without having to install anything. it is also widely used by svelte community. if you want to share an idea, ask for help, or report an issue, it's always ext
remely useful to create a repl instance demomstrating the issue. let's have a quick look at the svelte repl and how you'd use it. it looks like so: to start a repl, open your browser and navigate to https://svelte.dev/repl. on the left side of the screen you'll see the code of your components, and on the right you'll see the running output of your app. the bar above the code lets you create .
...ce it with a flat url, e.g. import todos from './todos.svelte'. the code so far git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/01-getting-started or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/01-getting-started
remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/fc68b4f059d34b9c84fa042d1cce586c?version=3.23.2 summary this brings us to the end of our initial look at svelte, including how to install it locally, create a starter app, and how the basics work. in the next article we'll start building ou...
Handling common JavaScript problems - Learn web development
mentations (e.g. see the code snippet in how to make an http request) so developers only have to write one simple bit of code (see jquery.ajax()). jquery (or whatever library you are using) will then handle the differences in the background, so you don't have to. things have improved significantly since then; modern browsers do a good job of supporting "classic javascript features", and the requi
rement to use such code has diminished as the requi
rement to support older browsers has lessened (although bear in mind that they have not gone away altogether). these days, most cross-browser javascript problems are seen: when poor-quality browser-sniffing code, feature-detection code, and vendor prefix usage block browsers from running code they could otherwise use just fine. when developers m...
...sponse value:", plus the same error message we saw before the console.log() output shows that the superheroes object doesn't appear to contain anything. a very common problem with async requests like this is when you try to do something with the response object before it has actually been returned from the network. ...
...ion about handing css prefixes. well, new javascript implementations sometimes use prefixes too, although javascript uses camel case rather than hyphenation like css. ...
...ing a new audio context instance to use for our web audio coding. this pattern can be applied to just about any prefixed javascript feature. javascript libraries/polyfills also make use of this kind of code, to abstract browser differences away from the developer as much as possible. again, prefixed features were never supposed to be used in production websites — they are subject to change or
removal without warning, and cause cross browser issues. if you insist on using prefixed features, make sure you use the right ones. you can look up what browsers require prefixes for different javascript/api features on mdn reference pages, and sites like caniuse.com. if you are unsure, you can also find out by doing some testing directly in browsers. for example, try going into your browser's deve...
Strategies for carrying out testing - Learn web development
of misleading bias, e.g. "we have no firefox mobile users" might lead you to not bother supporting firefox mobile. but you are not going to have any firefox mobile users if the site was broken on firefox mobile in the first place. other considerations there are other considerations that you should probably include as well. you should definitely include accessibility as a grade a testing requi
rement (we'll cover exactly what you should test in our handling common accessibility problems article) plus you might have other considerations. if you are creating some kind of company intranet for delivering sales figures to managers, and all the managers have been provided with windows phones for example, you will probably want to make mobile ie support a priority. final support chart so, our ...
...last two versions) on phone/tablet, chrome and firefox for android (last two versions) on phone tablet. accessibility passing common tests. b grade: ie 8 and 9 for windows, opera mini. c grade: opera, other niche modern browsers. what are you going to test? when you've got a new addition to your codebase that needs testing, before you start testing you should write out a list of testing requi
rements that need to pass to be accepted. these requi
rements can be visual or functional — both combine to make a usable web site feature. consider the following example (see the source code, and also the example running live): test criteria for this feature could be written like so: a and b grade: button should be activatable by the user's primary control mechanism, whatever it is — this...
...rk in ie8 — this is a problem according to our support chart, which you'll have to work on, perhaps by using a feature detection library to implement the functionality in a different way if the browser doesn't support css transitions (see implementing feature detection, later on in the course). you might also notice that the button isn't usable using only the keyboard — this also needs to be
remedied. maybe we could use some javascript to implement a keyboard control for the toggle, or use some other method entirely? these test criteria are useful, because: they give you a set of steps to follow when you are performing tests. they can be easily turned into sets of instructions for user groups to follow when carrying out tests (e.g. "try to active the button using your mouse, and the...
...ppear/disappear. does it do this, in each of the above three cases? is the text readable? does the information box animate smoothly as it appears/disappears? when running tests, it can also be a good idea to: set up a separate browser profile where possible, with browser extensions and other such things disabled, and run your tests in that profile (see use the profile manager to create and
remove firefox profiles and share chrome with others or add personas, for example). use browser's private mode functionality when running tests, where available (e.g. private browsing in firefox, incognito mode in chrome) so things like cookies and temp files are not saved. these steps are designed to make sure that the browser you are testing in is as "pure" as possible, i.e. there is nothing ins...
Command line crash course - Learn web development
why we are providing this chapter — to help you get started in this seemingly unfriendly environment. where did the terminal come from? the terminal originates from around the 1950s-60s and its original form really doesn’t resemble what we use today (for that we should be thankful). you can read a bit of the history on wikipedia’s entry for computer terminal. since then, the terminal has
remained a constant feature of all operating systems — from desktop machines, to servers tucked away in the cloud (it’s not really a cloud), to microcomputers like the raspberry pi zero, and even to mobile phones. it provides direct access to the computer’s underlying file system and low-level features, and is therefore incredibly useful for performing complex tasks rapidly, if you know what yo...
...with multiple options at the same time, you can usually put them all in a single string after the dash character, for example ls -lah, or ls -ltrh. try looking at the ls man page to work out what these extra options do! now that we’ve discussed two fundamental commands, have a little poke around your directory and see if you can navigate from one place to the next. creating, copying, moving,
removing there are a number of other basic utility commands that you’ll probably end up using quite a lot as you work with the terminal. they are pretty simple, so we won’t explain them all in quite as much detail as the previous couple. have a play with them in a test directory you’ve created somewhere so that you don’t accidentally delete anything important, using the example commands bel...
... with them in a test directory you’ve created somewhere so that you don’t accidentally delete anything important, using the example commands below for guidance: mkdir — this creates a new directory inside the current directory you are in, with the name you provide after the command name. for example, mkdir my-awesome-website will make a new directory called my-awesome-website. rmdir —
removes the named directory, but only if it’s empty. for example rmdir my-awesome-website will
remove the directory we created above. if you want to
remove a directory that is not empty (and also
remove everything it contains), then you can use the -r option (recursive), but this is dangerous. make sure there is nothing you might need inside the directory later on, as it will be gone forever. touc...
...is being moved, but from a practical perspective, this command is actually renaming the file. cp — similar in usage to mv, cp creates a copy of the file in the first location specified, in the second location specified. for example, cp mdn-example.txt mdn-example.txt.bak creates a copy of mdn-example.txt called mdn-example.txt.bak (you can of course call it something else if you wish). rm —
removes the specified file. for example, rm mdn-example.txt deletes a single file called mdn-example.txt. note that this delete is permanent and can’t be undone via the recycle bin that you might have on your desktop user interface. note: many terminal commands allow you to use asterisks as "wild card" characters, meaning "any sequence of characters". this allows you to run an operation against ...
Client-side tooling overview - Learn web development
t-side tooling there are, and how to find tools and get help with them. overview of modern tooling writing software for the web has become more sophisticated through the ages. although it is still entirely reasonable to write html, css, and javascript "by hand" there is now a wealth of tools that developers can use to speed up the process of building a web site, or app. there are some ext
remely well-established tools that have become common "household names" amongst the development community, and new tools are being written and released every day to solve specific problems. you might even find yourself writing a piece of software to aid your own development process, to solve a specific problem that existing tools don’t already seem to handle. it is easy to become overwhelmed by th...
...urity, testing for pwas, and more. it is available as a node.js command-line tool and a vs code extension. source code control also known as version control systems (vcs), source code control is essential for backing work up and working in teams. a typical vcs involves having a local version of the code that you make changes to. you then "push" changes to a "master" version of the code inside a
remote repository stored on a server somewhere. there is usually a way of controlling and coordinating what changes are made to the "master" copy of the code, and when, so a team of developers doesn’t end up overwriting each other’s work all the time. git is the source code control system that most people use these days. it is primarily accessed via the command line but can be accessed via frien...
...utomatically fixing errors that they find. prettier is a very popular example of a code formatter, which we’ll make use of later on in the module. bundlers/packagers these are tools that get your code ready for production, for example by “tree-shaking” to make sure only the parts of your code libraries that you are actually using are put into your final production code, or "minifying" to
remove all the whitespace in your production code, making it as small as possible before it is uploaded to a server. parcel is a particularly clever tool that fits into this category — it can do the above tasks, but also helps to package assets like html, css, and image files into convenient bundles that you can then go on to deploy, and also adds dependencies for you automatically whenever you tr...
...iting tests include jest, mocha, and jasmine. automated test running and notification systems include travis ci, jenkins, circle ci, and others. deployment tools deployment systems allow you to get your website published, are available for both static and dynamic sites, and commonly tend to work alongside testing systems. for example, a typical toolchain will wait for you to push changes to a
remote repo, run some tests to see if the changes are ok, and then if the tests pass, automatically deploy your app to a production site. netlify is one of the most popular deployment tools right now, but others include vercel and github pages. others there are a number of other tool types available to use in the post-development stage, including code climate for gathering code quality metrics, th...
Accessibility API cross-reference
ntrol with drop down list box, different from droplist combobox combo_box combo_box combobox abstract role - a form of widget that performs an action but does not receive input data. command a supporting section of the document, designed to be complementary to the main content at a similar level in the dom hierarchy, but
remains meaningful when separated from the main content. complementary <aside> n/a but <div> or even <p> have been suggested for this purpose a widget that may contain navigable descendants or owned children. composite (abstract role) a large perceivable region that contains information about the parent document such as cop...
... feed a landmark region that contains a collection of items and objects that, as a whole, combine to create a form. form <form> presumably msaa's graphic is aria's and html's img? graphic n/a n/a img <img> a cell in a grid or treegrid. ...
... sectionhead (abstract role) a form widget that allows the user to make selections from a set of choices. select (abstract role) a line that splits 2 areas from each other separator (either in menu or splits panes) separator (in menu only) separator separator <hr> adjust in inc
rements from min to max values slider slider slider slider <input type=range> a system sound sound n/a n/a n/a no default semantics in html, but semantics and other accessibility features may be provided with aria. see also div n/a n/a n/a <span> span kind of like a dial, but controls the valu...
... single_line single_line tells accessibility aid "don't add event listener - this object doesn't generate any". for example, could be used with higher level containers. n/a transient transient the descendents of composite roles behave rather like this. for grayed-out (disabled) vs. available (enabled) items. html attribute also
removes element from tab sequence and 'grays it out'. aria attribute keeps it 'perceivable'. unavailable enabled n/a aria-disabled=true disabled (boolean attribute) especially used for sliders and scrollbars n/a vertical vertical aria-orientation=vertical accessible events msaa event (event_object_*, event_system_*) j...
What to do and what not to do in Bugzilla
this document covers the use of bugzilla privileges to triage bugs. it explains what should and what should not be done in bugzilla.mozilla.org. getting/upgrading bugzilla privileges if you want to get bugzilla privileges (as described below), please see this page. it lists the requi
rements and the email to contact. if you need faster access to get canconfirm or editbugs, especially in order to triage bugs or to participate in a bug day, then you can ask in #bmo on irc, or you may create a bug requesting permissions. include a link to your bugzilla activity page in the bug description. before you have canconfirm, you can still do good triaging by leaving comments with useful information on the bug that will help to confirm it. the same is true for editbugs: leave comments with t...
...y the normal bug triager. the decision to mark a bug wontfix is reserved for module owners or module peers. verifying bugs only resolved bugs can be verified. to verify a bug, you will need to be the bug reporter, assignee, qa_contact, or in the 'editbugs' permission group. you should verify a bug if it has been proven that the resolution of the bug was correct. when verifying a bug, you should
remember the following: verifying duplicates is the easiest task, so start with that. note that in general it's impossible to verify a duplicate until the original has been resolved. verifying wontfix or invalid bugs is relatively easy if a developer or a trusted qa person has wontfixed or invalidated them. bugs that were invalidated or wontfixed by someone else must be verified by a module owner...
...bugs which are unconfirmed for more than a few days do not qualify for the blocker severity. the exceptions to this rule are platform-specific or compiler-specific bugs. basically, anything that prevents builds from building, running, or being used for dogfood (able to use bugzilla, tinderbox, lxr, etc.) is a blocker. bug reports about crashes, hangs, data-loss, or severe security exploits (e.g.
remote execution of arbitrary code) get the critical severity. priority/target milestone as stated in the bugzilla etiquette, you must not change the target milestone and priority fields. these fields are reserved for the developers. this also applies to bugs with target milestones in the past. reassigning bugs if a bug belongs to a different product or component it should be reassigned. when per...
...rget milestone as stated in the bugzilla etiquette, you must not change the target milestone and priority fields. these fields are reserved for the developers. this also applies to bugs with target milestones in the past. reassigning bugs if a bug belongs to a different product or component it should be reassigned. when performing bug reassignments, keep the following things in mind: always
remember to check the reassign to default owner and qa contact radio button under the comment textbox. mozilla applications like the application suite, thunderbird, or firefox share most of their program code and all of the backend code including things like network connectivity (ftp, http, imap) and html rendering. make sure that you also test thunderbird or firefox bugs with the application suite ...
Commenting IDL for better documentation
gen format into the standard reference article format we use here on mdn, with certain limitations. this article will help you understand how you can format your comments to help ensure that the conversion process can be automated as much as possible in order to ensure that your interface gets properly documented. happily, following these recommendations will also help ensure your comments are ext
remely human-readable, too. don't worry! you don't need to write perfect documentation. that is why mozilla has a couple of writers on-staff as well as a horde of happy volunteers. we will take your comments and notes and turn them into beautiful, easy to search and read documentation. but by following the guidelines here, you can help make sure that our tools can generate a "good start" version of t...
...rface. @param parameter description every parameter of a method should be documented, only use the parameter name, leave out things like [in]/[out]. @returns description if the method returns something then this should be included. @throws error description the error should be the actual name of the error constant, in all caps. @note description used to include a note styled paragraph. @
remarks
remark a
remark paragraph to be included in the
remarks section of the documentation. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. @see description either an interface or a html link. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. - or . used at the beginning of a commen...
...this is an * example of what an interface document should look like; however, it's not a * document about a real interface. * * @note the article's name should be simply "nsicookiemonster" but is not in * order to make it more obvious this is an example. also, you should add the * "interfaces" tag to your article, as well as "interfaces:scriptable" if the * interface is scriptable. * * @
remarks
remember, this isn't a real interface. this is where you would * provide additional information about the interface as necessary. * * @see nsicookie * @see nsicookiemanager */ /* * take note that this is not a doxygen style comment, there is only one * on * the line above. * this means that anything i mention here will not be used to generate * documentation. * * to make it easier...
...te chips. */ const integer cookie_flavor_double_chocolate = 4; /** * an unknown type of cookie. */ const integer cookie_flavor_other = 0; // yumminess constants /** * the cookie is disgusting. */ const integer cookie_not_yummy = 1; /** * the cookie is good but not awesome. */ const integer cookie_sort_of_yummy = 2; /** * the cookie is really, really yummy. */ const integer cookie_ext
remely_yummy = 3; /** * omg this is the best cookie evar!1!!1. */ const integer cookie_omg_yummy = 4; /** * the cookie monster's name. */ readonly attribute astring name; /** * the cookie monster's favorite kind of cookie. must be one of the * cookie_flavor_* constants. */ attribute integer favoritecookie; /** * a value from 0-100 indicating how hungry the cookie monster is. * 0 means "s...
HTML parser threading
uses that handle, so subsequent non-creation tree ops can safely dereference the handle to obtain a real node. nodes created by tree ops are owned by the parser for the lifetime of the parser, so for refcounting purposes, the parser owns each nsicontent object it creates by one reference no matter how many copies of the content handle for the node exist inside the parser. (this indeed means that
removing parser-created nodes from the dom during parsing doesn't release memory until the parser stops parsing, which is, in theory, a problem for long polling using html in an iframe e.g. for a chat app.) some tree ops hold char or prunichar arrays. those arrays are allocated when creating the tree op and delete[]d by the destructor of nshtml5treeoperation. hence, data gets copied to and from these...
...the tree builder stack, a copy of the list of open formatting elements and copies of various fields that define the tree builder state. it contains all the information that is necessary to load back into the tree builder to restore it into a behaviorally equivalent state. the flush timer is disengaged, because it's not useful to make the tree builder flush ops into the queue of the speculation inc
rementally. after the speculation has been started and mspeculationmutex released, the parser thread will parse incoming data and the tree builder will produce tree ops so that they get flushed into the queue in the speculation object. if another tree op that attempts to execute a script is generated while speculating, another speculation object is initialized as described above and placed in the que...
... incoming data and the tree builder will produce tree ops so that they get flushed into the queue in the speculation object. if another tree op that attempts to execute a script is generated while speculating, another speculation object is initialized as described above and placed in the queue of speculation objects after the previous one. it is possible that the parser thread ends up parsing all
remaining data into speculations before the main thread is ready to receive more tree ops. attempting to execute a script on the main thread, when the tree op executor executes a tree op that attempts to execute a script, the tree op is first checked for a tree builder state snapshot. there will be a snapshot if the tree op came from the parser thread. there won't be one if the tree op came from docu...
... the script end tag. the tree op executor then attempts to execute the script. this operation either executes an inline script right away or tells the parser to block (for external scripts). if the parser is told to block, the script loader will unblock the parser before the external script executes. if the script was executed without blocking, the executor dispatches an event to reflush itself. (
remember that reflushing ends up calling nshtml5parser::parseuntilblocked(). that method is responsible for moving back to consuming tree ops from the parser thread via the staging area.) document.write() calls to document.write() push data to the tokenizer/tree builder pair that exists on the main thread solely for parsing data from document.write(). if the parser isn't blocked, document.write() par...
TypeListener
typelisteners can be registered with addtypelistener() and will then receive notification as addontype are registered and unregistered. method overview void ontypeadded(in addontype type) void ontype
removed(in addontype type) methods ontypeadded() called when an add-on type has been added. ...
...ered and unregistered. method overview void ontypeadded(in addontype type) void ontype
removed(in addontype type) methods ontypeadded() called when an add-on type has been added. void ontypeadded( in addontype type ) parameters type the addontype that is being added needsrestart true if an application restart is necessary for the change to take effect ontype
removed() called when an add-on type has been
removed. ...
...n addontype type) void ontype
removed(in addontype type) methods ontypeadded() called when an add-on type has been added. void ontypeadded( in addontype type ) parameters type the addontype that is being added needsrestart true if an application restart is necessary for the change to take effect ontype
removed() called when an add-on type has been
removed. ...
...ontypeadded() called when an add-on type has been added. ...
AsyncShutdown.jsm
managing safe shutdown of asynchronous services. firefox shutdown is composed of phases that take place sequentially. typically, each shutdown phase
removes some capabilities from the application. for instance, at the end of phase profilebeforechange, no service is permitted to write to the profile directory (with the exception of telemetry). consequently, if any service has requested i/o to the profile directory before or during phase profilebeforechange, the system must be informed that these requests need to be completed before the end of phase profilebeforechange. failing to inform the system of this requi
rement can (and has been known to) cause data loss. example at some point during shutdown, the add-on manager needs to ensure that all add-ons have safely written their data t...
... resolved, and all the additional debug information returned by calls to info(). instances of phase note that you cannot create an instance of phase yourself. see attributes for the instances of phase. if you need a new phase added to asyncshutdown, please file a bug. methods overview void addblocker(string name, function|promise condition, optional function info) boolean
removeblocker(function|promise condition) methods addblocker () register a blocker for the completion of a phase. void addblocker( in string name, in function|promise|* condition, optional in function info ) arguments name the human-readable name of the blocker. used for debugging/error reporting. please make sure that the name respects the following model: "some service: some ...
...ated during the phase and the phase is guaranteed to not terminate until the resulting promise is either resolved or rejected. if condition is not a function but another value v, it behaves as if it were a function returning v. info optionally, a function returning information about the current state of the blocker as an object. used for providing more details when logging errors or crashing.
removeblocker ()
remove the blocker for a condition. if several blockers have been registered for the same condition,
remove all these blockers. if no blocker has been registered for this condition, this is a noop. boolean
removeblocker( in function|promise|* condition ) arguments condition a condition blocking the completion of the phase. this must be the same condition as was passed to ad...
...note that a result of false may mean either that the blocker has never been installed or that the phase has completed and the blocker has already been resolved. ...
API-provided widgets
panel or subview, depending on where they are placed. custom for fine-grained control over the creation of the widget. viewid only useful for views (and required there): the id of the that should be shown when clicking the widget. ...
...re they are placed. custom for fine-grained control over the creation of the widget. viewid only useful for views (and required there): the id of the that should be shown when clicking the widget. tooltiptext string to use for the tooltip of the widget label string to use for the label of the widget
removable whether the widget is
removable (optional, default: true). ...
...this is only used to display the shortcut as part of the tooltip for builtin widgets (which have strings inside customizablewidgets.properties). ...
...e fly (e.g. from bootstrapped add-ons). oncreated(anode) attached to all widgets; a function that will be invoked whenever the widget has a dom node constructed, passing the constructed node as an argument. ondestroyed(adoc) attached to all non-custom widgets; a function that will be invoked after the widget has a dom node destroyed, passing the document from which it was
removed. this is useful especially for 'view' type widgets that need to cleanup after views that were constructed on the fly. oncommand(aevt) only useful for button widgets; a function that will be invoked when the user activates the button. onclick(aevt) attached to all widgets; a function that will be invoked when the user clicks the widget. onviewshowing(aevt) o...
Application Translation with Mercurial
r your translation patch got accepted and uploaded. save the file and close it. enabling mercurial queues (revertable patches) some time will pass between the moment in which you start the localization, finish it, test it, improve it, upload it for review and get review (maybe not approved on first try). other localizers will likely have done changes to the translation, either adding new texts,
removing obsolete ones or improving the current texts. this can cause conflicts between the changes you created and theirs. for this reason, updating patches kann be necessary so mercurial is still able to find the lines in the files which it has to replace or where it has to add them. mercurial queues allow to revert changes and also pull changes and reapply your local changes. go back to the local...
...e locale for which the texts are being translated (in this example: de - german). with the second line start the file paths of the files which require changes. the file paths follow the directory structure of the locale repository downloaded for translation. in this example, the file aboutdialog can be found in the folder browser/chrome/browser/. the text striked through are texts which have been
removed in the english version and can also be
removed from the locale being worked on. in this example we will translate the one new text with the id privatebrowsingpage.howtostart4 in the file aboutprivatebrowsing.dtd. tips for finding files with usually easily translateable texts: look for files in browser/chrome/browser/ look for a file with only a few changes suggestions files starti...
...on the page in the sidebar and choose "properties" from the context menu which gets opened. rename it something meaningful, e.g. "firefox <version number> translation". after you saved the dialog, click with the left mouse button on the page in the sidebar to open the locally saved copy. opening english files and the target locale side-by-side the localization report shows the ids of added or
removed texts, but the english text itself is still unknown. we get this by comparing the english version of the file with the one of the locale we are translating in. to do so, launch winmerge. from its "file" menu, choose "save project". for the file path of the left directory, go to the downloaded mozilla-aurora source code and then into its browser/locales/ folder. in this example, the absol...
...english versionmoved from below the string with the id privatebrowsingpage.howtostart3 to a position above it. cut and paste these strings in the localized file so their position corresponds to the on in the english file. press the f5 key or click the reload button in winmerge's toolbar to re-compare the files. now copy the empty lines below privatebrowsingpage.learnmore and the line <!-- to be
removed post-australis --> to the localized file. this text is a comment (which in .dtd files always can be found between <!-- and -->). there is no need to translate this text. now we copy the two missing lines from the english file and insert them in the localized file: <!-- localization note (privatebrowsingpage.howtostart4): please leave &newprivatewindow.label; intact in the translation --> ...
Creating localizable web applications
ccept-language headers, the ua string, ip geolocation. see examples of the addons.mozillaorg code at /addons/trunk/site/app/config/language.php and /addons/trunk/site/app/config/language.inc.php. the language_config class expects arrays of valid languages & supported languages. always give the user a possibility to change the locale (e.g. by adding locale dropdown menu at bottom of page) and
remember this choice for the future visits. use the locale code in the urls depending on how you detect user's locale, you may want to provide a way of overriding the autodetection. you can achieve this by setting a cookie when the user changes the locale with the language dropdown, or by looking for locale code in the url. the latter involves rewriting the urls to include the locale code and rewri...
...ing it in a subdomain, as it can cause problems with certificates (this is wrong: http://en-us.example.com/foo/bar). simplify localized versions if necessary oftentimes, it is better to slightly simplify the localized version of your web application than to serve a mix of localized and english content. for example, if not all the pages of your website are going to be localized, you may consider
removing links to the english-only pages from the navigation (headers, footers, sidebars) in the localized versions. define the locale and the direction in the html generate the lang attribute dynamically, depending on the current locale. use the dir attribute on the <html/> element and consider using a rtl class on <html/> or <body/> as well, in order to easily change css rules like in the example...
... is easier), make sure to keep the code responsible for application logic separate from the localizable content. the logic of the website should not be exposed directly in the localization files, to avoid any accidental changes by localizers. snippet 1. bad: require_once('lib/user.php'); $user = new personauser(); snippet 2. good: require_once('templates/footer.php'); if it's not possible to
remove the app logic code, you should consider using gettext. gettext extracts localizable content form the source files, thus making it impossible for localizers to accidentally change them. you can learn more about the choice of the format for your project at file formats. text messages don't hardcode english content allow localizers to localize english content, such as: text messages, numbe...
...snippet 5. bad: printf(_("%1$s by %2$s"), $persona['name'], $persona['display_username']); snippet 6. good: // %1$s is persona name, %2$s is athor's username printf(_("%1$s by %2$s"), $persona['name'], $persona['display_username']); use printf variables swapping use printf() ordered variables (%1$s, %2$s, etc.) to allow changes to the order of the sentence. some languages may require this.
remember to use single quotes around the strings containing the formatting symbols. otherwise, php will treat $s as a regular variable, instead of parsing the whole %1$s formatting symbol. snippet 1. bad: $page_header = $persona['name'] . ' by ' . $persona['display_username']; snippet 2. better: printf(_("%s by %s"), $persona['name'], $persona['display_username']); snippet 3. good: // %1$s is t...
Basics
tmath" display="block"> <mrow> <mi>a</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext><input id="input12" value="?" size="1"/></mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input id="input21" value="?" size="1"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math> <div style="text-align:center"> left size: <a class="control" href="javascript:inc
rementinput('input21', 1);" title="increase input">+</a> <a class="control" href="javascript:inc
rementinput('input21',-1);" title="decrease input">-</a> right size: <a class="control" href="javascript:inc
rementinput('input12', 1);" title="increase input">+</a> <a class="control" href="javascript:inc
rementinput('input12',-1);" title="decrease input">-</a> ...
... mathml button html content <div style="text-align: center"> <button style="white-space: normal;"> <span style="color: brown;"> for example, <b>click<...
... mathml button html content <div style="text-align: center"> <button style="white-space: normal;"> <span style="color: brown;"> for example, <b>click</b> this mathml continue...
...("a13","1"); setselection("a21","1"); setselection("a22","1"); setselection("a23","1"); setselection("a31","1"); setselection("a32","1"); setselection("a33","1"); setselection("a41","1"); setselection("a42","1"); setselection("a43","1"); } function inc
rementinput(inputid, inc
rement) { var inputelement = document.getelementbyid(inputid); var size = parseint(inputelement.size) + inc
rement; if (size <= 0) size = 1 inputelement.size = size; } and there could be more... mathml button html content <div style="text-align: center"> <button style="white-space: normal;"> <span style="color: brown;"> for example, <b>click</b> this mathml continued fraction<br/> inside this html button<br /> </span> <math> <mrow> <mfrac> <mi>π</mi> <mn>4</mn...
DMD
ed twice or more. the presence of any such records indicates bugs in one or more memory reporters. "unreported stack trace records". this tells you which heap blocks were not reported, which indicate where additional memory reporters would be most helpful. "once-reported stack trace records": like the "unreported stack trace records" section, but for blocks reported once. "summary": gives measu
rements of the total heap, and the unreported/once-reported/twice-reported portions of it. the "twice-reported stack trace records" and "unreported stack trace records" sections are the most important, because they indicate ways in which the memory reporters can be improved. here's an example stack trace record from the "unreported stack trace records" section. unreported { 150 blocks in heap b...
...tion stack trace for all blocks is controlled by an option (see below). "live" mode output for "live" mode, dmd.py's output describes what live heap blocks are present. this output is broken into multiple sections. "invocation". this tells you how dmd was invoked, i.e. what options were used. "live stack trace records". this tells you which heap blocks were present. "summary": gives measu
rements of the total heap. the individual records are similar to those output in "dark matter" mode. "cumulative" mode output for "cumulative" mode, dmd.py's output describes how the live heap blocks are covered by memory reports. this output is broken into multiple sections. "invocation". this tells you how dmd was invoked, i.e. what options were used. "cumulative stack trace records". this ...
...matter" mode. "cumulative" mode output for "cumulative" mode, dmd.py's output describes how the live heap blocks are covered by memory reports. this output is broken into multiple sections. "invocation". this tells you how dmd was invoked, i.e. what options were used. "cumulative stack trace records". this tells you which heap blocks were allocated during the session. "summary": gives measu
rements of the total (cumulative) heap. the individual records are similar to those output in "dark matter" mode. "scan" mode output for "scan" mode, the output of dmd.py is the same as "live" mode. a separate script, block_analyzer.py, can be used to find out information about which blocks refer to a particular block. dmd.py --clamp-contents needs to be run on the log first. see this other page ...
... how records are sorted. acceptable values are usable (the default), req, slop and num-blocks. --clamp-contents. for a heap scan log, this performs a conservative pointer analysis on the contents of each block, changing any value that is a pointer into the middle of a live block into a pointer to the start of that block. all other values are changes to null. in addition, all trailing nulls are
removed from the block contents. as an example that combines multiple options, if you apply the following command to a profile obtained in "live" mode: dmd.py -r -f 2 -a -s slop it will give you a good idea of where the major sources of slop are. dmd.py can also compute the difference between two dmd output files, so long as those files were produced in the same mode. simply pass it two filename...
Profiling with the Firefox Profiler
not uploaded to the symbol server automatically, you need to trigger a "sym" job on treeherder: using treeherder's add new jobs ui, schedule a "sym" job for each platform whose "b" job you want symbols for. (and "symn" if you have an "n" job you want symbols for, i.e. a build job with the "nightly configuration.) profiling firefox mobile firefox 61 for android supports gecko profiler again; see
remote profiling on android for details. the following information is old version of firefox for android. for local builds of fennec, you should build with optimization and strip_flags="--strip-debug" but not with --enable-profiling. nightly builds are already built with the appropriate flags. you'll need to have adb and arm-eabi-addr2line (which is part of the android ndk) in your bash path, so...
...path, so use locate arm-eabi-addr2line (on linux) or mdfind name:arm-eabi-addr2line (on os x) and stick an export to its location in ~/.bash_profile. the extension will invoke bash to use adb and addr2line. install the latest pre-release build in your host machine's firefox browser that has your phone reachable via adb. this will add a icon in the top right of the browser. set devtools.debugger.
remote-enabled to true in about:config for fennec. select target mobile usb and press connect. the first run will take an additional 1 minute or so to pull in the required system libraries. profiling firefox startup start your firefox with the environment variable moz_profiler_startup=1 set. this way the profiler is started as early as possible during startup. then capture the profile using th...
...s large enough to be clicked). this will activate the "layertree" tab: in this screenshot, composite #143 has been selected. the layer tree structure can be seen in the left panel. it contains, for each layer, the type of the layer, and various metrics about the layer, such as the visible region and any transforms. in the right panel, a visualization of the layer tree (based entirely on the afo
rementioned metrics) is shown. hovering over a layer in the left panel highlights the layer in the right panel. this is useful for identifying what content each layer corresponds to. here, i'm hovering over the last layer in the layer tree (a paintedlayercomposite), and a strip at the top of the right panel is highlighted, telling me that this layer is for the system notification bar in b2g. viewing...
...leopatra: the resulting "profile" will have the layer tree view enabled (but nothing else). this is useful in cases where you want to gain a quick visual understanding of a layer dump without having to take a profile. on b2g, each line of a layer dump in adb logcat output is prefixed with something like i/gecko (30593):. cleopatra doesn't currently understand this prefix, so it needs to be
removed before pasting. display list dump the display list after each refresh with the texture data. this can be used to debug correctness problems. contribute source is located in tools/profiler. the bugzilla components are core::gecko profile for the profiler backend, and devtools::performance tools (profiler/timeline) for the toolbar button and about:profiling. the (now obsolete) profiler...
Introduction to NSPR
thread is an execution entity that is scheduled independently from other threads in the same process. a thread has a limited number of resources that it truly owns. these resources include the thread stack and the cpu register set (including pc). to an nspr client, a thread is represented by a pointer to an opaque structure of type prthread. a thread is created by an explicit client request and
remains a valid, independent execution entity until it returns from its root function or the process abnormally terminates. (prthread and functions for creating and manipulating threads are described in detail in threads.) nspr threads are lightweight in the sense that they are cheaper than full-blown processes, but they are not free. they achieve the cost reduction by relying on their containing pr...
...g threads are described in detail in threads.) nspr threads are lightweight in the sense that they are cheaper than full-blown processes, but they are not free. they achieve the cost reduction by relying on their containing process to manage most of the resources that they access. this, and the fact that threads share an address space with other threads in the same process, makes it important to
remember that threads are not processes . nspr threads are scheduled in two separate domains: local threads are scheduled within a process only and are handled entirely by nspr, either by completely emulating threads on each host operating system (os) that doesn't support threads, or by using the threading facilities of each host os that does support threads to emulate a relatively large number o...
...r." 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 requi
rement 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 values, v1, v2, and sum. the invariant i...
... that the third value is the sum of the other two. expressed mathematically, the invariant is sum = v1 + v2. any modification of v1 or v2 requires modification of sum. since that is a complex operation, it must be monitored. furthermore, any type of access to sum must also be monitored to ensure that neither v1 nor v2 are in flux. note: evaluation of the invariant expression is a conceptual requi
rement and is rarely done in practice. it is valuable to formally define the expression during design, write it down, and adhere to it. it is also useful to implement the expression during development and test it where appropriate. the thread makes an absolute assertion of the expression's evaluation both on entering and on exiting the monitor. acquiring a lock is a synchronous operation. once the l...
NSS_3.12.1_release_notes.html
ting key that signed csr bug 129303: nss needs to expose interfaces to deal with multiple token sources of certs. ...
... bug 439123: assertion failure in libpkix at shutdown bug 44006...
...new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above nss shared db compatibility n...
...ns for nss 3.11.4 and above nss shared db compatibility nss 3.12.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). ...
NSS 3.33 release notes
ntime (nspr) 4.17, or newer. nss 3.33 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_33_rtm/src/ notable changes in nss 3.33 tls compression is no longer supported. api calls that attempt to enable compression are accepted without failure. however, tls compression will
remain disabled. this version of nss uses a formally verified implementation of curve25519 on 64-bit systems. the compile time flag disable_ecc has been
removed. when nss is compiled without nss_force_fips=1 startup checks are no longer performed. fixes cve-2017-7805, a potential use-after-free in tls 1.2 server, when verifying client authentication. various minor improvements and correctness fi...
... "database needs user init" will be included in the listing. when using certutil to set an inacceptable password in fips mode, a correct explanation of acceptable passwords will be printed. new functions in cert.h cert_findcertbyissuerandsncx - a variation of existing function cert_findcertbyissuerandsn that accepts an additional password context parameter. ...
... certutil to set an inacceptable password in fips mode, a correct explanation of acceptable passwords will be printed. new functions in cert.h cert_findcertbyissuerandsncx - a variation of existing function cert_findcertbyissuerandsn that accepts an additional password context parameter. cert_findcertbynicknameo
remailaddrcx - a variation of existing function cert_findcertbynicknameo
remailaddr that accepts an additional password context parameter. cert_findcertbynicknameo
remailaddrforusagecx - a variation of existing function cert_findcertbynicknameo
remailaddrforusage that accepts an additional password context parameter. in secport.h nss_secu
rememcmpzero - check if a memory region is all zero in constant time. port_zallocaligned - allocate aligned memory. p...
...rmat=advanced&product=nss&target_milestone=3.33 compatibility nss 3.33 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.33 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (select product 'nss'). ...
NSS 3.53 release notes
similar performance as the build.sh/ninja/gyp system. (bug 290526) seed is now moved into a new freebl directory freebl/deprecated (bug 1636389). seed will be disabled by default in a future release of nss. at that time, users will need to set the compile-time flag (bug 1622033) to disable that deprecation in order to use the algorithm. algorithms marked as deprecated will ultimately be
removed. several root certificates in the mozilla program now set the cka_nss_server_distrust_after attribute, which nss consumers can query to further refine trust decisions. (bug 1618404, bug 1621159) if a builtin certificate has a cka_nss_server_distrust_after timestamp before the sct or notbefore date of a certificate that builtin issued, then clients can elect not to trust it. this ...
..._distrust_after attribute, which nss consumers can query to further refine trust decisions. (bug 1618404, bug 1621159) if a builtin certificate has a cka_nss_server_distrust_after timestamp before the sct or notbefore date of a certificate that builtin issued, then clients can elect not to trust it. this attribute provides a more graceful phase-out for certificate authorities than complete
removal from the root certificate builtin store. bugs fixed in nss 3.53 bug 1640260 - initialize pbe params (asan fix) bug 1618404 - set cka_nss_server_distrust_after for symantec root certs bug 1621159 - set cka_nss_server_distrust_after for consorci aoc, grca, and sk id root certs bug 1629414 - ppc64: correct compilation error between vmx vs. vsx vector instructions bug 1639033 - fix ...
...fix a null pointer in security/nss/lib/ssl/sslsock.c:4460 bug 1638289 - avoid multiple definitions of sha{256,384,512}_* symbols when linking libfreeblpriv3.so in firefox on ppc64le bug 1636389 - relocate deprecated seed algorithm bug 1637083 - lib/ckfw: no such file or directory. stop. ...
...format=advanced&product=nss&target_milestone=3.53 compatibility nss 3.53 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.53 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
Enc Dec MAC Output Public Key as CSR
eader = lab_header; trailer = lab_trailer; break; default: pr_close(file); return secfailure; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and
remove them */ char *trail = null; if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; ...
... * the db is open read only and we have authenticated to it * open input file, read in header, get iv and wrapped keys and * public key * unwrap the wrapped keys * loop until eof(input): * read a buffer of ciphertext from input file, * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv, * compute and check mac, then
remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to output file * close files * report success */ secstatus rv; secitem ivitem; secitem wrappedenckeyitem; secitem wrappedmackeyitem; secitem cipheritem; secitem macitem; sec...
...e output file. ...
... outfilename); return secfailure; } infilelength = filesize(encryptedfilename); if (rv == secsuccess) { /* decrypt and
remove mac */ rv = decryptandverifymac(outfile, infile, infilelength, &cipheritem, &macitem, enckey, mackey, &ivitem, &paditem); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed while decrypting and
removing mac\n"); } } cleanup: if (enckey) { pk11_freesymkey(enckey); } if (mackey) { pk11_freesymkey(mackey); } if (privkey) { seckey_destroyprivatekey(privkey); } if (pubkey) { seckey_destroypublickey(pubkey); } return rv; } /* * encryptfile */ secstatus encryptfile(pk11slotinfo *slot, const char *inf...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
_header; trailer = ns_sig_trailer; break; default: rv = secfailure; goto cleanup; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and
remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { ...
...serialnumber, int warpmonths, int validitymonths) { prexplodedtime printabletime; prtime now; prtime after; certvalidity *validity = null; certcertificate *issuercert = null; certcertificate *cert = null; if ( !selfsign ) { issuercert = cert_findcertbynicknameo
remailaddr(handle, issuernickname); if (!issuercert) { pr_fprintf(pr_stderr, "could not find certificate named %s\n", issuernickname); goto cleanup; } } now = pr_now(); pr_explodetime (now, pr_gmtparameters, &printabletime); if ( warpmonths ) { printabletime.tm_month += warpmonths; now = pr_implo...
...{ pr_delete(headerfilename); } headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing (%ld, %ld).\n", headerfilename, pr_geterror(), pr_getoserror()); rv = secfailure; goto cleanup; } cert = cert_findcertbynicknameo
remailaddr(certhandle, nicknamestr); if (!cert) { pr_fprintf(pr_stderr, "could not obtain certificate from file\n"); rv = secfailure; goto cleanup; } if (sigverify) { htype = certvfy; } writetoheaderfile(cert->dercert.data, cert->dercert.len, htype, headerfile); cleanup: if (headerfile) { pr_close(headerfile); } if ...
... write padding */ headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_append, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); rv = secfailure; goto cleanup; } /* get the certificate by nick name and write to header file */ cert = cert_findcertbynicknameo
remailaddr(certhandle, nicknamestr); if (!cert) { pr_fprintf(pr_stderr, "could not obtain certificate by name - %s\n", nicknamestr); rv = secfailure; goto cleanup; } writetoheaderfile(cert->dercert.data, cert->dercert.len, certvfy, headerfile); /* find private key from certificate */ privkey = pk11_findkeybyanycert(cert, null); if (privkey =...
sample2
tvfy: header = ns_cert_vfy_header; trailer = ns_cert_vfy_trailer; break; case sig: header = ns_sig_header; trailer = ns_sig_trailer; break; default: rv = secfailure; goto cleanup; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and
remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { pr_fprintf(pr_stderr, "input has header but no trailer\n"); port_free(filedata.data); rv = secfailure; goto...
...c certcertificate * makev1cert(certcertdbhandle *handle, certcertificaterequest *req, char * issuernickname, prbool selfsign, unsigned int serialnumber, int warpmonths, int validitymonths) { prexplodedtime printabletime; prtime now; prtime after; certvalidity *validity = null; certcertificate *issuercert = null; certcertificate *cert = null; if ( !selfsign ) { issuercert = cert_findcertbynicknameo
remailaddr(handle, issuernickname); if (!issuercert) { pr_fprintf(pr_stderr, "could not find certificate named %s\n", issuernickname); goto cleanup; } } now = pr_now(); pr_explodetime (now, pr_gmtparameters, &printabletime); if ( warpmonths ) { printabletime.tm_month += warpmonths; now = pr_implodetime (&printabletime); pr_explodetime (now, pr_gmtparameters, &printabletime); } printabletime.tm_month ...
...s, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_truncate, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing (%ld, %ld).\n", headerfilename, pr_geterror(), pr_getoserror()); rv = secfailure; goto cleanup; } cert = cert_findcertbynicknameo
remailaddr(certhandle, nicknamestr); if (!cert) { pr_fprintf(pr_stderr, "could not obtain certificate from file\n"); rv = secfailure; goto cleanup; } if (sigverify) { htype = certvfy; } writetoheaderfile(cert->dercert.data, cert->dercert.len, htype, headerfile); cleanup: if (headerfile) { pr_close(headerfile); } if (cert) { cert_destroycertificate(cert); } return rv; } /* * finds the public key from ...
...= null; secitem sigitem; secoidtag hashoidtag; /* open the header file to write padding */ headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_append, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); rv = secfailure; goto cleanup; } /* get the certificate by nick name and write to header file */ cert = cert_findcertbynicknameo
remailaddr(certhandle, nicknamestr); if (!cert) { pr_fprintf(pr_stderr, "could not obtain certificate by name - %s\n", nicknamestr); rv = secfailure; goto cleanup; } writetoheaderfile(cert->dercert.data, cert->dercert.len, certvfy, headerfile); /* find private key from certificate */ privkey = pk11_findkeybyanycert(cert, null); if (privkey == null) { fprintf(stderr, "couldn't find private key for cer...
JS_AddExternalStringFinalizer
try to avoid using it. register a custom string memory manager. syntax int js_addexternalstringfinalizer(jsstringfinalizeop finalizer); name type description finalizer jsstringfinalizeop pointer to a callback function, described below. the js engine will automatically call this function each time a string created by js_newexternalstring is garbage-collected. ...
...ands how to free or release the memory pointed at by js_getstringchars(str). ...
...ed at by js_getstringchars(str). returns a nonnegative type index if there is room for finalizer in the global gc finalizers table, else returns -1. ...
...negative type index if there is room for finalizer in the global gc finalizers table, else returns -1. ...
JS_DeleteElement2
renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t index, bool *succeeded); name type 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. ...
...ild, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise. description js_deleteelement2
removes a specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is
removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement2 stores true to *succeeded and returns true. otherwise it returns false and the value of *succeeded is undefined. notes per...
...operty, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is
removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement2 stores true to *succeeded and returns true. otherwise it returns false and the value of *succeeded is undefined. notes per the ecma standard, js_deleteelement2
removes read-only properties from objects as long as they are not also permanent. for javascript 1.2 and earlier, if deletion fails because the property is permanent, js_deleteelement2 reports the error and returns false. for javascript 1.3, the attempt is silently ignored. ...
..., js_deleteelement2
removes read-only properties from objects as long as they are not also permanent. for javascript 1.2 and earlier, if deletion fails because the property is permanent, js_deleteelement2 reports the error and returns false. for javascript 1.3, the attempt is silently ignored. in both these cases, *succeeded will receive the stored value of the property that was not deleted. to
remove all properties from an object, call js_clearscope. see also mxr id search for js_deleteelement2 bug 1113369 -- added result parameter ...
JS_DeleteProperty
removes a specified property from an object. syntax bool js_deleteproperty(jscontext *cx, js::handleobject obj, const char *name); bool js_deletepropertybyid(jscontext *cx, js::handleobject obj, jsid id); // added in spidermonkey 1.8.1 // added in spidermonkey 45 bool js_deleteproperty(jscontext *cx, js::handleobject obj, const char *name, js::objectopresult &result); bool js_deletepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::objectopresult &result); bool js_deleteucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime ...
...delete a property. name or id const char * or jsid or const char16_t * name of the property to delete. namelen size_t (only in js_deleteucproperty) the length of name in characters; or -1 to indicate that name is null-terminated. result js::objectopresult & (out parameter) receives the result of the operation. description js_deleteproperty
removes a specified property, name, from an object, obj. js_deletepropertybyid is the same but takes a jsid for the property name. these functions are identical to js_deleteproperty2 and js_deletepropertybyid2 except that they do not have an out parameter. first, a property lookup is performed. then one of the following cases applies: if obj has no property with the given name or id, or if obj in...
... error. if obj has the specified property but it is permanent, nothing happens. no property is deleted, but this is not an error. otherwise obj has a non-permanent own property with the given name or id. in this case, obj's jsclass.delproperty hook is called. if the hook returns false, the error is propagated. otherwise, if obj is not configurable, an error is raised. ...
...herwise, the property is
removed. these functions return true on success, regardless of whether a property was actually deleted, and false on error or exception. (in javascript 1.2 and earlier, attempting to delete a permanent property caused an error. there is no longer any way to get this behavior.) internally, property deletion is implemented by the jsobjectops.deleteproperty callback. to
remove all properties from an object, call js_clearscope. see also mxr id search for js_deleteproperty mxr id search for js_deletepropertybyid js_deleteproperty2 js_deletepropertybyid2 bug 461163 bug 1113369 -- added result parameter and js_deleteucproperty ...
JS_GetStringChars
try to avoid using it. retrieve a pointer to the 16-bit values that make up a given string. syntax jschar * js_getstringchars(jsstring *str); // obsolete since jsapi 1.8.5 const jschar * js_getstringcharsz(jscontext *cx, jsstring *str); // added in spidermonkey 1.8.2, obsolete since jsapi 33 name type description cx jscontext * (in js_getstringcharsz only) a context. str jsstring * the string to obtain characters from. ...
... jschars. warnings: the array is not necessarily null-terminated. to get the length of the string, use js_getstringlength. the program must not modify the array. if it does, the behavior is undefined. the content of a js string is not guaranteed to be valid utf-16. it may contain surrogate code units that aren't properly paired. it may also contain zeroes. ...
...ts that aren't properly paired. it may also contain zeroes. the array returned by this function
remains valid as long as str is valid. (eventually, str becomes unreachable, the garbage collector collects it, and the array is freed by the system.) js_getstringcharsz is the same except that it always returns either a null-terminated string or null, indicating out-of-memory. ...
...so contain zeroes. the array returned by this function
remains valid as long as str is valid. (eventually, str becomes unreachable, the garbage collector collects it, and the array is freed by the system.) js_getstringcharsz is the same except that it always returns either a null-terminated string or null, indicating out-of-memory. ...
JS_LockGCThing
try to avoid using it. protect a specified js item from garbage collection. syntax jsbool js_lockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_unlockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_lockgcthingrt(jsruntime *rt, void *thing); jsbool js_unlockgcthingrt(jsruntime *rt, void *thing); name type description cx jscontext * a context. requires request. ...
..., the caller must be in a request on this jscontext. rt jsruntime * a runtime. thing void * pointer to the item to protect. description js_lockgcthing is a deprecated function that protects a specified item, thing, associated with an executable script context, cx, from garbage collection. ...
...executable script context, cx, from garbage collection. thing is a pointer to a jsdouble, jsstring, or jsobject. js_unlockgcthing
removes a lock from a specified item, thing, allowing it to be garbage collected when the javascript engine determines it is unreachable. ...
...ollection. thing is a pointer to a jsdouble, jsstring, or jsobject. js_unlockgcthing
removes a lock from a specified item, thing, allowing it to be garbage collected when the javascript engine determines it is unreachable. js_lockgcthing and js_unlockgcthing are available only for backward compatibility with existing applications. ...
JS_SetGCZeal
description js_setgczeal sets the level of additional garbage collection to perform for a runtime, for the purpose of finding or reproducing bugs. there are several different levels which have different functions: zeal level description 0 normal amount of collection. the default: no additional collections are performed. ...
... 11 verify post write barriers between instructions. 12 verify post write barriers between paints. ...
...n every frequency allocations. 3 collect on window paints. 4 verify pre write barriers between instructions. 5 verify pre write barriers between window paints. 6 verify stack rooting. 7 collect the nursery every frequency nursery allocations. 8 inc
remental gc in two slices: 1) mark roots 2) finish collection. 9 inc
remental gc in two slices: 1) mark all 2) new marking and finish. 10 inc
remental gc in multiple slices. 11 verify post write barriers between instructions. 12 verify post write barriers between paints. 13 check internal hashtables on minor gc. 14 perform a shrinking collection every frequency allocations. with gc zeal enabled, gc-relat...
... post write barriers between paints. 13 check internal hashtables on minor gc. 14 perform a shrinking collection every frequency allocations. with gc zeal enabled, gc-related crashes are much easier to reproduce (they happen more reliably) and debug (they happen sooner, closer to the source of the bug). the drawback is that gc zeal can cause javascript code to run ext
remely slowly. regularly running your test suite with gc zeal enabled at level 2 is a good practice. this function is available only in debug builds. to enable this function in an optimized build, define the macro js_gc_zeal building spidermonkey. (in a debug build of gecko, you can also set the current gc zeal level using the javascript.options.gczeal preference.) see also mxr id search for js_set...
JS_updateMallocCounter
malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. maxmallocbytes is initialized with maxbytes parameter of js_newruntime, and could be configured later by calling js_getgcparameter with jsgc_max_malloc_bytes. ...
... malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. maxmallocbytes is initialized with maxbytes parameter of js_newruntime, and could be configured later by calling js_getgcparameter with jsgc_max_malloc_bytes. ...
... malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. maxmallocbytes is initialized with maxbytes parameter of js_newruntime, and could be configured later by calling js_getgcparameter with jsgc_max_malloc_bytes. ...
... malloc counter measures memory pressure for gc scheduling. it runs from maxmallocbytes down to zero. maxmallocbytes is initialized with maxbytes parameter of js_newruntime, and could be configured later by calling js_getgcparameter with jsgc_max_malloc_bytes. ...
Setting up an update server
e. delete the # at the beginning of the line to uncomment it. these are the files that must be changed: toolkit/components/maintenanceservice/moz.build toolkit/mozapps/update/tests/moz.build firefox should otherwise be built normally. after building, you may want to copy the installation of firefox elsewhere. if you update the installation without moving it, attempts at further inc
remental builds will not work properly, and a clobber will be needed when building next. to move the installation, first call ./mach package, then you can either copy <obj dir>/dist/firefox to a new "install directory" elsewhere, or run the installer located in the <obj dir>/dist/install/sea. if you are running windows and want the mozilla maintenance service to be used, there are a few additional s...
...lowing command, which should work in linux, macos, or windows in the mozillabuild environment: shasum --algorithm 512 <filename> on windows, you can get the exact file size in bytes for your mar by right clicking on it in the file explorer and selecting properties. you'll find the correct size in bytes at the end of the line that begins "size", not the one that begins "size on disk". ...
...ins "size on disk". be sure to
remove the commas when you paste this number into the xml file. on macos, you can get the exact size of your mar by running the command: stat -f%z <filename> or on linux, the same command would be: stat --format "%s" <filename> starting your update server now, start an update server to serve the update files on port 8000. an easy way to do this is with python.
remember to navigate to the correct directory before starting the server. this is the python2 command: python -m simplehttpserver 8000 or, this is the python3 command: python3 -m http.server 8000 if you aren't sure that you started the server correctly, try using a web browser to navigate to http://127.0.0.1:8000/update.xml and make sure that you get the xml file you created earlier. installin...
...es to ensure that no previously found updates interfere with installing the desired update. you can use this command with firefox's browser console to determine the update directory: const {fileutils} = chromeutils.import("resource://gre/modules/fileutils.jsm"); fileutils.getdir("updrootd", [], false).path once you have determined the update directory, close firefox, browse to the directory and
remove the subdirectory called updates. next, you need to change the update url to point to the local xml file. this can be done most reliably with an enterprise policy. the policy file location depends on the operating system you are using. windows/linux: <install dir>/distribution/policies.json macos: <install dir>/contents/resources/distribution/policies.json create the distribution directory,...
History Service Design
last visit date, and a generic visits counter, creating some problem due to the impossibility to represent real history flow in a timeframe. history views must be organized and as concise as possible. each visit is associated with a favicon, to allow for better recognizability and groupable by common timeframes or domains. history views should allow to quickly find a page in a certain timeframe
remembering only small details about it. the system should be customizable enough to allow creation of custom, calendar and graphical views based on queries executed through a common api upon underlying data. the querying system allows to extract slices of data based on common patterns, this is directly usable by the end user, but also by implementers to provide a variety of nice features. for examp...
...a, history service will eventually upgrade the database, moving and fixing its datas accordingly. in case the database has been created for the first time history service will create all tables, indexes and triggers, calling related inittables static methods of other dependant services. finally temporary tables, indexes and triggers are created, this happens at every run since those entities are
removed when closing the connection. temporary storage is used to avoid too frequent writes to the disk, since those are most likely to cause fsyncs (to ensure data integrity) on the target filesystem. the temporary data (actually visits and pages) are synced to disk either on a timer and on bookmark's inserts. performance to ensure performance a bunch of statements, commonly used when adding or re...
...mple uri nodes with page attributes or complete visit attributes, or can be containers (folders, other queries, dynamic containers and so on). see querying places for deeper knowledge on the actual implementation. expiration expiration is an important part of data management for two reasons: privacy: expiring data based on user interaction is important, nothing must be left behind on a page
removal database maintenance: having cleaner and smaller tables helps queries performances expiration is done at certain moments, but in future will most likely be moved to async queries, to be executed on a separate thread. actually pages and visits are expired: on page added (lazily) on idle on shutdown expiration of pages happens when a page is no more referenced, so there are no more vi...
... on page added (lazily) on idle on shutdown expiration of pages happens when a page is no more referenced, so there are no more visits, nor bookmarks associated with it. visits are expired based on user preferences, there is an hard limit on the minimum number of days that should be retained, visits in that range won't never expire. visits inside a slushy limit (> than the hard limit) will be
removed only if we are over a maximum number of pages we can retain, for performance issues. finally expiration can be forced by the user himself to clean up the full history or slices of it (last hour, last day, ...). see places expiration for more information. ...
Using the Places history service
tory service ("navhistory") implements these history interfaces: nsiglobalhistory2: basic add page, is visited functionality used by the docshell when visiting and rendering pages. nsiglobalhistory3: adds extra functions for dealing with redirects and hints for rendering (gecko flags). nsibrowserhistory: adds functions used by the basic browser like marking pages as typed in the url bar, and
removing pages as from the history interface. nsinavhistoryservice: complex query functions, more fine-grained getters and setters. nsiautocompletesearch: url-bar autocomplete from history from 1.9.1 (firefox3.1) on, don't use any places service on (or after) quit-application has been notified, since the database connection will be closed to allow the last sync, and changes will most likely be lo...
...y nsiglobalhistory2.setpagetitle: called by gecko when the <title> element is encountered. nsiglobalhistory3.setgeckoflags: called by gecko to store rendering information about a page. currently, this is used to store whether there was a scrollbar, which allows more efficient layout if the page is revisited. however, this is not yet supported by the navhistory implementation. nsibrowserhistory.
removepage:
removes a given uri and all of its visits from the history database. this is called by the ui when the user deletes a history entry. nsibrowserhistory.
removepagesfromhost: called from the ui when the user deletes a group associated with a host or domain. this function allows you to delete pages from a specific host, or pages from all hosts in a given domain. nsibrowserhistory.hidepage: ...
...: called by the ui (implemented, but not yet called, see bug 409301) when the user selects a bookmark. this will cause the transition type of the next visit of the url to be marked as "bookmark." nsinavhistoryservice.setpageusertitle: sets the user-defined title for the page, which will override the actual page title when displayed in the ui. this is used for bookmark titles.this function may be
removed if the bookmark service is changed. nsinavhistoryservice.setpagedetails: used to set all of the global bits associated with a url. it is designed for synchronizing or backup services. basic querying of the history system nsiglobalhistory2.isvisited: called by gecko when rendering links. when isvisited returns true, the link gets the "visited" style. otherwise, the link is colored as unvisi...
...ri. you should not count on this format, always use this function instead of hard-coding your own query strings. nsinavhistoryservice.querystringtoqueries: converts a serialized query ("place:" uri) back to the actual query objects and options. miscellaneous nsinavhistoryservice.addobserver: adds a history observer, which will be notified of changes to the history system. nsinavhistoryservice.
removeobserver:
removes a previously added observer. nsinavhistoryservice.beginupdatebatch: call when you will be making many small changes to the history system. observers generally stop updating ui when they are inside a batch, potentially making the operations faster. if you are just doing a few changes, it is probably better to not use a batch since inc
remental updates are not done. be sure to c...
XPCOM changes in Gecko 2.0
several changes that affect xpcom component compatibility are taking place in gecko 2. this article details those changes, and provides suggestions for how to update your code. no more frozen interfaces there are no longer any frozen interfaces; from now on, all interfaces are subject to change. documentation will be updated as time allows to
remove references to interfaces being "frozen" or "unfrozen." component registration the way xpcom components are registered changed in gecko 2. prior to gecko 2, during component registration, all binary and javascript component files were loaded and called, asking them to register themselves. if you used xpcomutils.jsm, some of this was hidden from you, but it was still there. starting in gecko 2, however, components are registered using manifest file...
...+ in the component must be changed: a binary component no longer exports a nsgetmodule() function. instead, it exports an nsmodule data symbol which points to a mozilla::module structure. for more information about the mozilla::module structure, see the module.h header file. for an up-to-date example of implementing a dynamic modules, see nssamplemodule.cpp. note that nsigenericfactory.h has been
removed. references to nsigenericfactory.h should be replaced with mozilla/moduleutils.h. it is possible for a binary component to be compatible with mozilla 1.9.2 and mozilla 2.0 by using the extra macro ns_impl_mozilla192_nsgetmodule. see nssamplemodule.cpp for more details. note: binary xpcom components must be recompiled for every new major release of firefox starting with firefox 4. your life wo...
...this was necessary in order to ensure that any components that should no longer be available are disposed of properly, and to re-register everything, loading any new components that may be needed. in...
... need to do this as well. this may be the case if, for example, you've written an extension that adds a delete button to a web mail service, and the service defines a window.delete() function that you need to call. if, on the other hand, all you're doing with content is accessing dom methods and properties, you've never needed to be using xpcnativewrappers=no in the first place, and should simply
remove it from your manifest. miscellaneous xpcnativewrapper changes using the delete operator on "expando" properties of an xpcnativewrapper no longer throws a security exception. xpcomutils.jsm changes the xpcomutils.jsm code module has been updated to let you specify the application ids of the applications you wish to register your component in. xpcom service getters a number of commonly used xp...
XPCOM hashtable guide
iled xpcom hashtable guide. everything you need to know is probably on this page. also note that mfbt/hashtable.h now exists. it is a lot faster than the xpcom hashtables due to more inlining and templating, and the api is arguably better. what is a hashtable? a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and
removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else. keys can be disjunct (i.e.
...e disjunct (i.e. you can store entries with keys 1, 5, and 3000). lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted: stored sorted; iterated over in a sorted fashion. unsorted: stored unsorted; cannot be iterated over in a sorted manner. inserting/
removing: o(n): adding and
removing items from a large array can be time-consuming o(1): adding and
removing items from hashtables is a quick operation wasted space: none: arrays are packed structures, so there is no wasted space. some: hashtables are not packed structures; depending on the implementation, there may be significant wasted memory. in their implementation, ha...
... hash to find the location in the hashtable. good hashtable implementations will automatically resize the hashtable in memory if extra space is needed, or if too much space has been allocated. when should i use a hashtable? hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or
removed. hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access. in these situations, an array, a linked-list, or various tree data structures are more efficient. which hashtable should i use? the appropriate hashtable class to use depends solely on the data type. the template specialization to use ...
...ps nsisupports pointers to reference counted cacheentrys - nsrefptrhashtable<nsisupportshashkey, cacheentry> a hashtable that maps jscontext pointers to a contextinfo struct - nsclasshashtable<nsptrhashkey<jscontext>, contextinfo> a hashset of strings - nsthashtable<nsstringhashkey> hashtable api the hashtable classes all expose the same basic api. there are three key methods, get, put, and
remove, which retrieve entries from the hashtable, write entries into the hashtable, and
remove entries from the hashtable respectively. the hashtables that hold references to pointers (nsrefptrhashtable and nsinterfacehashtable) also have getweak methods that return non-addrefed pointers. all of these hashtable classes can be iterated over via the iterator class and cleared via the clear method. ...
IAccessibleText
long width, [out] long height ); [propget] hresult ncharacters([out] long ncharacters ); [propget] hresult newtext([out] ia2textsegment newtext ); [propget] hresult nselections([out] long nselections ); [propget] hresult offsetatpoint([in] long x, [in] long y, [in] enum ia2coordinatetype coordtype, [out] long offset ); [propget] hresult oldtext([out] ia2textsegment oldtext ); hresult
removeselection([in] long selectionindex ); hresult scrollsubstringto([in] long startindex, [in] long endindex, [in] enum ia2scrolltype scrolltype ); hresult scrollsubstringtopoint([in] long startindex, [in] long endindex, [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult selection([in] long selectionindex, [out] long startoffset, [out] long endoffset ); ...
... point. y the position's y value for which to look up the index of the character that is rendered on to the display at that point. coordtype screen coordinates or window coordinates. offset index of the character under the given point or -1 if the point is invalid or there is no character under the point. return value e_invalidarg if bad [in] passed, [out] value is 0. s_ok. oldtext() returns any
removed text(). provided for use by the ia2_event_text_
removed/updated event handlers. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have different life cycle management strategies for controls depending on w...
... a control manages its children. lists, trees, and tables can have a large number of children and thus it's possible that the child objects for those controls would only be created as needed. servers should document their life cycle strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. ...
...s needed. servers should document their life cycle strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the last
removed block of text() and a scope of the entire application is adequate. [propget] hresult oldtext( [out] ia2textsegment oldtext ); parameters oldtext the text() that was just
removed. return value s_false if there is nothing to return, [out] value is null. s_ok.
removeselection() unselects a range of text(). hresult
removeselection( [in] long selectionindex ); parameters selectionindex index of selection() to
remove (0 based). return value e_invalidarg if bad [in] passed. s_ok. scrollsubstringto() makes a specific part of string visible on screen. hresult scrollsubs...
inIDOMUtils
rindex); nsidomfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname); void parsestylesheet(in nsidomcssstylesheet asheet, in domstring ainput); void
removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselectorindex, [optional] in domstring apseudo); void setcontentstate(in nsidomelement aelement, in unsigned long long astate); ...
...s inherited, otherwise false. parsestylesheet() parse css and update the style sheet in place. void parsestylesheet( in nsidomcssstylesheet asheet, in domstring ainput ); parameters asheet a domcssstylesheet. ainput a domstring. the new source string for the style sheet. return value void setcontentstate() sets the given element as the current owner of the specified state, and
removes that state from the previous owner. void setcontentstate( in nsidomelement aelement, in unsigned long long astate ); parameters aelement the element to set the content state of. astate the content state to set. this must be one (and only one) of the values listed in content state flags. selectormatcheselement() checks if a given selector from a style rule matches an element. ...
...atch. may be omitted when checking the regular elements. addpseudoclasslock() makes the element take on style properties that would apply if the element had the given pseudo-classes. void addpseudoclasslock( in nsidomelement aelement, in domstring apseudoclass ); parameters aelement the element to set the pseudo-class lock on. apseudoclass the pseudo-class to set. e.g. ":hover".
removepseudoclasslock()
removes a pseudo-class lock from the element. void
removepseudoclasslock( in nsidomelement aelement, in domstring apseudoclass ); parameters aelement the element to
remove the pseudo-class lock from. apseudoclass the pseudo-class to
remove the lock of. e.g. ":hover". haspseudoclasslock() checks whether the element element has a particular pseudo-class lock app...
...over". haspseudoclasslock() checks whether the element element has a particular pseudo-class lock applied. boolean haspseudoclasslock( in nsidomelement aelement, in domstring apseudoclass ); parameters aelement the element to test. apseudoclass the pseudo-class lock to test for existence, e.g. ":hover". return value true if lock exists, false otherwise clearpseudoclasslocks()
removes any pseudo-class locks from the element. void clearpseudoclasslocks( in nsidomelement aelement ); parameters aelement the element to
remove the pseudo-class locks from. ...
nsIAppShellService
isible. nsixulwindow createtoplevelwindow( in nsixulwindow aparent, in nsiuri aurl, in boolean ashowwindow, in boolean aloaddefaultpage, in pruint32 achromemask, in long ainitialwidth, in long ainitialheight, in nsiappshell aappshell ); parameters aparent the parent window. can be null. aurl the contents of the new window. ashowwindow obsolete since gecko 1.8 the window
remains invisible if pr_false. aloaddefaultpage obsolete since gecko 1.8 controls whether the window should try to load a default content page on its own. achromemask chrome flags affecting the kind of os border given to the window. (see nsibrowserwindow for bit/flag definitions). ainitialwidth width, in pixels, of the window. width of window at creation. can be overridden by the "width" tag in...
...l opendialog on the hidden window. void gethiddenwindowandjscontext( out nsidomwindow ahiddendomwindow, out jscontext ajscontext ); parameters ahiddendomwindow the hidden window queryinterface'd to type nsidomwindow. ajscontext the corresponding javascript context. hidesplashscreen() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)
remove the splash screen (if visible). this need be called only once per application session. void hidesplashscreen(); parameters none. initialize() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) required initialization routine. void initialize( in nsicmdlineservice acmdlineservice, in nsisupports nativeappsupportorsplashscreen ); param...
... ); parameters aferocity one of the e* constants. createwindowlessbrowser() this method creates a browser that does not have a window. if the browser is exited, this windowless browser will not prevent firefox from exiting. e10s notes: the browser is created in process. to get an out of process element you want to communicate with via message manager, then append a browser element with
remote attribute set to true. follow this bug - bugzilla - bug 1280028 nsiwebnav createwindowlessbrowser( in bool aischrome ); var webnav = services.appshell.createwindowlessbrowser(true); var docshell = webnav.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidocshell); var systemprincipal = cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); docshell.createaboutb...
...ll service needs to be informed of modal xul windows currently open. call this method as a window becomes modal or as it becomes nonmodal. void toplevelwindowismodal( in nsixulwindow awindow, in boolean amodal ); parameters awindow the window to register. amodal true if awindow is becoming modal or false if awindow is becoming nonmodal (or being closed). unregistertoplevelwindow()
remove a window from the application's window registry. note: this method will not automatically attempt to quit the application when the last window is unregistered. for that, see quit(). void unregistertoplevelwindow( in nsixulwindow awindow ); parameters awindow the window to register. see also nsiappshell ...
nsICollection
xpcom/ds/nsicollection.idlscriptable this interface represents a list of nsisupports items. it provides basic operations on those items like: getting, setting, appending,
removing, and so on. inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void
removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection. void appendelement( in nsisuppor...
...void clear(); parameters none. count() returns the number of items in the collection. pruint32 count(); parameters none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. ...
...em at the index position. queryelementat() performs a queryinterface on the item at the specified index into the collection. void queryelementat( in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters index position of the item to be queried. uuid nsiidref of the item. result comparison result of the previous two parameters.
removeelement()
removes an item from the collection. void
removeelement( in nsisupports item ); parameters item nsisupports item to be
removed from the list. setelementat() replaces an item at a specified index in the collection with a new one. void setelementat( in pruint32 index, in nsisupports item ); parameters index index position where the new item will be set. it...
...moveelement( in nsisupports item ); parameters item nsisupports item to be
removed from the list. setelementat() replaces an item at a specified index in the collection with a new one. void setelementat( in pruint32 index, in nsisupports item ); parameters index index position where the new item will be set. item the nsisupports item to be set in that position.
remarks nsienumerator is a broken interface, and nsisimpleenumerator should be used in its place. see also nsisupports nsienumerator nsisimpleenumerator ...
nsICookieManager
an optional interface for accessing or
removing the cookies that are in the cookie list. netwerk/cookie/nsicookiemanager.idlscriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsisupports this interface is intended to be used as a service. it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via services.cookies method overview void
remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void
removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list. the objects enumerated over are of ty...
... void
remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void
removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list. the objects enumerated over are of type nsicookie. read only. methods
remove() this method is called to
remove an individual cookie from the cookie list, specified by host, name, and path. if the cookie cannot be found, no exception is thrown. typically, the arguments to this method will be obtained directly from the desired nsicookie object. ...
...see nsicookiemanager2.add() for a description of acceptable host strings. ...
...r which the cookie was set. see nsicookiemanager2.add() for a description of acceptable host strings. if the target cookie is a domain cookie, a leading dot must be present. aname the name specified in the cookie. apath the path for which the cookie was set. ablocked indicates if cookies from this host should be permanently blocked. aoriginattributes the originattributes of this cookie.
removeall() this method is called to
remove all cookies from the cookie list. void
removeall(); parameters none. see also nsicookie nsicookie2 nsicookiemanager2 nsicookiepermission ...
nsIDOMXULElement
elist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute. allowevents boolean true if the element's allowevents attribute is the string "true", otherwise false.
removes the attribute if you set it to false. boxobject nsiboxobject read only. gets or creates a box object for the element; browser, editor, iframe, listbox, menu, menupopup, scrollbox, tooltip and tree elements receive specialized box objects allowing access to additional properties not normally available from script. builder nsixultemplatebuilder read only. retrives the element's template bui...
...lements receive specialized box objects allowing access to additional properties not normally available from script. builder nsixultemplatebuilder read only. retrives the element's template builder, if it has a template. classname domstring gets/sets the value of the element's class attribute. collapsed boolean true if the element's collapsed attribute is the string "true", otherwise false.
removes the attribute if you set it to false. contextmenu domstring gets/sets the value of the element's contextmenu attribute. controllers nsicontrollers read only. returns an nsicontrollers object that additional controllers may be appended to so as to provide focus-specific actions for commands. database nsirdfcompositedatasource read only. returns the template builder's database, if it is a...
...s attribute. dir domstring gets/sets the value of the element's dir attribute. flex domstring gets/sets the value of the element's flex attribute. flexgroup domstring gets/sets the value of the element's flexgroup attribute. height domstring gets/sets the value of the element's height attribute. hidden boolean true if the element's hidden attribute is the string "true", otherwise false.
removes the attribute if you set it to false. id domstring gets/sets the value of the element's id attribute. left domstring gets/sets the value of the element's left attribute. maxheight domstring gets/sets the value of the element's maxheight attribute. maxwidth domstring gets/sets the value of the element's maxwidth attribute. menu domstring gets/sets the value of the element's menu attr...
...sed to read or write individual css style properties for the element. tooltip domstring gets/sets the value of the element's tooltip attribute. tooltiptext domstring gets/sets the value of the element's tooltiptext attribute. top domstring gets/sets the value of the element's top attribute. width domstring gets/sets the value of the element's width attribute. methods blur() attempts to
remove focus from the element. void blur(); parameters none. click() unless the element is disabled, sends mouse events that simulate the effect of clicking the mouse on the element, then calls the docommand() method. void click(); parameters none. docommand() generates and dispatches a basic command event, as if the element was clicked with no keyboard modifiers. void docommand(); parameters none...
nsIDeviceMotion
ntroduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). method overview void addlistener(in nsidevicemotionlistener alistener); void addwindowlistener(in nsidomwindow awindow); native code only! void
removelistener(in nsidevicemotionlistener alistener); void
removewindowlistener(in nsidomwindow awindow); native code only! methods addlistener() when called, the accelerometer support implementation must begin to notify the specified nsidevicemotionlistener by calling its nsidevicemotionlistener.onaccelerationchange() method as appropriate to share updated acceleration data. void addlistener( ...
...whose nsidevicemotionlistener.onaccelerationchange() method should be called with updated acceleration data. native code only!addwindowlistener sets the nsiaccelerometer as the source for mozorientation events on the specified dom window. void addwindowlistener( in nsidomwindow awindow ); parameters awindow the dom window that the accelerometer should begin sending mozorientation events to. ...
...tive code only!addwindowlistener sets the nsiaccelerometer as the source for mozorientation events on the specified dom window. void addwindowlistener( in nsidomwindow awindow ); parameters awindow the dom window that the accelerometer should begin sending mozorientation events to.
removelistener() tells the accelerometer to stop sending updates to the specified nsidevicemotionlistener. ...
...); parameters awindow the dom window that the accelerometer should begin sending mozorientation events to.
removelistener() tells the accelerometer to stop sending updates to the specified nsidevicemotionlistener. void
removelistener( in nsidevicemotionlistener alistener ); parameters alistener the nsidevicemotionlistener object to which no further updates should be sent. native code only!
removewindowlistener
removes the nsiaccelerometer as the source for mozorientation events on the specified dom window. void
removewindowlistener( in nsidomwindow awindow ); parameters awindow the dom window that the accelerometer should stop sending mozorientation events to. see also mozorientation nsidomorientationevent nsidevicemotiondata nsidevicemotionlistener ...
nsIFormHistory2
ts last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this interface provides no means to access stored values. stored values are used by the formfillcontroller to generate autocomplete matches. method overview void addentry(in astring name, in astring value); boolean entryexists(in astring name, in astring value); boolean nameexists(in astring name); void
removeallentries(); void
removeentriesbytimeframe(in long long abegintime, in long long aendtime); void
removeentriesforname(in astring name); void
removeentry(in astring name, in astring value); attributes attribute type description dbconnection mozistorageconnection returns the underlying db connection the form history module is using. read only. hasentries boolean returns true if...
...( in astring name, in astring value ); parameters name value entryexists() gets whether a name and value pair exists in the form history. boolean entryexists( in astring name, in astring value ); parameters name value return value nameexists() returns true if there is no entry that is paired with a name. boolean nameexists( in astring name ); parameters name return value
removeallentries()
removes all entries in the entire form history. void
removeallentries(); parameters none.
removeentriesbytimeframe()
removes entries that were created between the specified times. void
removeentriesbytimeframe( in long long abegintime, in long long aendtime ); parameters abegintime the beginning of the timeframe, in microseconds. aendtime the end of the timeframe, in microse...
...tries()
removes all entries in the entire form history. void
removeallentries(); parameters none.
removeentriesbytimeframe()
removes entries that were created between the specified times. void
removeentriesbytimeframe( in long long abegintime, in long long aendtime ); parameters abegintime the beginning of the timeframe, in microseconds. aendtime the end of the timeframe, in microseconds.
removeentriesforname()
removes all entries that are paired with a name. void
removeentriesforname( in astring name ); parameters name
removeentry()
removes a name and value pair from the form history. ...
...eframe( in long long abegintime, in long long aendtime ); parameters abegintime the beginning of the timeframe, in microseconds. aendtime the end of the timeframe, in microseconds.
removeentriesforname()
removes all entries that are paired with a name. ...
nsIFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable provides methods for managing message listeners on local frames. this provides a way for local frames to receive messages from
remote frames. 1.0 66 introduced gecko 2.0 obsolete gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) this interface is obsolete and was
removed in firefox 17. you should use nsimessagelistenermanager or nsimessagesender instead. ...
...herits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) this interface is obsolete and was
removed in firefox 17. you should use nsimessagelistenermanager or nsimessagesender instead. method overview void addmessagelistener(in astring amessage, in nsiframemessagelistener alistener, [optional] in boolean listenwhenclosed); void
removemessagelistener(in astring amessage, in nsiframemessagelistener alistener); void sendasyncmessage(in astring amessage, in astring json); methods addmessagelistener() adds a message listener to the local frame. this listener will receive messages sent from the
remote frame. void addmessagelistener( in astring amessage, in nsiframemessagelistener alistener [optional in bo...
...elistener alistener [optional in boolean listenwhenclosed ); parameters amessage the name of the message for which to add a listener. alistener an object implementing nsiframemessagelistener whose receivemessage method will be called when the message is received. listenwhenclosed default is false. ...
...lse. set to oo if you want to receive messages during the short period after a frame has been
removed from the dom and before its frame script has finished unloading. this parameter only has an effect for frame message managers in the main process. an alternative method to listen for death of frame script is to use message-manager-disconnect observer: observer notifications :: message manager.
removemessagelistener()
removes a message listener previously added by calling addmessagelistener(). void
removemessagelistener( in astring amessage, in nsiframemessagelistener alistener ); parameters amessage the name of the message for which to
remove a listener. alistener an object implementing nsiframemessagelistener to stop receiving messages. sendasyncmessage() asynchronously s...
nsIFrameScriptLoader
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used to load frame scripts. methods void loadframescript(in astring aurl, in boolean aallowdelayedload, [optional] in boolean aruninglobalscope) void
removedelayedframescript(in astring aurl); jsval getdelayedframescripts(); loadframescript() load a script in the
remote frame. frame scripts are loaded as soon as loadframescript() is called. if this function is called on a chromemessagebroadcaster (for example, a global frame message manager or a window message manager) then: loadframescript() will load the frame script independently into each applicable frame: every open fra...
...nt-inserted notification. parameters name type description aurl string url for the script to load. aurl must be the absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if true, this flag means that the frame script will be loaded into any new frames opened after the loadframescript() call, until
removedelayedframescript() is called for that script. aruninglobalscope boolean optional, defaults to false. by default, frame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts. if present and set to true, this flag switches off that behavior, meaning that the script's scope is shared with any other ...
...scope boolean optional, defaults to false. by default, frame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts. if present and set to true, this flag switches off that behavior, meaning that the script's scope is shared with any other frame scripts in the same frame that have also set the flag.
removedelayedframescript()
removes aurl from the list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new frames. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type descrip...
... scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new frames. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for the script to
remove. getdelayedframescripts() returns all delayed scripts that will be loaded once a (
remote) frame becomes available. the return value is a list of pairs [<url>, <wasloadedinglobalscope>]. returns list of the delayed scripts. each script is returned as a pair: [<url>, <wasloadedinglobalscope>]. ...
nsIJSON
ing str, in jscontext cx); native code only! deprecated since gecko 2.0 methods decode() obsolete since gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) decodes a json string, returning the javascript object it represents. note: this method is more flexible than it should be, and accepts some not-correctly-structured json. for that reason, it has been
removed in gecko 7.0. jsobject decode( in astring str ); parameters str the json string to decode. return value the original javascript object, reconstructed from the json string. decodetojsval() note: this method may only be used from native code, and provides a way to decode a json string to a jsval for use in your native code. don't forget to gcroot the result before using it. j...
... byte-order mark (bom) into the stream, otherwise specify false. value the javascript object to encode. legacydecode() decodes a json string. this method accepts slightly more than the exact json syntax; details of extra accepted syntax are deliberately not described. this method is intended for use only by code processing legacy data. when the original instance requiring this function is
removed, this method will be
removed. thus, this deprecated method should not be used. jsval legacydecode( in astring str ); parameters str the json string to decode. return value the original javascript object, reconstructed from the json string. legacydecodefromstream() decodes a json string, read from a stream. this method accepts slightly more than the exact json syntax; detail...
...n value the original javascript object, reconstructed from the json string. legacydecodefromstream() decodes a json string, read from a stream. this method accepts slightly more than the exact json syntax; details of extra accepted syntax are deliberately not described. this method is intended for use only by code processing legacy data. when the original instance requiring this function is
removed, this method will be
removed. thus, this deprecated method should not be used. jsval legacydecodefromstream( in nsiinputstream stream, in long contentlength ); parameters stream the nsiinputstream from which to read the json string to decode. contentlength the length of the string to decode. return value the original javascript object, reconstructed from the json string. ...
...ode. return value the original javascript object, reconstructed from the json string. legacydecodetojsval() decodes a json string to a jsval. this method accepts slightly more than the exact json syntax; details of extra accepted syntax are deliberately not described. this method is intended for use only by code processing legacy data. when the original instance requiring this function is
removed, this method will be
removed. thus, this deprecated method should not be used. note: this method may only be used from native code, and provides a way to decode a json string to a jsval for use in your native code. don't forget to gcroot the result before using it. jsval legacydecodetojsval( in astring str, in jscontext cx ); parameters str the json string to decode. cx the...
nsIJumpListBuilder
individual step. the default number of allowed items in a jump list is ten. users can change the number through system preferences. user may also pin items to jump lists, which take up additional slots. applications do not have control over the number of items allowed in jump lists; excess items added are dropped by the system. item insertion priority is defined as first to last added. users may
remove items from jump lists after they are committed. the system tracks
removed items between commits. a list of these items is returned by a call to initlistbuild(). nsijumplistbuilder does not filter entries added that have been
removed since the last commit. to prevent repeatedly adding entires users have
removed, applications are encouraged to track
removed items internally. each list is made up...
...siwinjumplistitems representing items such as shortcuts, links, and separators. see nsijumplistitem for information on adding additional jump list types. method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray
removeditems); attributes attribute type description available short indicates whether jump list taskbar features are supported by the current host. read only. islistcommitted boolean jumplist management. indicates if a commit has already occurred in this session. read only. exceptions thrown ns_error_not_available on all calls if taskbar functionality is not supported by the operating sy...
...array items, optional in astring catname optional ); parameters acattype the type of list to add. items optional an array of nsijumplistitem items to add to the list. catname optional for custom lists, the title of the list. return value true if the operation completed successfully. exceptions thrown ns_error_unexpected on internal errors. ns_error_illegal_value if an item is added that was
removed since the last commit. ns_error_invalid_arg if incorrect parameters are passed for a particular category or item type. commitlistbuild() commits the current jump list build to the taskbar. boolean commitlistbuild(); parameters none. return value true if the operation completed successfully. deleteactivelist() deletes any currently applied taskbar jump list for this application. common uses ...
...ivelist() deletes any currently applied taskbar jump list for this application. common uses would be the enabling of a privacy mode and uninstallation. boolean deleteactivelist(); parameters none. return value true if the operation completed successfully. exceptions thrown ns_error_unexpected on internal errors. initlistbuild() initializes a jump list build and returns a list of items the user
removed since the last time a jump list was committed.
removed items can become state after initlistbuild is called, lists should be built in single-shot fashion. boolean initlistbuild( in nsimutablearray
removeditems ); parameters
removeditems a list of items that were
removed by the user since the last commit. return value true if the operation completed successfully. ...
nsIMemoryMultiReporter
the callback, which must implement the nsimemorymultireportercallback interface, receives values that match the fields in the nsimemoryreporter object. ...
...the callback, which must implement the nsimemorymultireportercallback interface, receives values that match the fields in the nsimemoryreporter object. ...
...the callback, which must implement the nsimemorymultireportercallback interface, receives values that match the fields in the nsimemoryreporter object. ...
...morymultireportercallback.callback() method once for each report. this will trigger any needed computation work. note: this differs from the behavior of nsimemoryreporter, which lets all fields except amount be accessed without triggering computation. attributes attribute type description explicitnonheap print64 the sum of all of this multi-reporter's measu
rements that have a path that starts with "explicit" and are of the kind kind_nonheap. note: this is a hack that makes nsimemoryreportermanager.explicit more efficient. this is important; multi-reporters can special-case this operation so it's much faster than gathering all the reports, filtering out the unneeded ones, and adding up the rest. method overview void collect...
nsIMicrosummary
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface defines attributes and methods for dealing with microsummaries generated by an nsimicrosummarygenerator. ...
... 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was
removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosummaryobserver observer); boolean equals(in nsimicrosummary aother); void
removeobserver(in nsimicrosummaryobserver observer); void update(); attributes attribute type description content astring the content of the microsummary. since generators and pages can be
remote resources, and we need them to generate the content, this may not always be available. read only. generator nsimicrosummarygenerator the generator ...
...read only. pageuri nsiuri the uri of the page being summarized. read only. ...
...summaries equal if they summarize the same page with the same microsummary-generator (see also nsimicrosummarygenerator.equals()). boolean equals( in nsimicrosummary aother ); parameters aother the microsummary to compare against. return value returns true if the microsummaries are equal. false if they aren't. note: this method returns false if either objects don't have a generator
removeobserver()
remove a microsummary observer from this microsummary. void
removeobserver( in nsimicrosummaryobserver observer ); parameters observer the microsummary observer to
remove. update() update the microsummary, first loading its generator and page content as necessary. if you want know when a microsummary finishes updating, add an observer before calling this method. void upd...
nsIMsgDBView
constants are defined in nsmsgviewtype. viewflags nsmsgviewflagstypevalue constants are defined in nsmsgviewflagstype. sorttype nsmsgv...
...ed when the message pane is collapsed. suppresscommandupdating boolean suppress command updating. used during folder loading. db nsimsgdatabase readonly: the current database of messages. supportsthreading boolean readonly: does the current database support threading? searchsession nsimsgsearchsession the current search session.
removerowonmoveordelete boolean readonly: usinglines boolean readonly: use lines for size. if false kb are used. methods open() opens a folder in the database. void open(in nsimsgfolder folder, in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); pa...
... parameters aurl the url of the message reloadmessage() reload the currently shown message. void reloadmessage(); reloadmessagewithallparts() reload the currently shown message with fetchcompletemessage set to true. this forces everything to be re-downloaded. void reloadmessagewithallparts(); selectmsgbykey() selects a message based on its key. used by "go to folder" feature and "
remember last selected message" feature. if key is not found, nothing is selected. void selectmsgbykey(in nsmsgkey key); parameters key the key of the message to load. nsmsgkey is defined as an unsigned long in mailnewstypes2.idl. selectfoldermsgbykey() selects a message within a folder by its key. this assumes that the key is somewhere in the displayed messages... i think. void selectfo...
...selection. if false then replace current selection. addcolumnhandler() attaches a nsimsgcustomcolumnhandler to a specific column (can be a new column or a built in).+ void addcolumnhandler(in astring acolumn, in nsimsgcustomcolumnhandler ahandler); parameters acolumn the name of the column to add the handler for. ahandler the nsimsgcustomcolumnhandler to add.
removecolumnhandler()
removes a nsimsgcustomcolumnhandler leaving the column to be handled by the system void
removecolumnhandler(in astring acolumn); parameters acolumn the name of the column to
remove the handler from. getcolumnhandler() returns the nsimsgcustomcolumnhandler attached to a specific column, if any. nsimsgcustomcolumnhandler getcolumnhandler(in astring acolumn); parame...
nsINavHistoryService
, size_is(aresultcount)] out nsinavhistoryquery aqueries, out unsigned long aresultcount, out nsinavhistoryqueryoptions options); autf8string queriestoquerystring([array, size_is(aquerycount)] in nsinavhistoryquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryoptions options); void addobserver(in nsinavhistoryobserver observer, in boolean ownsweak); void
removeobserver(in nsinavhistoryobserver observer); void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports aclosure); void importhistory(in nsifile file); astring getcharsetforuri(in nsiuri auri); astring setcharsetforuri(in nsiuri auri, in astring acharset); attributes attribute type description hashistoryentries...
...ld go in the history (that is for annotations). boolean canadduri( in nsiuri auri ); parameters auri the uri that needs to be added to the history system. return value returns true if this uri would be added to the history, otherwise returns false. addvisit() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was
removed in gecko 22.0. you should use the new async api moziasynchistory.updateplaces() instead. see this code for how a function to add visits and handle errors using the new api could look like. this method adds a visit for a specific page. this will probably not be commonly used other than for backup/restore type operations. if the uri does not have an entry in the history database already, one ...
...this code for how a function to add visits and handle errors using the new api could look like. this method adds a visit for a specific page. this will probably not be commonly used other than for backup/restore type operations. if the uri does not have an entry in the history database already, one will be created with no visits, no title, hidden, not typed. adding a visit will automatically inc
rement the visit count for the visited page and will unhide it and/or mark it typed according to the transition type. long long addvisit( in nsiuri auri, in prtime atime, in nsiuri areferringuri, in long atransitiontype, in boolean aisredirect, in long long asessionid ); parameters auri the visited page. atime the time page was visited (microseconds). areferringuri the uri of t...
...history service will keep an owning reference to the observer. if ownsweak is true, then aobserver must implement nsisupportsweakreference, and the history service will keep a weak reference to the observer. void addobserver( in nsinavhistoryobserver observer, in boolean ownsweak ); parameters observer the history observer to be added. ownsweak the owning reference state (boolean).
removeobserver() this method
removes a history observer. void
removeobserver( in nsinavhistoryobserver observer ); parameters observer the history observer to be
removed. runinbatchmode() this method runs the passed callback in batch mode. use this when a lot of things are about to change. calls can be nested, observers will only be notified when all batches begin/end. void runinbatchmo...
nsIObserver
nsisupports last changed in gecko 0.9.6 method overview void observe(in nsisupports asubject, in string atopic, in wstring adata); methods observe() this method will be called when there is a notification for the topic that the observer has been registered for. if you expect multiple topics/subjects, the implementor is responsible for filtering. you should not modify, add,
remove, or enumerate notifications in the implementation of this method. void observe( in nsisupports asubject, in string atopic, in wstring adata ); parameters asubject in general reflects the object whose change or action is being observed. atopic indicates the specific change or action. adata an optional parameter or other auxiliary data further describing the change or action. ...
...ove, or enumerate notifications in the implementation of this method. void observe( in nsisupports asubject, in string atopic, in wstring adata ); parameters asubject in general reflects the object whose change or action is being observed. atopic indicates the specific change or action. adata an optional parameter or other auxiliary data further describing the change or action.
remarks the specific values and meanings of the parameters provided varies widely, though, according to where the observer was registered, and what topic is being observed. a single nsiobserver implementation can observe multiple types of notification, and is responsible for dispatching its own behavior on the basis of the parameters for a given callback. in general, atopic is the primary criterion...
...is of the parameters for a given callback. in general, atopic is the primary criterion for such dispatch; nsiobserver implementations should take care that they can handle being called with unknown values for atopic. the most common implementation of nsiobserverservice is the xpcom observer service. with this implementation, it's safe (and common practice) for an implementation of nsiobserver to
remove itself as an observer during the observe callback, or to add or
remove other observers. be careful, though, because other uses of nsiobserver may not support these operations correctly within observe. example the following code is an implementation of nsiobserver that is registered to receive notifications for the "mytopicid" topic. see observer notifications for a list of built-in topics po...
... observer = new myobserver(); destruction - this should be fired once you're done observing (for example a window's unload event). failure to do so may result in memory leaks. observer.unregister(); "get everything" - note that "*" is an accept...
nsIParserUtils
zer: drops non-css presentational html elements and attributes, such as <font>, <center>, and the bgcolor attribute. sanitizerdropforms (1 << 4) flag for sanitizer: drops forms and form controls (excluding <fieldset> and <legend>. sanitizerdropmedia (1 << 5) flag for sanitizer: drops <img>, <video>, <audio>, and <source>, and flattens out svg. sanitizerlog
removals (1 << 6) flag for sanitizer: log messages to the console for everything that gets sanitized. methods converttoplaintext() converts html to plain text. astring converttoplaintext( in astring src, in unsigned long flags, in unsigned long wrapcol ); parameters src the html source to parse (c++ callers are allowed but not required to use the same string for the return...
...tizer is designed to protect against xss when sanitized content is inserted into a different-origin context without an iframe-equivalent sandboxing mechanism. by default, the sanitizer doesn't try to avoid leaking information that the content was viewed to third parties. ...
...t
removed. to avoid ambient information leakage upon loading the sanitized content, use the sanitizerinternalembedsonly flag. in that case, <a> links (and similar) to other content are preserved, so an explicit user action (following a link) after the content has been loaded can still leak information. by default, non-dangerous non-css presentational html elements and attributes or forms are not
removed. to
remove these, use sanitizerdropnoncsspresentation and/or sanitizerdropforms. by default, comments and css is
removed. to preserve comments, use sanitizerallowcomments. to preserve <style> elements and style attributes on other elements, use sanitizerallowstyle. -moz-binding is
removed from <style> elements and style attributes if present. in this case, properties that gecko doesn't recog...
...ve these, use sanitizerdropnoncsspresentation and/or sanitizerdropforms. by default, comments and css is
removed. to preserve comments, use sanitizerallowcomments. to preserve <style> elements and style attributes on other elements, use sanitizerallowstyle. -moz-binding is
removed from <style> elements and style attributes if present. in this case, properties that gecko doesn't recognize can get
removed as a side effect. note: if -moz-binding is not present, <style> elements and style attributes, and if sanitizerallowstyle is specified, the sanitized content may still be xss dangerous if loaded into a non-gecko web engine! astring sanitize( in astring src, in unsigned long flags ); parameters src the html source to parse (c++ callers are allowed but not required to use the same s...
nsIPluginHost
te temp file with content len header in, it will use by http post. nsifile createtempfiletopost( in string apostdataurl ); parameters apostdataurl return value native code only!createtmpfiletopost obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. to create temp file with content len header in, it will use by http post. void createtmpfiletopost( in string apostdataurl, out string atmpfilename ); parameters apostdataurl atmpfilename native code only!deletepluginnativewindow deletes plugin native window object created by newpluginnativewindow(). void deletepluginnativewindow( ...
... obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void getplugincount( out unsigned long aplugincount ); parameters aplugincount native code only!getpluginfactory obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. nsiplugin getpluginfactory( in string amimetype ); parameters amimetype return value native code only!getpluginname get the plugin name for the plugin instance. void getpluginname( in nsiplugininstance ainstance, [shared] out string apluginname ); parameters ainstance the plugin instance object. apluginname returns a pointer ...
...ls/communicator/plugin/pgfn2.htm#1007754 "if no custom headers are required, simply add a blank line ('\n') to the beginning of the file or buffer.", it skips that '\n' and considers rest of the input buffer as data. if "content-length" string and end of headers is found it substitutes single lf with crlf in the headers, so the end of headers always will be crlfcrlf (single cr in headers, if any,
remain untouched) else it puts "content-length: "+size_of_data+crlfcrlf at the beginning of the output buffer and memcpy data to the output buffer. on failure outpostdata and outpostdatalen will be set in 0. void parsepostbuffertofixheaders( in string ainpostdata, in unsigned long ainpostdatalen, out string aoutpostdata, out unsigned long aoutpostdatalen ); parameters ainpostdata the ...
...or new plugin libraries. void reloadplugins( in boolean reloadpages ); parameters reloadpages indicates whether currently visible pages should also be reloaded. native code only!setisscriptableinstance obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. to notify the plugin manager that the plugin created a script object. void setisscriptableinstance( in nsiplugininstance ainstance, in boolean ascriptable ); parameters ainstance ascriptable native code only!setupplugininstance void setupplugininstance( in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner ); par...
nsISHistory
read only. index long the index of the current document in session history. read only. maxlength long used to get/set the maximum number of toplevel document...
... index value whose entry is requested. modifyindex a boolean flag that indicates if the current index of session history should be modified to the parameter index. exceptions thrown ns_ok history entry for the index is obtained successfully. ns_error_failure error in obtaining history entry for the given index. purgehistory() called to purge older documents from history. documents can be
removed from session history for various reasons. for example to control memory usage of the browser, to prevent users from loading documents from history, to erase evidence of prior page loads and so on. void purgehistory( in long numentries ); parameters numentries the number of toplevel documents to be purged from history. during purge operation, the latest documents are maintained and...
...rious reasons. for example to control memory usage of the browser, to prevent users from loading documents from history, to erase evidence of prior page loads and so on. void purgehistory( in long numentries ); parameters numentries the number of toplevel documents to be purged from history. during purge operation, the latest documents are maintained and older numentries documents are
removed from history. exceptions thrown ns_error_failure numentries is invalid or out of bounds with the size of history. ns_success_loss_of_insignificant_data purge was vetoed. reloadcurrententry() void reloadcurrententry(); parameters none.
removeshistorylistener() called to
remove a listener for the session history component. listeners are notified when pages are loaded from hi...
...ds with the size of history. ns_success_loss_of_insignificant_data purge was vetoed. reloadcurrententry() void reloadcurrententry(); parameters none.
removeshistorylistener() called to
remove a listener for the session history component. listeners are notified when pages are loaded from history. note: a listener object must implement nsishistorylistener and nssupportsweakreference. void
removeshistorylistener( in nsishistorylistener alistener ); parameters alistener listener object to be
removed from session history. ...
nsISelection
read only. anchoroffset long ...
...read only. anchoroffset long the offset within the (text) no...
... to the end of the selection and applies the movement direction/granularity to the collapsed() selection. "extend()" leaves the start of the selection unchanged, and applies movement direction/granularity to the end of the selection. direction can be one of { "forward", "backward", "left", "right" } granularity can be one of { "character", "word", "line", "lineboundary" }
removeallranges()
removes all nsidomranges from the current selection. void
removeallranges(); parameters none
removerange()
removes a range from the current selection. void
removerange( in nsidomrange range ); parameters range selectallchildren() adds all children of the specified node to the selection. void selectallchildren( in nsidomnode parentnode ); parameters parentnode t...
...ren to be added to the selection. ...
nsIXSLTProcessor
cument-transformer;1?type=xslt. ...
...this will make the processor use the default-value for all parameters as specified in the stylesheet. void clearparameters(); parameters none. getparameter() gets a parameter if previously set by setparameter(). returns null otherwise. ...
...processor for transformations. void importstylesheet( in nsidomnode style ); parameters style the root-node of a xslt stylesheet. this can be either a document node or an element node. if a document node then the document can contain either a xslt stylesheet or a lre stylesheet. if the argument is an element node it must be the xsl:stylesheet (or xsl:transform) element of an xslt stylesheet. ...
...sformations. void importstylesheet( in nsidomnode style ); parameters style the root-node of a xslt stylesheet. this can be either a document node or an element node. if a document node then the document can contain either a xslt stylesheet or a lre stylesheet. if the argument is an element node it must be the xsl:stylesheet (or xsl:transform) element of an xslt stylesheet.
removeparameter()
removes a parameter, if set. this will make the processor use the default-value for the parameter as specified in the stylesheet. void
removeparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter. localname the local name of the xslt parameter. reset()
remove all parameters and stylesheets from this nsixsltprocessor. void ...
nsIXmlRpcClient
extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable please add a summary to this article. ...
...enticate clearauthentication() clear authentication info void setauthentication ( in string username, in string password ) ; parameters username password setencoding() set character encoding. the default charset if this function is not called is "utf-8" void setauthentication ( in string encoding ) ; parameters encoding encoding charset to be used asynccall() call
remote method methodname asynchronously with given arguments. supported arguments are: nsisupportspruint8, nsisupportspruint16, nsisupportsprint16, nsisupportsprint32: i4, nsisupportsprbool: boolean, nsisupportschar, nsisupportscstring: string, nsisupportsfloat, nsisupportsdouble: double, nsisupportsprtime: datetime.iso8601, nsiinputstream: base64, nsisupportsarray: array, nsidictionary: struct note ...
...tscstring array: nsisupportsarray struct: nsidictionary faults (server side errors) are indicated by returning ns_error_failure. via nsixpconnect::getpendingexception()->data a nsixmlrpcfault object can be retreieved with more information on the fault. ...
...ver side errors) are indicated by returning ns_error_failure. via nsixpconnect::getpendingexception()->data a nsixmlrpcfault object can be retreieved with more information on the fault. parameters listener a nsixmlrpcclientlistener that will get notified of xml-rpc events ctxt a context to be passed on to the listener methodname
remote method to call arguments array of arguments to pass to the
remote method count void asynccall ( in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, [array, size_is(count)] in nsisupports arguments, in pruint32 count ); createtype() convenience: return the correct nsisupportsprimitive for a given xml-rpc type, or nsisupportsarray or nsidictionary. 'base64' isn't supported. no queryinterface call is...
nsIZipWriter
exceptions thrown ns_error_not_initialized if no zip file has been opened. file nsifile the zip file being written to. read only. ...
...ted format. processqueue() processes all queued items until the entire queue has been processed or an error occurs. the observer is notified when the first operation begins and when the last operation completes. any failures are passed to the observer. the zip writer will be busy until the queue is complete or an error halts processing of the queue early. in the event of an early failure, the
remaining items stay in the queue; calling processqueue() again will continue where operations left off. void processqueue( in nsirequestobserver aobserver, in nsisupports acontext ); parameters aobserver the observer to receive notifications from the queue. acontext the context to pass to the observer. exceptions thrown ns_error_not_initialized no zip file is open. ns_error_in_pr...
...essqueue() again will continue where operations left off. void processqueue( in nsirequestobserver aobserver, in nsisupports acontext ); parameters aobserver the observer to receive notifications from the queue. acontext the context to pass to the observer. exceptions thrown ns_error_not_initialized no zip file is open. ns_error_in_progress the queue is already in progress.
removeentry()
removes an entry from the zip file. void
removeentry( in autf8string azipentry, in boolean aqueue ); parameters azipentry the path of the entry to
remove from the zip file. aqueue true to place the
remove operation into the queue, or false to process it at once. will be performed when processqueue() is called. exceptions thrown ns_error_not_initialized no zip file is...
...ory the parent dir (dir[0]) so it can succesfully populate files with same names but different folders in this parent dir, needed because recursviely going through all dirs var saveinzipas = relpath.substr(1); //need to get ride of the first '\' forward slash at start otherwise it puts every file added in a folder of its own. ...
Getting Started Guide
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 inc
rementing it when they acquire a reference to the interface, and dec
rementing 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 any function that creates or returns an interface pointer will have already addrefed it. the caller can then hold onto the reference indefinitely, cal...
... class nsibar : public nsifoo ... { ... }; nsibar* p = ...; // c++ thinks every |nsibar*| is an // |nsifoo*|, therefore, c++ allows // this... nscomptr<nsifoo> foo = p; // ...even though it is an xpcom // type error class nsibar : public nsifoo ... { ... }; nsibar* p = ...; // no type error here... nscomptr<nsifoo> foo(do_queryinterface(p));
remember, the c++ type system and the xpcom type system are really two independent things. because xpcom interfaces are expressed as abstract c++ base classes, you may be tempted to let c++ handle the differences, or to use c++ casts to navigate between interface types. this is wrong. the only sanctioned way to get between xpcom types is with queryinterface. in the example above, there is no reason t...
...here is a snippet of code that demonstrates this misconception. // incorrect assumptions about |nscomptr|... nsresult nscacherecord::getfilespec( nsifilespec** afilespec ) /* ...fills in the callers |nsfilespec*| (which the caller supplied the address of) with a copy of my member variable |mfilespec|, an |nscomptr|. i.e., this function is a `getter'.
remember: good xpcom getters always |addref| their result. */ { // ... *afilespec = mfilespec; // the |nscomptr| should take care of the refcount here, right? return ns_ok; } plainly, the author believed (though perhaps with some question) that the nscomptr, mfilespec, would addref automatically as it was assigned into *afilespec. this is not the case. an nscompt...
... compare this to the most frequent leaks caused by returning a raw pointer you have already addrefed: // don't return raw pointers; that incites leaks... nsifoo* createfoo(); // returns an |addref|ed pointer // ... nscomptr<nsifoo> myfoo = createfoo(); // oops: leak; nscomptr<nsifoo> myfoo( dont_addref(createfoo()) ); // since |createfoo| already |addref|s its result, we must
remind // our |nscomptr| not to. it's easy to forget. prevent it in advance // by not returning pointers as function results, or else by returning // an |already_addrefed<t>| as above. void f( nscomptr<t> ) don't pass an nscomptr by value this practice is wasteful, but not otherwise harmful. there is no need to addref parameters, as they are guaranteed to live as long as the f...
Events
saved searches, virtual folders, a quicksearch onsortchanged the sort method in the messages list has been changed ...
...saved searches, virtual folders, a quicksearch onsortchanged the sort method in the messages list has been changed ...
...saved searches, virtual folders, a quicksearch onsortchanged the sort method in the messages list has been changed ...
...saved searches, virtual folders, a quicksearch onsortchanged the sort method in the messages list has been changed ...
Gloda examples
* called when new items are returned by the database query or freshly indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitems
removed: function _onitems
removed(aitems, acollection) { }, /* called when our database query completes */ onquerycompleted: function _onquerycompleted(conversation_coll) { try { for (var conv in conversation_coll) { //do something with the conversation here alert(conv.subject); } } catch (e) {} } } glodamessage.
...* called when new items are returned by the database query or freshly indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitems
removed: function _onitems
removed(aitems, acollection) { }, /* called when our database query completes */ onquerycompleted: function _onquerycompleted(acollection) { var items = acollection.items; for (msg of items) { alert(msg.subject); }; } }; collection = id_q.getcollection(mylistener); show all messages where the from, to and cc values incl...
... an email address and turn it into an identity object id_q = gloda.newquery(gloda.noun_identity); id_q.kind("email"); id_q.value("test@example.com"); id_coll = id_q.getcollection({ onitemsadded: function _onitemsadded(aitems, acollection) { }, onitemsmodified: function _onitemsmodified(aitems, acollection) { }, onitems
removed: function _onitems
removed(aitems, acollection) { }, onquerycompleted: function _onquerycompleted(id_coll) { //woops no identity if (id_coll.items.length <= 0) return; id = id_coll.items[0]; //now we use the identity to find all messages that person was involved with ...
... }, /* called when items that are already in our collection get re-indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitems
removed: function _onitems
removed(aitems, acollection) { }, /* called when our database query completes */ onquerycompleted: function _onquerycompleted(msg_coll) { try { while(msg = msg_coll.items.pop()) { //do ...
Mail composition back end
as of yet. i will try to make comments for these exceptions. sending messages the primary responsibility of the back end is for the creation and sending of rfc822 messages. the interface that accomplishes this task is the nsimsgsend interface. the feedback mechanism is provided by a nsimsgsendlistener which is implemented by the caller. the caller has the ability to add or
remove listener interfaces to the nsimsgsend object and the interface can support multiple listeners. (for detailed information on the listener interfaces, see the listener interfaces section of this document) nsimsgsend the following describes the methods of the nsimsgsend interface. all of these methods are asynchronous operations. createandsendmessage ...
... nsmsgdelivermode mode, - mode is the delivery mode. this can be set for the various modes of delivery (i.e. send later, drafts, templates or send the message now) nsimsgsendlistener **alistenerarray) = 0; - an array of listeners for the send operation. this can be nsnull if you want to do the delivery operation "blind" the addlistener/
removelistener methods let the caller add and
remove listeners to the sending interface. ns_imethod addlistener(nsimsgsendlistener *alistener) = 0; ns_imethod
removelistener(nsimsgsendlistener *alistener) = 0; sending listener interfaces the nsimsgsendlistener interface will let a caller keep track of the progress and any status of a send operation. these are critical f...
...ssages(nsimsgidentity *identity, - the user identity for the person doing the send operation. this will be needed to determine the appropriate folder for copy operations. nsimsgsendlaterlistener **listenerarray) = 0; - an array of listeners for the send operation. ...
...ntity, - the user identity for the person doing the send operation. this will be needed to determine the appropriate folder for copy operations. nsimsgsendlaterlistener **listenerarray) = 0; - an array of listeners for the send operation. this can be nsnull if you want to do the delivery operations "blind" the addlistener &
removelistener methods will add and
remove listeners from the nsimsgsendlater object. ns_imethod addlistener(nsimsgsendlaterlistener *alistener) = 0; ns_imethod
removelistener(nsimsgsendlaterlistener *alistener) = 0; sending unsent messages listener the nsimsgsendlaterlistener interface will notify the implementor of the progress and completion of the send later operations. createandsendmessa...
WebIDL bindings
, for example, rootedunion<owningobjectorlong>. date webidl date types are represented by a mozilla::dom::date struct. c++ reflections of webidl declarations webidl declarations (maplike/setlike/iterable) are turned into a set of properties and functions on the interface they are declared on. each has a different set of helper functions it comes with. in addition, for iterable, there are requi
rements for c++ function implementation by the interface developer. maplike example interface: interface stringtolongmap { maplike<domstring, long>; }; the bindings for this interface will generate the storage structure for the map, as well as helper functions for accessing that structure from c++. the generated c++ api will look as follows: namespace stringtolongmapbinding { namespace maplike...
...key, errorresult& arv); } // namespace setlikehelpers } iterable unlike maplike and setlike, iterable does not have any c++ helpers, as the structure backing the iterable data for the interface is left up to the developer. with that in mind, the generated iterable bindings expect the wrapper object to provide certain methods for the interface to access. iterable interfaces have different requi
rements, based on if they are single or pair value iterators. example interface for a single value iterator: interface longiterable { iterable<long>; getter long(unsigned long index); readonly attribute unsigned long length; }; for single value iterator interfaces, we treat the interface as an indexed getter, as required by the spec. see the indexed getter implementation section for more inf...
... just like headerfile in bindings.conf, should be avoided. [jsimplementation="@mozilla.org/some-contractid;1"] used on an interface to provide the contractid of the javascript component implementing the interface. [navigatorproperty="propname"] setting this extended attribute to propname on an interface causes window.navigator.propname to be an instance of the interface. note that adding or
removing this extended attribute requires a clobber. see https://bugzilla.mozilla.org/show_bug.cgi?id=1333117 for details. [storeinslot] used to flag attributes that can be gotten very quickly from the js object by the jit. such attributes will have their getter called immediately when the js wrapper for the dom object is created, and the returned value will be stored directly on the js object. la...
...content-side object will be created. then, if there are any constructor arguments, the object's __init method will be invoked, with the constructor arguments as its arguments. if you want an instance of the class to be added to window.navigator, add an extended attribute navigatorproperty="propertyname" which will make the instance available as window.navigator.propertyname. note that adding or
removing navigatorproperty requires a clobber. see https://bugzilla.mozilla.org/show_bug.cgi?id=1333117 for details. static members static attributes and methods are not supported on js-implemented webidl (see bug 863952). however, with the changes in bug 1172785 you can route static methods to a c++ implementation on another object using a staticclassoverride annotation. this annotation include...
Zombie compartments
.com, but you closed your last www.foo.com tab a while ago, there's a good chance you're seeing a zombie compartment. follow these steps to make a more conclusive diagnosis. restart the browser. open the page that you think might cause a zombie compartment. open about:memory in another tab to confirm that the relevant compartment is present. close the first page. minimize memory usage and
remeasure in about:memory. it might be worth refreshing multiple times just to be sure. if the compartment is still present in about:memory, that's very suspicious. you could try waiting 20 minutes or so, then reload about:memory again. some zombie compartments stick around for a limited time before disappearing, others are immortal, and it's useful to know which is which. if you see any `ghost-...
...l to know which is which. if you see any `ghost-windows` (at the bottom of about:memory) that is also suspicious, as they are similar to zombie compartments. some zombie compartments are caused by add-ons. if you have add-ons enabled, please try to reproduce in safe mode, which disables them. if you can identify, by disabling them one at a time, a single add-on that is responsible, that is ext
remely helpful. if you're confident you've found a zombie compartment, please file a bug that includes all the information you've gathered, add “[memshrink]” to its whiteboard, and mark it as blocking bug 668871. attaching the full contents of about:memory?verbose is very helpful (and you can just cut and paste the page contents, there's no need to take a screenshot). see bug 669545 for an exa...
...emory open, things are much simpler. proactive checking of add-ons it's not uncommon for add-ons to cause zombie compartments, see bug 700547 for examples. follow these steps to do some basic checking of an add-on. create a new profile. install and enable the add-on. restart the browser. browse one or more pages and do something that exercises the add-on. for example, for an add-on that
remembers passwords, visit a site that requires a password; for an add-on that performs an operation involving a specific page element such as an image or a chunk of text, perform that operation. the more you exercise the add-on, the more thorough the testing will be, but in practice a lot of problems show up quickly. open about:memory and close all other pages. return to about:memory and minimiz...
...rds, visit a site that requires a password; for an add-on that performs an operation involving a specific page element such as an image or a chunk of text, perform that operation. the more you exercise the add-on, the more thorough the testing will be, but in practice a lot of problems show up quickly. open about:memory and close all other pages. return to about:memory and minimize memory and
remeasure, multiple times if necessary. if only system compartments are present, and there are no ghost windows, congratulations! that's a good sign that the add-on doesn't cause zombie compartments. otherwise, please file a bug (using the "tech evangelism" product and the "add-ons" component), add "[memshrink]" to its whiteboard, and mark it as blocking bug 668871 and bug 700547. restartless add...
Plugin Roadmap for Firefox - Plugins
to support the transition away from flash, firefox is working with other browsers to progressively and carefully make flash usage less common. below is the roadmap of past and future support for plugins in firefox. schedule june 2016 starting with firefox 47 in june 2016, all plugins other than adobe flash are click-to-activate. ...
...upports the flash plugin. march 2017 starting with firefox 52 in march 2017, plugins other than adobe flash are no longer supported in firefox. firefox extended support release 52 will continue to support non-flash plugins until early 2018. august 2017 starting with firefox 55 in august 2017, users must choose which sites are allowed to activate the flash plugin. users will have the choice to
remember the flash setting per-site. this change will be rolled out progressively during august and september 2017. in order to improve security and performance, mozilla will maintain a list of sites which cannot use any plugins. september 2017 starting with firefox 56 in september 2017, firefox for android will
remove all support for plugins (bug 1381916). 2019 in september 2019, firefox 69 w...
...r the flash setting per-site. this change will be rolled out progressively during august and september 2017. in order to improve security and performance, mozilla will maintain a list of sites which cannot use any plugins. september 2017 starting with firefox 56 in september 2017, firefox for android will
remove all support for plugins (bug 1381916). 2019 in september 2019, firefox 69 will
remove the "always activate" flash option so we always ask for user permission before activating flash on a website. 2020 in december 2020, flash support will be completely
removed from consumer versions of firefox. adobe will stop shipping security updates for flash at the end of 2020. see also mozilla firefox october 2015 - npapi plugins in firefox july 2016 - reducing adobe flash usage in...
...n november 2014 - the final countdown for npapi august 2016 - flash and chrome december 2016 - roll-out plan for html5 by default july 2017 - saying goodbye to flash in chrome microsoft edge and internet explorer april 2016 - putting users in control of flash december 2016 - extending user control of flash with click-to-run july 2017 - flash on windows timeline august 2019 - update on
removing flash from microsoft edge and internet explorer apple safari june 2016 - next steps for legacy plug-ins july 2017 - adobe announces flash distribution and updates to end ...
Break on DOM mutation - Firefox Developer Tools
mutation breakpoint in the page inspector. navigate to the dom node in which you are interested and use the context menu to set the breakpoint. there are three choices: subtree modification execution pauses if any of the elementʼs descendant nodes are modified. that means, the script execution is stopped whenever a child node or descendant node deeper in the dom structure is added to or
removed from the element the option is set on. examples for when this breakpoint is triggered are calling node.appendchild() and node.
removechild(), calling childnode.
remove() or setting element.innerhtml on one of the subnodes. attribute modification execution pauses when any of the elementsʼ attributes are modified. that means, the script execution is stopped whenever an attribute is added t...
...from the element the option is set on. examples for when this breakpoint is triggered are calling node.appendchild() and node.
removechild(), calling childnode.
remove() or setting element.innerhtml on one of the subnodes. attribute modification execution pauses when any of the elementsʼ attributes are modified. that means, the script execution is stopped whenever an attribute is added to or
removed from the element the option is set on or the value of one of its attributes is changed. examples for when this breakpoint is triggered are calling element.setattribute(), element.
removeattribute(), and element.classlist.add(), or setting element.id. node
removal execution pauses if the element the option is set on is
removed. examples for when this breakpoint is triggered are calling ...
... once you set the breakpoint, go to the debugger. you can see the breakpoint listed in the right-most panel under dom mutation breakpoints. ...
... once you set the breakpoint, go to the debugger. you can see the breakpoint listed in the right-most panel under dom mutation breakpoints. ...
Debugger.Memory - Firefox Developer Tools
o which they belong, not in a debuggee compartment. ongarbagecollection(statistics) a garbage collection cycle spanning one or more debuggees has just been completed. the statistics parameter is an object containing information about the gc cycle. it has the following properties: collections the collections property’s value is an array. because spidermonkey’s collector is inc
remental, a full collection cycle may consist of multiple discrete collection slices with the js mutator running interleaved. for each collection slice that occurred, there is an entry in the collections array with the following form: { "starttimestamp":timestamp, "endtimestamp":timestamp, } here the timestamp values are timestamps of the gc slice’s start and end events. reason ...
...ollection was triggered. ...
...otherwise, null is returned. known values include the following: “gc mode” “malloc bytes trigger” “allocation trigger” “requested” gccy...
...otherwise, null is returned. known values include the following: “gc mode” “malloc bytes trigger” “allocation trigger” “requested” gccyclenumber the gc cycle’s “number”. does not correspond to the number ...
Migrating from Firebug - Firefox Developer Tools
on on dom mutation in firebug you can break on dom mutations, that means that when an element is changed, the script execution is stopped at the related line within the javascript file, which caused the change. this feature can globally be enabled via the break on mutate button, or individually for each element and for different types of changes like attribute changes, content changes or element
removal. unfortunately, the devtools do not have this feature yet (see bug 1004678). to stop the script execution there, you need to set a breakpoint on the line with the modification within the debugger panel. search for elements via css selectors or xpaths firebug allows to search for elements within the html panel via css selectors or xpaths. also the devtools' inspector panel allows to search f...
... generated scripts are only listed there when they are named via a //# sourceurl comment. managing breakpoints in firebug you can set different types of breakpoints, which are all listed within the breakpoints side panel. in the devtools the breakpoints are shown below each script source within the sources side panel. those panels allow you to enable and disable single or all breakpoints and to
remove single breakpoints or all of them at once. they do currently only allow to set script breakpoints. xhr, dom, cookie and error breakpoints are not supported yet (see bug 821610, bug 1004678, bug 895893 and bug 1165010). while there are no breakpoints for single javascript errors, there is a setting pause on exceptions within the debugger panel options. step through code once the script execut...
... provides a security tab in addition to firebug's information and a timings tab showing detailed information about the network timings. view request timings firebug offers detailed information about the network timings related to a request by hovering the timeline column within its net panel. the network monitor shows this information within a timings side panel when you select a request. view
remote address the
remote address of a request is shown within the
remote ip column within firebug. in the network monitor the address is shown at
remote address in the headers tab when a request is selected. search within requests the search field within firebug allows to search within the requests. the search field in the firefox devtools filters the requests by the entered string. firebug allo...
... to right-click the cookie and choose edit from the context menu. then a dialog pops up allowing you to edit the data of the cookie and save it. inside the storage inspector you just have to double-click the data you want to edit. then an inline editor allows you to edit the value. delete cookies firebug's cookies panel allows you to delete all cookies of a website via the menu option cookies >
remove cookies or by pressing ctrl+shift+o. it also allows you to only
remove session cookies via cookies >
remove session cookies and to
remove single cookies by right-clicking them and choosing delete. the devtools storage inspector allows to
remove all cookies and a single one by right-clicking on a cookie and choosing delete all resp. delete "<cookie name>". additionally, it allows to delete all ...
Edit fonts - Firefox Developer Tools
fallback fonts used when nothing from the font-family css declaration has been applied. fonts editor firefox 63 adds the font editor — a new area below "fonts used" with additional controls for editing the fonts’ characteristics. for standard (static) fonts, you will be able to change the settings listed below size the font-size for the inspected element. this can be set using em,
rem, %, px, vh, or vw units. you can select values using the slider or enter a numeric value directly into the text box. note: if you want to use a different unit such as pt for font-size or line-height, you can set the property value applied to the currently inspected element to use that unit via the rules view, and the font editor will automatically pick it up and make it available in the associa...
... font-size or line-height, you can set the property value applied to the currently inspected element to use that unit via the rules view, and the font editor will automatically pick it up and make it available in the associated units dropdown menu. changing the unit of measure converts the numerical value to its equivalent in the new unit, so the same computed value is maintained. example: if 1
rem is equivalent to 10 pixels, when you change the unit of measu
rement from
rem to px, 2
rem becomes 20px. line height the line-height of the inspected element. this can be set using unitless, em, %, or px units. you can select values using the slider or enter a numeric value directly into the text box. changing the unit of measure changes the value relative to the font-size setting. example: ...
...value relative to the font-size setting. example: if the font is 20 pixels high and the line-height is 1.5em, when you change the unit of measure from em to px, the value will become 30px. weight the font-weight for the inspected element. you can select values using the slider or enter a numeric value directly into the text box. for non-variable fonts the slider ranges from 100 to 900 in inc
rements of 100. note: for variable fonts (see below) that define a wght variation axis, this range is custom. italic the font-style for the inspected element. this setting toggles between italic and normal values for the font-style css property. note: as you change settings, firefox applies inline styles to the element to make the changes instantly visible on the page. all fonts on page ...
... of 100. note: for variable fonts (see below) that define a wght variation axis, this range is custom. italic the font-style for the inspected element. this setting toggles between italic and normal values for the font-style css property. note: as you change settings, firefox applies inline styles to the element to make the changes instantly visible on the page. all fonts on page the
remaining area, at the bottom of the fonts tab, shows an expandable list of all of the fonts in use on the page. the list is useful because you can easily determine whether a font is a web font or a font hosted on your system. each font listed in this section shows you: the font-family identifier and full name of the font. the url to the font file in the case of web fonts not available on you...
Allocations - Firefox Developer Tools
in the example above: 8904 samples were taken in signallater(), which is 28.57% of the total number of samples taken those samples allocated 1102888 bytes, which is 30.01% of the total memory allocated in all samples next to each function name is a disclosure arrow. click this to see the places this function was called from: here you can see that signallater() was called from two places:
removeinner() and setselectioninner(). in this way you can walk back up the call stack, and understand better the context for these allocations. self cost and total cost you'll see that there are separate sets of columns for "self" and for "total". "self" records samples taken only in this function. "total" records samples taken in this function or in functions called by this function. at the to...
... taken in this function or in functions called by this function. at the top level, these are always the same, since the view presents "leaf" functions at the top level (that is, it presents an inverted view of the call stack). but if you start walking back up the call stack, you'll see the difference: here, 8904 samples were taken in signallater(). but signallater() was called from two places:
removeinner() and setselectioninner(). both these functions have 0 in self count, meaning that no allocations were seen directly in these functions. however,
removeinner() has 8901 in total count, while setselectioninner() has just 3 in total count. this is telling us that, of the 8904 allocations seen in signallater(), all but three came through the
removeinner() branch. allocations and garbage col...
...the runtime periodically needs to walk the heap looking for objects that are no longer reachable, and then freeing the memory they occupy. while gc events like this are executing, the javascript engine must be paused, so your program is suspended and will be completely unresponsive. to reduce the impact on responsiveness, spidermonkey (the javascript engine in firefox) can perform gc in small inc
rements, letting the program run in between. sometimes, though, it needs to perform a full non-inc
remental collection, and the program has to wait for it to finish. gc events are shown as red markers in the waterfall view, and are a big red flag for responsiveness, sometimes running for hundreds of milliseconds: if you're seeing gc events in your site's performance profile, what can you do? spid...
...milliseconds: if you're seeing gc events in your site's performance profile, what can you do? spidermonkey uses a complex set of heuristics to decide when to do what sort of garbage collection. in general, though: allocation pressure - allocating a lot of memory, or allocating memory at a high rate - makes spidermonkey more likely to run garbage collection, and more likely to run full, non-inc
remental garbage collection. if a gc event was caused by allocation pressure, then the sidebar on the right of the marker in the waterfall view contains a link labeled "show allocation triggers". if you click this link, the devtools switches to the allocations view, and selects the region of time from the end of the last gc cycle to the start of the one you clicked on. this shows you all the allocat...
Attr - Web APIs
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 / thunderbird 7.0 / seamonkey 2.4). this note w...
...d 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 / thunderbird 7.0 / seamonkey 2.4). this note was
removed again in gecko 49.0 (firefox 49.0 / thunderbird 49.0 / seamonkey 2.46). specified read only this property always returns true. originally, it returned true if the attribute was explicitly specified in the source code or by a script, and false if its value came from the default one defined in the document's dtd. value the attribute's value. note: dom level 3 defined namespaceuri, l...
...he value of attr.value instead. issupported() you shouldn't have been using this in the first place, so you probably don't care that this is going away. isequalnode() you shouldn't have been using this in the first place, so you probably don't care that this is going away. normalize() you shouldn't have been using this in the first place, so you probably don't care that this is going away.
removeattributenode() use element.
removeattribute() instead.
removechild() obsolete since gecko 14 modify the value of attr.value instead. replacechild() obsolete since gecko 14 modify the value of attr.value instead. setattributenode() use element.setattribute() instead. setattributenodens() use element.setattributens() instead. specifications specification status comment ...
...ute() instead. setattributenodens() use element.setattributens() instead. specifications specification status comment domthe definition of 'attr' in that specification. living standard added ownerelement property back dom4the definition of 'attr' in that specification. obsolete moved namespaceuri, prefix and localname from node to this api and
removed ownerelement, schematypeinfo and isid. document object model (dom) level 3 core specificationthe definition of 'attr' in that specification. obsolete initial definition ...
BluetoothDevice - Web APIs
/><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">bluetoothdevice</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} interface interface bluetoothdevice { readonly attribute domstring id; readonly attribute domstring? name; readonly attribute bluetooth
remotegattserver? gatt; readonly attribute frozenarray uuids; promise watchadvertisements(); void unwatchadvertisements(); readonly attribute boolean watchingadvertisements; }; bluetoothdevice implements eventtarget; bluetoothdevice implements bluetoothdeviceeventhandlers; bluetoothdevice implements characteristiceventhandlers; bluetoothdevice implements serviceeventhandlers; properties ...
...luetoothdeviceeventhandlers; bluetoothdevice implements characteristiceventhandlers; bluetoothdevice implements serviceeventhandlers; properties bluetoothdevice.id read only a domstring that uniquely identifies a device. bluetoothdevice.name read only a domstring that provices a human-readable name for the device. ...
... bluetoothdevice.addata read only an instance of bluetoothadvertisingdata containing the most recent advertising data received for the device. bluetoothdevice.deviceclass read only a number representing the bluetooth devices "class of device". ...
...to the device's gatt server or null if the device is disconnected. methods bluetoothdevice.watchadvertisments() a promise that resolves to undefined or is rejected with an error if advetisments can’t shown for any reason. bluetoothdevice.unwatchadvertisments() stops watching for advertisments. bluetoothdevice.connectgatt() a promise that resolves to an instance of bluetoothgatt
remoteserver. specifications specification status comment web bluetooththe definition of 'bluetoothdevice' in that specification. draft initial definition. ...
BroadcastChannel: message event - Web APIs
ere are two "receiver" iframes that listen to the broadcast message and write the result into a <div> element. ...
...<label for="message">type a message to broadcast:</label><br/> <textarea id="message" name="message" rows="1" cols="40">hello</textarea> <button id="broadcast-message" type="button">broadcast message</button> body { border: 1px solid black; padding: .5
rem; height: 150px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1
rem; } textarea { padding: .2
rem; } label, br { margin: .5
rem 0; } button { vertical-align: top; height: 1.5
rem; } const channel = new broadcastchannel('example-channel'); const messagecontrol = document.queryselector('#message'); const broadcastmessagebutton = document.queryselector('#broadcast-message'); broadcastmessagebutton.addeventlistener('click', () => { channel.post...
...= new broadcastchannel('example-channel'); const messagecontrol = document.queryselector('#message'); const broadcastmessagebutton = document.queryselector('#broadcast-message'); broadcastmessagebutton.addeventlistener('click', () => { channel.postmessage(messagecontrol.value); }) receiver 1 <h1>receiver 1</h1> <div id="received"></div> body { border: 1px solid black; padding: .5
rem; height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1
rem; } const channel = new broadcastchannel('example-channel'); channel.addeventlistener('message', (event) => { received.textcontent = event.data; }); receiver 2 <h1>receiver 2</h1> <div id="received"></div> body { border: 1px solid black; padding: .
... height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1
rem; } const channel = new broadcastchannel('example-channel'); channel.addeventlistener('message', (event) => { received.textcontent = event.data; }); receiver 2 <h1>receiver 2</h1> <div id="received"></div> body { border: 1px solid black; padding: .5
rem; height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1
rem; } const channel = new broadcastchannel('example-channel'); channel.addeventlistener('message', (event) => { received.textcontent = event.data; }); result specifications specification status html living standard living standar...
Content Index API - Web APIs
h allows developers to add urls and metadata of already cached pages, under the scope of the current service worker. the browser can then use these entries to display offline reading to a user. as a developer you can also display these entries within your application. indexed entries do not automatically expire. it's good practice to present an interface for clearing out entries, or periodically
remove older entries. the api supports indexing urls corresponding to html documents. a url for a cached media file, for example, can't be indexed directly. instead, you need to provide a url for a page that displays media, and which works offline. interfaces contentindex the contentindex interface provides functionality to register content available offline. contentindexevent the c...
...g additions to the serviceworker have been specified in the content index api spec to provide an entry point for using content indexing. serviceworkerregistration.index read only returns a reference to the contentindex interface for indexing cached pages. serviceworkerglobalscope.oncontentdelete an event handler fired whenever a contentdelete event occurs. this happens when content is
removed by the user agent. examples all the following examples assume a service worker has been registered. for more information see the service worker api. feature detection and interface access here we get a reference to the serviceworkerregistration, then check for the index property, which gives us access to the content index interface. // reference registration const registration = await n...
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the scope of the service ...
... index await registration.index.delete(article.id); } all the above methods are available within the scope of the service worker. they are accessible from the workerglobalscope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); contentdelete event when an item is
removed from the user agent interface, a contentdelete event is received by the service worker. self.addeventlistener('contentdelete', (event) => { console.log(event.id); // logs content index id, which can then be used to determine what content to delete from your cache }); the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user in...
DOMTokenList.toggle() - Web APIs
return value a boolean indicating whether token is in the list after the call. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. ...
... return value a boolean indicating whether token is in the list after the call. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. ...
...if token doesn't exist it's added and the function returns true. syntax tokenlist.toggle(token [, force]); parameters token a domstring representing the token you want to toggle. force optional a boolean that, if included, turns the toggle into a one way-only operation. if set to false, then token will only be
removed, but not added. if set to true, then token will only be added, but not
removed. return value a boolean indicating whether token is in the list after the call. examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then replace a token in the list, and write the list into the <span>'s node.textcontent. first, the html: <span class="a b">classlist is 'a b'</span> now the javascript: ...
... into the <span>'s node.textcontent. first, the html: <span class="a b">classlist is 'a b'</span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; span.addeventlistener('click', function() { let result = classes.toggle("c"); if (result) { span.textcontent = `'c' added; classlist is now "${classes}".`; } else { span.textcontent = `'c'
removed; classlist is now "${classes}".`; } }) the output looks like this: specifications specification status comment domthe definition of 'toggle()' in that specification. living standard initial definition ...
DataTransfer - Web APIs
cancelled read only this property applies only to the dragend event, and is true if the user canceled the drag operation by pressing escape. it will be false in all other cases, including if the drag failed for any other reason, for instance due to a drop over an invalid location. deprecated properties datatransfer.mozitemcount read only gives the number of items in the drag operation.
removed in firefox 71. methods standard methods datatransfer.cleardata()
remove the data associated with a given type. the type argument is optional. if the type is empty or not specified, the data associated with all types is
removed. if data for the specified type does not exist, or the data transfer contains no data, this method will have no effect. datatransfer.getdata() retrieves the da...
...at. if data for the type already exists, the existing data is replaced in the same position. datatransfer.setdragimage() set the image to be used for dragging if a custom one is desired. gecko methods note: all of the methods in this section are gecko-specific. datatransfer.addelement() sets the drag source to the given element. deprecated methods datatransfer.mozcleardataat()
removes the data associated with the given format for an item at the specified index. the index is in the range from zero to the number of items minus one.
removed in firefox 71. datatransfer.mozgetdataat() retrieves the data associated with the given format for an item at the specified index, or null if it does not exist. the index should be in the range from zero to the number of items minus on...
...s the data associated with the given format for an item at the specified index. the index is in the range from zero to the number of items minus one.
removed in firefox 71. datatransfer.mozgetdataat() retrieves the data associated with the given format for an item at the specified index, or null if it does not exist. the index should be in the range from zero to the number of items minus one.
removed in firefox 71. datatransfer.mozsetdataat() a data transfer may store multiple items, each at a given zero-based index. mozsetdataat() may only be called with an index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is inc
remented by one.
removed in firefox 71. datatransfer.moztype...
... examples every method and property listed in this document has its own reference page and each reference page either directly includes an example of the interface or has a link to an example. ...
Document.execCommand() - Web APIs
, and have evolved over time. check the compatibility table to determine if you can use it in your case. createlink creates an hyperlink from the selection, but only if there is a selection. requires a uri string as a value argument for the hyperlink's href. the uri must contain at least a single character, which may be whitespace. (internet explorer will create a link with a null value.) cut
removes the current selection and copies it to the clipboard. when this behavior is enabled varies between browsers, and its conditions have evolved over time. check the compatibility table for usage details. decreasefontsize adds a <small> tag around the selection or at the insertion point. (not supported by internet explorer.) defaultparagraphseparator changes the paragraph separator used when ...
...e inserts a <hr> element at the insertion point, or replaces the selection with it. inserthtml inserts an html string at the insertion point (deletes selection). requires a valid html string as a value argument. (not supported by internet explorer.) insertimage inserts an image at the insertion point (deletes selection). requires a url string for the image's src as a value argument. the requi
rements for this string are the same as createlink. insertorderedlist creates a numbered ordered list for the selection or at the insertion point. insertunorderedlist creates a bulleted unordered list for the selection or at the insertion point. insertparagraph inserts a paragraph around the selection or the current line. (internet explorer inserts a paragraph at the insertion point and deletes...
...or insertion point. justifyleft justifies the selection or insertion point to the left. justifyright right-justifies the selection or the insertion point. outdent outdents the line containing the selection or insertion point. paste pastes the clipboard contents at the insertion point (replaces current selection). disabled for web content. see [1]. redo redoes the previous undo command.
removeformat
removes all formatting from the current selection. selectall selects all of the content of the editable region. strikethrough toggles strikethrough on/off for the selection or at the insertion point. subscript toggles subscript on/off for the selection or at the insertion point. superscript toggles superscript on/off for the selection or at the insertion point. underline toggl...
...e region. strikethrough toggles strikethrough on/off for the selection or at the insertion point. subscript toggles subscript on/off for the selection or at the insertion point. superscript toggles superscript on/off for the selection or at the insertion point. underline toggles underline on/off for the selection or at the insertion point. undo undoes the last executed command. unlink
removes the anchor element from a selected hyperlink. usecss toggles the use of html tags or css for the generated markup. requires a boolean true/false as a value argument. note: this argument is logically backwards (i.e. use false to use css, true to use html) and unsupported by internet explorer. this has been deprecated in favor of stylewithcss. stylewithcss replaces the usecss command. tr...
Document.requestStorageAccess() - Web APIs
er has. examples: allow lists, block lists, on-device classification, user settings, anti-clickjacking heuristics, or prompting the user for explicit permission. reject if some rule is not fulfilled. grant the document access to cookies and other site storage and store that fact for the purposes of future calls to document.hasstorageaccess() and requeststorageaccess(). assuming all of the requi
rements above are satisfied, firefox will automatically grant storage access to the requesting origin on up to a threshold number of first-party origins in the current session for the duration of user’s session, up to a maximum of 24 hours. after the requesting origin has exceeded the maximum allowable number of storage access grants, any future call to requeststorageaccess() during the same browsi...
...nd bar.example.com will only count as a single exception against the limit. at the time of a requeststorageaccess() call, if the requesting origin has storage access to... ...fewer origins than the maximum: the user is not prompted. the origin is given an ephemeral storage access grant for the current top-level origin. the number of origins the requesting origin has storage access to is inc
remented by one. note that this number is also inc
remented when automatic access grants are given through our compatibility heuristics. the ephemeral storage access grant is: invalidated at the end of the browser session. not persisted to disk (e.g. will not persist if the browser crashes). reset after 24 hours in the case of a long-running browser session. ...equal or ...
...any site” the request is resolved. if the user clicks “don’t allow”, the storage access request is rejected and the requesting origin can re-request once it receives another user interaction. if the user allows storage the requesting origin is given a persistent storage access grant on the current top-level origin. the number of origins the requesting origin has storage access to is inc
remented by one. the persistent storage access permission is: persisted to disk and will
remain valid in future browser sessions. reset after 30 days. when an ephemeral or persistent storage access grant expires, the number of origins the requesting origin has storage access to is dec
remented by one. note: if the requesting origin is not classified as a tracking origin, the access ...
...d, the resolve handler will run as if a user gesture is being processed, whether the promise was fulfilled or rejected: in the former case, code can then start to call apis that require user activation and things can move forward. in the latter case, code can run to inform the user of why the request failed and what they can do to continue (for example asking them to log in, if that is a requi
rement). examples document.requeststorageaccess().then( () => { console.log('access granted') }, () => { console.log('access denied') } ); specifications the api is currently only at the proposal stage — the standardization process has yet to begin. you can currently find specification details of the api at apple's introducing storage access api blog post, and the storage access api propos...
HTMLInputElement - Web APIs
ribute, indicating whether more than one value is possible (e.g., multiple files). files filelist array: returns the list of selected files. htmlinputelement.labels read only nodelist array: returns a list of <label> elements that are labels for this element. step string: returns / sets the element's step attribute, which works with min and max to limit the inc
rements at which a numeric or date-time value can be set. it can be the string any or a positive floating point number. if this is not set to any, the control accepts only values at multiples of the step value greater than the minimum. valueasdate date object: returns / sets the value of the element, interpreted as a date, or null if conversion is not possible. valueasnumber d...
...are none, off, characters, words, or sentences. inputmode provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents. htmlinputelement.align string: represents the alignment of the element. use css instead. htmlinputelement.usemap string: represents a client-side image map. methods blur()
removes focus from the input element; keystrokes will subsequently go nowhere. click() simulates a click on the input element. focus() focuses on the input element; keystrokes will subsequently go to this element. select() selects all the text in the input element, and focuses it so the user can subsequently replace all of its content. setselectionrange() ...
.... it returns true if the element is not a candidate for constraint validation, or if it satisfies its constraints. reportvalidity() runs the checkvalidity() method, and if it returns false (for an invalid input or no pattern attribute provided), then it reports to the user that the input is invalid in the same manner as if you submitted a form. ...
...throws an invalid_state_err exception: if the method is not applicable to for the current type value., if the element has no step value, if the value cannot be converted to a number, if the resulting value is above the max or below the min. ...
IDBDatabaseException - Web APIs
in the indexeddb api, an idbdatabaseexception object represents exception conditions that can be encountered while performing database operations. attributes attribute type description code unsigned short the most appropriate error code for the condition. message domstring error message describing the exception raised. constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. ...
...err 8 a request was aborted, for example, through a call to idbtransaction.abort. constraint_err 4 a mutation operation in the transaction failed because a constraint was not satisfied. for example, an object, such as an object store or index, already exists and a request attempted to create a new one. ...
...
rements. non_transient_err 2 an operation was not allowed on an object. unless the cause of the error is corrected, retrying the same operation would result in failure. not_allowed_err 6 an operation was called on an object where it is not allowed or at a time when it is not allowed. it also occurs if a request is made on a source object that has been deleted or
removed. more specific variants of this error includes: transaction_inactive_err and read_only_err. not_found_err 3 the operation failed because the requested database object could not be found; for example, an object store did not exist but was being opened. ...
... read_only_err 9 a mutation operation was attempted in a read_only transaction. timeout_err 10 a lock for the transaction could not be obtained in a reasonable time. ...
Basic concepts - Web APIs
make to the database happen within transactions. like most web storage solutions, indexeddb follows a same-origin policy. so while you can access stored data within a domain, you cannot access data across different domains. indexeddb is an asynchronous api that can be used in most contexts, including web workers. it used to include a synchronous version also, for use in web workers, but this was
removed from the spec due to lack of interest by the web community. indexeddb used to have a competing spec, websql database, but the w3c deprecated it on november 18, 2010. while both indexeddb and websql are solutions for storage, they do not offer the same functionalities. websql database is a relational database access system, whereas indexeddb is an indexed table system. big concepts if you h...
...eration succeeded or failed. this sounds a little complicated at first, but there are sanity measures baked in. it's not that different from the way that xmlhttprequest works. indexeddb uses a lot of requests. requests are objects that receive the success or failure dom events that were mentioned previously. they have onsuccess and onerror properties, and you can call addeventlistener() and
removeeventlistener() on them. they also have readystate, result, and errorcode properties that tell you the status of the request. the result property is particularly magical, as it can be many different things, depending on how the request was generated (for example, an idbcursor instance, or the key for a value that you just inserted into the database). indexeddb uses dom events to notify yo...
...s by opening it with a greater version than the current one. this will start a versionchange transaction and fire an upgradeneeded event. the only place where the schema of the database can be updated is inside the handler of that event. note: this definition describes the most recent specification, which is only implemented in up-to-date browsers. old browsers implemented the now deprecated and
removed idbdatabase.setversion() method. database connection an operation created by opening a database. a given database can have multiple connections at the same time. transaction an atomic set of data-access and data-modification operations on a particular database. it is how you interact with the data in a database. in fact, any reading or changing of data in the database must happen in a t...
...ith the data in a database. in fact, any reading or changing of data in the database must happen in a transaction. a database connection can have several active transactions associated with it at a time, so long as the writing transactions do not have overlapping scopes. the scope of transactions, which is defined at creation, determines which object stores the transaction can interact with and
remains constant for the lifetime of the transaction. so, for example, if a database connection already has a writing transaction with a scope that just covers the flyingmonkey object store, you can start a second transaction with a scope of the unicorncentaur and unicornpegasus object stores. as for reading transactions, you can have several of them — even overlapping ones. transactions are expe...
Intersection Observer API - Web APIs
you, but it can be helpful to understand these steps in order to better grasp exactly when intersections will occur. the target element's bounding rectangle (that is, the smallest rectangle that fully encloses the bounding boxes of every component that makes up the element) is obtained by calling getboundingclientrect() on the target. this is the largest the intersection rectangle may be. the
remaining steps will
remove any portions that don't intersect. starting at the target's immediate parent block and moving outward, each containing block's clipping (if any) is applied to the intersection rectangle. a block's clipping is determined based on the intersection of the two blocks and the clipping mode (if any) specified by the overflow property. setting overflow to anything but visible ca...
...hich keeps a counter of how many times elements transition from not intersecting the root to intersecting by at least 75%. for a threshold value of 0.0 (default) the callback is called approximately upon transition of the boolean value of isintersecting. the snippet thus first checks that the transition is a positive one, then determines whether intersectionratio is above 75%, in which case it inc
rements the counter. intersectioncallback(entries) => { entries.foreach(entry => { if (entry.isintersecting) { let elem = entry.target; if (entry.intersectionratio >= 0.75) { intersectioncounter++; } } }); } interfaces intersectionobserver the primary interface for the intersection observer api. provides methods for creating and managing an observer which...
...the result: not only does the color get changed, but the transparency of the target element changes, too; as the intersection ratio goes down, the background color's alpha value goes down with it, resulting in an element that's more transparent. similarly, if the intersectionratio is going down,...
...oes down, the background color's alpha value goes down with it, resulting in an element that's more transparent. similarly, if the intersectionratio is going down, we use the string decreasingcolor and replace the word "ratio" in that with the intersectionratio before setting the target element's background-color. finally, in order to track whether the intersection ratio is going up or down, we
remember the current ratio in the variable prevratio. result below is the resulting content. scroll this page up and down and notice how the appearance of the box changes as you do so. there's an even more extensive example at timing element visibility with the intersection observer api. specifications specification status comment intersection observer working dr...
MediaDevices.getUserMedia() - Web APIs
isn't loaded securely, navigator.mediadevices will be undefined, and you cannot use getusermedia(). see security for more information on this and other security issues related to using getusermedia(). syntax var promise = navigator.mediadevices.getusermedia(constraints); parameters constraints a mediastreamconstraints object specifying the types of media to request, along with any requi
rements for each type. the constraints parameter is a mediastreamconstraints object with two members: video and audio, describing the media types requested. either or both must be specified. if the browser cannot find all media tracks with the specified types that meet the constraints given, then the returned promise is rejected with notfounderror. the following requests both audio and video with...
...the constraints parameter is a mediastreamconstraints object with two members: video and audio, describing the media types requested. either or both must be specified. if the browser cannot find all media tracks with the specified types that meet the constraints given, then the returned promise is rejected with notfounderror. the following requests both audio and video without any specific requi
rements: { audio: true, video: true } if true is specified for a media type, the resulting stream is required to have that type of track in it. if one cannot be included for any reason, the call to getusermedia() will result in an error. while information about a user's cameras and microphones are inaccessible for privacy reasons, an application can request the camera and microphone capabilitie...
...typeerror the list of constraints specified is empty, or has all constraints set to false. this can also happen if you try to call getusermedia() in an insecure context, since navigator.mediadevices is undefined in an insecure context. privacy and security as an api that may involve significant privacy concerns, getusermedia()'s specification lays out a wide array of privacy and security requi
rements that browsers are obligated to meet. getusermedia() is a powerful feature which can only be used in secure contexts; in insecure contexts, navigator.mediadevices is undefined, preventing access to getusermedia(). a secure context is, in short, a page loaded using https or the file:/// url scheme, or a page loaded from localhost. in addition, user permission is always required to access the ...
...required to access the user's audio and video inputs. only a window's top-level document context for a valid origin can even request permission to use getusermedia(), unless the top-level context expressly grants permission for a given <iframe> to do so using feature policy. otherwise, the user will never even be asked for permission to use the input devices. for additional details on these requi
rements and rules, how they are reflected in the context in which your code is running, and about how browsers manage user privacy and security issues, read on. user privacy as an api that may involve significant privacy concerns, getusermedia() is held by the specification to very specific requi
rements for user notification and permission management. first, getusermedia() must always get user perm...
MediaQueryList - Web APIs
list interface inherits methods from its parent interface, eventtarget. addlistener() adds to the mediaquerylist a callback which is invoked whenever the media query status—whether or not the document matches the media queries in the list—changes. this method exists primarily for backward compatibility; if possible, you should instead use addeventlistener() to watch for the change event. ...
...erits methods from its parent interface, eventtarget. addlistener() adds to the mediaquerylist a callback which is invoked whenever the media query status—whether or not the document matches the media queries in the list—changes. this method exists primarily for backward compatibility; if possible, you should instead use addeventlistener() to watch for the change event. ...
... events the following events are delivered to mediaquerylist objects: change sent to the mediaquerylist when the result of running the media query against the document changes. ...
... events the following events are delivered to mediaquerylist objects: change sent to the mediaquerylist when the result of running the media query against the document changes. ...
MediaStream - Web APIs
interface represents a stream of media content. a stream consists of several tracks such as video or audio tracks. each track is specified as an instance of mediastreamtrack.you can obtain a mediastream object either by using the constructor or by calling mediadevices.getusermedia(). some user agents subclass this interface to provide more precise information or functionality, like in canvascaptu
remediastream. constructor mediastream() creates and returns a new mediastream object. you can create an empty stream, a stream which is based upon an existing stream, or a stream that contains a specified list of tracks (specified as an array of mediastreamtrack objects). properties this interface inherits properties from its parent, eventtarget. mediastream.active read only a boolean v...
...ains a specified list of tracks (specified as an array of mediastreamtrack objects). properties this interface inherits properties from its parent, eventtarget. mediastream.active read only a boolean value that returns true if the mediastream is active, or false otherwise. mediastream.ended read only a boolean value set to true if the end of the stream has been reached. this has been
removed from the specification; you should instead check the value of mediastreamtrack.readystate to see if its value is ended for the track or tracks you want to ensure have finished playing. mediastream.id read only a domstring containing 36 characters denoting a universally unique identifier (uuid) for the object. event handlers mediastream.onaddtrack an eventhandler containing the act...
...s value is ended for the track or tracks you want to ensure have finished playing. mediastream.id read only a domstring containing 36 characters denoting a universally unique identifier (uuid) for the object. event handlers mediastream.onaddtrack an eventhandler containing the action to perform when an addtrack event is fired when a new mediastreamtrack object is added. mediastream.on
removetrack an eventhandler containing the action to perform when a
removetrack event is fired when a mediastreamtrack object is
removed from it. methods this interface inherits methods from its parent, eventtarget. mediastream.addtrack() stores a copy of the mediastreamtrack given as argument. if the track has already been added to the mediastream object, nothing happens. mediastream.clo...
...he order is not defined, and may not only vary from one browser to another, but also from one call to another. mediastream.getvideotracks() returns a list of the mediastreamtrack objects stored in the mediastream object that have their kind attribute set to "video". the order is not defined, and may not only vary from one browser to another, but also from one call to another. mediastream.
removetrack()
removes the mediastreamtrack given as argument. if the track is not part of the mediastream object, nothing happens. events addtrack fired when a new mediastreamtrack object is added. also available via the onaddtrack property.
removetrack fired when a mediastreamtrack object has been
removed. also available via the on
removetrack property. active fired when the mediastre...
PayerErrors.email - Web APIs
if the email address is valid, this property should be omitted from the payererrors object. ...
...if the email address is valid, this property should be omitted from the payererrors object. ...
...if the email address is valid, this property should be omitted from the payererrors object. ...
...email) found problems, this property should be set to a domstring that explains the validation problem and how to correct it. if the email address is valid, this property should be omitted from the payererrors object. example function validatepayment(response) { const correctionpromises let paymenterrors = {}; let payererrors = {}; // check payer details if (!validemail(response.paye
remail)) { payererrors.email = "please make sure you enter a valid email address." } if (!validname(response.payername)) { payererrors.email = "please enter a valid name, using only <appropriate characters>." } if (!validphone(response.payerphone)) { payererrors.phone = "please enter a valid phone number in the form ###-###-####." } // check everything else too... // } s...
Pointer Lock API - Web APIs
the pointer lock api (formerly called mouse lock api) provides input methods based on the movement of the mouse over time (i.e., deltas), not just the absolute position of the mouse cursor in the viewport. it gives you access to raw mouse movement, locks the target of mouse events to a single element, eliminates limits on how far mouse movement can go in a single direction, and
removes the cursor from view. it is ideal for first person 3d games, for example. more than that, the api is useful for any applications that require significant mouse input to control movements, rotate objects, and change entries, for example allowing users to control the viewing angle simply by moving the mouse around without any button clicking. the buttons are then freed up for other actions. other examples inclu...
...d re-enter the browser window. if that happens, movementx and movementy could be set to zero. simple example walkthrough we've written a simple pointer lock demo to show you how to use it to set up a simple control system (see source code). the demo looks like this: this demo uses javascript to draw a ball on top of an <canvas> element. when you click the canvas, pointer lock is then used to
remove the mouse pointer and allow you to move the ball directly using the mouse. let's see how this works. we set initial x and y positions on the canvas: var x = 50; var y = 50; the pointer lock methods are currently prefixed, so next we'll fork them for the different browser implementations. canvas.requestpointerlock = canvas.requestpointerlock || canvas.mozrequestp...
...ok pointer lock state change events for different browsers document.addeventlistener('pointerlockchange', lockchangealert, false); document.addeventlistener('mozpointerlockchange', lockchangealert, false); this function checks the pointlockelement property to see if it is our canvas. if so, it attached an event listener to handle the mouse movements with the updateposition() function. ...
...if so, it makes the ball wrap around to the opposite edge. ...
Multi-touch interaction - Web APIs
event and some will fire several pointermoves. // // this function sets the target element's border to "dashed" to visually // indicate the target received a move event. if (logevents) log("pointermove", ev); update_background(ev); ev.target.style.border = "dashed"; } pointer up the pointerup event is fired when a pointer is raised from the contact surface. ...
...te_background(ev); ev.target.style.border = "dashed"; } pointer up the pointerup event is fired when a pointer is raised from the contact surface. when this occurs, the event is
removed from the associated event cache. in this application, this handler is also used for pointercancel, pointerleave and pointerout events. function pointerup_handler(ev) { if (logevents) log(ev.type, ev); //
remove this touch point from the cache and reset the target's // background and border
remove_event(ev); update_background(ev); ev.target.style.border = "1px solid black"; } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and to clear the log. to prevent the browser's default touch behavior from overriding this application's po...
...vcache3. ...
...cache(ev) { // return the cache for this event's target element switch(ev.target.id) { case "target1": return evcache1; case "target2": return evcache2; case "target3": return evcache3; default: log("error with cache handling",ev); } } function push_event(ev) { // save this event in the target's cache var cache = get_cache(ev); cache.push(ev); } function
remove_event(ev) { //
remove this event from the target's cache var cache = get_cache(ev); for (var i = 0; i < cache.length; i++) { if (cache[i].pointerid == ev.pointerid) { cache.splice(i, 1); break; } } } update background color the background color of the touch areas will change as follows: no active touches is white; one active touch is yellow; two simultaneous touches is ping and three or more s...
Pinch zoom gestures - Web APIs
if (curdiff < prevdiff) { // the distance between the two pointers has decreased log("pinch moving in -> zoom out",ev); ev.target.style.background = "lightblue"; } } // cache the distance for the next move event prevdiff = curdiff; } } pointer up the pointerup event is fired when a pointer is raised from the contact surface. ...
...r up the pointerup event is fired when a pointer is raised from the contact surface. when this occurs, the event is
removed from the event cache and the target element's background color and border are restored to their original values. in this application, this handler is also used for pointercancel, pointerleave and pointerout events. ...
...hen this occurs, the event is
removed from the event cache and the target element's background color and border are restored to their original values. in this application, this handler is also used for pointercancel, pointerleave and pointerout events. function pointerup_handler(ev) { log(ev.type, ev); //
remove this pointer from the cache and reset the target's // background and border
remove_event(ev); ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; // if the number of pointers down is less than two then reset diff tracker if (evcache.length < 2) { prevdiff = -1; } } application ui the application uses a <div> element for the touch area and provides buttons to enable logging and to clear the log. to prevent the browser's default ...
...ng --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved in the event flow. cache management this function helps manage the global event caches evcache. function
remove_event(ev) { //
remove this event from the target's cache for (var i = 0; i < evcache.length; i++) { if (evcache[i].pointerid == ev.pointerid) { evcache.splice(i, 1); break; } } } event logging these functions are used to send event activity to the application's window (to support debugging and learning about the event flow). // log events flag var logevents = false; // ...
RTCConfiguration.bundlePolicy - Web APIs
mstring identifying the sdp bundling policy to use for the rtp streams used by the rtcpeerconnection. this string, which must be a member of the rtcbundlepolicy enumeration, has the following possible values: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for video, and one for the rtc data channel, if applicable. if the
remote peer isn't bundle-aware, the ice agent chooses one audio track and one video track and those two tracks are each assigned to the corresponding rtcdtlstransport. all other tracks are ignored by the connection. this is the default, and most compatible, policy. max-compat the ice agent intially creates one rtcdtlstransport for each media track and a separate one for the rtcdatachannel, if one i...
...dle-aware, the ice agent chooses one audio track and one video track and those two tracks are each assigned to the corresponding rtcdtlstransport. all other tracks are ignored by the connection. this is the default, and most compatible, policy. max-compat the ice agent intially creates one rtcdtlstransport for each media track and a separate one for the rtcdatachannel, if one is created. ...
...ignored by the connection. this is the default, and most compatible, policy. max-compat the ice agent intially creates one rtcdtlstransport for each media track and a separate one for the rtcdatachannel, if one is created. if the
remote endpoint can't handle bundling, each media track is negotiated on its own separate transport. this introduces bundling but will fall back to not bundling if the
remote peer can't handle it. max-bundle the ice agent starts by creating a single rtcdtlstransport to handle all of the connection's media. if the
remote peer isn't bundle-compatible, only one media track is negotiated and the rest are ignored. this maximizes bundling at the risk of losing tracks if the
remote peer can't do bundling. if any other value is specified, no configuration is specified ...
...r can't do bundling. if any other value is specified, no configuration is specified when creating the rtcpeerconnection, or if the bundlepolicy property isn't included in the rtcconfiguration object specified when creating the connection, balanced is assumed. description the bundlepolicy configuration option for an rtcpeerconnection specifies how the ice agent should handle negotiation if the
remote peer isn't compatible with the sdp bundle standard. if the
remote peer is bundle compatible, the policy is moot and all media tracks and the data channel are bundled onto a single rtcdtlstransport at the completion of the negotiation process. any other transports that were used during negotiation are then closed. in technical terms, an sdp bundle lets all of the media tracks (identified in th...
RTCIceCandidatePair - Web APIs
ctionary describes a pair of ice candidates which together comprise a description of a viable connection between two webrtc endpoints. it is used as the return value from rtcicetransport.getselectedcandidatepair() to identify the currently-selected candidate pair identified by the ice agent. properties local an rtcicecandidate describing the configuration of the local end of the connection.
remote the rtcicecandidate describing the configuration of the
remote end of the connection. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); ...
... the rtcicecandidate describing the configuration of the
remote end of the connection. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. ...
...figuration of the
remote end of the connection. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. ...
...rently selected candidate pair. var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); var
remoteproto = document.getelementbyid("
remote-protocol"); icetransport.onselectedcandidatepairchange = function(event) { var pair = icetransport.getselectedcandidatepair(); localprotocol.innertext = pair.local.protocol.touppercase();
remoteprotocol.innertext = pair.
remote.protocol.touppercase(); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidatepair' in that specification. candidate recommendation initial specification. ...
RTCIceCandidateStats.networkType - Web APIs
syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type. the string indicates the type of network connection that the described candidate would use to communicate with the other peer. ...
... syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type. the string indicates the type of network connection that the described candidate would use to communicate with the other peer. ...
...chnology used by the described connection. this may be because the browser isn't able to determine the network type for some reason or it may be intentionally getting obscured for security reasons, such as to avoid device fingerprinting. note: keep in mind that the specified value only reflects the initial connection between the local peer and the next hop along the network toward reaching the
remote peer. for example, if the networktype is wifi but the user is connected using a cellular hotspot, the connection will be bottlenecked by the underlying cellular network (and any other networks between the two peers). example this example sets up a periodic function using setinterval() that outputs statistics reports for candidates that use or would use a cellular data network to a log view.
... the two peers). example this example sets up a periodic function using setinterval() that outputs statistics reports for candidates that use or would use a cellular data network to a log view. ...
RTCPeerConnection.onicecandidate - Web APIs
the rtcpeerconnection property onicecandidate property is an eventhandler which specifies a function to be called when the icecandidate event occurs on an rtcpeerconnection instance. this happens whenever the local ice agent needs to deliver a message to the other peer through the signaling server. this lets the ice agent perform negotiation with the
remote peer without the browser itself needing to know any specifics about the technology being used for signaling; simply implement this method to use whatever messaging technology you choose to send the ice candidate to the
remote peer. syntax rtcpeerconnection.onicecandidate = eventhandler; value this should be set to a function which you provide that accepts as input an rtcpeerconnectioniceevent object representing the icecandidate even...
...when this happens, the connection's icegatheringstate has also changed to complete. ...
...when this happens, the connection's icegatheringstate has also changed to complete. ...
...you don't need to watch for this explicitly; instead, if you need to sense the end of signaling, you should watch for a icegatheringstatechange event indicating that the ice negotiation has transitioned to the complete state. example the example below, which is based on the code from the article signaling and video calling, sets up a handler for icecandidate events to send the candidates to the
remote peer. pc.onicecandidate = function(event) { if (event.candidate) { // send the candidate to the
remote peer } else { // all ice candidates have been sent } } notice that the end of negotiation is detected here when the event's candidate property is null. specifications specification status comment webrtc 1.0: real-time communication between browser...
RTCPeerConnection.signalingState - Web APIs
um specifies the possible values of rtcpeerconnection.signalingstate, which indicates where in the process of signaling the exchange of offer and answer the connection currently is. constant description "stable" there is no ongoing exchange of offer and answer underway. ...
...both the localdescription and
remotedescription are null; it may also mean that negotiation is complete and a connection has been established. "have-local-offer" the local peer has called rtcpeerconnection.setlocaldescription(), passing in sdp representing an offer (usually created by calling rtcpeerconnection.createoffer()), and the offer has been applied successfully. "have-
remote-offer" the
remote peer has created an offer and used the signaling server to deliver it to the local peer, which has set the offer as the
remote description by calling rtcpeerconnection.set
remotedescription(). ...
...r (usually created by calling rtcpeerconnection.createoffer()), and the offer has been applied successfully. "have-
remote-offer" the
remote peer has created an offer and used the signaling server to deliver it to the local peer, which has set the offer as the
remote description by calling rtcpeerconnection.set
remotedescription(). "have-local-pranswer" the offer sent by the
remote peer has been applied and an answer has been created (usually by calling rtcpeerconnection.createanswer()) and applied by calling rtcpeerconnection.setlocaldescription(). ...
... "closed" the connection is closed. ...
ResizeObserver.observe() - Web APIs
values are content-box (the default), and border-box. return value void. exceptions none. ...
...ions none. ...
... editor's ...
... editor's draft initial definition. ...
Selection - Web APIs
ngle point. selection.collapsetoend() collapses the selection to the end of the last range in the selection. selection.collapsetostart() collapses the selection to the start of the first range in the selection. selection.containsnode() indicates if a certain node is part of the selection. selection.deletefromdocument() deletes the selection's content from the document. ...
...ion to the end of the last range in the selection. selection.collapsetostart() collapses the selection to the start of the first range in the selection. selection.containsnode() indicates if a certain node is part of the selection. selection.deletefromdocument() deletes the selection's content from the document. selection.empty()
removes all ranges from the selection. ...
...the selection. selection.collapsetostart() collapses the selection to the start of the first range in the selection. selection.containsnode() indicates if a certain node is part of the selection. selection.deletefromdocument() deletes the selection's content from the document. selection.empty()
removes all ranges from the selection. this is an alias for
removeallranges() — see selection.
removeallranges() for more details. selection.extend() moves the focus of the selection to a specified point. selection.getrangeat() returns a range object representing one of the ranges currently selected. selection.modify() changes the current selection. selection.
removerange()
removes a range from the selection. selection.
removeallranges()
removes all ranges from the selection. selecti...
...t of a document. a range can contain entire nodes as well as portions of nodes (such as a portion of a text node). a user will normally only select a single range at a time, but it's possible for a user to select multiple ranges (e.g., by using the control key). a range can be retrieved from a selection as a range object. range objects can also be created via the dom and programmatically added or
removed from a selection. specifications specification status comment selection apithe definition of 'selection' in that specification. working draft the selection api specification is based on the html editing apis specification and focuses on the selection-related functionality. ...
Selection API - Web APIs
ed, you can use the window.getselection() or document.getselection() method, storing the return value — a selection object — in a variable for futher use. once your selection is in a variable, you perform a variety of operations on it, for example copying the selection to a text string using selection.tostring(), adding a range (as represented by a standard range object) to the selection (or
removing one) with selection.addrange()/selection.
removerange(), or changing the selection to be the entire contents of a dom node using selection.selectallchildren(). you can run code in response to the selection being changed, or a new selection being started, using the globaleventhandlers.onselectionchange and globaleventhandlers.onselectstart event handlers. selection api interfaces selec...
... opera full support yessafari full support yeswe...
... yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yes
removeallranges experimentalchrome full support yesedge full support 12firefox full support yesie full support yesopera full support yessafari full support ...
... opera full support 45safari no support nowebview andr...
SubtleCrypto.verify() - Web APIs
e; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsassa-pkcs1 .signature-value"); signaturevalue.classlist.
remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "rsassa-pkcs1-v1_5", publickey, signature, encoded ); signaturevalue.classlist.add(result ? "valid" : "invalid"); } rsa-pss this code uses a public key to verify a signature. see the complete code on github. /* fetch the contents of the "message" textbox, and en...
....value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsa-pss .signature-value"); signaturevalue.classlist.
remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( { name: "rsa-pss", saltlength: 32, }, publickey, signature, encoded ); signaturevalue.classlist.add(result ? "valid" : "invalid"); } ecdsa this code uses a public key to verify a signature. see the complete code on github. /* fetch the contents o...
...ox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".ecdsa .signature-value"); signaturevalue.classlist.
remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( { name: "ecdsa", hash: {name: "sha-384"}, }, publickey, signature, encoded ); signaturevalue.classlist.add(result ? "valid" : "invalid"); } hmac this code uses a secret key to verify a signature. see the complete code on github. /* fetch the cont...
...gebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(key) { const signaturevalue = document.queryselector(".hmac .signature-value"); signaturevalue.classlist.
remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "hmac", key, signature, encoded ); signaturevalue.classlist.add(result ? "valid" : "invalid"); } specifications specification status comment web cryptography apithe definition of 'subtlecrypto.verify()' in that specification. re...
Scissor animation - Web APIs
a) that is updated every frame (we set frame rate to roughly one every 17ms, or roughly 60fps – frames per second). in contrast, the color of the square (set with clearcolor) is only updated when a new square is created. this is a nice demonstration of webgl as a state machine. for each square, we set its color once, and then update only its position every frame. the clear color state of webgl
remains at the set value, until we change it again when a new square is created. <p>webgl animation by clearing the drawing buffer with solid color and applying scissor test.</p> <button id="animation-onoff"> press here to <strong>[verb goes here]</strong> the animation</button> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas...
...r : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); // variables to hold the webgl context, and the color and // position of animated squares. var gl, color = getrandomcolor(), position; function setupanimation (evt) { window.
removeeventlistener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); gl.clearcolor(color[0], color[1], color[2], 1.0); // unlike the browser window, vertical position in webgl is // measured from bottom to top. in here we set the initial // position of the square to be at the top left corner of the // drawing buffer. positio...
...rcolor(color[0], color[1], color[2], 1.0); // unlike the browser window, vertical position in webgl is // measured from bottom to top. in here we set the initial // position of the square to be at the top left corner of the // drawing buffer. ...
...var size = [60, 60], velocity = 3.0; function drawanimation () { gl.scissor(position[0], position[1], ...
WebGL model view projection - Web APIs
s homogeneous coordinate represents some point at infinity. this is a handy way to represent a ray shooting off from the origin in a specific direction. in addition to a ray, it could also be thought of as a representation of a directional vector. if this homogeneous coordinate is multiplied against a matrix with a translation then the translation is effectively stripped out. when numbers are ext
remely large (or ext
remely small) on computers they begin to become less and less precise because there are only so many ones and zeros that are used to represent them. the more operations that are done on larger numbers, the more and more errors accumulate into the result. when dividing by w, this can effectively increase the precision of very large numbers by operating on two potentially smaller, l...
...to chop away vertices in order to reduce the polygon count are the near clipping plane and the far clipping plane. in webxr, the near and far clipping planes are defined by specifying the distance from the lens to the closest point on a plane which is perpendicular to the viewing direction. anything closer to the lens than the near clipping plane or farther from it than the far clipping plane is
removed. this results in the viewing frustum, which looks like this: the set of objects to be rendered for each frame is essentially created by starting with the set of all objects in the scene. then any objects which are entirely outside the viewing frustum are
removed from the set. next, objects which partially extrude outside the viewing frustum are clipped by dropping any polygons which are en...
...artially extrude outside the viewing frustum are clipped by dropping any polygons which are entirely outside the frustum, and by clipping the polygons which cross outside the frustrum so that they no longer exit it. once that's been done, we have the largest set of polygons which are entirely within the viewing frustum. this list is usually further reduced using processes like back-face culling (
removing polygons whose back side is facing the camera) and occlusion culling using hidden-surface determination (
removing polygons which can't be seen because they're entirely blocked by polygons that are closer to the lens). perspective projection matrix up to this point, we've built up our own 3d rendering setup, step by step. however the current code as we've built it has some issues. for one, ...
... to define what distance is relevant to the scene so that precision isn't lost in converting the numbers. finally it's very helpful to have a fine-tuned control over what points get placed inside and outside of clip space. in the previous examples the corners of the cube occasionally get clipped. the perspective projection matrix is a type of projection matrix that accomplishes all of these requi
rements. the math also starts to get a bit more involved and won't be fully explained in these examples. in short, it combines dividing by w (as done with the previous examples) with some ingenious manipulations based on similar triangles. if you want to read a full explanation of the math behind it check out some of the following links: opengl projection matrix perspective projection trying to ...
Using WebRTC data channels - Web APIs
ose. since all webrtc components are required to use encryption, any data transmitted on an rtcdatachannel is automatically secured using datagram transport layer security (dtls). see security below for more information. creating a data channel the underlying data transport used by the rtcdatachannel can be created in one of two ways: let webrtc create the transport and announce it to the
remote peer for you (by causing it to receive a datachannel event). this is the easy way, and works for a wide variety of use cases, but may not be flexible enough for your needs. write your own code to negotiate the data transport and write your own code to signal to the other peer that it needs to connect to the new channel. let's look at each of these cases, starting with the first, which is th...
... is the most common. automatic negotiation often, you can allow the peer connection to handle negotiating the rtcdatachannel connection for you. to do this, simply call createdatachannel() without specifying a value for the negotiated property, or specifying the property with a value of false. this will automatically trigger the rtcpeerconnection to handle the negotiations for you, causing the
remote peer to create a data channel and linking the two together across the network. the rtcdatachannel object is returned immediately by createdatachannel(); you can tell when the connection has been made successfully by watching for the open event to be sent to the rtcdatachannel. let datachannel = pc.createdatachannel("myapp channel"); datachannel.addeventlistener("open", (event) => { begint...
...annel connection, you need to first create a new rtcdatachannel object using the createdatachannel() method on the rtcpeerconnection, specifying in the options a negotiated property set to true. this signals to the peer connection to not attempt to negotiate the channel on your behalf. then negotiate the connection out-of-band, using a web server or other means. ...
...s. this process should signal to the
remote peer that it should create its own rtcdatachannel with the negotiated property also set to true, using the same id. this will link the two objects across the rtcpeerconnection. let datachannel = pc.createdatachannel("myapp channel", { negotiated: true }); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); request
remotechannel(datachannel.id); in this code snippet, the channel is created with negotiated set to true, then a function called request
remotechannel() is used to trigger negotiation, to create a
remote channel with the same id as the local channel. doing this lets you create data channels with each peer using different properties, and to create channels declaratively by simply using the same value ...
Geometry and reference spaces in WebXR - Web APIs
he value of the y axis is 0 at floor level. if that floor level isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over ext
remely long distances from their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically...
... the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace the
remainder of this guide explores how to select the right reference space for your app's needs. defining spatial relationships with reference spaces there are a number of commonly used ways to reference the positions and orientations of objects relative to their environment, as well as to constrain the environment itself. to that end, webxr defines a set of standard spaces, called reference spaces, ...
...ntation of the player's avatar, then create a new reference space to represent the avatar's point of view at the new position using the xrreferencespace method getoffsetreferencespace(). this comes in especially handy when implementing support for using non-xr devices such as keyboards or mice to move the player's avatar through the world. with the newly-created reference space, the avatar can
remain at the same coordinates yet appear in the world to be located at (and be see the world from the perspective of) its new location. for a more detailed look at how to use reference spaces to manage the player's viewpoint, see the article in the case of our game avatar example, it's rare for an avatar (or any other moving creature or machine) to be a simple blob sliding around the world. they us...
...paces. using these, you can ensure before your code even runs that you have access to a webxr session that can support the reference space type you require or prefer. note: at this time, the reference space to use or to prefer is the only option available when creating an xrsession. in the future, it's likely that more options will become available. <<<--- insert table of reference space requi
rements here --->>> positioning and orienting objects all spatial (position, orientation, and movement) information exchanged between your app and the webxr api is expressed in relation to a specific space at the time the frame is being rendered. any further position and orientation management is between you and webgl, though you do make use of the origin offset from the reference space in order to...
Starting up and shutting down a WebXR session - Web APIs
26, 2020. it introduced support for augmented reality (ar) through the webxr ar module, which has is approaching a stable state. documentation for ar is forthcoming shortly here on mdn. other improvements include updating the emulator to rename the xr interface to xrsystem, introduce support for squeeze (grip) input sources, and add support for the xrinputsource property profiles. context requi
rements a webxr compatible environment starts with a securely-loaded document. your document needs to either have been loaded from the local drive (such as by using an url such as http://localhost/...), or using https when loading the page. the javascript code must, likewise, have been loaded securely. if the document wasn't loaded securely, you won't get very far. the navigator.xr property doesn't...
...// get the native xrsystem object const xr = getxr("yes"); // always returns an xrsystem from the polyfill const xr = getxr("if-needed"); // use the polyfill only if navigator.xr missing the returned xrsystem object can then be used according to the documentation provided here on mdn. the global variable webxrpolyfill is used only to retain a reference to the polyfill in order to ensure that it
remains available until you no longer need it. setting it to null signals that the polyfill can be garbage collected when no objects depending on it are using it anymore. of course, you can simplify this depending on your needs; since your app is probably not going to go back and forth much on whether or not to use the polyfill, you can simplify this to just the specific case you need. permissions ...
... prepare the session for use and begin your animations. the key things you need (or may need) to do in order to finish the configuration of your session include: add handlers for the events you need to watch. this most likely includes the end at a minimum, so you can detect when the session is over. if you use xr input controllers, watch the inputsourceschange event to detect the addition or
removal of xr input controllers, and the various select and squeeze action events. you may want to watch for the xrsystem event devicechange so you can be advised when the set of available immersive devices changes. obtain a webgl context for the canvas into which you intend to render your frames by calling the htmlcanvaselement method getcontext() on the target context. set up your webgl data and...
...ered the rendering stage of our application. to learn more about rendering, see the article rendering and the webxr frame animation callback. on operational details obviously, this was a just an example. you don't need a worlddata object to store everything; you can store the information you need to maintain any way you want to. you may need different information or have different specific requi
rements that cause you to do things differently, or in a different order. similarly, the specific methodology you use for loading models and other information and setting up your webgl data—textures, vertex buffers, shaders, and so on—will vary a great deal depending on your needs, what if any frameworks you're using, and the like. important session maintenance events over the course of your ...
Privileged features - Web APIs
when its parent window closes. a dependent window is minimized on the windows task bar only when its parent window is minimized. on windows platforms, a dependent window does not show on the task bar. a dependent window also stays in front of the parent window. dependent windows are not implemented on macos x, this option will be ignored. the dependent feature is currently under revision to be
removed (bug 214867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method. chrome if on, the page is loaded as window's only content, without any of the browser's interface elements. there will be no context menu defined by default and none of the standard keyboard shortcuts will work. the page is supposed to provide a user interface of its own, usually this feature...
... is loaded as window's only content, without any of the browser's interface elements. there will be no context menu defined by default and none of the standard keyboard shortcuts will work. the page is supposed to provide a user interface of its own, usually this feature is used to open xul documents (standard dialogs like the javascript console are opened this way). dialog the dialog feature
removes all icons (restore, minimize, maximize) from the window's titlebar, leaving only the close button. mozilla 1.2+ and netscape 7.1 will render the other menu system commands (in ff 1.0 and in ns 7.0x, the command system menu is not identified with the firefox/ns 7.0x icon on the left end of the titlebar: that's probably a bug. you can access the command system menu with a right-click on the tit...
...ersion. note: as of gecko 1.9, the internet explorer equivalent to this feature is the window.showmodaldialog() method. for compatibility reasons, it's now supported in firefox. note also that starting in gecko 2.0, you can use window.showmodaldialog() without universalbrowserwrite privileges. titlebar by default, all new secondary windows have a titlebar. if set to no or 0, this feature
removes the titlebar from the new secondary window. mozilla and firefox users can force new windows to always render the titlebar by setting dom.disable_window_open_feature.titlebar to true in about:config or in their user.js file. alwaysraised if on, the new window will always be displayed on top of other browser windows, regardless of whether it is active or not. alwayslowered if on, the new...
... in ns 6.x, the alwayslowered window has no minimize system command icon and no restore/maximize system command. alwaysontop if on, the new window will always be displayed on top of all other windows (browser windows and otherwise), regardless of whether it is active or not. this was added in firefox 66 (see bug 1519893). z-lock same as alwayslowered. close when set to no or 0, this feature
removes the system close command icon and system close menu item. it will only work for dialog windows (dialog feature set). close=no will override minimizable=yes. mozilla and firefox users can force new windows to always have a close button by setting dom.disable_window_open_feature.close to true in about:config or in their user.js file. ...
XRInputSourcesChangeEventInit.added - Web APIs
the xrinputsourceschangeeventinit property added specifies a list of input sources, each identified using an xrinputsource object, which the represented inputsourceschange event is to indicate are newly available for use. ...
... the xrinputsourceschangeeventinit property added specifies a list of input sources, each identified using an xrinputsource object, which the represented inputsourceschange event is to indicate are newly available for use. ...
... specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeeventinit.added' in that specification. working draft initial definition. ...
... specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeeventinit.added' in that specification. working draft initial definition. ...
XRSessionInit - Web APIs
ve sessions all immersive (both immersive-vr and immersive-ar) sessions support both the viewer and local reference spaces. because immersive sessions are required to support the local reference space, any request to open an immersive xrsession is required to obtain explicit or implicit user consent. inline sessions all inline webxr sessions support the viewer reference space. ...
...ons support both the viewer and local reference spaces. because immersive sessions are required to support the local reference space, any request to open an immersive xrsession is required to obtain explicit or implicit user consent. inline sessions all inline webxr sessions support the viewer reference space. security requi
rements each reference space or feature type has minimum safety requi
rements. ...
...required to support the local reference space, any request to open an immersive xrsession is required to obtain explicit or implicit user consent. inline sessions all inline webxr sessions support the viewer reference space. security requi
rements each reference space or feature type has minimum safety requi
rements. ...
...reference space, any request to open an immersive xrsession is required to obtain explicit or implicit user consent. inline sessions all inline webxr sessions support the viewer reference space. security requi
rements each reference space or feature type has minimum safety requi
rements. ...
ARIA live regions - Accessibility
-atomic=boolean is used to set whether or not the screen reader should always present the live region as a whole, even if only part of the region changes. the possible settings are: false or true. the default setting is false. aria-relevant: the aria-relevant=[list_of_changes] is used to set what types of changes are relevant to a live region. the possible settings are one or more of: additions,
removals, text, all. the default setting is: additions text. aria-labelledby: the aria-labelledby=[idlist] is used to associate a region with its labels, similar to aria-controls but instead associating labels to the region. and label identifiers are separated with a space. aria-describedby: the aria-describedby=[idlist] is used to associate a region with its descriptions, similar to aria-controls ...
...scribedby: the aria-describedby=[idlist] is used to associate a region with its descriptions, similar to aria-controls but instead associating descriptions to the region and description identifiers are separated with a space. advanced use case: clock as an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes. the clock is updated each minute, with the new
remaining time simply overwriting the current content. <div id="clock" role="timer" aria-live="polite"></div> /* basic javascript to update the clock */ setinterval(function() { var now = new date(); document.getelementbyid('clock').innerhtml = "time: " + now.gethours() + ":" + ("0"+now.getminutes()).substr(-2); }, 60000); the first time the function executes, the entirety of the string tha...
...es only the changed value of year. with aria-atomic="true", the screenreader announces "the set year is: changedvalue" advanced use case: roster a chat site would like to display a list of users currently logged in. display a list of users where a user's log-in and log-out status will be reflected dynamically (without a page reload). <ul id="roster" aria-live="polite" aria-relevant="additions
removals"> <!-- use javascript to add
remove users here--> </ul> breakdown of aria live properties: aria-live="polite" indicates that the screen reader should wait until the user is idle before presenting updates to the user. this is the most commonly used value, as interrupting the user with "assertive" might interrupt their flow. aria-atomic is not set (false by default) so that only the add...
...> <!-- use javascript to add
remove users here--> </ul> breakdown of aria live properties: aria-live="polite" indicates that the screen reader should wait until the user is idle before presenting updates to the user. this is the most commonly used value, as interrupting the user with "assertive" might interrupt their flow. aria-atomic is not set (false by default) so that only the added or
removed users should be spoken and not the entire roster each time. aria-relevant="additions
removals" ensures that both users added or
removed to the roster will be spoken. ...
ARIA: tab role - Accessibility
, ideally the active tab's associated tabpanel. → focuses and optionally activates the next tab in the tab list. if the current tab is the last tab in the tab list it activates the first tab. ← focuses and optionally activates the previous tab in the tab list. if the current tab is the first tab in the tab list it activates the last tab. delete when allowed
removes the currently selected tab from the tab list. required javascript features while there are ways to build tab-like functionality without javascript, there are no substitute combination of html and css only that will provide the same set of functionality that's required above for accessible tabs with content. example this example combines the role tab with tablist and elements with...
...riggering element's parent element, and its grandparent element. we then find all tabs with aria-selected=true inside the parent element and sets it to false, then sets the triggering element's aria-selected to true. after that, we find all tabpanel elements in the grandparent element, make them all hidden, and finally select the element whose id is equal to the triggering tab's aria-controls and
removes the hidden attribute, making it visible. window.addeventlistener("domcontentloaded", () => { const tabs = document.queryselectorall('[role="tab"]'); const tablist = document.queryselector('[role="tablist"]'); // add a click event handler to each tab tabs.foreach(tab => { tab.addeventlistener("click", changetabs); }); // enable arrow navigation between tabs in the tab list ...
...de === 37) { tabfocus--; // if we're at the start, move to the end if (tabfocus < 0) { tabfocus = tabs.length - 1; } } tabs[tabfocus].setattribute("tabindex", 0); tabs[tabfocus].focus(); } }); }); function changetabs(e) { const target = e.target; const parent = target.parentnode; const grandparent = parent.parentnode; //
remove all current selected tabs parent .queryselectorall('[aria-selected="true"]') .foreach(t => t.setattribute("aria-selected", false)); // set this tab as selected target.setattribute("aria-selected", true); // hide all tab panels grandparent .queryselectorall('[role="tabpanel"]') .foreach(p => p.setattribute("hidden", true)); // show the selected panel grandparent...
...for controlling tab key functionality for elements with the role tab, it is recommended to set all non-active elements to tabindex=-1, and to set the active element to tabindex=0. specifi...
:scope - CSS: Cascading Style Sheets
no support 20 — 32disabled disabled from version 20 until version 32 (e...
... no support 20 — 32disabled disabled from version 20 until version 32 (exclusive): this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true). ...
... full support 20disabled disabled from version 20: this...
... full support 20disabled disabled from version 20: this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true). ...
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
will need to use margins to achieve this. you can see from the live example below that in order to create gaps that do not also create a gap at the edges of the container, we need to use negative margins on the flex container itself. any border on the flex container is then moved to a second wrapper in order that the negative margin can pull the items up to that wrapper element. it is this requi
rement that the gap properties, once implemented, will solve for us. proper gaps only happen on the inside edges of items. collapsed items the flexbox specification details what should happen if a flex item is collapsed by setting visibility: collapse on an item. see the mdn documentation for the visibility property. the specification describes the behaviour as follows: “specifying visibility...
... should happen if a flex item is collapsed by setting visibility: collapse on an item. see the mdn documentation for the visibility property. the specification describes the behaviour as follows: “specifying visibility:collapse on a flex item causes it to become a collapsed flex item, producing an effect similar to visibility:collapse on a table-row or table-column: the collapsed flex item is
removed from rendering entirely, but leaves behind a "strut" that keeps the flex line’s cross-size stable. thus, if a flex container has only one flex line, dynamically collapsing or uncollapsing items may change the flex container’s main size, but is guaranteed to have no effect on its cross size and won’t cause the rest of the page’s layout to "wobble". flex line wrapping is re-done after c...
...nt to target flex items using javascript to show and hide content for example. the example in the specification demonstrates one such pattern. in the following live example i have a non-wrapped flex container. the third item has more content than the others yet is set to visibility: collapse and therefore the flex container is retaining a strut of the height required to display this item. if you
remove visibility: collapse from the css or change the value to visible, you will see the item disappear and the space redistribute between non-collapsed items; the height of the flex container should not change. note: use firefox for the below two examples as chrome and safari treat collapse as hidden. when dealing with multiple-line flex containers however you need to understand that the wrap...
...long enough. that top row then only becomes as tall as a single line of text. if this causes a problem for your layout it may require a rethinking of the structure, for example putting each row into a separate flex container in order that they can’t shift rows. the difference between visibility: hidden and display: none when you set an item to display: none in order to hide it, the item is
removed from the formatting structure of the page. what this means in practice is that counters ignore it, and things like transitions do not run. using visibility: hidden keeps the box in the formatting structure which is useful in that it still behaves as if it were part of the layout even though the user can’t see it. ...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
on the main axis with flex-start as this is the initial behaviour of flexbox, and we are aligning the item on the right by giving it a left margin of auto. you can move the class from one item to another to change where the split happens. also in this example we are using margins on the flex items to create a gap between items, and a negative margin on the container in order that the items still
remain flush with the right and left edges. until the gap properties from the box alignment specification are implemented in flexbox, we have to use margins in this way if we want to create a gutter between items. center item before flexbox, developers would joke that the hardest problem in web design was vertical centering. this has now been made straightforward using the alignment properties in...
... stick to the bottom of the card. flexbox can solve this. we make the card a flex container, with flex-direction: column. we then set the content area to flex: 1, which is the shorthand for flex: 1 1 0 — the item can grow and shrink from a flex basis of 0. as this is the only item that can grow, it takes up all available space in the flex container and pushes the footer to the bottom. if you
remove the flex property from the live example you will see how the footer then moves up to sit directly under the content. media objects the media object is a common pattern in web design — this pattern has an image or other element to one side and text to the right. ideally a media object should be able to be flipped — moving the image from left to right. we see this pattern everywhere, us...
... to the right. ideally a media object should be able to be flipped — moving the image from left to right. we see this pattern everywhere, used for comments, and anywhere we need to display images and descriptions. with flexbox we can allow the part of the media object containing the image to take its sizing information from the image, and then the body of the media object flexes to take up the
remaining space. in the live example below you can see our media object. i have used the alignment properties to align the items on the cross axis to flex-start, and then set the .content flex item to flex: 1. as with our column layout card pattern above, using flex: 1 means this part of the card can grow. some things that you might want to try in this live example relate to the different ways yo...
...ipping the media object to switch the display of the media object so that the image is on the right and the content is on the left we can use the flex-direction property set to row-reverse. the media object now displays the other way around. i have achieved this in the live example by adding a class of flipped alongside the existing .media class. this means you can see how the display changes by
removing that class from the html. form controls flexbox is particularly useful when it comes to styling form controls. forms have lots of markup and lots of small elements that we typically want to align with each other. a common pattern is to have an <input> element paired with a <button>, perhaps for a search form or where you simply want your visitor to enter an email address. flexbox makes ...
In Flow and Out of Flow - CSS: Cascading Style Sheets
apping content around the float. the box of our paragraph is still displaying according to the rules of normal flow. this is why, to make space around a floated item, you must add a margin to the item, in order to push the line boxes away from it. you cannot apply anything to the following in-flow content to achieve that. absolute positioning giving an item position: absolute or position: fixed
removes it from flow, and any space that it would have taken up is
removed. in the next example i have three paragraph elements, the second element has position absolute, with offset values of top: 30px and right: 30px. it has been
removed from document flow. using position: fixed also
removes the item from flow, however the offsets are based on the viewport rather than the containing block. when...
...based on the viewport rather than the containing block. when taking an item out of flow with positioning, you will need to manage the possibility of content overlapping. out of flow essentially means that the other elements on your page no longer know that element exists so will not respond to it. ...
...your page no longer know that element exists so will not respond to it. relative positioning and flow if you give an item relative positioning with position: relative it
remains in flow, however you are then able to use the offset values to push it around. the space that it would have been placed in normal flow is reserved however, as you can see in the example below. when you do anything to
remove, or shift an item from where it would be placed in normal flow, you can expect to need to do some managing of the content and the content around it to prevent overlaps. ...
... summary in this guide we have covered the ways to take an element out of flow in order to achieve some very specific types of positioning. ...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
back in the early days of web design, the way we constructed page layout was to use html tables, then fragment our design into the cells of those tables in order to create a layout. this had some advantages over the “css positioning” that came afterwards, in that we could take advantage of the alignment and full height columns offered by table display. the biggest downside however was that it tied our design to the mark-up, often creating accessibility issues as it did so. ...
...o the logical order too. the nice thing about using css grid layout is that you should be able to move an item in the source to match the logical order, without needing to make big changes to your layout. this is a huge improvement over a float-based layout for example, where document source matters a lot in order to get layouts at different breakpoints. however the onus is on us as developers to
remember to go back to our source and update it to maintain logical order. grid and the danger of markup flattening another issue to be aware of in css grid layout and to a lesser extent in css flexbox, is the temptation to flatten markup. as we have discovered, for an item to become a grid item it needs to be a direct child of the grid container. therefore, where you have a <ul> element inside a ...
...d by the ul to disappear from the dom. for more information about this interaction see the guide on the relationship of grid layout to other layout methods and the section on display: contents. given that interoperable support for display: contents is limited and we do not yet have subgrids, there is a definite temptation when developing a site using css grid layout to flatten out the markup, to
remove semantic elements in order to make it simpler to create a layout. an example would be where some content was semantically marked up as a list but you decide to use a set of <div> elements instead as then you can have the element to be a direct child of a container set to display: grid. be aware of this temptation and find ways to develop your design without stripping out the markup. starting o...
...as semantically marked up as a list but you decide to use a set of <div> elements instead as then you can have the element to be a direct child of a container set to display: grid. be aware of this temptation and find ways to develop your design without stripping out the markup. starting out with a well-structured document is a very good way to avoid the problem, as you will be aware that you are
removing semantic elements in order to make the layout work if you actually have to go into the document and do so! further reading there is not a lot of existing material regarding accessibility and css grid layout. many of the issues are similar to those raised regarding css flexbox, which also gives methods of reordering content with flex-direction and the order property. the concept of visual ...
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
d in safari, chrome, opera, firefox and edge. support for all the properties and values detailed in these guides is interoperable across browsers. this means that if you write some grid layout code in firefox, it should work in the same way in chrome. this is no longer an experimental specification, and you are safe to use it in production. the internet explorer and edge situation it should be
remembered that the original implementation of css grid layout happened in internet explorer 10. this early specification did not contain all of the properties and values that the up-to-date specification has. there are also substantial differences between what shipped in ie10 and the current specification, even where the properties and values appear the same. this early implementation is also the ve...
...ce the layout using grid. i can turn my <ul> into a grid container with three column tracks. however, the width i have assigned to the list items themselves still applies, and it now makes those items a third of the width of the track: if i reset the width to auto, then this will stop the float behavior happening for older browsers. i need to be able to define the width for older browsers, and
remove the width for grid supporting browsers. thanks to css feature queries i can do this, right in my css. feature queries will look very familiar if you have ever used a media query to create a responsive layout. rather than checking a viewport width, or some feature of the browser or device, we check for support of a css property and value pair using an @supports rule. inside the feature query, ...
...queries i can do this, right in my css. feature queries will look very familiar if you have ever used a media query to create a responsive layout. rather than checking a viewport width, or some feature of the browser or device, we check for support of a css property and value pair using an @supports rule. inside the feature query, we can then write any css we need to apply our modern layout, and
remove anything required for the older layout. @supports (display: grid) { .wrapper { /* do anything for grid supporting browsers here. */ } } feature queries have excellent browser support, and all of the browsers that support the updated grid specification support feature queries too. you can use them to deal with the issue we have with our enhanced: floated layout. i use an @su...
...e. */ } } feature queries have excellent browser support, and all of the browsers that support the updated grid specification support feature queries too. you can use them to deal with the issue we have with our enhanced: floated layout. i use an @supports rule to check for support of display: grid. i then do my grid code on the <ul>, set my width and min-height on the <li> to auto. i also
remove the margins and negative margins, and replace the spacing with the grid-gap property. this means i don’t get a final margin on the last row of boxes. the layout now works, even if there is more content in one of the cards, than the others: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; ...
CSS values and units - CSS: Cascading Style Sheets
ute url or a relative url. for example, if you wanted to include a background image, you might use either of the following. .box { background-image: url("images/my-background.png"); } .box { background-image: url("https://www.exammple.com/images/my-background.png"); } the parameter for url() can be either quoted or unquoted. if unquoted, it is parsed as a <url-token>, which has extra requi
rements including the escaping of certain characters. see <url> for more information. numeric data types <integer> <number> <dimension> <percentage> integers an integer is one or more decimal digits, 0 through 9, such as 1024 or -55. an integer may be preceded by a + or - symbol, with no space between the symbol and the integer. numbers a <number> represents a real number, which may or m...
...s font. cap cap height (the nominal height of capital letters) of the element's font. ch average character advance of a narrow glyph in the element’s font, as represented by the “0” (zero, u+0030) glyph. ic average character advance of a full width glyph in the element’s font, as represented by the “水” (cjk water ideograph, u+6c34) glyph.
rem font size of the root element. lh line height of the element. rlh line height of the root element. vw 1% of viewport's width. vh 1% of viewport's height. vi 1% of viewport's size in the root element's inline axis. vb 1% of viewport's size in the root element's block axis. vmin 1% of viewport's smaller dimension...
...it. percentages a <percentage> is a type that represents a fraction of some other value. percentage values are always relative to another quantity, for example a length. each property that allows percentages also defines the quantity to which the percentage refers. this quantity can be a value of another property of the same element, the value of a property of an ancestor element, a measu
rement of a containing block, or something else. as an example, if you specify the width of a box as a percentage, it refers to the percentage of the box's parent's computed width: .box { width: 50%; } mixing percentages and dimensions some properties accept a dimension that could be either one of two types, for example a <length> or a <percentage>. in this case the allowed value is detailed in...
...ts, white space is optional before and after the comma. specifications specification status comment css values and units module level 4 editor's draft adds the vi, vb, ic, cap, lh and rlh units. adds the min(), max() and clamp() functional notation adds toggle() css values and units module level 3 candidate recommendation adds calc(), ch,
rem, vw, vw, vmin, vmax, q css color module level 4 working draft adds commaless syntaxes for the rgb(), rgba(), hsl(), and hsla() functions. allows alpha values in rgb() and hsl(), turning rgba() and hsla() into (deprecated) aliases for them. adds color keyword rebeccapurple. adds 4- and 8-digit hex color values, where the last digit(s) represents the alpha value. adds hwb...
background-color - CSS: Cascading Style Sheets
#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...lpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...la()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
... css level 1the definition of 'background-color' in that specification. initial definition ...
float - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. a floating element is one where the computed value of float is not none. ...
...ts. formal definition initial valuenoneapplies toall elements, but has no effect if the value of display is none.inheritednocomputed valueas specifiedanimation typediscrete formal syntax left | right | none | inline-start | inline-end examples how floated elements are positioned as mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still
remaining part of it). it is shifted to the left, or right, until it touches the edge of its containing box, or another floated element. in this example, there are three colored squares. two are floated left, and one is floated right. note that the second "left" square is placed to the right of the first. additional squares would continue to stack to the right, until they filled the containing box, ...
...a floated element is at least as tall as it's tallest nested floated children. we gave the parent width: 100% and floated it to ensure it is tall enough to encompass it's floated children, and to make sure it takes up the width of the parent so we don't have to clear it's adjacent sibling. html <section> <div class="left">1</div> <div class="left">2</div> <div class="right">3</div> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. morbi tristique sapien ac erat tincidunt, sit amet dignissim lectus vulputate. donec id iaculis velit. aliquam vel malesuada erat. praesent non magna ac massa aliquet tincidunt vel in massa. phasellus feugiat est vel leo finibus congue.</p> </section> css section { border: 1px solid blue; width: 100%; float: left; } ...
...inibus congue.</p> </section> css section { border: 1px solid blue; width: 100%; float: left; } div { margin: 5px; width: 50px; height: 150px; } .left { float: left; background: pink; } .right { float: right; background: cyan; } result clearing floats sometimes you may want to force an item to move below any floated elements. for instance, you may want paragraphs to
remain adjacent to floats, but force headings to be on their own line. see clear for examples. specifications specification status comment css logical properties and values level 1the definition of 'float and clear' in that specification. editor's draft adds the values inline-start and inline-end. css level 2 (revision 1)the definition of 'float' in that s...
overflow-block - CSS: Cascading Style Sheets
ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:scroll</code> — alwa...
...ng elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:scroll</code> — always adds a scrollbar <div id="div2"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:visible</code> — dis...
...od tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:visible</code> — displays the text outside the box if needed <div id="div3"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:auto</code> — on mos...
...empor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-block:auto</code> — on most browser, equivalent to <code>scroll</code> <div id="div4"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> </ul> css #div1, #div2, #div3, #div4 { borde...
overflow-y - CSS: Cascading Style Sheets
ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:scroll</code> — always a...
...sicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:scroll</code> — always adds a scrollbar <div id="div2"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:visible</code> — display...
...iusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:visible</code> — displays the text outside the box if needed <div id="div3"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:auto</code> — on most br...
...od tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li><code>overflow-y:auto</code> — on most browser, equivalent to <code>scroll</code> <div id="div4"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> </ul> css #div1, #div2, #div3, #div4 { borde...
place-content - CSS: Cascading Style Sheets
eight/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'align-content'> <'justify-content'>? ...
...nctionality), so that the combined size exactly fills the alignment container formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'align-content'> <'justify-content'>? ...
...ctly fills the alignment container formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'align-content'> <'justify-content'>? ...
...r formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'align-content'> <'justify-content'>? ...
text-shadow - CSS: Cascading Style Sheets
a-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
... candidate recommendation the css property text-shadow was improperly defined in css2 and dropped in css2 (level 1). ...
... candidate recommendation the css property text-shadow was improperly defined in css2 and dropped in css2 (level 1). the css text module level 3 spec refined the syntax. ...
transition-duration - CSS: Cascading Style Sheets
happen, that is the switch between the two states will be instantaneous. a negative value for the time renders the declaration invalid. ...
...ransition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 1s <div class="parent"> <div class="box">lo
rem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top -webkit-transform color; -webkit-transition-duration:1s; -webkit-transition-timing-function: ease-in-out; ...
...ransition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 2s <div class="parent"> <div class="box">lo
rem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration:2s; -webkit-transition-timing-function: ease-i...
...ransition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 4s <div class="parent"> <div class="box">lo
rem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration:4s; -webkit-transition-timing-function: ease-i...
will-change - CSS: Cascading Style Sheets
-change to too many elements. the browser already tries as hard as it can to optimize everything. some of the stronger optimizations that are likely to be tied to will-change end up using a lot of a machine’s resources, and when overused like this can cause the page to slow down or consume a lot of resources. use sparingly. the normal behavior for optimizations that the browser make is to
remove the optimizations as soon as it can and revert back to normal. but adding will-change directly in a stylesheet implies that the targeted elements are always a few moments away from changing and the browser will keep the optimizations for much longer time than it would have otherwise. so it is a good practice to switch will-change on and off using script code before and after the change occurs.
... to normal. but adding will-change directly in a stylesheet implies that the targeted elements are always a few moments away from changing and the browser will keep the optimizations for much longer time than it would have otherwise. so it is a good practice to switch will-change on and off using script code before and after the change occurs. don't apply will-change to elements to perform p
remature optimization. if your page is performing well, don't add the will-change property to elements just to wring out a little more speed. will-change is intended to be used as something of a last resort, in order to try to deal with existing performance problems. it should not be used to anticipate performance problems. excessive use of will-change will result in excessive memory use and will cau...
...e-feature> = scroll-position | contents | <custom-ident> examples via script this is an example showing how to apply the will-change property through scripting, which is probably what you should be doing in most cases. ...
...d be doing in most cases. var el = document.getelementbyid('element'); // set will-change when the element is hovered el.addeventlistener('mouseenter', hintbrowser); el.addeventlistener('animationend',
removehint); function hintbrowser() { // the optimizable properties that are going to change // in the animation's keyframes block this.style.willchange = 'transform, opacity'; } function
removehint() { this.style.willchange = 'auto'; } specifications specification status comment css will change module level 1the definition of 'will-change' in that specification. candidate recommendation initial definition ...
Writing forward-compatible websites - Developer guides
ble in event handlers. don't assume that browsers with support for a given dom feature must also have some other, especially nonstandard, dom feature. or, conversely, that they don't have support for some other feature (e.g., don't assume that a browser that supports onload on script elements will never support onreadystatechange on them). as browsers converge behavior, they both add features and
remove them. they also fix bugs. all three of these have happened in the past and will happen again. so don't sniff for one feature or object and then assume that, because it exists or doesn't exist, some other feature or object must also exist or not exist. don't ua-sniff this is really a particularly common instance of assuming that one feature (the presence of a particular substring in the use...
...breaking the site for those you've sent down one or more of the alternative paths. testing test with all major engines test your code at least in firefox, chrome, safari, opera, and internet explorer. if you are following the advice given above so that you have a single code path for all current and unknown browsers, testing that this single code path works in all the major engines makes it ext
remely probable that your code won't break in the future. sometimes browsers implement a given feature slightly differently. if you have a single code path that works in all the top engines, it means that you are either using features where browser behavior has already converged or, if the behavior hasn't quite converged yet, your code works regardless of which engine's behavior standards turn out t...
...recent version of a browser you have tested, as in the case of the ua sniffing advice above. avoid depending on cutting-edge nonstandard features even if the feature is prefixed, using it could be dangerous: as the specification evolves the browser's prefixed implementation can likewise change to track the specification. and once the feature is standardized, the prefixed version is likely to be
removed. prefixed, non-standard features are provided by browser developers for you to experiment with and offer feedback on, and aren't meant to be deployed. if you choose to use them, be prepared to need to frequently update your site to keep up with changes. when using cutting-edge features (even standard ones) that are not universally implemented, make sure to test fallback paths make sure to ...
...ing to that attribute. here's an example that works in browsers without html5 support but breaks in a browser supporting html5: <form action="http://www.example.com"> <input type="submit" value="submit the form" </form> due to the missing > on the input tag. don't leave experiments that didn't work in your code if you try using a css property to do something you want, but it has no effect,
remove it. it might start doing something you don't expect in the future ...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
rt at 0 seconds, so setting currenttime to a time before that would fail. for example, if the audio's media timeline starts at 12 hours, setting currenttime to 3600 would be an attempt to set the current playback position well before the beginning of the media, and would fail. the getstartdate() method can be used to determine the beginning point of the media timeline's reference frame. disable
remoteplayback a boolean attribute used to disable the capability of
remote playback in devices that are attached using wired (hdmi, dvi, etc.) and wireless technologies (miracast, chromecast, dlna, airplay, etc). see this proposed specification for more information. in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which...
...oss browsers, you'll need to create custom controls; these can be marked up and styled in whatever way you want, and then javascript can be used along with the htmlmediaelement api to wire up their functionality. video player styling basics provides some useful styling techniques — it is written in the context of <video>, but much of it is equally applicable to <audio>. detecting addition and
removal of tracks you can detect when tracks are added to and
removed from an <audio> element using the addtrack and
removetrack events. however, these events aren't sent directly to the <audio> element itself. instead, they're sent to the track list object within the <audio> element's htmlmediaelement that corresponds to the type of track that was added to the element: htmlmediaelement.audiotrac...
...o the element. htmlmediaelement.texttracks add an addtrack event listener to this texttracklist to be notified when new text tracks are added to the element. note: even though it's an <audio> element, it still has video and text track lists, and can in fact be used to present video, although the use interface implications can be odd. ...
...deo and text track lists, and can in fact be used to present video, although the use interface implications can be odd. for example, to detect when audio tracks are added to or
removed from an <audio> element, you can use code like this: var elem = document.queryselector("audio"); elem.audiotracklist.onaddtrack = function(event) { trackeditor.addtrack(event.track); }; elem.audiotracklist.on
removetrack = function(event) { trackeditor.
removetrack(event.track); }; this code watches for audio tracks to be added to and
removed from the element, and calls a hypothetical function on a track editor to register and
remove the track from the editor's list of available tracks. you can also use addeventlistener() to listen for the addtrack and
removetrack events. examples basic usage the f...
<input type="month"> - HTML: Hypertext Markup Language
the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not r...
...he id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest year and month to accept as a valid input min the earliest year and month to accept as a valid input readonly a boolean which, if present, indicates that the input's value can't be edited step a stepping interval to use when inc
rementing and dec
rementing the value of the input field list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: user...
...pan:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to
remove it entirely. it's also possible for someone to simply bypass your html entirely and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data is submitted (or data which is too large, of the wrong type, and so forth). handling browser support as mentioned above, the major problem with using ...
... specifications specification status comments html living standardthe definition of '<input type="month">' in that specification. living standard ...
<input type="tel"> - HTML: Hypertext Markup Language
aracters wide the input field should be onscreen list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the telephone number field. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the telephone number field has no maximum length. this value must also be greater than or equa...
...hat the pattern is treated as a sequence of unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requi
rements are to match the pattern. you should also include other explanatory text nearby. see pattern validation below for details and an example. placeholder the placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory...
...ata on the web. when creating any kind of registration or e-commerce site, for example, you will likely need to ask the user for a telephone number, whether for business purposes or for emergency contact purposes. given how commonly-entered phone numbers are, it's unfortunate that a "one size fits all" solution for validating phone numbers is not practical. fortunately, you can consider the requi
rements of your own site and implement an appropriate level of validation yourself. see validation, below, for details. custom keyboards one of the main advantages of <input type="tel"> is that it causes mobile browsers to display a special keyboard for entering phone numbers. for example, here's what the keypads look like on a couple of devices. examples of custom keyboards on mobile devices. ...
... one-size-fits-all client-side validation solution for phone numbers. so what can we do? let's consider some options. important: html form validation is not a substitute for server-side scripts that ensure the entered data is in the proper format before it is allowed into the database. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to
remove it entirely. it's also possible for someone to simply bypass your html entirely and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data (or data which is too large, is of the wrong type, and so forth) is entered into your database. making telephone numbers required you can make it so t...
<input type="text"> - HTML: Hypertext Markup Language
ault spell checking configuration should be used list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the text input. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the text input has no maximum length. this value must also be greater than or equal to the value of minlen...
...hat the pattern is treated as a sequence of unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requi
rements are to match the pattern. you should also include other explanatory text nearby. see specifying a pattern for further details and an example. placeholder the placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explan...
...got better options available). basic example <form> <div> <label for="uname">choose a username: </label> <input type="text" id="uname" name="name"> </div> <div> <button>submit</button> </div> </form> this renders like so: when submitted, the data name/value pair sent to the server will be uname=chris (if "chris" was entered as the input value before submission). you must
remember to include name attribute on the <input> element, otherwise the text field's value won't be included with the submitted data. setting placeholders you can provide a useful placeholder inside your text input that can provide a hint as to what to enter by including using the placeholder attribute. look at the following example: <form> <div> <label for="uname">choose a username: </labe...
...ince a basic text input needs to be capable of accepting any arbitrary string), but there are some client-side validation options available, which we'll discuss below. note: html form validation is not a substitute for server-scripts that ensure the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to
remove it entirely. it's also possible for someone to simply bypass your html entirely and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data (or data which is too large, is of the wrong type, and so forth) is entered into your database. a note on styling there are useful pseudo-classes avai...
<input type="time"> - HTML: Hypertext Markup Language
ive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. appearance chrome and opera in chrome/opera the time control is simple, with slots to enter hours and minutes in 12 or 24-hour format depending on operating system locale, and up and down arrows to inc
rement and dec
rement the currently selected component. in some versions, an "x" button is provided to clear the control's value. 12-hour 24-hour chrome 83 in chrome 83, the ui controls have been updated with a new look and feel. the new element is functionally identical to the old one, but has a similar ui to edge. 24-hour firefox firefox's time control is very similar to chrome's, except ...
...ng min and max cross midnight section of this article. list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. max a string indicating the latest time to accept, specified in the same time value format as described above. if the specified string isn't a valid time, no maximum value is set. min a string specifying the earliest time to accept, given in the time value format described previously. if the value specified isn't a ...
... </label> <input id="appt-time" type="time" name="appt-time"> </form> controlling input size <input type="time"> doesn't support form sizing attributes such as size, since times are always about the same number of characters long. you'll have to resort to css for sizing needs. using the step attribute you can use the step attribute to vary the amount of time jumped whenever the time is inc
remented or dec
remented (for example, so the time moves by 10 minutes at a time when clicking the little arrow widgets). this property has some strange effects across browsers, so is not completely reliable. it takes an integer value that equates to the number of seconds you want to inc
rement by; the default value is 60 seconds, or one minute. if you specify a value of less than 60 seconds (1 min...
...s), the browser displays an error. try playing with the example now: here's a screenshot for those of you who aren't using a browser that supports time inputs: important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to
remove it entirely. it's also possible for someone to simply bypass your html entirely and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data is submitted (or data which is too large, of the wrong type, and so forth). handling browser support as mentioned above, safari and a few other, less ...
Using the application cache - HTML: Hypertext Markup Language
as of firefox 44+, when appcache is used to provide offline support for a page, a warning message displays in the console advising developers to use service workers instead (bug 1204581). introduction html5 provides an application caching mechanism that lets web applications run offline. this application cache (appcache) interface lists resources that browsers should cache to be available offline. applications that are cached load and work correctly offline, even if users press the refresh button. ...
...: c:\users\<username>\appdata\local\mozilla\firefox\profiles\<salt>.<profile name>\offlinecache mac/linux: /users/<username>/library/caches/firefox/profiles/<salt>.<profile name>/offlinecache in firefox the current status of the offline cache can be inspected on the about:cache page (under the "offline cache device" heading). the offline cache can be cleared for each site separately using the "
remove..." button in tools -> options -> advanced -> network -> offline data. prior to firefox 11, neither tools -> clear recent history nor tools -> options -> advanced -> network -> offline data -> clear now cleared the offline cache. this has been fixed. on linux, you can find the setting at edit > preferences > advanced > network > offline web content and user data see also clearing the dom st...
..., neither tools -> clear recent history nor tools -> options -> advanced -> network -> offline data -> clear now cleared the offline cache. this has been fixed. on linux, you can find the setting at edit > preferences > advanced > network > offline web content and user data see also clearing the dom storage data. application caches can also become obsolete. if an application's manifest file is
removed from the server, the browser
removes all application caches that use that manifest, and sends an "obsoleted" event to the applicationcache object. this sets the application cache's state to obsolete. the cache manifest file referencing a cache manifest file the manifest attribute in a web application can specify either the relative path of a cache manifest file or an absolute url. (absolut...
...t text files, and may optionally include a bom character. newlines may be represented by line feed (u+000a), carriage return (u+000d), or carriage return and line feed both. the first line of the cache manifest must consist of the string cache manifest (with a single u+0020 space between the two words), followed by zero or more space or tab characters. any other text on the line is ignored. the
remainder of the cache manifest must be comprised of zero or more of the following lines: blank line you may use blank lines comprised of zero or more space and tab characters. comment comments consist of zero or more tabs or spaces followed by a single # character, followed by zero or more characters of comment text. comments may only be used on their own lines (after the initial cache manifes...
Browser detection using the user agent - HTTP
e cases in which this is necessary. in these cases, you should first analyze your situation to be sure it's really necessary. can you prevent it by adding some non-semantic <div> or <span> elements? the difficulty of successfully using user agent detection is worth a few disruptions to the purity of your html. also, rethink your design: can you use progressive enhancement or fluid layouts to help
remove the need to do this? avoiding user agent detection if you want to avoid using user agent detection, you have options! feature detection feature detection is where you don't try to figure out which browser is rendering your page, but instead, you check to see if the specific feature you need is available. if it's not, you use a fallback. in those rare cases where behavior differs between...
... it assumed that all user agent strings that include the substring "chrome" are chrome. ua strings are notoriously misleading. it assumed that the lookbehind feature would always be available if the browser was chrome. the agent might be an older version of chrome, from before support was added, or (because the feature was experimental at the time) it could be a later version of chrome that
removed it. most importantly, it assumed no other browsers would support the feature. support could have been added to other browsers at any time, but this code would have continued choosing the inferior path. problems like these can be avoided by testing for support of the feature itself instead: var islookbehindsupported = false; try { new regexp("(?<=)"); islookbehindsupported = t...
...ued choosing the inferior path. problems like these can be avoided by testing for support of the feature itself instead: var islookbehindsupported = false; try { new regexp("(?<=)"); islookbehindsupported = true; } catch (err) { // if the agent doesn't support lookbehinds, the attempted // creation of a regexp object using that syntax throws and // islookbehindsupported
remains false. } var splitupstring = islookbehindsupported ? function(str) { return (""+str).split(new regexp("(?<=[a-z])")); } : function(str) { return str.replace(/[a-z]/g,"z$1").split(/z(?=[a-z])/g); }; as the above code demonstrates, there is always a way to test browser support without user agent sniffing. there is never any reason to check the user agent string for this. lastly, t...
...]; function whenmediachanges(){mediaqueryupdated = true} var listentomediaquery = iswebkit ? function(mq, f) { if(/height|width/.test(mq.media)) mql.push([mq, f]); mq.addlistener(f), mq.addlistener(whenmediachanges); } : function(){}; var destroymediaquery = iswebkit ? ...
JavaScript data types and data structures - JavaScript
ice. javascript offers other means to represent a set of booleans (like an array of booleans, or an object with boolean values assigned to named properties). bit masking also tends to make the code more difficult to read, understand, and maintain. it may be necessary to use such techniques in very constrained environments, like when trying to cope with the limitations of local storage, or in ext
reme cases (such as when each bit over the network counts). this technique should only be considered when it is the last measure that can be taken to optimize size. bigint type the bigint type is a numeric primitive in javascript that can represent integers with arbitrary precision. with bigints, you can safely store and operate on large integers even beyond the safe integer limit for numbers. a b...
...e taken to optimize size. bigint type the bigint type is a numeric primitive in javascript that can represent integers with arbitrary precision. with bigints, you can safely store and operate on large integers even beyond the safe integer limit for numbers. a bigint is created by appending n to the end of an integer or by calling the constructor. ...
...tegers even beyond the safe integer limit for numbers. a bigint is created by appending n to the end of an integer or by calling the constructor. you can obtain the safest value that can be inc
remented with numbers by using the constant number.max_safe_integer. with the introduction of bigints, you can operate with numbers beyond the number.max_safe_integer. this example demonstrates, where inc
rementing the number.max_safe_integer returns the expected result: > const x = 2n ** 53n; 9007199254740992n > const y = x + 1n; 9007199254740993n you can use the operators +, *, -, **, and % with bigints—just like with numbers. a bigint is not strictly equal to a number, but it is loosely so. a bigint behaves like a number in cases where it is converted to boolean: if, ||, &&, boolean, !. bigi...
...symbols are called "atoms". for more details see symbol and the symbol object wrapper in javascript. objects in computer science, an object is a value in memory which is possibly referenced by an identifier. properties in javascript, objects can be seen as a collection of properties. with the object literal syntax, a limited set of properties are initialized; then properties can be added and
removed. property values can be values of any type, including other objects, which enables building complex data structures. properties are identified using key values. a key value is either a string or a symbol value. there are two types of object properties which have certain attributes: the data property and the accessor property. note: each property has corresponding attributes. attributes are...
Set - JavaScript
though nan !== nan). constructor set() creates a new set object. static properties get set[@@species] the constructor function that is used to create derived objects. instance properties set.prototype.size returns the number of values in the set object. instance methods set.prototype.add(value) appends value to the set object. returns the set object. set.prototype.clear()
removes all elements from the set object. set.prototype.delete(value)
removes the element associated to the value and returns the value that set.prototype.has(value) would have previously returned. set.prototype.has(value) will return false afterwards. set.prototype.has(value) returns a boolean asserting whether an element is present with the given value in the set object or not. iteration meth...
... b: 2} myset.add(o) myset.add({a: 1, b: 2}) // o is referencing a different object, so this is okay myset.has(1) // true myset.has(3) // false, since 3 has not been added to the set myset.has(5) // true myset.has(math.sqrt(25)) // true myset.has('some text'.tolowercase()) // true myset.has(o) // true myset.size // 5 myset.delete(5) //
removes 5 from the set myset.has(5) // false, 5 has been
removed myset.size // 4, since we just
removed one value console.log(myset) // logs set(4) [ 1, "some text", {…}, {…} ] in firefox // logs set(4) { 1, "some text", {…}, {…} } in chrome iterating sets // iterate over items in set // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2} for (le...
...erence(seta, setc) // => set [1, 2] relation with array objects let myarray = ['value1', 'value2', 'value3'] // use the regular set constructor to transform an array into a set let myset = new set(myarray) myset.has('value1') // returns true // use the spread operator to transform a set into an array. ...
...tion with array objects let myarray = ['value1', 'value2', 'value3'] // use the regular set constructor to transform an array into a set let myset = new set(myarray) myset.has('value1') // returns true // use the spread operator to transform a set into an array. ...
Strict mode - JavaScript
trict mode isn't just a subset: it intentionally has different semantics from normal code. browsers not supporting strict mode will run strict mode code with different behavior from browsers that do, so don't rely on strict mode without feature-testing for support for the relevant aspects of strict mode. strict mode code and non-strict mode code can coexist, so scripts can opt into strict mode inc
rementally. strict mode makes several changes to normal javascript semantics: eliminates some javascript silent errors by changing them to throw errors. fixes mistakes that make it difficult for javascript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode. prohibits some syntax likely to be defined in future version...
...n by changing the last instance. duplicate property names are a syntax error in strict mode: this is no longer the case in ecmascript 2015 (bug 1041128). 'use strict'; var o = { p: 1, p: 2 }; // !!! syntax error fifth, strict mode requires that function parameter names be unique. in normal code the last duplicated argument hides previous identically-named arguments. those previous arguments
remain available through arguments[i], so they're not completely inaccessible. still, this hiding makes little sense and is probably undesirable (it might hide a typo, for example), so in strict mode duplicate argument names are a syntax error: function sum(a, a, c) { // !!! syntax error 'use strict'; return a + a + c; // wrong if this code ran } sixth, a strict mode in ecmascript 5 forbids oc...
...variable uses strict mode simplifies how variable names map to particular variable definitions in the code. many compiler optimizations rely on the ability to say that variable x is stored in that location: this is critical to fully optimizing javascript code. javascript sometimes makes this basic mapping of name to variable definition in the code impossible to perform until runtime. strict mode
removes most cases where this happens, so the compiler can better optimize strict mode code. first, strict mode prohibits with. the problem with with is that any name inside the block might map either to a property of the object passed to it, or to a variable in surrounding (or even global) scope, at runtime: it's impossible to know which beforehand. strict mode makes with a syntax error, so there's...
... the result of eval. third, strict mode forbids deleting plain names. delete name in strict mode is a syntax error: 'use strict'; var x; delete x; // !!! syntax error eval('var y; delete y;'); // !!! syntax error making eval and arguments simpler strict mode makes arguments and eval less bizarrely magical. both involve a considerable amount of magical behavior in normal code: eval to add or
remove bindings and to change binding values, and arguments by its indexed properties aliasing named arguments. strict mode makes great strides toward treating eval and arguments as keywords, although full fixes will not come until a future edition of ecmascript. first, the names eval and arguments can't be bound or assigned in language syntax. all these attempts to do so are syntax errors: 'use st...
Critical rendering path - Web Performance
nd, at which point it constructs the css object model. with the dom and cssom complete, the browser builds the render tree, computing the styles for all the visible content. after the render tree is complete, layout occurs, defining the location and size of all the render tree elements. once complete, the page is rendered, or 'painted' on the screen. document object model dom construction is inc
remental. the html response turns into tokens which turns into nodes which turn into the dom tree. a single dom node starts with a starttag token and ends with an endtag token. nodes contain all relevant information about the html element. the information is described using tokens. nodes are connected into a dom tree based on token hierarchy. if another set of starttag and endtag tokens come between ...
...number of nodes, the longer the following events in the critical rendering path will take. measure! a few extra nodes won't make a difference, but divitis can lead to jank. css object model the dom contains all the content of the page. the cssom contains all the styles of the page; information on how to style that dom. cssom is similar to the dom, but different. while the dom construction is inc
remental, cssom is not. css is render blocking: the browser blocks page rendering until it receives and processes all of the css. css is render blocking because rules can be overwritten, so the content can't be rendered until the cssom is complete. css has its own set of rules for identifying valid tokens.
remember the c in css stands for 'cascade'. css rules cascade down. as the parser converts tok...
...ge rendering until it receives and processes all of the css. css is render blocking because rules can be overwritten, so the content can't be rendered until the cssom is complete. css has its own set of rules for identifying valid tokens.
remember the c in css stands for 'cascade'. css rules cascade down. as the parser converts tokens to nodes, with descendants of nodes inheriting styles. the inc
remental processing features don't apply to css like they do with html, because subsequent rules may override previous ones. the css object model gets built as the css is parsed, but can't be used to build the render tree until it is completely parsed because styles that are going to be overwritten with later parsing should not be rendered to the screen. in terms of selector performance, less specif...
...reen. onload, the entire screen is painted. after that, only impacted areas of the screen will be repainted, as browsers are optimized to repaint the minimum area required. paint time depends on what kind of updates are being applied to the render tree. while painting is a very fast process, and therefore likely not the most impactful place to focus on in improving performance, it is important to
remember to allow for both layout and re-paint times when measuring how long an animation frame may take. the styles applied to each node increase the paint time, but
removing style that increases the paint by 0.001ms may not give you the biggest bang for your optimization buck.
remember to measure first. then you can determine whether it should be an optimization priority. optimizing for crp impro...
Navigation and resource timings - Web Performance
both provide the same read-only properties, but navigation timing measures the main document's timings whereas the resource timing provides the times for all the assets or resources called in by that main document and the resources' requested resources. the general performance timings below have been deprecated in favor of the performance entry api, which provides for marking and measuring times along the navigation and resource loading process. ...
... domcontentloadedeventstart, domcontentloadedeventend, domcomplete, loadeventstart, and loadeventend. with the metrics above, and a little bit of math, we can calculate many important metrics like time to first byte, page load time, dns lookup, and whether the connection is secure. to help measure the time it takes to complete all the steps, the performance timing api provides read only measu
rements of navigation timings. to view and capture our app's timing we enter: let time = window.performance.timing we can then use the results to measure how well our app is performing. the order is: performance timings details navigationstart when the prompt for unload terminates on the previous document in the same browsing context. if there is no previous document...
...ut that doesn't mean javascript, css, or media assets aren't adding bloat. checking compression ratios is important but ensure to also check duration and the time between when the domcontentloaded event ended and when the dom is complete, as running javascript on the main thread for long periods of time can lead to a non-responsive user interface. request time the api doesn't provide every measu
rement you may desire. for example, how long did the request take? we can use measu
rements we do have, to get our answer. to measure the response time, subtract the request start time from the response start time. the request start is the moment immediately before the user agent starts requesting the resource from the server, or from relevant application caches or from local resources. the response ...
...n you are measuring, returning navigate, reload, back_forward or prerender. resource timing whereas navigation timing is for measuring the performance of the main page, generally the html file via which all the other assets are requested, resource timing measures timing for individual resources, the assets called in by the main page, and any assets that those resources request. many of the measu
rements are similar: there is a dns look up, tcp handshake and the secure connection start is done once per domain. the main thing to look at for each resource. see also performancenavigationtiming performanceresourcetiming, performancemark performancemeasure performancepainttiming ...
Progressive loading - Progressive web apps (PWAs)
same way the original images are, so it will take up the same space and not cause the layout to repaint as the images load. loading via javascript the app.js file processes the data-src attributes like so: let imagestoload = document.queryselectorall('img[data-src]'); const loadimages = (image) => { image.setattribute('src', image.getattribute('data-src')); image.onload = () => { image.
removeattribute('data-src'); }; }; the imagestoload variable contains references to all the images, while the loadimages function moves the path from data-src to src. when each image is actually loaded, we
remove its data-src attribute as it's not needed anymore. then we loop through each image and load it: imagestoload.foreach((img) => { loadimages(img); }); blur in css to make the whole pro...
... and load it: imagestoload.foreach((img) => { loadimages(img); }); blur in css to make the whole process more visually appealing, the placeholder is blurred in css. we render the images with a blur at the beginning, so a transition to the sharp one can be achieved: article img[data-src] { filter: blur(0.2em); } article img { filter: blur(0em); transition: filter 0.5s; } this will
remove the blur effect within half a second, which looks good enough for the "loading" effect. loading on demand the image loading mechanism discussed in the above section works ok — it loads the images after rendering the html structure, and applies a nice transition effect in the process. the problem is that it still loads all the images at once, even though the user will only see the first two...
...and react accordingly — when an image is visible, we load the correct image and stop observing it as we no longer need to observe it. let's reiterate our earlier mention of progressive enhancement — the code is written so that the app will work whether intersection observer is supported or not. if it's not, we just load the images using the more basic approach covered earlier. improvements
remember that there are many ways to optimize loading times, and this example is exploring only one of the approaches. you could try to make your apps more bulletproof by making them work without javascript — either using <noscript> to show the image with final src already assigned, or by wrapping <img> tags with <a> elements pointing at the target images, so the user can click and access them when...
...the initial html structure would be minimal, loading time even smaller, and we would have even greater performance benefits. conclusion less files to load initially, smaller files split into modules, use of placeholders, and loading more content on demand — this will help achieve faster initial load times, which brings benefits to the app creator and offers a smoother experience to the user.
remember about the progressive enhancement approach — offer a usable product no matter the device or platform, but be sure to enrich the experience to those using modern browsers. final thoughts that's all for this tutorial series — we went through the source code of the js13kpwa example app and learned about the use of progressive web apps features including an introduction, pwa structure, off...
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
#000; display: inline-block; } note that in the css, the mask is specified using a url to the id #mask-1, which is the id of the svg mask specified below it. everything else specifies details about the gradient mask itself. applying the svg effect to (x)html is accomplished by assigning the target class defined above to an element, like this: <p class="target" style="background:lime;"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </p> <p> lo
rem ipsum dolor sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. </p> the above example would be rendered with the ma...
...cing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. </p> the above example would be rendered with the mask applied to it. example: clipping this example demonstrates using svg to clip html content. notice that even the clickable areas for links are clipped. <p class="target" style="background:lime;"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </p> <p> lo
rem ipsum dolor sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. </p> <button onclick="toggleradius()">toggle radius</...
...ve: function toggleradius() { var circle = document.getelementbyid("circle"); circle.r.baseval.value = 0.40 - circle.r.baseval.value; } example: filtering this demonstrates applying a filter to html content using svg. it establishes several filters, which are applied with css to three elements in both the normal and mouse hover states. <p class="target" style="background: lime;"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </p> <pre class="target">lo
rem</pre> <p> lo
rem ipsum dolor sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. </p> any svg filter ...
...ver { filter:url(#f4); } pre.target { filter:url(#f2); } pre.target:hover { filter:url(#f3); } view this example live example: blurred text in order to blur text, webkit based browsers have a (prefixed) css filter called blur (see also css filter). you can achieve the same effect using svg filters. <p class="blur">time to clean my glasses</p> <svg height="0"> <defs> <filter id="wherea
remyglasses" x="0" y="0"> <fegaussianblur in="sourcegraphic" stddeviation="1"/> </filter> </defs> </svg> you can apply the svg and the css filter in the same class: .blur { filter: url(#wherea
remyglasses); } blurring is computation heavy, so ensure to use it sparingly, especially in elements that get scrolled or animated. example: text effects svg effects can also be used to add...
dx - SVG: Scalable Vector Graphics
-width: .5px; stroke-dasharray: 3px; } altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used. for <altglyph>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the
remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. value list of <length> default value none animatable yes fedropshadow for <fedropshadow>, dx defines the x offset of the droped shadow. the unit used to resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element. ...
...of the glyph, in the font metric system. value <number> default value 0 animatable yes text for <text>, if it contains a single value, dx defines a shift along the x-axis for all glyphs. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the
remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. value list of <length> default value none animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- lines materialized the position of the glyphs --> <line x1="0" x2="100%" y1="25%" y2="25...
...stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } tref warning: as of svg2 <tref> is deprecated and shouldn't be used. for <tref>, if it contains a single value, dx defines a shift along the x-axis for all glyphs. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the
remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value list of <length> default value none animatable yes tspan for <tspan>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph. if there are multiple values, dx defines a shift along the x-axis for each individual gl...
...alues are ignored. value list of <length> default value none animatable yes tspan for <tspan>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the
remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. value list of <length> default value none animatable yes specifications specification status comment filter effects module level 1the definition of 'dx' in that specification. working draft initial definition for <fedropshado...
dy - SVG: Scalable Vector Graphics
width: .5px; stroke-dasharray: 3px; } altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used. for <altglyph>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the
remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value list of <length> default value none animatable yes fedropshadow for <fedropshadow>, dy defines the y offset of the dropped shadow. the unit used to resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element. ...
...f the glyph, in the font metric system. value <number> default value 0 animatable yes text for <text>, if it contains a single value, dy defines a shift along the y-axis for all glyphs. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the
remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value list of <length> default value none animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 150 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal lines --> <line x1="0" x2="100%" y1="30" y2="30" /> <line x1="0" x2="100%"...
...stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } tref warning: as of svg2 <tref> is deprecated and shouldn't be used. for <tref>, if it contains a single value, dy defines a shift along the y-axis for all glyphs. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the
remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value list of <length> default value none animatable yes tspan for <tspan>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph. if there are multiple values, dy defines a shift along the y-axis for each individual gl...
...lues are ignored. value list of <length> default value none animatable yes tspan for <tspan>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the
remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value list of <length> default value none animatable yes specifications specification status comment filter effects module level 1the definition of 'dy' in that specification. working draft initial definition for <fedropsha...
Namespaces crash course - SVG: Scalable Vector Graphics
for svg elements this ...
...for svg elements this is 'http://www.w3.o...
...for svg elements this is 'http://www.w3.org/2000/svg'. however, note...
...for svg elements this is 'http://www.w3.org/2000/svg'. however, note carefully: the nam...
SVG fonts - SVG: Scalable Vector Graphics
t correctly, a font description technology was added to svg to provide this ability. it was not meant for compatibility with other formats like postscript or otf, but rather as a simple means of embedding glyph information into svg when rendered. svg fonts are currently supported only in safari and android browser. internet explorer hasn't considered implementing this, the functionality has been
removed from chrome 38 (and opera 25) and firefox has postponed its implementation indefinitely to concentrate on woff. other tools however like the adobe svg viewer plugin, batik and parts of inkscape support svg font embedding. the base for defining an svg font is the <font> element. defining a font there are some ingredients required for embedding a font in svg. let's show an example declaratio...
...an just use a simple font-family attribute to actually apply the font to some svg text: <font> <font-face font-family="super sans" /> <!-- and so on --> </font> <text font-family="super sans">my text uses super sans</text> however, you are free to combine several methods for great freedom of how and where to define the font. ...
...e font-family attribute to actually apply the font to some svg text: <font> <font-face font-family="super sans" /> <!-- and so on --> </font> <text font-family="super sans">my text uses super sans</text> however, you are free to combine several methods for great freedom of how and where to define the font. ...
...thods for great freedom of how and where to define the font. ...
Referer header: privacy and security concerns - Web security
ising a user's security. by the same logic, an image hosted on a third party side but embedded in your page could result in sensitive information being leaked to the third party. even if security is not compromised, the information may not be something the user wants shared. how can we fix this? much of this risk can be mitigated by sensible design of applications. a sensible application would
remove such risks by making password reset urls only usable for a single use, or when combined with a unique user token, and transmitting sensitive data in different ways. you should use post rather than get wherever possible, to avoid passing sensitive data to other locations via urls. you should always use https for your sites. this has many security advantages, including the fact that https site...
...e, to avoid passing sensitive data to other locations via urls. you should always use https for your sites. this has many security advantages, including the fact that https sites will never transmit referer information to non-https sites. this is becoming less useful in this context now that most of the web is using https, but it is still a worthy consideration. in addition, you should consider
removing any third party content (e.g. social networking widgets embedded in <iframe>) from secure areas of your website, like password reset pages, payment forms, login areas, etc. you can also mitigate such risks using: the referrer-policy header on your server to control what information is sent through the referer header. again, a directive of no-referrer would omit the referer header entirel...
...more information. the exit page technique. security-conscious server-side frameworks tend to have built in mitigations for such problems, for example: security in django (especially see cross site request forgery (csrf) protection). helmetjs referrer-policy — middleware for setting referrer-policy in node.js/express apps (see also helmetjs for more security provisions). ...
...ide frameworks tend to have built in mitigations for such problems, for example: security in django (especially see cross site request forgery (csrf) protection). helmetjs referrer-policy — middleware for setting referrer-policy in node.js/express apps (see also helmetjs for more security provisions). policy and requi
rements it would make sense to write a set of security and privacy requi
rements for your project team(s) that specify usage of such features to mitigate the associated risks. you should enlist the help of a web security expert to write these requi
rements, and consider both user needs and welfare, as well as other issues like policy and regulation enforced by legislation such as the eu general data protection regulation (gdpr). ...
Transport Layer Security - Web security
es tls for encryption, many people still refer to it as "ssl" out of habit. although tls can be used on top of any low-level transport protocol, the original goal of the protocol was to encrypt http traffic. http encrypted using tls is commonly referred to as https. tls-encrypted web traffic is by convention exchanged on port 443 by default, while unencrypted http uses port 80 by default. https
remains an important use case for tls. http over tls tls provides three primary services that help ensure the safety and security of data exchanged with it: authentication authentication lets each party to the communication verify that the other party is who they claim to be. encryption data is encrypted while being transmitted between the user agent and the server, in order to prevent it fro...
...ude custom settings, so be sure to review the generated configuration before using it; installing the configuration file without ensuring any references to domain names and the like are correct will result in a server that just doesn't work. tls 1.3 rfc 8446: tls 1.3 is a major revision to tls. tls 1.3 includes numerous changes that improve security and performance. the goals of tls 1.3 are:
remove unused and unsafe features of tls 1.2. include strong security analysis in the design. improve privacy by encrypting more of the protocol. reduce the time needed to complete a handshake. tls 1.3 changes much of the protocol fundamentals, but preserves almost all of the basic capabilities as previous versions of tls. for the web, tls 1.3 can be enabled without affecting compatibility with ...
...e. web servers that enable tls 1.3 might need to adjust configuration to allow tls 1.3 to operate successfully. tls 1.3 adds just one significant new use case. the 0-rtt handshake can provide significant performance gains for latency sensitive applications, like the web. enabling 0-rtt requires additional steps, both to ensure successful deployment and to manage the risks of replay attacks. the
removal of renegotiation in tls 1.3 might affect some web servers that rely on client authentication using certificates. some web servers use renegotiation to either ensure that client certificates are encrypted, or to request client certificates only when certain resources are requested. for the privacy of client certificates, the encryption of the tls 1.3 handshake ensures that client certificates ...
...ient certificates are encrypted; however this might require some software changes. reactive client authentication using certificates is supported by tls 1.3 but not widely implemented. alternative mechanisms are in the process of being developed, which will also support http/2. retiring old tls versions to help with working towards a more modern, more secure web, tls 1.0 and 1.1 support will be
removed from all major browsers in q1 2020. you'll need to make sure your web server supports tls 1.2 or 1.3 going forward. from version 74 onwards, firefox will return a secure connection failed error when connecting to servers using the older tls versions (bug 1606734). tls handshake timeout values if the tls handshake starts to become slow or unresponsive for some reason, the user's experience ...
port - Archive of obsolete content
}); in the main add-on code, to listen for "mymessage" sent from a a content script: // main.js worker.port.on("mymessage", function handlemymessage(mymessagepayload) { // handle the message }); once() often you'll want to receive a message just once, then stop listening. the port object offers a shortcut to do this: the once() method. this example rewrites the content script in the port.
removelistener() example so that it uses once(): // content-script.js function getfirstparagraph() { var paras = document.getelementsbytagname('p'); console.log(paras[0].textcontent); } self.port.once("get-first-para", getfirstparagraph);
removelistener() you can use port.on() to listen for messages. to stop listening for a particular message, use port.
removelistener(). this takes the same t...
...k" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para", label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script listens for "get-first-para". when it receives this message, the script logs the first paragraph of the document and then calls
removelistener() to stop listening. // content-script.js function getfirstparagraph() { var paras = document.getelementsbytagname('p'); console.log(paras[0].textcontent); self.port.
removelistener("get-first-para", getfirstparagraph); } self.port.on("get-first-para", getfirstparagraph); the result is that the paragraph is only logged the first time the button is clicked. due to bug 816272 t...
...to stop listening. // content-script.js function getfirstparagraph() { var paras = document.getelementsbytagname('p'); console.log(paras[0].textcontent); self.port.
removelistener("get-first-para", getfirstparagraph); } self.port.on("get-first-para", getfirstparagraph); the result is that the paragraph is only logged the first time the button is clicked. due to bug 816272 the page-mod's
removelistener() function does not prevent the listener from receiving messages that are already queued. this means that if "main.js" sends the message twice in successive lines, and the listener stops listening as soon as it receives the first message, then the listener will still receive the second message. json-serializable values the payload for a message can be any json-serializable value. whe...
XUL Migration Guide - Archive of obsolete content
a xul-based add-on will need to be reorganized to respect this distinction. the main reason for this design is security: it reduces the risk that a malicious web page will be able to access privileged apis. there's much more information on content scripts in the working with content scripts guide. using the supported apis the sdk provides a set of high level apis providin...
...amic manipulation of the dom directly access the tabbrowser object modifying the browser chrome this example uses the action button api, which is only available from firefox 29 onwards. the window/utils module gives you direct access to chrome windows, including the browser's chrome window. ...
...s to chrome windows, including the browser's chrome window. here's a really simple example add-on that modifies the browser chrome using window/utils: function
removeforwardbutton() { var window = require("sdk/window/utils").getmostrecentbrowserwindow(); var forward = window.document.getelementbyid('forward-button'); var parent = window.document.getelementbyid('urlbar-container'); parent.
removechild(forward); } require("sdk/ui/button/action").actionbutton({ id: "
remove-forward-button", label: "
remove forward button", icon: "./icon-16.png", onclick:
removeforwardbutton }); there are more useful examples of this technique in the jetpack wiki's collection of third party modules. accessing tabbrowser this example uses the action button api, which is only available from fire...
selection - Archive of obsolete content
html selections in the current web page. usage registering for selection notifications to be notified when the user makes a selection, register a listener for the "select" event. each listener will be called after a selection is made. function mylistener() { console.log("a selection has been made."); } var selection = require("sdk/selection"); selection.on('select', mylistener); // you can
remove listeners too. selection.
removelistener('select', mylistener); iterating over discontiguous selections discontiguous selections can be accessed by iterating over the selection module itself. each iteration yields a selection object from which text, html, and iscontiguous properties can be accessed. private windows if your add-on has not opted into private browsing, then you won't see any s...
...tion"); if (!selection.iscontiguous) { for (var subselection in selection) { console.log(subselection.html); } } surround html selections with delimiters: var selection = require("sdk/selection"); selection.on('select', function () { selection.html = "\\\" + selection.html + "///"; }); globals properties text gets or sets the current selection as plain text. setting the selection
removes all current selections, inserts the specified text at the location of the first selection, and selects the new text. getting the selection when there is no current selection returns null. setting the selection when there is no current selection throws an exception. getting the selection when iscontiguous is true returns the text of the first selection. html gets or sets the current selectio...
...rts the specified text at the location of the first selection, and selects the new text. getting the selection when there is no current selection returns null. setting the selection when there is no current selection throws an exception. getting the selection when iscontiguous is true returns the text of the first selection. html gets or sets the current selection as html. setting the selection
removes all current selections, inserts the specified text at the location of the first selection, and selects the new text. getting the selection when there is no current selection returns null. setting the selection when there is no current selection throws an exception. getting the selection when iscontiguous is true returns the text of the first selection. iscontiguous true if the current selec...
ui/button/action - Archive of obsolete content
ick option. you can also add, or change, the listener afterwards: var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: firstclick }); function firstclick(state) { console.log("you clicked '" + state.label + "'"); button.
removelistener("click", firstclick); button.on("click", subsequentclicks); } function subsequentclicks(state) { console.log("you clicked '" + state.label + "' again"); } the listener is passed a state object that contains all the button's properties. you can generate click events programmatically with the button's click() method. disabling buttons you can disable a button by setting its dis...
...{ console.log("button '" + state.label + "' was clicked"); } parameters event : string the event to listen for. action buttons only emit one type of event, "click". listener : function function that will be called on click. once() assign a listener to the first occurrence only of an event emitted by the button. the button only emits one type of event, click. the listener is automatically
removed after the first time the event is emitted. parameters event : string the event to listen for. action buttons only emit one type of event, "click". listener : function function that will be called on click.
removelistener()
removes an event listener. for example, this code is equivalent to once(): button.on("click", handleclick) function handleclick(state) { console.log("button '" +...
...tted. parameters event : string the event to listen for. action buttons only emit one type of event, "click". listener : function function that will be called on click.
removelistener()
removes an event listener. for example, this code is equivalent to once(): button.on("click", handleclick) function handleclick(state) { console.log("button '" + state.label + "' was clicked"); button.
removelistener("click", handleclick); } parameters event : string the event to listener is listening for. action buttons only emit one type of event, "click". listener : function the listener to
remove. destroy() destroy the button. after calling this function, the button will no longer appear in the ui, and accessing any of its properties or methods will throw an error. properties id the ...
ui/button/toggle - Archive of obsolete content
d, or change, the listener afterwards: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: firstclick, onchange: firstchange }); function firstclick(state) { console.log("you clicked '" + state.label + "'"); button.
removelistener("click", firstclick); button.on("click", subsequentclicks); } function subsequentclicks(state) { console.log("you clicked '" + state.label + "' again"); } function firstchange(state) { console.log("you changed '" + state.label + "'"); button.
removelistener("change", firstchange); button.on("change", subsequentchanges); } function subsequentchanges(state) { console.log("...
...lick) function handleclick(state) { console.log("button '" + state.label + "' was clicked"); } parameters event : string the event to listen for. toggle buttons emit two types of event, "click" and "change". listener : function function that will be called on the event. once() assign a listener to the first occurrence only of an event emitted by the button. the listener is automatically
removed after the first time the event is emitted. parameters event : string the event to listen for. toggle buttons emit two types of event, "click" and "change". listener : function function that will be called on the event.
removelistener()
removes an event listener. for example, this code is equivalent to once(): button.on("click", handleclick) function handleclick(state) { console.log...
...ters event : string the event to listen for. toggle buttons emit two types of event, "click" and "change". listener : function function that will be called on the event.
removelistener()
removes an event listener. for example, this code is equivalent to once(): button.on("click", handleclick) function handleclick(state) { console.log("button '" + state.label + "' was clicked"); button.
removelistener("click", handleclick); } parameters event : string the event to listener is listening for. toggle buttons emit two types of event, "click" and "change". listener : function the listener to
remove. destroy() destroy the button. after calling this function, the button will no longer appear in the ui, and accessing any of its properties or methods will throw an error. properties ...
ui/sidebar - Archive of obsolete content
active window. this parameter is new in firefox 33. on(type, listener) registers an event listener with the sidebar. parameters type : string the type of event to listen for. listener : function the listener function that handles the event. once(type, listener) registers an event listener with the sidebar. the difference between on and once is that on will continue listening until it is
removed, whereas once is
removed automatically upon the first event it catches. parameters type : string the type of event to listen for. listener : function the listener function that handles the event.
removelistener(type, listener) unregisters/
removes an event listener from the sidebar. parameters type : string the type of event for which listener was registered. listener : function th...
... the worker passed into the corresponding attach event. after detach, this worker can no longer be used to communicate with the scripts in that sidebar instance, because it has been unloaded. ...
...d. if you listen to attach, and in the listener take a reference to the worker object that's passed into it, so you can send it messages later on, then you should probably listen to detach, and in its handler,
remove your reference to the worker. ...
Release notes - Archive of obsolete content
details github commits made between firefox 34 and firefox 35. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 34 and firefox 35. this will not include any uplifts made after this release entered aurora. firefox 34 highlights new api: dev/panel enables you to extend the firefox developer tools. jpm beta released. "./my-file" introduced everywhere as an alias for require("sdk/self").data.url("my-file") added the ability to attach stylesheets to individual tabs. details github commits made between firefox 33 and firefox 34. ...
.... this will not include any uplifts made after this release entered aurora. firefox 30 highlights added the ability to anchor panels to buttons. changes in the way content scripts share objects with page scripts. documentation and blog post. added child_process, an implementation of the node.js child_process api. content scripts in page-mod get detach events when the add-on is disabled or
removed. throttle() and debounce() functions added to lang/functional. gettabforid() function added to tabs/utils. details github commits made between firefox 29 and firefox 30. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 29 and firefox 30. this will not include any uplifts made after this release entered aurora. firefox 29 highlights ...
...red aurora. bugs fixed between firefox 29 and firefox 30. this will not include any uplifts made after this release entered aurora. firefox 29 highlights added new ui modules for australis: actionbutton, togglebutton, frame and toolbar. made the preferences branch for simple-prefs configurable. added predicatecontext to sdk/context-menu. deprecated widget in favor of the new ui modules.
removed tab-browser, app-strings and api-utils.publicconstructor details github commits made between firefox 28 and firefox 29. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 28 and firefox 29. this will not include any uplifts made after this release entered aurora. firefox 28 highlights added wildcard event type "*". added a ready even...
Bookmarks - Archive of obsolete content
nd bookmarks for a given uri), you can use the nsinavbookmarksservice.getfolderidforitem() method. ...
...use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.
removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
...parent, aoldindex, anewparent, anewindex) {}, queryinterface: xpcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.
removeobserver(myext_bookmarklistener); }, dosomething: function() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using xpcom without chrome - bookmark observer ...
Forms related code snippets - Archive of obsolete content
appendchild(ohrow); ocapt.appendchild(odecryear); ocapt.appendchild(odecrmonth); ocapt.appendchild(oincryear); ocapt.appendchild(oincrmonth); ocapt.appendchild(this.display); this.container.appendchild(ocapt); this.container.appendchild(othead); this.current.setdate(1); this.writedays(); otarget.onclick = function () { if (otable.parentnode) { otable.parentnode.
removechild(otable); return; } otable.style.zindex = nzindex++; otable.style.position = "absolute"; otable.style.left = otarget.offsetleft + "px"; otable.style.top = (otarget.offsettop + otarget.offsetheight) + "px"; otarget.parentnode.insertbefore(otable, otarget); }; ainstances.push(this); } datepicker.prototype.writedays = function () { ...
... otarget.parentnode.insertbefore(otable, otarget); }; ainstances.push(this); } datepicker.prototype.writedays = function () { const nendblanks = (this.current.getday() + bzeroismonday * 6) % 7, nend = amonthlengths[this.current.getmonth()] + nendblanks, ntotal = nend + ((7 - nend % 7) % 7); var otd, otr; if (this.otbody) { this.container.
removechild(this.otbody); } this.otbody = document.createelement("tbody"); for (var nday, oday, niter = 0; niter < ntotal; niter++) { if (niter % 7 === 0) { otr = document.createelement("tr"); this.otbody.appendchild(otr); } nday = niter - nendblanks + 1; otd = document.createelement("td"); if (niter + 1 > nendblanks && niter < nend) { o...
...hiscal.current[bismonth ? ...
JavaScript Debugger Service - Archive of obsolete content
see the tracking bug bug 800200 for more details. ...
...see the tracking bug bug 800200 for more details. snippets acquiring the service we acquire the service by calling the xpcom object. ...
...pper.cpp")); jsd.appendfilter(createfilter("file://*")); note that appendfilter adds the filter to the end of the list. you can use insertfilter (jsdifilter filter, jsdifilter after) to insert the filter after a particular filter; you can pass null for jsdifilter after to insert at the head of the list. you can also use swapfilters (jsdifilter filter_a, jsdifilter filter_b) to swap filters, and
removefilter(jsdifilter filter) to
remove a filter. learning more a quick and dirty introduction by lei venkman javascript debugger source code firebug service source code jsd architecture (old) ...
Progress Listeners - Archive of obsolete content
e load finishes } }, onlocationchange: function(aprogress, arequest, auri) { // this fires when the location bar changes; that is load event is confirmed // or when the user switches tabs. if you use mylistener for more than one tab/window, // use aprogress.domwindow to obtain the tab/window which triggered the change. ...
...nts that the tabbrowser is interested in, except that the onlinkiconavailable and onrefreshattempted notifications are optional. the tabbrowser uses a strong reference to your listener object. gecko 2.0 note starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), all events are optional. the tabbrowser only notifies you of the events for which you provide a callback.
remember to change mylistener to a unique identifier. example: notification when the value in address bar changes a commonly asked question is how to get notified whenever the url in the address bar (also known as location bar) changes. using the following code, you will get notified when user navigates to another page (by clicking a link, using the back/forward button, by typing an address in the ...
...s location bar) changes. using the following code, you will get notified when user navigates to another page (by clicking a link, using the back/forward button, by typing an address in the location bar, etc.) and also when user switches tabs. var myextension = { oldurl: null, init: function() { gbrowser.addprogresslistener(this); }, uninit: function() { gbrowser.
removeprogresslistener(this); }, processnewurl: function(auri) { if (auri.spec == this.oldurl) return; // now we know the url is new... alert(auri.spec); this.oldurl = auri.spec; }, // nsiwebprogresslistener queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), ...
Rosetta - Archive of obsolete content
s code has been automatically translated from \"" + smimetype + "\" to \"text/ecmascript\". ...
... accessible."); } function reqsuccess () { createscript(this.refscript, this); } function getsource (oscript) { var oreq = new xmlhttprequest(); oreq.onload = reqsuccess; oreq.onerror = reqerror; oreq.refscript = oscript; oreq.open("get", oscript.src, true); oreq.send(null); } function parsescript (oscript) { if (oscript.hasattribute("type") && !rigno
remimes.test(oscript.getattribute("type").tolowercase())) { oscript.hasattribute("src") ? getsource(oscript) : createscript(oscript); } } function parsedocument () { for ( var ascripts = document.getelementsbytagname("script"), nidx = 0; nidx < ascripts.length; parsescript(ascripts[nidx++]) ); } var odicts = {}, rigno
remimes = /^\s...
...="content-type" content="text/html; charset=utf-8" /> <title>rosetta c example</title> <script type="text/javascript" src="rosetta.js"></script> <script type="text/javascript" src="rosetta_c.js"></script> <script type="text/x-csrc"> #include <stdio.h> int main () { printf("hello world number 1!\n"); return 0; } </script> <script type="text/x-c" src="example.c"></script> </head> <body> <p>lo
rem ipsum</p> <script type="text/javascript"> rosetta.translateall(); </script> </body> </html> example.c: c example #include <stdio.h> int main () { printf("hello world number 2!\n"); return 0; } if creating a compiler for the c programming language, as in the example above, can really look a huge task, there are many dialects of ecmascript which could be easily translated to standard ecm...
Extension Etiquette - Archive of obsolete content
preferences (for options and preferences, see the add-on manager). if possible, create a menu item in the menu where it is most applicable; for instance, a bookmark sharing extension should be called from the bookmarks menu. to maintain the default theme, avoid the use of an icon next to the menu items. other ui elements in general, toolbar items are very useful to end users because they can be
removed or added to various toolbars as necessary. status bar items should only be added for extensions that need constant monitoring, such as ad blocking, page ranking, or cookie management. likewise, use context menu items sparingly — only for tasks that are done frequently or on specific elements of a web page. focus don't steal focus. it's not your extension's job to take focus from the web c...
... myextension-, or short prefixes such as ffx-, are likely to be used elsewhere, and therefore unsuitable to the purpose. call .noconflict(true) where applicable many common libraries which create global variables provide a method called noconflict, or similar, which revert any global variables they've declared, and return the object itself. for instance, calling jquery.noconflict(true) will
remove the window.jquery and window.$ variables, and return the jquery object itself, for future use by the caller. when available, these methods should always be used to prevent conflicts with third-party code. names and metadata naming be creative! don't be redundant and include "extension," "mozilla/firefox/thunderbird," or the version number in the name. be original! descriptions use so...
...ix release (like 1.0.7). internationalization locales always use locale dtds and property files, even if providing your extension in one language. it will make translation of your extension to another language easier. it occurs more often than you would think. options firefox users like options. lots of options. try to include everything a user could ever want to customize in your extension,
remembering more can be added later. for a large number of options for your extension, break the options window into multiple pages (tabs) that are well labeled. don't hesitate to give long descriptions for each preference, as long as they are easy to understand, even for non-computer-savvy users. however, please make sure the default set of preferences is adequate — don't require people to tweak o...
Install Manifests - Archive of obsolete content
32 multiple item package 64 spell check dictionary 128 telemetry experiment 256 webextension experiment examples <em:type>2</em:type> this property was added for firefox 1.5, and is only required for add-on types other than extensions and themes. firefox 2 and previous supported a value of 16 to represent plug-ins. in firefox 3 this has been
removed. version a version string identifying the version of the add-on being supplied. for firefox/thunderbird 1.0, the format must conform to the rules specified in extension versioning, update and compatibility. for firefox/thunderbird 1.5, see toolkit version format. examples <em:version>2.0</em:version> <em:version>1.0.2</em:version> <em:version>0.4.1.2005090112</em:version> firefox 1.5 ...
...tensions list does not make sense. note: this property is no longer supported under gecko 1.9.2 (firefox 3.6) or later, to prevent extensions from being installed in such a way that the user might not be able to tell they're installed. examples <em:hidden>true</em:hidden> requires firefox 2.0 - 3.6.x. other versions will ignore the restrictions and install the add-on regardless of the requi
rements. see replacement for install.rdf property "requires" discussion for rationale behind
removing this feature and the suggested workaround. <em:requires> has a similar syntax to the <em:targetapplication> tag (i.e. you must specify <em:id>, <em:minversion>, <em:maxversion> when using it). if the add-on specified by the <em:id> tag is not installed or has an incompatible version, the extension ...
...lication> tag (i.e. you must specify <em:id>, <em:minversion>, <em:maxversion> when using it). if the add-on specified by the <em:id> tag is not installed or has an incompatible version, the extension manager will disable your extension and show the message "requires additional items". you can add as many <em:requires> tags as you like. your extension will be disabled if any of the specified requi
rements fail. it is not possible to add dependencies that are specific to a <em:targetapplication>. see extension dependencies for more details. glossary restricted access area a restricted access area is an install location that could be restricted on a restricted-access account, regardless of whether or not the location is restricted with the current user privileges (see nsiinstalllocation::rest...
Jetpack Processes - Archive of obsolete content
ses are created by components that implement the nsijetpackservice interface, and their parent chrome process communicates with them via the nsijetpack interface. note: the jetpack service, provided by nsijetpackservice, is not included by default in firefox 4. prior to firefox 12, it could be included in custom builds by using enable_jetpack_service at compile time. however, the service has been
removed entirely as of firefox 12. these processes are relatively lightweight, do not have access to xpcom, and can innately do little other than compute. messaging facilities that allow them to communicate with their parent chrome process are the only means by which they can be endowed with any real power. note: the above statement is not currently true, as js-ctypes is now provided to jetpack proce...
...does not exist, the lifetime of a handle needs to be controlled manually by code. by default, a handle is rooted in the javascript interpreter's garbage collector, meaning that even if a process throws it away, it will not be garbage collected unless the other process explicitly does something to indicate that it is no longer needed. ...
...needs to be controlled manually by code. by default, a handle is rooted in the javascript interpreter's garbage collector, meaning that even if a process throws it away, it will not be garbage collected unless the other process explicitly does something to indicate that it is no longer needed. if that other process does not do something explicit and simply
removes all references to it, the handle
remains rooted yet unreachable in both processes and a memory leak is created. to prevent such memory leaks, a process can either invalidate a handle, immediately preventing it from being passed as a message argument, or it can unroot the handle, allowing it to be passed as a message argument until all references to it are
removed, at which point it is garbage collected. handles have the following na...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
inguished. the namespace uri for xhtml is "http://www.w3.org/1999/xhtml" ; for svg is it "http://www.w3.org/2000/svg". css: a style language to alter the display of xml documents like xml, cascading style sheets (css) is a technical specification established by the w3c; it is a style-description language defining the display of data marked up in xml and html. as shown in listing 1, it has an ext
remely simple syntax. by separating the structure of the data, expressed through html or xml, and the display style, indicated by css, data can be reused better than it is when structural and stylistic markup are both embedded in html. there are three css specifications (level 1 through level 3), with progressively powerful features. the gecko rendering engine handles nearly all of css level 2 and s...
...pt and xml); that plus the advent of a number of libraries that paper over implementation differences between different web browsers has more recently led to a re-evaluation of javascript as a programming language. javascript is a prototype-based object-oriented language, and as shown in listing 3, also permits independent class definitions. it does not have strict typing like java, making it ext
remely flexible and giving it qualities that in some senses could be considered similar to lisp. firefox 3.5 includes a number of extensions to the specification standardized in ecmascript 3rd edition, and can use javascript 1.7 and javascript 1.8. listing 3: an example of a class definition in javascript function myclass() { } myclass.prototype = { property1 : true, property2 : 'string', me...
...ows an example that deletes the second child element of the element with the "toolbar" id, adds a new button element as a substitute, and sets a label attribute. ...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
are the ones that aren't provided by gtk. gtk icons are accessed using special urls, like this one: moz-icon://stock/gtk-go-back?size=menu. you can enter this url in firefox on linux, and the corresponding icon will be displayed. this is also the reason this is the only theme that still has colorful icons for its buttons. now let's look at the css work involved in a toolbar that works on the afo
rementioned systems. if you want your toolbar to look right on all systems, you should consider having different icon sets for each. you should also consider using a graphic designer for this work, as it takes a lot of attention to detail to make good icons. you can have a different skin directory for each operating system using manifest flags in the chrome.manifest file: skin xulschoolhello classi...
...px, 16px, 16px, 0px); } several css rules apply by default to all toolbar buttons. these add the button-like look you want. if for some reason you want to override these styles (not recommended), you'll need the following rule: -moz-appearance: none; -moz-appearance can be used in many cases where you want to strip the native look out of an element. this will save you a lot of time trying to
remove all the css rules that give the buttons a native look. you'll probably still need to override a couple other css rules to get a completely plain look. the customize toolbars dialog firefox has the option to customize its toolbars. we've already mentioned this before, and if you follow our recommendations, then you shouldn't have many problems making your toolbar compatible with the customize...
...xisting toolbars finally, there is the very common case where you just want to add one button to the main toolbar. in this case you still need to add the button to the palette using an overlay. in order to add your button to the main toolbar on first run, you'll have to use javascript code. keep in mind that you shouldn't assume anything about the location (or presence!) of any specific buttons;
remember users could have moved them or
removed them altogether. the toolbar code snippets page has a code sample you can use to do this.
remember to validate if your button is already present, to prevent duplicates. it's also a good idea to set a preference that indicates that you added your button already, so that it can be
removed permanently if the user chooses to. another option is to use fuel'...
Handling Preferences - Archive of obsolete content
ly separated by dots. now let's look at how we actually manage the preference values. managing preferences with xpcom we use the preferences service in order to get and set preference values: this._prefservice = cc["@mozilla.org/preferences-service;1"].getservice(ci.nsiprefbranch); // ... get count() { return this._prefservice.getintpref("extensions.xulschoolhello.message.count"); }, inc
rement : function() { let currentcount = this._prefservice.getintpref("extensions.xulschoolhello.message.count"); this._prefservice.setintpref("extensions.xulschoolhello.message.count", currentcount + 1); } one important thing to keep in mind is that the "get" methods of the service can throw an exception if the preference is not found. if you are going to use xpcom, you should always set...
...eners the xpcom way to add a listener was mentioned in the xpcom section when describing the queryinterface method: this._prefservice.queryinterface(ci.nsiprefbranch2); this._prefservice.addobserver(prefname, this, false); this._prefservice.queryinterface(ci.nsiprefbranch); all the qi'ing is necessary because the addobserver method is in a different interface, and other than for adding and
removing observers, we use the nsiprefbranch interface for everything related to preferences. then, create the observer method: observe : function(asubject, atopic, adata) { if ("nspref:changed" == atopic) { let newvalue = asubject.getintpref(adata); // do something. } }, always
remember to
remove the observer when you don't need it anymore: this._prefservice.queryinterface(ci.n...
...fbranch interface for everything related to preferences. then, create the observer method: observe : function(asubject, atopic, adata) { if ("nspref:changed" == atopic) { let newvalue = asubject.getintpref(adata); // do something. } }, always
remember to
remove the observer when you don't need it anymore: this._prefservice.queryinterface(ci.nsiprefbranch2); this._prefservice.
removeobserver(prefname, this); preference windows it's very common for extensions to have a few settings that their users can change to tailor them to their needs. since there are some subtleties related to preference management, there are some facilities provided in xul and firefox that make this much easier to deal with. the standard way of opening a preferences window is to open the add-ons ...
JavaScript Object Management - Archive of obsolete content
we follow is this: whenever you have to set a callback function parameter, wrap it in an anonymous function. that is, something like function() { /* your code, usually a single function call. */ }. if you have to use a reference to this inside the function, declare a variable called that that equals this, and use that in the anonymous function. javascript has a host of features that make it ext
remely flexible, but it also has some disadvantages, as it is not as strict as other languages, such as java. a clear example of this is the fact that there are no private or public keywords that allow you to protect object members. as a alternative for this, a naming standard is frequently used to distinguish private and public members. there's no scope enforcement whatsoever, but this standard give...
...nd methods in js objects. for example: _stringbundle, _createusernode(). exercise here's a short exercise to test a particular aspect of the chrome. modify the hello world extension so that the message says how many times it has been displayed. the message could say something like "hello! this message has been shown 5 times." keep the counter as a variable in the browseroverlay object, and inc
rement it every time the message is going to be shown. once you have this working right, try the following: open the message a few times, so that the number inc
rements. now open a new window and display the message from the new window. what do you think will happen? what will the count be this time? you probably didn't expect this, but the count was reset in the new window. each window keeps its ow...
...line, we keep all of our business logic in jsm, available through service objects, and chrome scripts are limited to handle presentation logic. we handle most of our code through static objects, singleton objects that don't require instantiation. but it is sometimes necessary to define classes and be able to create multiple instances. common cases include interacting with a local database or a
remote api. data will often be translated into arrays of entities, and those are better represented through classes. one way to define a class is as follows: /** * user class. represents a hello world user (whatever that may be). */ 〈modulenamespace〉.user = function(aname, aurl) { this._name = aname; this._url = aurl; }; /** * user class methods. */ 〈modulenamespace〉.user.prototyp...
User Notifications and Alerts - Archive of obsolete content
e done. users will find them annoying and probably will learn to dismiss them as quickly as possible without even reading what they have to say. or they will just get rid of your add-on. this section lists a few alternatives that give you the possibility of notifying the user and requesting action without being too annoying. the notificationbox element you have probably seen these before. the "
remember password" prompt is the one that shows up the most often. they are thin boxes that appear from beneath the tab list and above the page content, with some text and maybe a few buttons. this kind of notification is implemented with a notificationbox. this kind on notification is very easy to implement, it doesn't interrupt the user and is easy to read and dismiss, so it is our recommended way...
...iven the advantages of xul overlays and css positioning. however, these solutions are prone to be buggy and have accessibility issues. you should use the 2 alternatives mentioned above whenever possible. if none of those fit your needs then this is an acceptable solution. an easy way to display alerts is to include a hidden box in your overlay, which you can fill with any content you need before
removing the hidden attribute so that it is displayed to the user. the best locations for this kind of box are above and below the tab browser. below is preferrable because it only cuts the bottom part of the current page, as opposed to pushing down all tabs and content. notification boxes are a good guideline to what you should aim for: thin, informative and easy to dismiss. another option is to al...
...ork. you'll end up with a box with a white background you can't get rid of . on firefox 3 and above, this seems to have been corrected, using the panel element. the bottom right corner of the browser is the recommended location for an alert, because it normally doesn't block the part of the content where the user is reading, or the most important parts of page content, such as menus and titles.
remember this is not a recommended practice. imagine having multiple extensions notifying you in their own custom way, probably even at the same time! this is not good from a ui perspective, so you consider custom alerts the very last resort. « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
Promises - Archive of obsolete content
the performance and stability costs of synchronous io, many apis which rely on it have been deprecated. the following page contains examples of many promise-based replacement apis for common operations. these apis allow asynchronous operation to be achieved with a coding style similar to synchronous variants. the following examples make use of the task api, which harnesses generator functions to
remove some of the syntactic clutter of raw promises, such that asynchronous promise code more closely resembles synchronous, procedural code. a task example like the following: components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function* () { var response = yield request("login", { username: user, password: password }); if (response.messages) { try { ...
... let data = xhr.response; // use the response to construct form data object for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. xhr = yield request(updateurl, { data: form }); // use the response of the second request. notifyuser(xhr.responsetext); }); downloading
remote files nearly all previous methods of downloading
remote files have been superseded by the much simpler downloads.jsm module. the downloads object provides a promise-based api for downloading
remote files, with full support for progress tracking, pause and resume, and, optionally, integration with the download manager ui. representative example usage components.utils.import("resource://gre/m...
... when the file's contents * have been written. ...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
5 years now. i used to pride myself in knowing how to reproduce any interface design down to a pixel-perfect level. a developer would tell me something wasn't possible, and i could prove otherwise every time. like other designers and html whizzes, i became a master at manipulating and troubleshooting tables, nesting them in intricate ways to produce any layout or effect that could be imagined. i
remember one project for lycos where we had nested tables 10 levels deep. i counted them myself. it wasn't that every level was absolutely necessary to reproduce the intended design effects. but each table ensured the flexibility we needed if certain modules and pieces of content appeared or disappeared. when you get to that point, the amount of markup you have to sift through to find anything become...
...nt within generic markup. for wired news, the center (or main) column usually contains the most important content for each page. i wanted center column content to appear first in browsers that got the un-styled version. with floats, either the left column or the right column always had to be drawn first. for sites that rely on a left or right column for primary navigation, this content order requi
rement of float usage may produce desired and advantageous behavior. i also found a lot of trouble ensuring a consistent vertical start position of columns using floats. two column layouts using floats seemed easy. but adding a third column to the mix created too many width variables for some browsers to dynamically calculate a total. resizing the browser window often resulted in one column getting ...
...positioned absolutely, there is no way to ensure a footer would always appear at the bottom of the longest column. we ended up confining the footer to the width of the center column to avoid any possible overlap. the other disadvantage comes into play at small browser window sizes. while floats automatically reconfigure if they don't fit within the window width, absolute positioned columns always
remain in the same place, even if it means content in one column begins to overlap another column. both of these put together weren't enough to dissuade me from the advantages of positioning over floats. how does the new design perform when the pages are printed? we have one css file specifically set up to cover most of the content throughout our pages for print media. by default, all links to scre...
CSS3 - Archive of obsolete content
css3 is the latest evolution of the cascading style sheets language and aims at extending css2.1. it brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts. experimental parts are vendor-prefixed and should either be avoided in production environments, or used with ext
reme caution as both their syntax and semantics can change in the future. modules and the standardization process css level 2 needed 9 years, from august 2002 to june 2011 to reach the recommendation status. this was due to the fact that a few secondary features held back the whole specification. in order to accelerate the standardization of non-problematic features, the css working group of the w3...
...after, break-before, and break-inside. css values and units module level 3 candidate recommendation makes initial and inherit keywords usable on any css property. formally defines the css data types of css 2.1, that were implicitely defined by their grammar token and some textual precisions. adds: definition for new font-relative length units:
rem and ch . definition for viewport-relative length units: vw, vh, vmax, and vmin . precision about the real size of the absolute length units, which are not really absolute, but defined in relation with the reference pixel . definition for <angle>, <time>, <frequency>, <resolution>. normative value to the definition of <color>, <image>, and <position>. definition for the ca...
...x-flow, flex-item-align, flex-line-pack, flex-order, flex-pack, and flex-wrap. css cascading and inheritance level 3 candidate recommendation adds: the initial, unset values for properties. the css all property. the scoping mechanism. clarifies: interaction of media-dependent @import statements and style sheet loading requi
rements. css writing modes module level 3 proposed recommendation defines the writing modes of both horizontal and vertical scripts and clarifies how the css direction and unicode-bidi properties interact with the new css text-orientation property, and extends them where needed. css counter styles level 3 candidate recommendation ...
Autodial for Windows NT - Archive of obsolete content
tion that uses networking. starting with windows nt, and in all nt-based versions (windows nt, windows 2000, and windows xp, including xp home) microsoft has changed the behavior of autodial. for these oss, the autodial options found in the internet options control panel applet only apply to microsoft applications, including internet explorer and outlook. microsoft added a windows system service (
remote access auto connection) to handle autodial for all other applications. if this service is running, and control panel | network connections | advanced | dialup preferences is set to enable autodial, then any application trying to access the internet will trigger the autodial feature whenever an internet address cannot be reached. however, this service will won't function if you have a lan card ...
...that one. if more than one dialup connection is configured, and none is selected as the default, we display a list of dialup connections and let the user choose one. how to configure autodial on nt-based systems first, you will need to configure a dialup connection and make sure it works when triggered manually. if you are using a system with just a modem, the best approach is to configure the
remote access auto connection service to automatically start. then enable autodial for a dialup connection: control panel | network connections | advanced | dialup preferences. this will handle autodial whenever an address can't be found. if you are using a system with both a lan and a modem connection, and you want to use the autodial feature whenever you are not connected to the lan, it's probably ...
...ess. issues there have been a few bug reports filed against this new feature that are the result of the fact that mozilla now looks at the control panel | internet options | connections settings. some users have had the autodial setting turned on, but mozilla never triggered them before. starting in mozilla 1.1, autodial is triggered whenever an address can't be reached (mozilla now mimics the
remote access autodial service.) see bug 160846, bug 167624, and bug 160846. if a user doesn't want the os to use autodial, he must turn off the feature from the os. there is also a problem with the aol client when used as a dialer. bug 166134 describes how the aol client installs itself as a dialer, but it doesn't behave like other dialers. the problem is with the aol client, be the bug could probab...
Protecting Mozilla's registry.dat file - Archive of obsolete content
stry.dat file copied over from the server using the logon script. moreover, it's advisable to "protect" the mozilla registry using attrib +r +s in case the logon script is finished before ie's "personnalized settings" have completed their dirty deed... ...
...on script. moreover, it's advisable to "protect" the mozilla registry using attrib +r +s in case the logon script is finished before ie's "personnalized settings" have completed their dirty deed... ...
...oreover, it's advisable to "protect" the mozilla registry using attrib +r +s in case the logon script is finished before ie's "personnalized settings" have completed their dirty deed... ...
Getting Started - Archive of obsolete content
can open them up in your zip program the same way you open up zip files. mozilla currently comes with two skins, classic and modern. looking in the directory you'll also notice that there are classic.jar and modern.jar files. for this tutorial we are going to use the classic skin as a base. extract classic.jar into \classic (\mozilla\chrome\classic), but make sure to keep the directory structure.
remember if at any point you wish to revert back to the original code again, just extract this jar over top of what you've modified. now all of the css and images are extracted, but if you make some changes and run mozilla as it is, you will not see them because it's still set to look at the files in the jar files. to point mozilla at the correct files we need to open up \mozilla\chrome\installed-chr...
...ughout mozilla. if you want to modify how checkboxes, radio buttons, and scrollbars appear, this is the place. the next directory is the \communicator directory. this is a catchall directory which holds all of the images and styles for portions of mozilla that don't merit their own individual directory. you'll be able to change the bookmark manager and the profile migration window here. the three
remaining directories are pretty self-explanatory. they contain the images/styles for the browser, email client, or html editor. css files the css files in these directories tell the browser how to display the buttons and other controls, where to put the images, what border and padding it should put around them, etc. for this next part, let's modify the standard button. go into \mozilla\chrome\classi...
...s with one of your own. it should probably be of the same size, but it doesn't have to be. if you do need to change the size, also make sure to change any css that may be affected by that change. after you've changed the images, launch mozilla and you should see them. creating the install script getting it ready for the installation before we can package everything up for installation, we need to
remove all references to classic. copy everything in \mozilla\chrome\classic\skin\classic to a directory called \myskin. skin info when switching skins in mozilla, it displays a preview image and some information about the theme. this is what we're going to create now. take a screenshot of mozilla running your theme and create an image that is 438x89 pixels in size. place it in \myskin and call it pr...
Creating regular expressions for a microsummary generator - Archive of obsolete content
a sequence of characters) that matches patterns of characters in other strings. microsummary generators use them to identify the pages that the generators know how to summarize by matching patterns in those pages' urls. in this tutorial, we'll explain how to make regular expressions that match the urls for ebay auction item pages. by the end of the tutorial, you should know some basics about regular expressions and understand how to create expressions that match urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. ...
...the expression must be found at the beginning of the string being matched. now that we've prepended a caret to our regular expression, it will only match urls that look like the example url right from the start. matching multiple urls but this expression still only matches the url for a single auction item page. it won't work with any other auction item. to make it match other items, we have to
remove the unique parts of it that match the specific item, leaving behind only those parts which are common to all items. to identify which parts are unique and which are common, let's look at the urls of several other auction item pages: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=130017517168 http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=290019763032 http://cgi.ebay.com/ws/ebayisa...
... look at the urls of several other auction item pages: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=130017517168 http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=290019763032 http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=170019463424 based on these examples, it looks like the unique part is the item number at the end of the urls, and everything else is common to all urls. so we
remove the item number, leaving us with the following regular expression: ^http://cgi\.ebay\.com/ws/ebayisapi\.dll\?viewitem&item= accommodating variations in query parameters we now have a regular expression that matches all four example urls. it'll probably match the urls for other auction item pages, too. but to make it more robust, we should accommodate the possibility of variation in the qu...
Microsummary XML grammar reference - Archive of obsolete content
a microsummary generator is an xml document that describes how to pull specific information from a web page to be presented in summary form as a bookmark whose title changes based on the content of the page it targets. warning: microsummary support was
removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this article provides detailed information about the xml grammar used to build microsummary generators, describing each element and their attributes. for an introduction to how to create a microsummary, read the article creating a microsummary. example the microsummary generator created in the creating a microsummary tutorial: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <templat...
...attributes: name (required) a descriptive, human-readable name for the microsummary created by the generator. uri (optional) a valid uri uniquely identifying the generator. only relevant for generators dynamically created by firefox code and extensions. generators installed from the web via nssidebar::addmicrosummarygene...
...ibing the generator. attributes: name (required) a descriptive, human-readable name for the microsummary created by the generator. uri (optional) a valid uri uniquely identifying the generator. only relevant for generators dynamically created by firefox code and extensions. generators installed from the web via nssidebar::addmicrosummarygenerator are identified by the
remote url from which they were downloaded, and firefox ignores the value of this attribute for them. child elements: <template> (required) defines how to transform pages into their microsummaries. <pages> (required) identifies the set of pages that the generator is able to summarize. <update> (optional) specifies how frequently firefox should update the mi...
Space Manager High Level Design - Archive of obsolete content
en up by floats (updatespacemanager in nsblockframe) and provides information about the space available for other elements (getavailablespace in nsblockreflowstate). additionally, there is a need to manage impacts to lines caused by changes to floated elements. this is referred to as propagation of float damage and is handled by the block frame, making use of the space manager. when a float is inc
rementally reflowed, the space manager is notified if the float's region has changed. if so, the vertical space that has been affected (including both the float's old region and the float's new region) is noted in the internal nsintervalset as potential float damage (the method is includeindamage). during the inc
remental reflow of dirty lines the block frame may encounter lines that are not dirty. in...
...ssentially a css-specific wrapper for generic nsbanddata. bandrect: keeps the bounds of a band, along with the frames associated with the band. bandrects are a linked list (provided by prcliststr super-class) and also provide some geometry-management methods (splitvertically, splithorizontally) and some methods that query or manipulate the frames associated with the band (isoccupiedby, addframe,
removeframe). bandlist: a subclass of bandrect that provides a list interface - head(), tail(), isempty(), etc. frameinfo: a structure that keeps information about the rectangle associated with a specific frame, in a linked list. nsbandtrapezoid: represents the discrete regions within a band that are either available, occupied by a single frame, or occupied by several frames. this is used to commu...
...d by floats before, but is now it is impacted by floats and is a block problems / bugs found during documentation: bandrect and bandlist are public in nsspacemanager.h - should be private (compiles fine) nsspacemanager data members are declared protected, but there are no subclasses. ...
URIs and URLs - Archive of obsolete content
ther report for los angeles"), and a collection of other resources. not all resources are network "retrievable"; e.g., human beings, corporations, and bound books in a library can also be considered resources. the resource is the conceptual mapping to an entity or set of entities, not necessarily the entity which corresponds to that mapping at any particular instance in time. thus, a resource can
remain constant even when its content---the entities to which it currently corresponds---changes over time, provided that the conceptual mapping is not changed in the process. identifier an identifier is an object that can act as a reference to something that has identity. in the case of uri, the object is a sequence of characters with a restricted syntax. a uri can be further classifi...
...eference uri's scheme is inherited from the base uri's scheme component. due to a loophole in prior specifications (rfc1630), some parsers allow the scheme name to be present in a relative uri if it is the same as the base uri scheme. unfortunately, this can conflict with the correct parsing of non-hierarchical uri. for backwards compatibility, an implementation may work around such references by
removing the scheme if it matches that of the base uri and the scheme is known to always use the "hier_part" syntax. the parser can then continue with the steps below for the
remainder of the reference components. validating parsers should mark such a misformed relative reference as an error. the decision was made against backwards compatibility. this means that urls like "http:page.html" or "http:...
...one of the authors of rfc 2396, stating that the given example is wrong. details can be found at bug 90439. registry-based authoritys currently necko's url-objects only support host based authoritys or urls with no authoritys. registry-based authoritys as defined in rfc 2396 many uri schemes include a top hierarchical element for a naming authority, such that the namespace defined by the
remainder of the uri is governed by that authority. this authority component is typically defined by an internet-based server or a scheme-specific registry of naming authorities. ... the structure of a registry-based naming authority is specific to the uri scheme, but constrained to the allowed characters for an authority component. are not supported. references main reference for uris, urls and...
Venkman Introduction - Archive of obsolete content
e it easier to read by inserting line breaks and whitespace in appropriate places. when pretty print is enabled you will see a green check mark on the toolbar button, and the menu item will be checked as well. the loaded scripts view the loaded scripts view is in the top left portion of the window. when a file is loaded by the browser it will appear in this view, and when unloaded it will be
removed. files are listed in alphabetical order, grouped by file type. file names are displayed after a color coded, single letter icon representing the file extension. figure 6 shows the table of icon and file types. at the time if this writing, the order and grouping of file names cannot be changed. icon file type .js .html, .htm .xul ...
...box, and responses are appended to the end of the output. type /commands in the input area (the text box) to list all of the commands available. the /help command can be used to get additional information about a specific command. you can type /help next, for example, to see how to use the next command. the input area supports command history and tab-completion for command names. command history
remembers the last 20 commands entered. the up and down arrows can be used to revisit these previous commands. tab completion allows the user to type the first portion of a command, and press tab twice to see possible completions. if only one command matches, it will be auto-completed on the first tab. view customization venkman offers nearly complete control over the arrangement and display of vie...
...ation venkman offers nearly complete control over the arrangement and display of views within the application. the debugger is built on top of an application framework that allows you to drag and drop, resize, and toggle all the available views, and even to create new views or modules for the debugger if you choose—though this latter is an advanced topic and a subject for a future article. to
remove a view from venkman, simply click the close button at the top right of that view. when the view again becomes necessary—for example, when you open a source file from the loaded scripts view and want to view the source—the view reappears where it was last positioned. to make a view reappear explicitly, select it from the view->show/hide menu of the debugger. you can also make views float in...
Learn XPI Installer Scripting by Example - Archive of obsolete content
n be used in place of full path names in methods such as addfile. "program" represents the directory where software itself is installed (e.g., c:\program files\ on win32 systems), as opposed to supporting directories like "components", "chrome", or "temporary" (see getfolder in the xpinstall api reference for a list of keywords). registering the software registering software is sometimes a requi
rement of both the operating system and of the netscape 6 platform. when you install new chrome, for example, like the browser.xpi install does, you need to alert the chrome registry to these changes, so that skins, user preferences, packaging lists, and localization bundles will all track the new software. for registering software with the win32 operating system, the xpinstall api provides two spec...
...,"skin/modern/communicator/"); registerchrome(skin | delayed_chrome, getfolder(cf,"modern.jar"),"skin/modern/editor/"); ... in lines 42-58, registerchrome is called as many times as there are different directories that contain content that needs to be registered with the chrome registry. note that in the first few lines of this process, new content from the xpi is being registered, and in the
remainder, it is new skin information. in this most common form of the registerchrome function (it can also be used to support the now-deprecatedmanifest.rdf style of installation archive), the three parameters represent, in order, the chrome switch used to indicate what kind of software is being registered, the target destination of the software (e.g., the "chrome" folder in the example above), and ...
...only a single executable, no registration, and no commenting. it does, however, take the executable and the readme file and install them on the user's system. note also that for the installation script in a xpi to be automatically triggered from a web page, you must use a "trigger script." the following installtrigger function, called from an event handler on a regular web page, will point to the
remotely-hosted xpi (called here 'cdrip.xpi') and trigger its installation: function putit() { xpi={'cd_ripper':'cdrip.xpi'}; installtrigger.install(xpi); } ... <a href="#" onclick="putit();">install the cd ripper now!</a> see the installtrigger object in the xpinstall api reference for more information on triggering installations. original document information author(s): ian oeschger l...
XUL Events - Archive of obsolete content
some of the events can be attached using attributes as well. when attaching event listeners using attributes, be aware that only one listener can be attached at a time. any previously attached listeners are disconnected. the attribute name is the event name with an 'on' prefix. ...
...d new values of the attribute using the event's prevvalue and newvalue properties. domnodeinserted this event is sent when a node is added as a child of a element. if you capture this event at the document level, you can be notified of document changes. domnode
removed this event is sent when a node is
removed from an element. if you capture this event at the document level, you can be notified of document changes warning: it should be noted that the addition of any mutation event listeners to a document degrades the performance of subsequent dom operations in that docume...
...see mutation events for more details and mutation observers for a more efficient alternative. ...
Moving, Copying and Deleting Files - Archive of obsolete content
documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. there are several methods of the nsifile object which may be used to move and copy files on disk. nsifile.copyto() is used to copy a file, while nsifile.moveto() is used to move files. nsifile.
remove() may be used to delete a file. copying a file nsifile.copyto() is used to copy files or directories, and should be called on the source file to copy. this method takes two arguments, the first is the destination directory in which to copy the file to, and the second argument is the new name of the file, if you wish to rename it in its new location. if you do not want to rename the file, and...
...directory, the destination argument may be null. for instance, the following example renames a file within the same directory: file.moveto(null, "hello.txt"); if the destination file already exists, nsifile.moveto() replaces the existing file. for this reason, you may wish to check if the file exists using nsifile.exists() before moving the file. deleting a file to delete a file, use nsifile.
remove(). this method takes one boolean argument which indicates whether to delete recursively or not. if true and the file object refers to a directory, the directory will be
removed as well all files and subdirectories within it. if false, a directory will only be
removed if it is empty. if the directory is not empty, an error will occur. for files, the argument is simply ignored. var file = io.ne...
...ean argument which indicates whether to delete recursively or not. if true and the file object refers to a directory, the directory will be
removed as well all files and subdirectories within it. if false, a directory will only be
removed if it is empty. if the directory is not empty, an error will occur. for files, the argument is simply ignored. var file = io.newfile("home", "photo.jpg"); file.
remove(false); this example
removes the file called 'photo.jpg'. ...
Introduction to XUL - Archive of obsolete content
ather synonymous with xpfe. though the former term seems more concrete than the other, and therefore is not an exact replacement, no one is completely certain why we have both. "xul" already introduced, is an application of xml used to describe the layout of most windows in the mozilla browser, including and especially the main, browser window. scope this paper makes no attempt to explain requi
rements. we don't have a current "requi
rements" document. xptoolkit architecture is a better place to gain an understanding of such things. this paper contains a short introduction to mozilla front-end architecture, concentrating on the task of building uis. it is, as always, incomplete. mozilla applications will be built of "small" components like dialog buttons and mail inbox folders, which we col...
...t's possible to load a xul document from an xml file (one named *.xml). the resulting ui will be created using an xml content model. a xul content model is generated from *.xul files. xml documents support the basic dom level 1 core apis. xul documents support an extended set, much as html documents support dom level 1 html apis. mozilla's xul content models also support nifty features like local/
remote merging; see the xul and rdf document for details. in general, you will want to store xul in *.xul files. a xul file can contain xml elements and html elements, as well as special elements unique to xul: xul elements. namespace declarations for xul (and html, if html elements are used) must be included in the file. namespaces must be treated carefully. correct namespace usage dictates that th...
...ontain html content, including javascript. javascript functions may be added in a fashion similar to html. there is no <head> section of a xul file, so script is just mixed in with the other content, delimited by a script element in the html namespace. <html:script type="application/javascript"> // dialog initialization code function initwindow() { var checkbox = document.getelementbyid("
remember"); if (checkbox) checkbox.checked = true; } </html:script> javascript can be referenced as in html documents: as onclick handlers and the like. see individual widget documentation referenced at the index for a list of attributes accepting javascript values. javascript is most safely kept in a separate file and included in the xul file <html:script language="javascript" src="o...
MenuItems - Archive of obsolete content
in. as this can be more complicated, it is also possible to use the autocheck attribute to disable this behavior. when the autocheck attribute is set to false, the checkbox state is not updated automatically, and you must write code to adjust the state yourself. <script> function changetoolbarstate(event) { if (event.target.getattribute("checked") == "true") hidetoolbar(); event.target.
removeattribute("checked"); } else { if (!showtoolbar()) return; event.target.setattribute("checked", "true"); } } </script> ... <menuitem label="show toolbar" accesskey="t" type="checkbox" autocheck="false" oncommand="changetoolbarstate();"/> this version of the changetoolbarstate function changes the checked attribute itself. the autocheck attribute has been set to f...
... that the code has been reversed in the condition blocks to hide the toolbar when the menuitem is checked and show the toolbar when the menuitem is not checked because the checked state hasn't been modified. the example assumes that the showtoolbar() function might fail so if it returns false, the checked attribute is not modified. when clearing the checked state, the checked attribute should be
removed rather than just set to false. in the example, this is done by using the
removeattribute method. radio menu items a radio menu item os used when you wish to have a group of menuitems in which only one can be checked at a time. this works similarly to the checkbox type, except when selecting an item, all others in the same group are automatically unchecked. to create a menuitem that acts li...
...ge of the accesskey attribute in xul. ...
Panels - Archive of obsolete content
default when a panel is opened, adjust the focus within a popupshown event handler. ...
...cument.getelementbyid('search').focus()"> to disable the adjusting of focus when a panel is opened, set the noautofocus attribute to true: <panel noautofocus="true"> this will cause the focus to
remain on the element within the main window that has focus when the panel is opened. note that this will also keep the focus within the panel when it is closed. when a panel is closed, the focus is
removed from the element within the panel which has the focus event, if any, and whatever element was focused before the panel was opened is refocused. you can prevent the focus from being
removed by setting the noautofocus attribute to true as above. in addition, the norestorefocus attribute should be set to true in order to prevent the previously focused element from being refocused. normally, only...
...focus event, if any, and whatever element was focused before the panel was opened is refocused. you can prevent the focus from being
removed by setting the noautofocus attribute to true as above. in addition, the norestorefocus attribute should be set to true in order to prevent the previously focused element from being refocused. normally, only the latter would be set if needed. this process of
removing the focus when opening and closing a popup occurs after the popupshowing event or popuphiding event is fired, which means that if those events are cancelled, the focus is not adjusted. letting panels be dragged by grabbing the background requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), you can...
disabled - Archive of obsolete content
« xul reference disabled type: boolean gets and sets the value of the disabled attribute. ...
... « xul reference disabled type: boolean gets and sets the value of the disabled attribute. ...
... « xul reference disabled type: boolean gets and sets the value of the disabled attribute. ...
Multiple Rules - Archive of obsolete content
ut for each type. if a result from the query doesn't match any of the rules, it is ignored and no content is generated for it. note that only the first rule, in the order that the rules appear in the template, that matches for a result is used, not all of them that match. thus, you can assume that earlier rules handled earlier matches. for instance, if the first rule matched all folders, then the
remaining rules can assume that any results that get past the first rule are not folders. this allows the conditions can be simpler. it also allows a common technique where the last rule in a template has no conditions, allowing all
remaining results that didn't match earlier rules to match this last rule. a multiple rule template looks like the following: <hbox id="photoslist" datasources="template...
...' is used to compare the title. the rel specifies a relation operator to compare with. here 'equals' is the operator used so an exact match is needed. the value attribute is the value to compare to, which here is 'canal'. as the datasource has three photos, one of which has a title of 'canal', this photo will match the first rule and the content's of that rule's action body will be generated. the
remaining two photos do not match the first rule, however they do match the second rule, as the second rule has no where clauses. for these two photos, the action body of the second rule will apply. when used together in this example, the results are combined and only three results are shown. however, you will probably notice that the one photo that matches the first rule has appeared differently tha...
...element may be used. beside the equals operator, there are several other operators that may be used. ...
Template and Tree Listeners - Archive of obsolete content
e two methods if you wish to be notified when the template is rebuilt using the builder's rebuild call. the template builder might also force a rebuild when the underlying data change notifications require it. the primary use of this listener is to store some state before the template is rebuilt and restore it afterwards. recall that when a template is rebuilt, all of the existing content will be
removed and generated fresh. the willrebuild method of any listeners will be called before the content is
removed, and didrebuild method will be called when the content has been regenerated. this listener will also work for tree builders, and will call the appropriate methods before and after the tree has been generated. to assign a builder listener to a builder, use the addlistener method. var somel...
...source method. (as this example uses the rdf resources directly, it requires elevated privileges so you will need a chrome url to test it.) you might also guess that the builder's root property, which is used above, refers to the tree. in a content builder, it will return the element with the datasources attribute, which in the template builder is referred to as the root element. finally, you can
remove a listener using the builder's
removelistener method. listening for tree changes the second type of listener is used to handle particular actions related to trees. the tree builder implements the nsitreeview interface, so handles the gathering of data and passing it on to the tree. the tree widget informs the view when certain operations are performed that might affect the data. the tree view ...
...he tree. the tree widget informs the view when certain operations are performed that might affect the data. the tree view handles all of these operations, but allows an observer to be attached which is invoked during these operations. for instance, the observer may have an ontoggleopenstate method which will be called when the user opens or closes a row. the tree builder will handle the adding or
removing of rows, but will call the observer so that it can perform some task. the tree builder observer implements the nsixultreebuilderobserver interface and may be attached to a tree builder using the builder's addobserver method. you can add more than one observer if needed, and can
remove them again with the builder's
removeobserver method. the observer is always invoked before the appropriate o...
Adding Style Sheets - Archive of obsolete content
ormation such as the fonts, colors, borders, and size of elements. mozilla applies a default style sheet to each xul window. in many cases, it will suffice to leave the defaults as is. other times, however, you will want to provide a custom style sheet. in general, you will associate a single style sheet with each xul file. you can place a style sheet anywhere you wish. if your xul file is stored
remotely and accessed via an http url, you can store the style sheet
remotely as well. if you are creating a xul package to be installed as part of the chrome system, you have two choices. first, you could store the style sheet in the same directory as the xul file. this method has the disadvantage because it means your application will not be themeable. the second method involves placing your files ...
...> <hbox> <progressmeter id="progmeter" value="50%" style="display:none;"/> the new xml-stylesheet line is used to import the style sheet. it will contain the styles instead of having them directly in the xul file. you can include any number of style sheets in a similar way. here the style sheet is placed in the same directory as findfile.xul. some of the styles in the code above have been
removed. one that wasn't was the display property on the progressmeter. this will be changed by a script so it was left in, as it doesn't really make sense to have the progress bar visible initially. you could still put this in a separate style sheet if you really wanted to. a class was added to the spacers so that they can be referred to. a style sheet also needs to be created. create a file findf...
...cated here. we have done a similar thing with the global style sheet file (chrome://global/skin). a style sheet may import styles from another stylesheet using the import directive. normally, you will only import one style sheet from each xul file. the global style sheet can be imported from within the style sheet associated with the xul file. this can be done with the code below, allowing you to
remove the import from the xul file: style import from xul: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> style import from css: @import url(chrome://global/skin/); the second syntax is preferred because it reduces the number of dependencies within the xul file itself.
remove the global style sheet import from findfile.xul and add the import to findfile.css. all elements can ...
Anonymous Content - Archive of obsolete content
ments that were specified on the outer element. declaring scrollbar example the example below shows how a scrollbar might be declared (it has been simplified a bit from the real thing): <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <binding id="scrollbarbinding"> <content> <xul:scrollbarbutton type="dec
rement"/> <xul:slider flex="1"> <xul:thumb/> </xul:slider> <xul:scrollbarbutton type="inc
rement"/> </content> </binding> </bindings> this file contains a single binding, declared with the binding element. the id attribute should be set to the identifier of the binding. this way it can be referred to through the css -moz-binding property. the content tag is used to dec...
...mably this binding would be bound to a scroll bar, although it doesn't have to be. any element that has its css -moz-binding property set to the uri of the binding will use it. the result of using the above binding is that the line of xul below will be expanded as follows, assuming that the scrollbar is bound to the xbl above: <scrollbar/> expands to: <scrollbar> <xul:scrollbarbutton type="dec
rement"/> <xul:slider flex="1"> <xul:thumb/> </xul:slider> <xul:scrollbarbutton type="inc
rement"/> </scrollbar> the elements within the content tag are added to the scroll bar anonymously. although anonymous content is displayed on screen, you cannot get to it through a script in the normal way. to the xul, it's as if there was only one single element, even though it is really made u...
...see also anonymous content section of the xbl reference. in the next section, we'll look at how attributes can be inherited into the anonymous content. « previousnext » ...
Box Objects - Archive of obsolete content
boxes, that is the box is the base of all displayed xul elements. however, there are a number of subtypes, about 25 or so, for specific xul elements. some of these subtypes, such as the stack or listbox are needed for more complex layouts than the basic box, while others such as the button are used only to add extra mouse and key event handling. the layout object associated with an element can be
removed and a completely different type of object created just by changing the css display property, among others. for example changing the display property of a button element to block will cause the button layout object to be deleted and a block object to be created instead. naturally, this will change the appearance and function of the element. it isn't necessary to know the details of how the lay...
...width and height, respectively. note that retrieving these values will return the size only if it was explicitly specified. these properties will return an empty string if the width or height attributes or properties were not set already. that is, you cannot get the current size with these properties; instead you must use the box object properties. this may be a bit confusing, but, the key is to
remember that the width and height properties on an element return the size that was set in the xul while the width and height properties of the box object return the current size. hidden or collapsed element the hidden attribute will hide an element such that it will not be displayed. since it is not displayed, all four position and size properties of the box object will have the value 0. when an el...
...d height properties on an element return the size that was set in the xul while the width and height properties of the box object return the current size. hidden or collapsed element the hidden attribute will hide an element such that it will not be displayed. since it is not displayed, all four position and size properties of the box object will have the value 0. when an element is hidden, it is
removed from the display and the layout objects are
removed for it. thus, since it isn't displayed anywhere, it will have no position or size. the collapsed attribute will have the same effect to the user element visually, except that it leaves the element on screen and keeps the layout objects intact, but changes the size of the element to 0. this means that while both hidden and collapsed elements ...
Modifying a XUL Interface - Archive of obsolete content
hat a xul element will be created. for an html document, an html element will be created, so it will have the features and functions of an html element instead. the createelementns() function may be used to create elements in a different namespace. the appendchild() function is used to add an element as a child of another element. three related functions are the insertbefore(), replacechild() and
removechild functions. the syntax of these functions is as follows: parent.appendchild(child); parent.insertbefore(child, referencechild); parent.replacechild(newchild, oldchild); parent.
removechild(child); it should be fairly straightforward from the function names what these functions do. the insertbefore() function inserts a new child node before an existing one. this is used to insert into th...
...ild); parent.replacechild(newchild, oldchild); parent.
removechild(child); it should be fairly straightforward from the function names what these functions do. the insertbefore() function inserts a new child node before an existing one. this is used to insert into the middle of a list of children of the parent element instead of at the end like appendchild() does. the replacechild() function
removes an existing child and adds a new one in its place at the same position in the list of its parent element. finally the
removechild() function
removes a child from the list of its parent element. note that for all these functions, the object referred to by the variable referencechild or the variables newchild and oldchild must already exist or an error occurs. likewise the object referred to...
...one in its place at the same position in the list of its parent element. finally the
removechild() function
removes a child from the list of its parent element. note that for all these functions, the object referred to by the variable referencechild or the variables newchild and oldchild must already exist or an error occurs. likewise the object referred to by the variable child which is to be
removed must already exist or an error occurs. moving nodes to a different place it is often the case that you want to
remove an existing element and add it somewhere else. if so, you can just add the element without
removing it first. since a node may only be in one place at a time, the insertion call will always
remove the node from its existing location first. this is a convenient way to move node...
Numeric Controls - Archive of obsolete content
fied, it will default to 1, the minimum value. the min attribute is set to 1 to indicate a minimum possible value of 1 and the max attribute is set to 20 to indiciate a maximum possible value of 20. if the minimum value is not specified, it has a default value of 0. the maximum value defaults to the special value infinity which means that there is no limit. other numeric textbox attributes the inc
rement attribute may be used to specify by how much the value changes when the arrows are pressed. the default value is 1, but specifying a different value allows the number to change by a larger amount. for instance, the following example steps in multiples of 10. <textbox type="number" inc
rement="10" max="100"/> this textbox steps in multiples of 10 from 0 to 100. since the min attribute was not s...
...lt value is 1, but specifying a different value allows the number to change by a larger amount. for instance, the following example steps in multiples of 10. <textbox type="number" inc
rement="10" max="100"/> this textbox steps in multiples of 10 from 0 to 100. since the min attribute was not specified, it defaults to 0. note that the user can still enter other values if they are typed in. the inc
rement attribute only affects the arrow buttons. the user may also inc
rement or dec
rement the value using this inc
rement by using the up and down cursor keys while the textbox is focused. the decimalplaces attribute indicates how many decimal places to show. the default value is 0, which means show integers only. however a different value may be used to show decimal values. <textbox type="number" dec...
... right of the decimal point are shown. values with additional fractional digits are rounded to two digits. scales a scale element may also be used to select from a range of values. instead of a textbox however, a sliding scale is used. the user may drag the thumb of the scale to adjust the value. many of the same attributes as a numeric textbox may be used with a scale: value, min, max and inc
rement may all be used in a similar fashion. the scale does not actually show the value as a number, but it may be used in a script. a scale will fire a change event whenever the scales's value is modified. <scale value="40" min="1" max="50"/> this scale defaults to a value of 40 and has a range between 1 and 50. a numeric textbox would normally be used when the value was important to the user, for ...
Scroll Bars - Archive of obsolete content
l bar. you probably won't use this too often. a scroll bar is made up of several parts: the slider, which is the main part of the scroll bar with the adjustable box, and the two arrow buttons on the end. a scroll bar creates all of these elements automatically. the syntax of a scroll bar is as follows: <scrollbar id="identifier" orient="horizontal" curpos="20" maxpos="100" inc
rement="1" pageinc
rement="10"/> the attributes are as follows: id the unique identifer of the scroll bar orient this specifies the direction of the scroll bar. the default is horizontal, which creates a scroll bar that extends from left to right. you can also specify vertical which creates a scroll bar that extends from top to bottom. curpos this in...
... curpos this indicates the current position of the scroll bar thumb (the box that you can slide back and forth.) the value ranges from 0 to the value of maxpos. this value does not need a unit. the default value is 0. maxpos this indicates the maximum position of the scroll bar thumb. the is a numeric value and does not have a unit. the default value is 100. inc
rement the value here specifies how much the value of curpos changes by when the user clicks on one of the scroll bar arrows. the default value is 1. pageinc
rement the value here specifies how much the value of curpos changes by when the user clicks pages through the scroll bar, which can be done by clicking on the tray between the box and the arrows. the default value is 10. ...
... to 100. the value 100 might be the number of lines in a list, but it could be anything you want. the initial value in this example is 20. when clicking on one of the scroll bar arrows, the value would change by 1 either up or down. by paging through the scroll bar, the value will change by 10. when the user clicks the scroll bar arrows, the thumb will move by the amount specified by the value inc
rement. increasing the value of this attribute will cause the scroll bar to move farther with each click. the leftmost or topmost position of the scroll bar has the value 0 and the rightmost or bottommost position of the scroll bar has the value given by maxpos. by adjusting the values of the scroll bar, you can have the thumb positioned just as you want it and the change when the user clicks the arr...
Templates - Archive of obsolete content
ever, you can use other elements if you want although they are more useful for specialized cases. nevertheless, we'll start with these other elements because trees and menus require more code. to allow the creation of elements based on rdf data, you need to provide a simple template which will be duplicated for each element that is created. essentially, you provide only the first element and the
remaining elements are constructed based on the first one. the template is created using the template element. inside it, you can place the elements that you want to use for each constructed element. the template element should be placed inside the container that will contain the constructed elements. for example, if you are using a tree, you should place the template element inside a tree element. ...
... template. however, the elements inside the template need to be declared differently. you may notice in the example above that the button has a uri attribute and an unusual value for the label attribute. an attribute value inside the template that begins with 'rdf:' indicates that the value should be taken from the datasource. in the example earlier, this is the case for the label attribute. the
remainder of the value refers to the name property in the datasource. it is constructed by taking the namespace url used by the datasource and appending the property name. if you don't understand this, try re-reading the last part of the previous section. it explains how resources in rdf can be referred to. here, we only use the name of the bookmark but numerous other fields are available. the label...
...e (rdf:type), we needed to add the namespace declaration to the window tag. if we didn't do this, the attribute would be looked for in the xul namespace. because it does not exist there, the rule will not match. if you use attributes in your own custom namespace, you need to add the namespace declaration in order to match them. you should be able to guess what would happen if the second rule was
removed. the result would be a single spacer displayed but no bookmarks because they don't match any of the rules. put simply, a rule matches if all of the attributes placed on the rule element match the corresponding attributes on the rdf resource. in the case of an rdf file, the resources would be the description elements. there are some small exceptions however. you cannot match based on the att...
Using Spacers - Archive of obsolete content
« previousnext » in this section, we will find out how to add some spacing in between the elements we have created. adding spacers one of the problems with developing user interfaces is that each user has a different display. some users may have larger displays with higher resolutions and others may have lower resolutions. in addition, different platforms may have special requi
rements on the user interface. if adding support for multiple languages, the text for one language may require more room than another. applications that need to support multiple platforms and languages usually have their windows laid out with lots of space to allow for this. some platforms and user interface toolkits provide components that are smart enough to resize and re-position themselves to fit th...
...ve, the spacer has a flex of 1. this makes the spacer element stretchy. if you place a spacer directly inside a window, the spacer will grow in size when the size of the window is changed. we'll add a spacer to our find file dialog soon. first, let's take a look at what happens when the current dialog is resized. if you change the size of the find files window, you can see that the elements have
remained where they started. none of them have been moved or resized even though the window has more room in it. let's see what happens when a spacer is added between the text box and the find button. by adding a spacer and resizing the window, you can see that the spacer has expanded to fill the space. the buttons have been pushed over. our find file example the code to add a spacer is shown b...
... flex of 2 says that this element has a flex that is two times the elements that have a flex of one. the flex attribute isn't used to specify an actual size. instead, it specifies how empty space it divided among the children of a container box. we'll look at boxes in the next section. once the default sizes of the children of a box are determined, the flexibility values are used to divide up the
remaining empty space in the box. for example, if a box is 200 pixels wide and contains two flexible buttons, the first 50 pixels and the other 90 pixels, there will be 60 pixels of space left over. if both buttons have a flex value of 1, the space will be divided evenly with 30 extra pixels of width going to each button. if the second button's flexibility was increased to 2, the first button would r...
XPCOM Interfaces - Archive of obsolete content
some of the properties and methods of the nsilocalfile interface. initwithpath this method is used to initialize the path and filename for the nsilocalfile. the first parameter should be the file path, such as '/usr/local/mozilla'. leafname the filename without the directory 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 fil...
...py 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. ...
...try this example by adding this code to an event handler. you should change the filename to an existing file that you have that you would like to delete. in the functions table above, you will see two functions copyto() and moveto(). ...
iframe - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an inner frame that works much like the html <iframe> element. the src attribute can be used to specify the content of the frame. this content is a separate document. the children of the iframe are ignored. currently, xul iframes running in
remote processes are not supported. if you want to run content in a
remote process, use a xul browser element. warning: when used in chrome-privileged documents (either html or xul) such as firefox addons, the contents of the frame may have the same permissions as firefox itself. this can be a serious security vulnerability, for example if you use src="http://...". when used in this case, please see displaying web content in an extension without security...
... contentdocument type: document this read-only property contains the document object in the element. ...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related nsiaccessibleprovider ...
promptBox - Archive of obsolete content
tshowing attribute on the tabbrowser will tell you how many prompts a given tab has. note: this is largely an implementation detail; if you're developing an add-on, you shouldn't need to tinker with this. you should use the window.alert() method or the nsiprompt interface instead. see using tab-modal prompts for details. ...
... listprompts() returns a list of all the prompts on the tabbrowser. nodelist listprompts( nsidomelement aprompt ); parameters aprompt this parameter isn't used; i don't know why it's even there. ...
...idomelement aprompt); nodelist listprompts(nsidomelement aprompt); methods appendprompt() creates a new prompt, adding it to the tab. nsidomelement appendprompt( args, onclosecallback ); parameters args arguments for the prompt. onclosecallback the callback routine to be called when the prompt is closed. return value an nsidomelement object representing the new prompt.
removeprompt()
removes an existing prompt. void
removeprompt( nsidomelement aprompt ); parameters aprompt the prompt to dispose of. listprompts() returns a list of all the prompts on the tabbrowser. nodelist listprompts( nsidomelement aprompt ); parameters aprompt this parameter isn't used; i don't know why it's even there. return value a nodelist containing all of the prompt elements on the tabbrowser. ...
toolbarbutton - Archive of obsolete content
h a higher tabindex are later in the tab sequence. title type: string this functionality only applies when toolbarbutton is used in the customize toolbar dialog. the text that is displayed as a button's label when it's in the customize toolbar palette. it overrides the value of label, which is used if title is not set. this does not affect the button's label when it is in a toolbar, which
remains determined by the label attribute. type type: string the type of button. if this attribute is not present, a normal button is created. you can set this attribute to the value menu to create a button with a menu popup. this will typically cause the button to be displayed differently. menu: set the type attribute to the value menu to create a button with a menu popup. place a menup...
...te a group of toolbarbuttons using this type and the attribute group. examples: type value <toolbarbutton > menu menu-button checkbox radio validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored
remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the image will be loaded from the cache if possible. properties accesskey type: character gets and sets the value of the accesskey attr...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider, nsi...
toolbaritem - Archive of obsolete content
em that appears on a toolbar. this element should wrap all customizable items (unless they're instances of toolbarbutton). if you don't need the thing you're placing in the toolbar to be customized then it doesn't need to be in a toolbaritem element. the element is used, for example, to hold the location bar's textbox in firefox. it is also used to group buttons together so they can be added and
removed all at once like firefox's unified-back-forward-button. examples <toolbaritem> <menulist label="bus"> <menupopup> <menuitem label="car"/> <menuitem label="taxi"/> <menuitem label="bus" selected="true"/> <menuitem label="train"/> </menupopup> </menulist> </toolbaritem> <toolbaritem id="sample-toolbutton-unified"> <toolbarb...
...lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
loper preview of the mozilla xulrunner application framework. it replaces version 1.8.0.1; all users should upgrade. it provides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications. as of december 2008,xulrunner 1.9.0.4 is available in the "gecko 1.9.0" branch upon which firefox 3 is based. system requi
rements before installing, make sure your computer meets the system requi
rements. the system requi
rements for xulrunner are the same as the system requi
rements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to ...
.../xulrunner/1.8.0.4 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. ...
...alling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to
remove all installed versions of xulrunner,
remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with th...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
plication framework. it provides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications. xulrunner 1.9.1.x is built from the same source code snapshot as firefox 3.5.x. current version the current version of xulrunner is 1.9.1.19, matching firefox 3.5.19 detailed release notes can be found here. system requi
rements before installing, make sure your computer meets the system requi
rements. the system requi
rements for xulrunner are the same as the system requi
rements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a ...
...pt/xulrunner/1.9.1 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. ...
...alling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to
remove all installed versions of xulrunner,
remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the ex...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
ation framework. it provides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications. xulrunner 1.9.2.x is built from the same source code snapshot as firefox 3.6.x. current version the current version of xulrunner 1.9.2 is 3.6.26, matching firefox 3.6.26 detailed release notes can be found here. system requi
rements before installing, make sure your computer meets the system requi
rements. the system requi
rements for xulrunner are the same as the system requi
rements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new dire...
...ed: /opt/xulrunner/1.9.2 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. ...
... uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to
remove all installed versions of xulrunner,
remove the /library/frameworks/xul.framework directory. you also need to
remove the receipt, especially if you plan on reinstalling a different version. type sudo rm /var/db/receipts/org.mozilla.xu...
XULRunner 1.9 Release Notes - Archive of obsolete content
ll users should upgrade. it provides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications. xulrunner 1.9 is built from the same source code snapshot as firefox 3. current version the current version of xulrunner is 1.9.0.17, matching firefox 3.0.17 detailed release notes can be found here. system requi
rements before installing, make sure your computer meets the system requi
rements. the system requi
rements for xulrunner are the same as the system requi
rements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to ...
.../opt/xulrunner/1.9 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. ...
...alling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to
remove all installed versions of xulrunner,
remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with th...
XULRunner 2.0 Release Notes - Archive of obsolete content
ner application framework. it provides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications. xulrunner 2.0.x is built from the same source code snapshot as firefox 4.0.x. current version the current version of xulrunner 2.0 is 2.0, matching firefox 4.0 detailed release notes can be found here. system requi
rements before installing, make sure your computer meets the system requi
rements (nb: that page will change for firefox 4 shipping). the system requi
rements for xulrunner are the same as the system requi
rements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english. the releases directory can be found here. specific runtimes can be found at: downl...
...nded: /opt/xulrunner/2.0 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. ...
... uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to
remove all installed versions of xulrunner,
remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the exte...
2006-10-06 - Archive of obsolete content
ests for rc2 have been run and that rc2 is go for the final staging of the release. preed followed up and said that the checker was run and "build is go for launch". re: sunbird and lightning 0.3rc1 available sunbird and lightning 0.3rc1 is announced. this launches a (misguided?) discussion and comparison of sunbird and lightning to outlook. extension compatibility for firefox 2 chris hofmann
reminds about the push to have extensions work with ff2. also invites people to file bugs about extensions that don't work. also invites people to help extension developers test for compatibility (link to a bunch of extension compatability bugs) discussions reining in the release process a discussion of what can be done to speed up the release process. the new roadmap - will there be something som...
...ile bugs about extensions that don't work. also invites people to help extension developers test for compatibility (link to a bunch of extension compatability bugs) discussions reining in the release process a discussion of what can be done to speed up the release process. the new roadmap - will there be something sometime? simon paquet asked for an update of the road map and either update or
removal of the planning blog. adam gutherie replied that cbeard's blog post from nov 2005 is as close to a roadmap as exists right now and agrees that needs to be done about this. re: plan to hold trunk closed for lack of talkback dbaron mentioned that maybe trunk should be closed because of lack of talkbacks received ( bug 354835 is suspected). pal-moz offers a solution to bug 354835. dbaron then ...
...ks about the gecko 1.8.0.8 schedule. dbaron and chris ilias respond with relative dates but still no schedule. rc2 status schrep asks for any final things standing in the way of rc2. rc2 starts spinning and en-us builds are annoucned. beltzner says that (as per bon echo status meeting) that rc2 is going to be re-spun to fix some final bugs that were regressed and patches that were just landed.
reminder - ff2 rc2 code freeze 9/29/2006 at 9am pdt schrep started a discussion of bugs that need to be fixed for the ff2 rc2 code freeze to go ahead. meetings weekly status meeting - 10/02/2006 - (last meeting notes) bon echo status meeting - 10/03/2006 - (last meeting notes) ...
2006-12-01 - Archive of obsolete content
firefox 1.5.0.9/2.0.0.1 update - we need help! jay patael calls for help getting the next update ff 1.5.x and 2.x. ...
... firefox 1.5.0.9/2.0.0.1 update - we need help! jay patael calls for help getting the next update ff 1.5.x and 2.x. ...
...king over the ff2 triage meetings until gecko 1.9a1 ships (nov 28th). watch #grandparadiso for updates. discussion november 29th gecko 1.9/gran paradiso status meeting other than annoucing the meeting, this thread discusses where else can info about what happens at the meetings be found (since the agenda often seems bare). m.d.planning and dev news blog are suggested. bon echo project status:
remaining "to-do" items beltzner starts a discussion on when to offer 1.5.0.8+ users the chance to upgrade to ff2.x (now or when ff2.0.0.1 is released). also discussed is the the mozilla_1_8_branch's npotb (not part of the build) checkin policy. this newsgroup or "governance"? mitchell baker asks where should topics about organization and governance, moz.dev.planning or moz.governance? mozilla.or...
NPClass - Archive of obsolete content
t). syntax struct npclass { uint32_t structversion; npallocatefunctionptr allocate; npdeallocatefunctionptr deallocate; npinvalidatefunctionptr invalidate; nphasmethodfunctionptr hasmethod; npinvokefunctionptr invoke; npinvokedefaultfunctionptr invokedefault; nphaspropertyfunctionptr hasproperty; npgetpropertyfunctionptr getproperty; npsetpropertyfunctionptr setproperty; np
removepropertyfunctionptr
removeproperty; npenumerationfunctionptr enumerate; npconstructfunctionptr construct; }; warning: don't call these routines directly. you should instead use the appropriate api functions. fields structversion the version number of the structure. this is set to np_class_struct_version, which is 1 in mozilla 1.8.*, 2 since mozilla 1.9a1, and 3 since firefox 3.0b1. ...
...y exists, otherwise returns false. getproperty called by npn_getproperty() to get the value of the specified property on a given npobject. returns true if the value was successfully retrieved, otherwise returns false. setproperty called by npn_setproperty() to set the value of the specified property on a given npobject. returns true if the value was successfully set, otherwise returns false.
removeproperty called by npn_
removeproperty() to
remove a given property from a specified npobject. returns true if the property was successfully
removed, otherwise returns false. enumerate called by npn_enumerate. this field is available only if structversion is np_class_struct_version_enum (2) or greater. construct called by npn_construct. this field is available only if structversion is np_cl...
... npvariant *result); typedef bool (*nphaspropertyfunctionptr)(npobject *npobj, npidentifier name); typedef bool (*npgetpropertyfunctionptr)(npobject *npobj, npidentifier name, npvariant *result); typedef bool (*npsetpropertyfunctionptr)(npobject *npobj, npidentifier name, const npvariant *value); typedef bool (*np
removepropertyfunctionptr)(npobject *npobj, npidentifier name); typedef bool (*npenumerationfunctionptr)(npobject *npobj, npidentifier **value, uint32_t *count); typedef bool (*npconstructfunctionptr)(npobject *npobj, const npvariant *args, ...
NPAPI plugin reference - Archive of obsolete content
pecified amount of memory. npn_memfree deallocates a block of allocated memory. npn_pluginthreadasynccall thread safe way to request that the browser calls a plug-in function on the browser or plugin thread (the thread on which the plug-in was initiated). npn_posturl posts data to a url. npn_posturlnotify posts data to a url, and receives notification of the result. ...
...result. npn_releaseobject dec
rements the reference count of the given npobject. if the reference count reaches 0, the npobject is deallocated by calling its deallocate function if one is provided; if one is not provided, free() is used. npn_releasevariantvalue npn_releasevariantvalue() releases the value in the given variant. npn_reloadplugins reloads all of the installed plugins. npn_
removeproperty
removes a property from the specified npobject. npn_requestread requests a range of bytes from a seekable stream. this initiates a read operation; the actual data is received through subsequent calls to npp_writeready() and npp_write(). npn_retainobject inc
rements the reference count of the given npobject. npn_setexception a plugin can call this function to indicate that a call ...
...mented by plugins. this call is used to inform plugins of variable information controlled by the browser. npp_setwindow tells the plug-in when a window is created, moved, sized, or destroyed. npp_streamasfile provides a local file name for the data from a stream. npp_urlnotify notifies the plug-in instance of the completion of a url request. npp_write delivers data to a plug-in instance. (
remark: hence the name "npp_write" is misleading - just think of:"data_arrived") npp_writeready determines maximum number of bytes that the plug-in can consume. npprint contains information the plug-in needs to print itself in full-page or embedded mode. npprintcallbackstruct contains information required by the platformprint field of the npembedprint structure during embedded mode printing on ...
Security Controls - Archive of obsolete content
ould be protected based on the potential impact of a loss of confidentiality, integrity, or availability. protection measures (otherwise known as security controls) tend to fall into two categories. first, security weaknesses in the system need to be resolved. for example, if a system has a known vulnerability that attackers could exploit, the system should be patched so that the vulnerability is
removed or mitigated. second, the system should offer only the required functionality to each authorized user, so that no one can use functions that are not necessary. this principle is known as least privilege. limiting functionality and resolving security weaknesses have a common goal: give attackers as few opportunities as possible to breach a system. there are three types of security controls, a...
... the security controls that are primarily implemented and executed by people (as opposed to systems). technical controls: the security controls that are primarily implemented and executed by the system through the system's hardware, software, or firmware. all three types of controls are necessary for robust security. for example, a security policy is a management control, but its security requi
rements are implemented by people (operational controls) and systems (technical controls). think of phishing attacks. an organization may have an acceptable use policy that specifies the conduct of users, including not visiting malicious websites. security controls to help thwart phishing, besides the management control of the acceptable use policy itself, include operational controls, such as traini...
...wise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system. a combination of network-based and host-based controls is generally most effective at providing consistent protection. original document information author(s): u.s. department of commerce title: federal information processing standard publication 200, minimum security requi
rements for federal information and information systems last updated date: march 2006 copyright information: this document is not subject to copyright. original document information author(s): karen scarfone, wayne jansen, and miles tracy title: nist special publication 800-123, guide to general server security last updated date: july 2008 copyright information: this document is not subje...
Building a Theme - Archive of obsolete content
themes/my_theme/). inside your new theme folder, create two new empty text files, one called chrome.manifest and the other called install.rdf. the file preview.png is shown as a preview of the theme in the themes panel of the add-ons window. the file icon.png is used as an icon in the same panel. we'll leave both of them out for now, unless you have something picked out that you want to use. the
remaining directories will be extracted from the default theme. first, you'll want to create a directory somewhere. copy your firefox installation's omni.ja into this directory. the location differs by operating system: linux: /usr/lib/mozillafirefox/chrome/classic.ja or /usr/lib/firefox-*.*.*/omni.ja windows: \program files\mozilla firefox\omni.ja mac os x: /applications/firefox.app/contents/maco...
...restart firefox. locate your profile folder and beneath it the profile you want to work with (e.g. firefox/profiles/<profile_id>.default/). open the extensions/ folder, creating it if need be. create a new text file and put the full path to your development folder inside (e.g. c:\themes\my_theme\ or ~/themes/my_theme/). windows users should retain the os' slash direction, and everyone should
remember to include a closing slash and
remove any trailing spaces. save the file with the id of your theme as its name (e.g. sample@example.net). no file extension. now you should be ready to test your theme! start firefox. firefox will detect the text link to your theme directory and install the theme. your theme will not be active the first time you install, and you will need to click "enable"...
... now upload the .xpi file to your server, making sure it's served as application/x-xpinstall. you can link to it and allow people to download and install it. for the purposes of just testing our .xpi file we can just drag it into the add-ons manager via "tools -> add-ons manager", or open it using "file -> open file...". installing from a w...
Browser Feature Detection - Archive of obsolete content
an experimental approach to discovering degree of support for standards. among the methods of browser detection, many people recommend using the existence of specific properties or methods in a browser's dom to detect the browser type and whether it supports a given operation. this test takes that idea to the ext
reme and tests a large number of properties and methods to determine the level of support a browser has for particular standards and reports a rating as the percentage of names the browser defines. this article has generally never been more than a way to show off firefox web compatibility, rather than something truly informative in a broader sense. therefore, given that it's also badly out of date, it's been archived. you should not rely on any information here. browse...
...e true true true borderrightstyle true true true borderbottomstyle true true true borderleftstyle true true true bottom true true true captionside true false true clear true true true clip true true true content true false true counterinc
rement true false true counterreset true false true cue true false false cueafter true false false cuebefore true false false cursor true true true direction true true true elevation true false false emptycells true false true fontsizeadjust...
...yle', 'supported': false}, {name: 'borderrightstyle', 'supported': false}, {name: 'borderbottomstyle', 'supported': false}, {name: 'borderleftstyle', 'supported': false}, {name: 'bottom', 'supported': false}, {name: 'captionside', 'supported': false}, {name: 'clear', 'supported': false}, {name: 'clip', 'supported': false}, {name: 'content', 'supported': false}, {name: 'counterinc
rement', 'supported': false}, {name: 'counterreset', 'supported': false}, {name: 'cue', 'supported': false}, {name: 'cueafter', 'supported': false}, {name: 'cuebefore', 'supported': false}, {name: 'cursor', 'supported': false}, {name: 'direction', 'supported': false}, {name: 'elevation', 'supported': false}, {name: 'emptycells', 'supported': false}, {name: 'fontsizeadjust', 'support...
Array.observe() - Archive of obsolete content
you can use the more general proxy object instead. ...
...ange objects are: name: the name of the property which was changed. object: the changed array after the change was made. type: a string indicating the type of change taking place. one of "add", "update", "delete", or "splice". oldvalue: only for "update" and "delete" types. the value before the change. index: only for the "splice" type. the index at which the change occurred.
removed: only for the "splice" type. an array of the
removed elements. addedcount: only for the "splice" type. the number of elements added. description the callback function is called each time a change is made to arr, with an array of all changes in the order in which they occurred. changes done via array methods, such as array.prototype.pop() will be reported as "splice" changes.
...plice" changes. index assignment changes which do not change the length of the array may be reported as "update" changes. examples logging different change types var arr = ['a', 'b', 'c']; array.observe(arr, function(changes) { console.log(changes); }); arr[1] = 'b'; // [{type: 'update', object: <arr>, name: '1', oldvalue: 'b'}] arr[3] = 'd'; // [{type: 'splice', object: <arr>, index: 3,
removed: [], addedcount: 1}] arr.splice(1, 2, 'beta', 'gamma', 'delta'); // [{type: 'splice', object: <arr>, index: 1,
removed: ['b', 'c'], addedcount: 3}] specifications strawman proposal specification. ...
Array.unobserve() - Archive of obsolete content
the array.unobserve() method was used to
remove observers set by array.observe(), but has been deprecated and
removed from browsers. you can use the more general proxy object instead. syntax array.unobserve(arr, callback) parameters arr the array to stop observing. callback the reference to the observer to stop calling each time changes are made on the array arr. description array.unobserve() should be called after array.observe() in order to
remove an observer from an array. the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer. it's useless to call array.unobserve() with an anonymous function as callback, it will not
remove any observer. examples unobserving an array var a...
...function, because this reference will be used to unset the previous observer. it's useless to call array.unobserve() with an anonymous function as callback, it will not
remove any observer. ...
...rve(arr, observer); arr.push(4); // [{type: "splice", object: <arr>, index: 3,
removed:[], addedcount: 1}] array.unobserve(arr, observer); arr.pop(); // the callback wasn't called using an anonymous function var persons = ['khalid', 'ahmed', 'mohammed']; array.observe(persons, function (changes) { console.log(changes); }); persons.shift(); // [{type: "splice", object: <arr>, index: 0,
removed: [ "khalid" ], addedcount: 0 }] array.unobserve(persons, function (changes) { console.log(changes); }); persons.push('abdullah'); // [{type: "splice", object: <arr>, index: 2,
removed: [], addedcount: 1 }] // the callback will always be called ...
ActiveXObject - Archive of obsolete content
to an automation object. this object is used only to instantiate automation objects, and has no members. syntax let newobj = new activexobject(servername.typename[, location]) parameters servername the name of the application providing the object. typename the type or class of the object to create. location optional the name of the network server where the object is to be created.
remarks automation servers provide at least one type of object. for example, a word-processing application may provide an application object, a document object, and a toolbar object. you may be able to identify servername.typename values on a host pc in the hkey_classes_root registry key. for example, here are a few examples of values you may find there, depending on which programs are installed: ...
... activesheet.cells collection. // make excel visible through the application object. excelsheet.application.visible = true; // place some text in the first cell of the sheet. excelsheet.activesheet.cells(1,1).value = "this is column a, row 1"; // save the sheet. excelsheet.saveas("c:\\test.xls"); // close excel with the quit method on the application object. ...
...method on the application object. excelsheet.application.quit(); requi
rements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards. not supported in windows 8.x store apps. note: creating an activexobject on a
remote server is not supported in internet explorer 9 standards mode, internet explorer 10 standards mode, internet explorer 11 standards mode, and windows store apps or later. ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
has capabilities that run in rhino. let’s take a closer look at rhino and its importance to the javascript developer. rhino offers a unique opportunity for the javascript developer to tap into the power of java classes using javascript. armed with some basic java knowledge, you can extend javascript to include some of the most desired capability such as database access,
remote web requests, and xml processing. we’ll start by taking a look at querying a sql database. this first example we’ll demonstrate is querying a mysql database for some employee contact information. it is assumed that you have already downloaded, extracted, and consumed the necessary documentation to get up and running with some basic rhino scripts. if you don’t al...
...4x (ecmascript for xml) is an extension of javascript which provides direct support for xml, greatly simplifying the process of consuming xml via javascript. rhino’s support of this important standard eliminates the pain of using dom or sax based parsers in java. listing 3 below details a script used to process an rss feed from the mozilla website. ...
...)", [ name, email, message ] ); } formprocessor.proxy = true; </script> the first statement which uses the j...
Reference - Archive of obsolete content
wording should be changed with the javascript 1.x examples, as well as refer to the versions in the past tense. i also support the use of a deprecated pre box with these examples. since it's been 9 months since the last comment on this, i think i'll go ahead and change all of the examples. if anyone disagrees, you can always revert. sevenspade 13:19, 2 july 2006 (pdt) after some thought, i
removed the references to using language="javascript1.2", and all references are merely presented as information detailing past behavior. the "backwards compatibility" sections have been renamed to "behavior in older versions." however, i think this is only appropriate if we are going to document the evolution of everything, or at least note the most significant changes introduced in the various vers...
...vascript1.2", and all references are merely presented as information detailing past behavior. the "backwards compatibility" sections have been renamed to "behavior in older versions." however, i think this is only appropriate if we are going to document the evolution of everything, or at least note the most significant changes introduced in the various versions. otherwise, i think we should just
remove the "behavior in other versions" sections, and rename the "javascript 1.2" section headings to something like "differences with javascript 1.2," as well as include a link to the yet-to-be-written javascript 1.2 page documenting the various oddities and deviations made in that version, something which i think we should do anyway. maybe something like main article: javascript 1.2--sevenspade 15:...
...is number 2. it's not in the ecma docs. if it's not in a standard, and that sun doc is corrent, then it should probably go in the window object methods. --jonnyq i've already added those methods in the methods listing, but i haven't defined them yet. --maian 02:39, 21 october 2005 (pdt) delete? i don't see any mention in the operators section for the delete operator. did this operator get
removed/deprecated, or is it missing from the documentation? brundlefly 13:15, 19 december 2005 (pst) neither: core javascript 1.5 reference:operators:special operators:delete operator --nickolay 14:48, 19 december 2005 (pst) reading offline? well, may be it's no so common in today's world... but is there a way to get content of jsref-1.5 or other documents as a tarball? there are still valid ne...
Writing JavaScript for XHTML - Archive of obsolete content
ersion 9, internet explorer was incapable of handling xhtml sent with the official xhtml media type at all. (rather than displaying content, it would present the user with a file download dialog.) but it is also founded in the experience that javascript, authored carefully for html, can break when placed with an xml environment. this article shows some of the reasons alongside with strategies to
remedy the problems. it will encourage web authors to use more xml features and make their javascript interoperable with real xhtml applications. (note that xhtml documents which behave correctly in both application/xhtml+xml and text/html environments are sometimes known as 'polyglot' documents.) to test the following examples locally, use firefox's extension switch. just write an ordinary (x)html...
.../999/xhtml"><h1>hello world!</h1></div>'; var parser = new domparser(); var documentfragment = parser.parsefromstring(string, "text/xml"); body.appendchild(documentfragment); // assuming 'body' is the body element but be aware that if your string is not well-formed xml (e.g., you have an & where it should not be), then this method will crash, leaving you with a parser error. problem: i want to
remain forward compatible! given the direction away from formatting attributes and the possibility of xhtml becoming eventually more prominent (or at least the document author having the possibility of later wanting to make documents available in xhtml for browsers that support it), one may wish to avoid features which are not likely to stay compatible into the future. solution: avoid html-specific...
...which are not likely to stay compatible into the future. solution: avoid html-specific dom the html dom , even though it is compatible with xhtml 1.0, is not guaranteed to work with future versions of xhtml (perhaps especially the formatting properties which have been deprecated as element attributes). the regular xml dom provides sufficient methods via the element interface for getting/setting/
removing attributes. problem: my favourite js library still breaks if you use javascript libraries like the famous prototype.js or yahoo's one, there is bad news for you: as long as the developers don't apply the fixes mentioned above, you won't be able to use them in your xml-xhtml applications. two possible ways still are there, but neither is very promissing: take the library, recode it and pub...
XForms Custom Controls - Archive of obsolete content
this is required for all examples here to run! purpose you are in the right place if you would like to create your own custom renderings of the xforms controls like input, output, trigger, etc. we will also show you how to create custom controls that work with the xforms model and are automatically updated just like xforms controls. ...
...current default behavior). every xforms control's presentation has its own xbl binding. in many cases different values provided for the appearance or mediatype attributes will determine which xbl binding will be used for a particular xforms control on the form. as mentioned in the spec, the appearance attribute can be used to influence the look and feel of a control even when all other conditions
remain constant. for example, in the mozilla xforms extension we will render a combobox widget when appearance='minimal' on a select1 control. should the form author instead choose to use appearance='compact' on this control, we would render a listbox widget. here is a snippet from our .css file to show the type of css rule we would use to make such a determination. xf|select1[appearance="compact"] {...
...trol should be disabled. * this really only applies to the submit element. */ void disable(in boolean disable); /** * is called to get current value of control. */ string getcurrentvalue(); } notes: getcurrentvalue() should return the current value of the control as seen by a user. the current value of a control could differ from the value of the bound node in cases where @inc
remental='false'. disable() is called by the xforms processor to indicate to a submit element that it needs to disable/enable due to the beginning/ending of the submission process. currently it has no meaning outside of this context. focus() is used by the processor to tell the control that it is getting focus through one of a variety of ways (i.e. through xf:setfocus action) and that the control nee...
Implementation Status - Archive of obsolete content
7.4.3 expressions in actions and submissions partial 7.4.4 ui expressions partial scenarios exist where controls contained inside other controls inside a repeat won't be bound correctly 333638; 7.4.5 ui binding in other xml vocabularies unsupported not a compliance requi
rement for an xforms processor 7.4.6 binding examples supported 7.5 xforms core function library supported 7.6.1 boolean-from-string() supported 7.6.2 is-card-number() unsupported 7.7.1 avg() ...
...upported 7.10.3 id() unsupported 7.10.4 context() unsupported 7.11.1 choose() unsupported 7.11.2 event() supported 7.12 extension functions unsupported not a compliance requi
rement for an xforms processor 8. core form controls section title status notes bugs 8.1 the xforms core form controls module supported 8.1.1 common requi
rements n/a 8.1.2 input supported 8.1.3 ...
...es bugs 11.1 submission partial from 1.1 we do not yet support @mode, @indent, @replace='text', @separator, @serialize, @target, header or method child elements 11.2 xforms-submit partial we currently limit (for security reasons) submission only back to the server that served the document. but the user can choose to
remove this restriction on a site by site basis via a preference. click for more details. 330557; 11.3 xforms-submit-serialize supported 11.4 xforms-submit-done supported 11.5 xforms-submit-error supported 11.6.1 resource supported ...
XForms Range Element - Archive of obsolete content
introduction allows the user to choose a value from within a specific range of values (see the spec). attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special inc
remental - supported, default value is false start - lower bound of possible values end - upper bound of possible values step - is used for inc
rementing/dec
rementing values start/end/step attributes if the value of the bound instance node is outside the range of values specified by the start and end attributes, then the range element receives a xforms-out-of-range event. if the bound value then becomes in range, the range element receives a xforms-in-range event. start specifies the lower bound of possible values, i.
...event. start specifies the lower bound of possible values, i.e. values can't be less than the value of this attribute. if this attribute is omitted, then it is assumed to be 0. end specifies the upper bound of possible values, i.e. values can't be greater than the value of this attribute. if this attribute is omitted, then it is assumed to be the value of start + 20. step specifies the step of inc
rementing/dec
rementing values. this determines how much the value of the range will be changed upon user interaction. if this attribute is omitted, then it is assumed to be the value of end - start / 20. type restrictions the range element can be bound to a node of type xsd:duration, xsd:date, xsd:time, xsd:datetime, xsd:gyearmonth, xsd:gyear, xsd:gmonthday, xsd:gday, xsd:gmonth, xsd:float, xsd:de...
... ...
XForms Select Element - Archive of obsolete content
te gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - isn't currently supported. 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. inc
remental - supported, default value is true properties selection - see corresponding attribute inc
remental - 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 obta...
...s for the specified appearance attribute values: list - default representation (xhtml/xul) check group- used when appearance = 'full' (xhtml/xul) list displaying a listbox is the default representation (xhtml/xul). characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> visual grouping by choices element isn't implemented if inc
remental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection check group the select is represented as group of checkboxes (xhtml/xul). characteristics appearance attribute contains the value full there are no analogue widgets in xhtml or in xul visual grouping by choices element is supported if ...
...al attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection check group the select is represented as group of checkboxes (xhtml/xul). ...
Styling Abbreviations and Acronyms - Archive of obsolete content
the underline tells readers that the word in question has extra information associated with it. in mozilla, placing the mouse pointer over the element and leavi...
...ine, per the following rule in resource://gre-resources/html.css abbr[title], acronym[title] { text-decoration: dotted underline; } the solution if authors wish to
remove the underline from abbr and acronym elements, this can be done with the following rule: abbr[title], acronym[title] { text-decoration: none; } it may be better to lessen the visual weight of the border without actually
removing it. the underline tells readers that the word in question has extra information associated with it. ...
... related links web content accessibility guidelines 1.0 original document information author(s): eric a. ...
The Business Benefits of Web Standards - Archive of obsolete content
e. the development process: working in teams a common challenge for web developers when assuming management of existing sites is the code written by other developers. in many cases, they are faced with poor html code quality that may also rely on undocumented features or hacks and specific coding practices. lack of documentation is also often problematic. following standards-compliance in requi
rements documents is a very effective way to ensure measurable quality of the final product, the w3c being an impartial judge. because standards are very well documented, another person taking over some standard-compliant code can hit the ground running - and will not need to become familiar with the previous developer's coding practices. this also significantly reduces vendor lock-in. web standard...
...ng practices. this also significantly reduces vendor lock-in. web standards: enriching the user experience the whole ethos of web standards is that it is driven by the user experience. it is not driven by graphics designers, by the developers of proprietary code generators or by the need to perform three dimensional coding gymnastics to cope with the vendors of browsers and other user agents. fo
remost among the goals of standards led development to improve that user experience are the great twins usability and accessibility. put simply - and quite crudely - a pleasing, satisfying and fulfilling user experience translates, into more traffic, more repeat visitors, fewer bounces, greater loiter time and higher click throughs. ultimately that better user experience delivers the business or oper...
...are, operating system, or any one of a dozen other variables including screen size, text resolution, javascript activation, or any disabilty the user may have. conclusion using web standards and separating structure from presentation brings a host of benefits for today and tomorrow. today, it means more audience, lower cost to produce new content, and becoming compliant with accessibility requi
rements. for tomorrow, it means reducing vendor lock-in, reducing cost of maintenance, and having a more flexible web site in terms of presentation. last but not least, use of standards opens the door to xml technologies. all these factors also contribute to easier site management, a larger audience and a better return on investment. geeks, marketers and bean-counters can all benefit from a standar...
Audio for Web games - Game development
ring is an outdated one. as long as byte-range requests are accepted (which is the default behavior), we should be able to jump to a specific point in the audio without having to download the preceding content. however, preloading is still useful — without it, there would always need to be some client-server communication required before playing can commence. concurrent audio playback a requi
rement of many games is the need to play more than one piece of audio at the same time; for example, there might be background music playing along with sound effects for various things happening in the game. although the situation is soon going to get better with the adoption of the web audio api, the current most widely-supported method — using the vanilla <audio> element — leads to patchy resul...
... encourage the player in some way. music is an important part of the gaming experience and depending on the type of game you are making you may wish to invest significant effort into getting it right. one way you can make your music soundtrack more dynamic is by splitting it up into component loops or tracks. this is often the way that musicians compose music anyway, and the web audio api is ext
remely good at keeping these parts in sync. once you have the various tracks that make up your piece you can bring tracks in and out as appropriate. you can also apply filters or effects to music. is your character in a cave? increase the echo. maybe you have underwater scenes, during which you could apply a filter that muffles the sound. let's look at some web audio api techniques for dynamically ...
...ed the resulting value to the start() function with the first parameter, which takes the absolute time of when that playback should commence. note the second parameter (where to start playing from in the new track) is relative: if (offset == 0) { source.start(); offset = context.currenttime; } else { var relativetime = context.currenttime - offset; var beats = relativetime / tempo; var
remainder = beats - math.floor(beats); var delay = tempo - (
remainder*tempo); source.start(context.currenttime+delay, relativetime+delay); } note: you can try our wait calculator code here, on jsfiddle (i've synched to the bar in this case). note: if the first parameter is 0 or less than the context currenttime, playback will commence immediately. positional audio positional audio can be ...
Desktop mouse and keyboard controls - Game development
var rightpressed = false; var leftpressed = false; var uppressed = false; var downpressed = false; then we will listen for the keydown and keyup events and act accordingly in both handler functions. inside them we can get the code of the key that was pressed from the keycode property of the event object, see which key it is, and then set the proper variable. ...
...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 handler functions we could do something like this, which is arguably easier to
remember: if(event.keycode == keyboardhelper.left) { leftpressed = true; } note: you can also find a list if the different keycodes and what keys they relate to in the keycode reference page. you can see this example in action online at end3r.github.io/javascript-game-controls and the full source code can be found at github.com/end3r/javascript-game-controls. phaser approach as i mention...
...his.keyfire2.isdown) { // fire the weapon } if yes, then it's time to shoot some bullets! we can even define a secret cheat button: this.keycheat = this.input.keyboard.addkey(phaser.keycode.c); and then in the update() function whenever c is pressed we'll do this: if(this.keycheat.isdown) { this.player.health = this.player.maxhealth; } we can set the health of the player to maximum.
remember: it's a secret, so don't tell anyone! how to play we've implemented the controls, and now we should inform the player about their options to control the game — they wouldn't know about them otherwise. when showing the how to play screen where the various ways to control the ship in the game are shown, instead of showing them all to everyone, we can detect whether the game is launched on ...
2D maze game with device orientation - Game development
d the optional id of the dom container we want to put the canvas in. if there's nothing specified in that last argument or the element is not found, the canvas will be added to the <body> tag. without the framework, to add the canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> the important thing to
remember is that the framework is setting up helpful methods to speed up a lot of things like image manipulation or assets management, which would be a lot harder to do manually. note: you can read the building monster wants candy article for the in-depth introduction to the basic phaser-specific functions and methods. back to game states: the line below is adding a new state called boot to the g...
...unction, will execute the updatecounter function every single second from the beginning of the game, so we can apply the changes accordingly. this is how the complete updatecounter function looks: updatecounter: function() { this.timer++; this.timertext.settext("time: "+this.timer); this.totaltimetext.settext("total time: "+(this.totaltimer+this.timer)); }, as you can see we’re inc
rementing the this.timer variable and updating the content of the text objects with the current values on each iteration, so the player sees the elapsed time. finishing the level and the game the ball is rolling on the screen, the timer is working and we have the hole created that we have to reach. now let’s set up the possibility to actually finish the level! the following line in the update() f...
...ts source code on github. html5 gives us raw tools, the frameworks built on top of it are getting faster and better, so now is a great time get into web game development. in this tutorial we used phaser, but there are a number of other frameworks worth considering too like impactjs, construct 2 or playcanvas — it depends on your preferences, coding skills (or lack thereof), project scale, requi
rements and other aspects. you should check them all out and decide which one suits your needs best. ...
HTML: A good basis for accessibility - Learn web development
d use css to display images that are only decorative. more on links links ( the <a> element with an href attribute ), depending on how they are used, can help or harm accessibility. by default, links are accessible in appearance. they can improve accessibility by helping a user quickly navigate to different sections of a document. they can also harm accessibility if their accessible styling is
removed or if javascript causes them to behave in unexpected ways. link styling by default, links are visually different from other text in both color and text-decoration, with links being blue and underlined by default, purple and underlined if visited, and with a focus-ring when they receive keyboard focus. color should not be used as the sole method of distinguishing links from non-linking con...
...nderlined if visited, and with a focus-ring when they receive keyboard focus. color should not be used as the sole method of distinguishing links from non-linking content. link text color, like all text, has to be significantly different from the background color (a 4.5:1 contrast). in addition, links should visually be significantly different from non-linking text. with a minimum contrast requi
rement of 3:1 between link text and surrounding text and between default, visited, and focus/active states and a 4:5 contrast between all those state colors and the background color. onclick events anchor tags are often abused with the onclick event to create pseudo-buttons by setting href to "#" or "javascript:void(0)" to prevent the page from refreshing. these values cause unexpected behavior wh...
...cag 2.0 proximity large amounts of interactive content—including anchors—placed in close visual proximity to each other should have space inserted to separate them. this spacing is beneficial for people who suffer from fine motor control issues and may accidentally activate the wrong interactive content while navigating. spacing may be created using css properties such as margin. hand t
remors and the giant-button-problem - axess lab test your skills! you've reached the end of this article, but can you
remember the most important information? see test your skills: html accessibility to verify that you've retained this information before you move on. summary you should now be well-versed in writing accessible html for most occasions. our wai-aria basics article will help to fill...
HTML: A good basis for accessibility - Learn web development
d use css to display images that are only decorative. more on links links ( the <a> element with an href attribute ), depending on how they are used, can help or harm accessibility. by default, links are accessible in appearance. they can improve accessibility by helping a user quickly navigate to different sections of a document. they can also harm accessibility if their accessible styling is
removed or if javascript causes them to behave in unexpected ways. link styling by default, links are visually different from other text in both color and text-decoration, with links being blue and underlined by default, purple and underlined if visited, and with a focus-ring when they receive keyboard focus. color should not be used as the sole method of distinguishing links from non-linking con...
...nderlined if visited, and with a focus-ring when they receive keyboard focus. color should not be used as the sole method of distinguishing links from non-linking content. link text color, like all text, has to be significantly different from the background color (a 4.5:1 contrast). in addition, links should visually be significantly different from non-linking text. with a minimum contrast requi
rement of 3:1 between link text and surrounding text and between default, visited, and focus/active states and a 4:5 contrast between all those state colors and the background color. onclick events anchor tags are often abused with the onclick event to create pseudo-buttons by setting href to "#" or "javascript:void(0)" to prevent the page from refreshing. these values cause unexpected behavior wh...
...cag 2.0 proximity large amounts of interactive content—including anchors—placed in close visual proximity to each other should have space inserted to separate them. this spacing is beneficial for people who suffer from fine motor control issues and may accidentally activate the wrong interactive content while navigating. spacing may be created using css properties such as margin. hand t
remors and the giant-button-problem - axess lab test your skills! you've reached the end of this article, but can you
remember the most important information? see test your skills: html accessibility to verify that you've retained this information before you move on. summary you should now be well-versed in writing accessible html for most occasions. our wai-aria basics article will help to fill...
Mobile accessibility - Learn web development
e on mobile, you just need to follow general good web design and accessibility best practices. there are some exceptions that need special consideration for mobile; the main ones are: control mechanisms — make sure interface controls such as buttons are accessible on mobiles (i.e., mainly touchscreen), as well as desktops/laptops (mainly mouse/keyboard). user input — make user input requi
rements as painless as possible on mobile (e.g., in forms, keep typing to a minimum). responsive design — make sure layouts work on mobile, conserve image download sizes, and think about the provision of images for high-resolution screens. summary of screenreader testing on android and ios the most common mobile platforms have fully functional screen readers. these function in much the same way...
...over is enabled, ios's basic control gestures will be a bit different: a single tap will cause the item you tap on to be selected; your device will speak the item you've tapped on. you can also navigate the items on the screen by swiping left and right to move between them, or by sliding your finger around on the screen to move between different items (when you find the item you want, you can
remove your finger to select it). to activate the selected item (e.g., open a selected app), double-tap anywhere on the screen. swipe with three fingers to scroll through a page. tap with two fingers to perform a context-relevant action — for example, taking a photo while in the camera app. to turn it off again, navigate back to settings > general > accessibility > voiceover using the above ge...
...ler images to narrow screen devices as appropriate. you can handle this using responsive image techniques. thinking about high resolutions. many mobile devices have high-resolution screens, and therefore need higher-resolution images so that the display can continue to look crisp and sharp. again, you can serve images as appropriate using responsive image techniques. in addition, many image requi
rements can be fulfilled using the svg vector images format, which is well-supported across browsers today. svg has a small file size and will stay sharp regardless of whatever size is being displayed (see adding vector graphics to the web for more details). note: we won't provide a full discussion of responsive design techniques here, as they are covered in other places around mdn (see above lin...
What is accessibility? - Learn web development
e more severely affected, perhaps being significantly paralyzed to the point where they need to use a head pointer to interact with computers. this kind of disability can also be a result of old age, rather than any specific trauma or condition, and it could also result from hardware limitations — some users might not have a mouse. the way this usually affects web development work is the requi
rement that controls be accessible by the keyboard — we'll discuss keyboard accessibility in later articles in the module, but it is a good idea to try out some websites using just the keyboard to see how you get on. can you use the tab key to move between the different controls of a web form, for example? you can find more details about keyboard controls in our cross browser testing using native k...
...on disability and functioning (noninstitutionalized adults 18 years and over) reports the usa "percent of adults with any physical functioning difficulty: 16.1%". people with cognitive impairments cognitive impairment refers to a broad range of disabilities, from people with intellectual disabilities who have the most-limited capabilities, to all of us as we age and have difficulty thinking and
remembering. the range includes people with mental illnesses, such as depression and schizophrenia. it also includes people with learning disabilities, such as dyslexia and attention deficit hyperactivity disorder. importantly, though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems. these include difficu...
...ple with mental illnesses, such as depression and schizophrenia. it also includes people with learning disabilities, such as dyslexia and attention deficit hyperactivity disorder. importantly, though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems. these include difficulty with understanding content,
remembering how to complete tasks, and confusion caused by inconsistent webpage layouts. a good foundation of accessibility for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; easily-understood content, such as text written using plain-language standards; focusing attention on important content; minimizing distractions...
Backgrounds and borders - Learn web development
may end up with gaps on either side or on the top and bottom of the image, if the aspect ratio of the image is different from that of the box. in the example below i have used the larger image from the example above and used length units to size it inside the box. you can see this has distorted the image. try the following. change the length units used to modify the size of the background.
remove the length units and see what happens when you use background-size: cover or background-size: contain. if your image is smaller than the box, you can change the value of background-repeat to repeat the image. positioning the background image the background-position property allows you to choose the position in which the background image appears on the box it is applied to. this uses a co...
... it causes the element's background to scroll when the page is scrolled. if the element content is scrolled, the background does not move. in effect, the background is fixed to the same position on the page, so it scrolls as the page scrolls. fixed: it causes an element's background to be fixed to the viewport so that it doesn't scroll when the page or element content is scrolled. it will always
remain in the same position on the screen. local: this value was added later on (it is only supported in internet explorer 9+, whereas the others are supported in ie4+) because the scroll value is rather confusing and doesn't really do what you want in many cases. the local value fixes the background to the element it is set on, so when you scroll the element, the background scrolls with it. the b...
...adius of 10%: .box { border-top-right-radius: 1em 10%; } we have set all four corners in the example below and then changed the values for the top right corner to make it different. you can play with the values to change the corners. take a look at the property page for border-radius to see the available syntax options. test your skills! we have covered a lot in this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: backgrounds and borders. summary we have covered quite a lot here, and you can see that there is quite a lot to adding a background or a border to a box. do explore the different property pages if you want to find out more about any of...
Overflowing content - Learn web development
nt won't cause problems. instead, perhaps you would like to add scrollbars when content overflows? using overflow: scroll, browsers with visible scrollbars will always display them—even if there is not enough content to overflow. this offers the advantage of keeping the layout consistent, instead of scrollbars appearing or disappearing, depending upon the amount of content in the container.
remove some content from the box below. notice how the scrollbars
remain, even if there is no need for scrolling. in the example above, we only need to scroll on the y axis, however we get scrollbars in both axes. to just scroll on the y axis, you could use the overflow-y property, setting overflow-y: scroll. you can also scroll on the x axis using overflow-x, although this is not a recommende...
...e second applies to overflow-y. otherwise, both overflow-x and overflow-y are set to the same value. for example, overflow: scroll hidden would set overflow-x to scroll and overflow-y to hidden. if you only want scrollbars to appear when there is more content than can fit in the box, use overflow: auto. this allows the browser to determine if it should display scrollbars. in the example below,
remove content until it fits into the box. you should see the scrollbars disappear. overflow establishes a block formatting context when you use a value of overflow such as scroll or auto, you create a block formatting context (bfc). the content of the box that you have changed the value of overflow for acquires a self-contained layout. content outside the container cannot poke into the container...
...in mind. test designs with large and small amounts of content. increase the font sizes of text. generally ensure that your css works in a robust way. changing the value of overflow to hide content, or to add scrollbars, is likely to be reserved for a few select use cases. (for example, where you intend to have a scrolling box) test your skills! there is a lot to absorb from this lesson! can you
remember the most important information? to check your understanding, see test your skills: overflow. summary this lesson introduced the concept of overflow. you should understand that default css avoids making overflowing content invisible. you have discovered that you can manage potential overflow, and also, that you should test work to make sure it does not accidentally cause problematic overflo...
Flexbox - Learn web development
duction to css.) objective: to learn how to use the flexbox layout system to create web layouts. why flexbox? for a long time, the only reliable cross browser-compatible tools available for creating css layouts were things like floats and positioning. these are fine and they work, but in some ways they are also rather limiting and frustrating. the following simple layout requi
rements are either difficult or impossible to achieve with such tools, in any kind of convenient, flexible way: vertically centering a block of content inside its parent. making all the children of a container take up an equal amount of the available width/height, regardless of how much width/height is available. making all columns in a multiple column layout adopt the same height even if they c...
...lex-start and flex-end, which will align all items at the start and end of the cross axis respectively. see align-items for the full details. you can override the align-items behavior for individual flex items by applying the align-self property to them. for example, try adding the following to your css: button:first-child { align-self: flex-end; } have a look at what effect this has, and
remove it again when you've finished. justify-content controls where the flex items sit on the main axis. the default value is flex-start, which makes all the items sit at the start of the main axis. you can use flex-end to make them sit at the end. center is also a value for justify-content, and will make the flex items sit in the center of the main axis. the value we've used above, space-aro...
... than some css features. for example, if a browser is missing a css drop shadow, then the site will likely still be usable. not supporting flexbox features however will probably break a layout completely, making it unusable. we discuss strategies for overcoming cross browser support issues in our cross browser testing module. test your skills! we have covered a lot in this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: flexbox. summary that concludes our tour of the basics of flexbox. we hope you had fun, and will have a good play around with it as you travel forward with your learning. next we'll have a look at another important aspect of css layout...
Beginner's guide to media queries - Learn web development
inside the article, of the article content and related information in the aside element. we have also used flexbox to put the navigation into a row. open step 2 in the browser, or view the source. lets continue to expand the width until we feel there is enough room for the sidebar to also form a new column. inside a media query we'll make the main element into a two column grid. we then need to
remove the margin-bottom on the article in order that the two sidebars align with each other, and we'll add a border to the top of the footer. typically these small tweaks are the kind of thing you will do to make the design look good at each breakpoint. again, add the below code into the bottom of your step1.html css. @media screen and (min-width: 70em) { main { display: grid; ...
... by default (usually 960 pixels), and then shrink the rendered result so that it fits in the display. this is all well and good, but it means that responsive sites are not going to work as expected. if the viewport width is reported as 960 pixels, then mobile layouts (for example created using a media query of @media screen and (max-width: 600px) { ... }) are not going to render as expected. to
remedy this, including a viewport meta tag like the one above on your page tells the browser "don't render the content with a 960 pixel viewport — render it using the real device width instead, and set a default initial scale level for better consistency." the media queries will then kick in as expected. there are a number of other options you can put inside the content attribute of the viewport m...
...king at the viewport width, but the width it has available for this component. it might seem strange to wrap up a section about media queries with a suggestion that you might not need one at all! however, in practice you will find that good use of modern layout methods, enhanced with media queries, will give the best results. test your skills! you've reached the end of this article, but can you
remember the most important information? you can find a test to verify that you've retained this information before you move on — see test your skills: responsive web design. summary in this lesson you have learned about media queries, and also discovered how to use them in practice to create a mobile first responsive design. you could use the starting point that we have created to test out more...
Web fonts - Learn web development
to concern yourself with a single font file for each choice. note: under the "find fonts" section in the right-hand column, you can click on the different tags and classifications to filter the displayed choices. generating the required code now you'll need to generate the required code (and font formats). for each font, follow these steps: make sure you have satisfied any licensing requi
rement, if you are going to use this in a commercial and/or web project. go to the fontsquirrel webfont generator. upload your two font files using the upload fonts button. check the checkbox labeled "yes, the fonts i'm uploading are legally eligible for web embedding." click download your kit. after the generator has finished processing, you should get a zip file to download — save it in the...
... you should get a zip file to download — save it in the same directory as your html and css. implementing the code in your demo at this point, unzip the webfont kit you just generated. inside the unzipped directory you'll see three useful items: multiple versions of each font: (for example .ttf, .woff, .woff2, etc.; the exact fonts provided will be updated over time as browser support requi
rements change). as mentioned above, multiple fonts are needed for cross browser support — this is fontsquirrel's way of making sure you've got everything you need. a demo html file for each font — load these in your browser to see what the font will look like in different usage contexts. a stylesheet.css file, which contains the generated @font-face code you'll need. to implement these fonts...
... to be incorporated into a single file, rather than having a separate font file for every width, weight, or style. they are somewhat advanced for our beginner's course, but if you fancy stretching yourself and looking into them, read our variable fonts guide. test your skills! you've reached the end of this article, and already did some skill testing in our active learning sections, but can you
remember the most important information going forward? you can find an assessment to verify that you've retained this information at the end of the module — see typesetting a community school homepage. summary now that you have worked through our articles on text styling fundamentals, it is time to test your comprehension with our assessment for the module, typesetting a community school homepage...
Example 4 - Learn web development
ers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function definitions // // -------------------- // function deactivateselect(select) { if (!select.classlist.contains('active')) return; var optlist = select.queryselector('.optlist'); optlist.classlist.add('hidden'); select.classlist.
remove('active'); } function activeselect(select, selectlist) { if (select.classlist.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.querysel...
...st.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.
remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; funct...
...= index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.
remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (option) { option.addeventlistener('mouseover', function () { highlightoption(select, option); ...
Example 5 - Learn web development
ers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function definitions // // -------------------- // function deactivateselect(select) { if (!select.classlist.contains('active')) return; var optlist = select.queryselector('.optlist'); optlist.classlist.add('hidden'); select.classlist.
remove('active'); } function activeselect(select, selectlist) { if (select.classlist.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.querysel...
...st.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.
remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[index].setattribute('aria-select...
...= index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.
remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, s...
Responsive images - Learn web development
ontent image will fit somewhere inside the content column. here's a simple example: this works well on a wide screen device, such as a laptop or desktop (you can see the example live and find the source code on github.) we won't discuss the css much in this lesson, except to say that: the body content has been set to a maximum width of 1200 pixels — in viewports above that width, the body
remains at 1200px and centers itself in the available space. in viewports below that width, the body will stay at 100% of the width of the viewport. the header image has been set so that its center always stays in the center of the header, no matter what width the heading is set at. if the site is being viewed on a narrower screen, the important detail in the center of the image (the people) can sti...
... images via a <picture> element, but then also offer multiple resolutions of each one. realistically, you probably won't want to do this kind of thing very often. in all cases, you must provide an <img> element, with src and alt, right before </picture>, otherwise no images will appear. this provides a default case that will apply when none of the media conditions return true (you could actually
remove the second <source> element in this example), and a fallback for browsers that don't support the <picture> element. this code allows us to display a suitable image on both wide screen and narrow screen displays, as shown below: note: you should use the media attribute only in art direction scenarios; when you do use media, don't also offer media conditions within the sizes attribute. w...
...e the <picture> element to implement an art direction picture switcher! create multiple image files of different sizes, each showing the same picture. use srcset/size to create a resolution switcher example, either to serve the same size image at different resolutions, or different image sizes at different viewport widths. test your skills! you've reached the end of this article, but can you
remember the most important information? you can find a detailed assessment that tests these skills at the end of the module; see mozilla splash page. summary that's a wrap for responsive images — we hope you enjoyed playing with these new techniques. as a recap, there are two distinct problems we've been discussing here: art direction: the problem whereby you want to serve cropped images for ...
Fetching data from the server - Learn web development
the web was simple — you'd send a request for a website to a server, and as long as nothing went wrong, the assets that made the web page would be downloaded and displayed on your computer. the trouble with this model is that whenever you want to update any part of the page, for example, to display a new set of products or load a new page, you've got to load the entire page again. this is ext
remely wasteful and results in a poor user experience, especially as pages get larger and more complex. enter ajax this led to the creation of technologies that allow web pages to request small chunks of data (such as html, xml, json, or plain text) and display them only when needed, helping to solve the problem described above. this is achieved by using apis like xmlhttprequest or — more recent...
...(unless you specify a different value in a value attribute) — so for example "verse 1". the corresponding verse text file is "verse1.txt", and is in the same directory as the html file, therefore just the file name will do. however, web servers tend to be case sensitive, and the file name doesn't have a space in it. to convert "verse 1" to "verse1.txt" we need to convert the v to lower case,
remove the space, and add .txt on the end. this can be done with replace(), tolowercase(), and simple string concatenation. add the following lines inside your updatedisplay() function: verse = verse.replace(" ", ""); verse = verse.tolowercase(); let url = verse + '.txt'; to begin creating an xhr request, you need to create a new request object using the xmlhttprequest() constructor. you can...
... if the promise fails for some reason. inside it, we include a function that is passed as a parameter, an error object. this error object can be used to report the nature of the error that has occurred, in this case we do it with a simple console.log(). however, a complete website would handle this error more gracefully by displaying a message on the user's screen and perhaps offering options to
remedy the situation, but we don't need anything more than a simple console.log(). you can test the fail case yourself: make a local copy of the example files (download and unpack the can-store zip file). run the code through a web server (as described above, in serving your example from a server). modify the path to the file being fetched, to something like 'produc.json' (make sure it is missp...
Silly story generator - Learn web development
turn to the raw text file. copy the code found underneath the heading "3. event listener and partial function definition" and paste it into the bottom of your main.js file. this: adds a click event listener to the randomize variable so that when the button it represents is clicked, the result() function is run. adds a partially-completed result() function definiton to your code. for the
remainder of the assessment, you'll be filling in lines inside this function to complete it and make it work properly. completing the result() function: create a new variable called newstory, and set its value to equal storytext. this is needed so we can create a new random story each time the button is pressed and the function is run. if we made changes directly to storytext, we'd only be ...
...unds' with the contents of the weight variable. finally, in the second-to-last line of the function, make the textcontent property of the story variable (which references the paragraph) equal to newstory. hints and tips you don't need to edit the html in any way, except to apply the javascript to your html. if you are unsure whether the javascript is applied to your html properly, try
removing everything else from the javascript file temporarily, adding in a simple bit of javascript that you know will create an obvious effect, then saving and refreshing. the following for example turns the background of the <html> element red — so the entire browser window should go red if the javascript is applied properly: document.queryselector('html').style.backgroundcolor = 'red'; math...
...built-in javascript method that simply rounds the result of a calculation to the nearest whole number. there are three instances of strings that need to be replaced. you may repeat the replace() method multiple times, or you can use regular expressions. for instance, let text = 'i am the biggest lover, i love my love'; text.replace(/love/g,'like'); will replace all instances of 'love' to 'like'.
remember, strings are immutable! assessment or further help if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable editor such as codepen, jsfiddle, or glitch. write a post asking for assessment and/or help at the mdn discourse forum learning category. your post should include: a descriptive title such as "assessment wanted for...
What is JavaScript? - Learn web development
to the right size and shape, find the correct-sized screws, and then put them together to make a bookshelf. they generally fall into two categories. browser apis are built into your web browser, and are able to expose data from the surrounding computer environment, or do useful complex things. for example: the dom (document object model) api allows you to manipulate html and css, creating,
removing and changing html, dynamically applying new styles to your page, etc. every time you see a popup window appear on a page, or some new content displayed (as we saw above in our simple demo) for example, that's the dom in action. the geolocation api retrieves geographical information. this is how google maps is able to find your location and plot it on a map. the canvas and webgl apis allow ...
...ns using one instruction. the code we used above to serve this purpose looks like this: const buttons = document.queryselectorall('button'); for(let i = 0; i < buttons.length ; i++) { buttons[i].addeventlistener('click', createparagraph); } this might be a bit longer than the onclick attribute, but it will work for all buttons — no matter how many are on the page, nor how many are added or
removed. the javascript does not need to be changed. note: try editing your version of apply-javascript.html and add a few more buttons into the file. when you reload, you should find that all of the buttons when clicked will create a paragraph. neat, huh? script loading strategies there are a number of issues involved with getting scripts to load at the right time. nothing is as simple as it se...
...them using defer and put their corresponding <script> elements in the order you want the browser to execute them. comments as with html and css, it is possible to write comments into your javascript code that will be ignored by the browser, and exist simply to provide instructions to your fellow developers on how the code works (and you, if you come back to your code after six months and can't
remember what you did). comments are very useful, and you should use them often, particularly for larger applications. there are two types: a single line comment is written after a double forward slash (//), e.g. // i am a comment a multi-line comment is written between the strings /* and */, e.g. /* i am also a comment */ so for example, we could annotate our last demo's javascript...
Adding features to our bouncing balls demo - Learn web development
should also define a new property called exists, which is used to track whether the balls exist in the program (have not been eaten by the evil circle). this should be a boolean (true/false). the ball() constructor should inherit the x, y, velx, vely, and exists properties from the shape() constructor. it should also define a color and a size property, like the original ball() constructor did.
remember to set the ball() constructor's prototype and constructor appropriately. the ball draw(), update(), and collisiondetect() method definitions should be able to stay exactly the same as they were before. you also need to add a new parameter to the new ball() ( ... ) constructor call — the exists parameter should be the 5th parameter, and should be given a value of true. at this point, tr...
... not going to take over the world with a single evil circle, but it will do for this assessment. the evilcircle() constructor should inherit x, y, velx, vely, and exists from shape(), but velx and vely should always equal 20. you should do this something like shape.call(this, x, y, 20, 20, exists); it should also define its own properties, as follows: color — 'white' size — 10 again,
remember to define your inherited properties as parameters in the constructor, and set the prototype and constructor properties correctly. defining evilcircle()'s methods evilcircle() should have four methods, as described below. draw() this method has the same purpose as ball()'s draw() method: it draws the object instance on the canvas. it will work in a very similar way, so you can start by co...
... element just below the <h1> element containing the text "ball count: ". in your css file, add the following rule at the bottom: p { position: absolute; margin: 0; top: 35px; right: 5px; color: #aaa; } in your javascript, make the following updates: create a variable that stores a reference to the paragraph. keep a count of the number of balls on screen in some way. inc
rement the count and display the updated number of balls each time a ball is added to the scene. dec
rement the count and display the updated number of balls each time the evil circle eats a ball (causes it not to exist). assessment or further help if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable editor such as codepen...
Measuring performance - Learn web development
window's load handler, and more. you can use the api for metrics related to all of the navigation events displayed in the didagram below. the performance api, which provides access to performance-related information for the current page, includes the performance timeline api, the navigation timing api, the user timing api, and the resource timing api. these interfaces allows the accurate measu
rement of the time it takes for javascript tasks to complete. the performanceentry object is part of the performance timeline. a performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. performance entries are also created in indirect ways; such as loading a resource, like an image. the perfo...
... the performanceentry object is part of the performance timeline. a performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. performance entries are also created in indirect ways; such as loading a resource, like an image. the performanceobserver api can be used to observe performance measu
rement events and it can notify you of new performance entries as they are recorded in the browser's performance timeline. while this article does not dive into using these apis, it is useful to know they exist. you can also refer to the navigation and timings article for further examples on using performance web apis. tools and metrics there are a number of different tools available to help you...
...espeed insights or the firefox network monitor and performance monitor. these tools show you how fast or slow your web app or site load. they also indicate areas that can be improved to optimize your web app. tools that update code so that your web app or site will perform better. for example, bundling tools pack your code into single files to reduce the number of http requests or minifiers that
remove all whitespace from your code to make the files smaller. we'll talk about both categories in this course. and as well as talking about performance metrics we will of course talk about the metrics that you'll use to measure whether your site's performance is improving. general performance reporting tools tools like pagespeed insights can measure a website’s performance. you can enter a ur...
Server-side web frameworks - Learn web development
both the effort to write and maintain code (since you can't write new features while old ones are broken). many of the factors affecting productivity are similar to those for "effort to learn" — e.g. documentation, community, programming experience, etc. — other factors include: framework purpose/origin: some web frameworks were initially created to solve certain types of problems, and
remain better at creating web apps with similar constraints. for example, django was created to support development of a newspaper website, so it's good for blogs and other sites that involve publishing things. by contrast, flask is a much lighter-weight framework and is great for creating web apps running on embedded devices. opinionated vs unopinionated: an opinionated framework is one in which ...
...en knowledge foundation, pinterest, open stack. flask (python) flask is a microframework for python. while minimalist, flask can create serious websites out of the box. it contains a development server and debugger, and includes support for jinja2 templating, secure cookies, unit testing, and restful request dispatching. it has good documentation and an active community. flask has become ext
remely popular, particularly for developers who need to provide web services on small, resource-constrained systems (e.g. running a web server on a raspberry pi, drone controllers, etc.) express (node.js/javascript) express is a fast, unopinionated, flexible and minimalist web framework for node.js (node is a browserless environment for running javascript). it provides a robust set of features for ...
...ined systems (e.g. running a web server on a raspberry pi, drone controllers, etc.) express (node.js/javascript) express is a fast, unopinionated, flexible and minimalist web framework for node.js (node is a browserless environment for running javascript). it provides a robust set of features for web and mobile applications and delivers useful http utility methods and middleware. express is ext
remely popular, partially because it eases the migration of client-side javascript web programmers into server-side development, and partially because it is resource-efficient (the underlying node environment uses lightweight multitasking within a thread rather than spawning separate processes for every new web request). because express is a minimalist web framework it does not incorporate every co...
Getting started with Ember - Learn web development
he ember toolchain locally, create a sample app, and then do some initial setup to get it ready for development. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be ext
remely beneficial, as ember makes heavy use of them. objective: to learn how to install ember, and create a starter app. introducing ember ember is a component-service framework that focuses on the overall web application development experience, minimizing the trivial differences between applications — all while being a modern and light layer on top of native javascript. emb...
...unity-backed "best practices" allow for faster long-term development speed. ember has clear conventions that are useful for enforcing consistency and helping team members get up to speed quickly. ember with add-ons emberjs has a plugin architecture, which means that add-ons can be installed and provide additional functionality without much, if any, configuration. examples include: p
rember: static website rendering for blogs or marketing content. fastboot: server-side rendering, including improving search-engine optimization (seo), or improving initial render performance of complex, highly interactive web pages. empress-blog: authoring blog posts in markdown while optimizing for seo with p
rember. ember-service-worker: configuring a pwa so that the app can be installed on mobi...
...make meaningful contributions to any ember project with minimal fear of breaking code. designers and other non-developers can contribute to page templates without any knowledge of javascript, and interactivity can be added later. this language also enables lighter asset payloads due to compiling the templates into a "byte code" that can be parsed faster than javascript. the glimmer vm enables ext
remely fast dom change tracking without the need to manage and diff a cached virtual representation (which is a common approach to mitigating the slow i/o of dom changes). for more information on the technical aspects of the glimmer vm, the github repository has some documentation — specifically, references and validators may be of interest. everything else in ember is just javascript. in particu...
Ember resources and troubleshooting - Learn web development
sources that you can use to go further in your learning, plus some useful troubleshooting and other information. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be ext
remely beneficial, as ember makes heavy use of them. objective: to provide further resource links and troubleshooting information. further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discord server — a forum/chat server where you can meet the ember community, ask for help, and help others! general troubleshooting, ...
...shooting, gotchas, and misconceptions this is nowhere near an extensive list, but it is a list of things that came up around the time of writing (latest update, may 2020). how do i debug what's going on in the framework? for framework-specific things, there is the ember-inspector add-on, which allows inspection of: routes & controllers components services promises data (i.e: from a
remote api — from ember-data, by default) deprecation information render performance for general javascript debugging, check out our guides on javascript debugging as well as interacting with the browser's other debugging tools. in any default ember project, there will be two main javascript files, vendor.js and {app-name}.js. both of these files are generated with sourcemaps, so when you ...
...oute represents part of the url when a user navigates from place to place in the app. a route has only a couple responsibilities: load the minimally required data to render the route (or view-sub-tree). gate access to the route and redirect if needed. handle loading and error states from the minimally required data. a route only has 3 lifecycle hooks, all of which are optional: befo
remodel — gate access to the route. model — where data is loaded. aftermodel — verify access. last, a route has the ability to handle common events resulting from configuring the model: loading — what to do when the model hook is loading. error — what to do when an error is thrown from model. both loading and error can render default templates as well as customized templates d...
Getting started with Vue - Learn web development
added when you initialized the app with your cli, and some other useful links to the vue community and ecosystem. making a couple of changes let's make our first change to the app — we’ll delete the vue logo. ...
...er useful links to the vue community and ecosystem. making a couple of changes let's make our first change to the app — we’ll delete the vue logo. open the app.vue file, and delete the <img> element from the template section: <img alt="vue logo" src="./assets/logo.png"> if your server is still running, you should see the logo
removed from the rendered site almost instantly. let’s also
remove the helloworld component from our template. ...
... your server is still running, you should see the logo
removed from the rendered site almost instantly. let’s also
remove the helloworld component from our template. first of all delete this line: <helloworld msg="welcome to your vue.js app"/> if you save your app.vue file now, the rendered app will throw an error because we’ve registered the component but are not using it. we also need to
remove the lines from inside the <script> element that import and register the component: delete these lines now: import helloworld from './components/helloworld.vue' components: { helloworld } your rendered app should no longer show an error, just a blank page, as we currently have no visible content inside <template>. let’s add a new <h1> inside <div id="app">. since we’re going to be cr...
Handling common HTML and CSS problems - Learn web development
n even older, proprietary version of the syntax (this is actually from a really old version of the webkit engine). the third one has no prefix, and shows the final version of the syntax (included in the css image values and replaced content module level 3 spec, which defines this feature). prefixed features were never supposed to be used in production websites — they are subject to change or
removal without warning, and cause cross browser issues. this is particularly a problem when developers decide to only use say, the -webkit- version of a property — meaning that the site won't work in other browsers. this actually happens so much that other browsers have started to implement -webkit- prefixed versions of various css properties, so they will work with such code. usage of prefixes by...
...this used to be much more of a problem, but recently, with modern browsers tending to support css more consistently, layout issues tend to be more commonly associated with: lack of (or differences in) support for modern layout features. layouts not looking good in mobile browsers (i.e. responsive design problems). note: historically web developers used to use css files called resets, which
removed all the default browser styling applied to html, and then applied their own styles for everything over the top — this was done to make styling on a project more consistent, and reduce possible cross browser issues, especially for things like layout. however, it has more recently been seen as overkill. the best equivalent we have in modern times is normalize.css, a neat bit of css that build...
...bugs that would also need to be investigated if you were to try to support ie that far back). however, they are not really meant for layout purposes — using floats the way we do is really a hack — and they do have some serious limitations (e.g. see why flexbox?) more recently, dedicated layout mechanisms have appeared, like flexbox and css grids, which make common layout tasks far easier and
remove such shortcomings. these however are not as well-supported in browsers: css grids are very new; at the time of writing, they were only supported in the very newest versions of modern browsers. flexbox is well-supported in modern browsers, but provides problems in older browsers. ie 9 doesn't support it at all, and ie 10 and old versions of ios/desktop safari respectively support incompatib...
Package management basics - Learn web development
that you want to use instead of the current one, or a new version of your dependency is released that you want to update to? this is not too painful for a couple of dependencies, but in larger projects with many dependencies this kind of thing can become really challenging to keep track of. it makes more sense to use a package manager such as npm, as this will guarantee that the code is added and
removed cleanly, as well as a host of other advantages. what exactly is a package manager? we've met npm already, but stepping back from npm itself, a package manager is a system that will manage your project dependencies. the package manager will provide a method to install new dependencies (also referred to as "packages"), manage where packages are stored on your file system, and offer capabilit...
...on't have any known vulnerabilities. downloading them and putting them in the correct locations in your project. writing the code to include the package(s) in your application (this tends to be done using javascript modules, another subject that is worth reading up on and understanding). doing the same thing for all of the packages' sub-dependencies, of which there could be tens, or hundreds.
removing all the files again if you want to
remove the packages. in addition, package managers handle duplicate dependencies (something that becomes important and common in front-end development). in the case of npm (and javascript- and node-based package managers) you have two options for where you install your dependencies. as we touched on in the previous article, dependencies can be installed ...
... excluding 3.0.0. this is determined using a system called semver, which might look a bit complicated from the documentation but can be simplified by considering only the summary information and that a version is represented by major.minor.patch, such as 2.0.1 being major version 2 with patch version 1. an excellent way to try out semver values is to use the semver calculator. it's important to
remember that npm update will not upgrade the dependencies to beyond the range defined in the package.json — to do this you will need to install that version specifically. audit for vulnerabilities npm audit yarn audit this will check all of the dependency tree for your project and run the specific versions you're using against a vulnerability database and notify you if there are potential vulne...
Accessibility Features in Firefox
s to get there. caret browsing allows you to move through web content one letter a time. you can even select web content and copy it to the clipboard. -- all with the keyboard detailed advanced javascript control: mozilla gives you the ability to fine tune what javascript is allowed to do while you browse. for example, you can disable functions that websites use to move or resize windows, or to
remove your status bar, to disable right-click contextual menus, change the status bar text, etc. you can furthermore control javascript capabilities to
remove scrollbars, toolbars or system buttons like minimize, close and maximize by editing the about:config related properties or by editing accordingly the user.js file as explained in this "disable other javascript window features" document. movin...
...tion source". this will show the html source for only the selected text, which is useful for understanding accessibility problems in some web sites. customize your experience! many users are finding the true greatness of firefox lies in support for third party extensions. extensions are small add-ons which can change your browser experience as you see fit. extensions can easily be installed or
removed with the extension manager in the tools menu. here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this information): adblock plus
removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior. in muc...
...ble accessibility in firefox on windows and especially for this new powerful world of "web applications". a web application may be an easier-to-use online tax assistant, a web calendar or a live sports statistics page, which is familiar in that it acts much like a desktop application. whether the current buzzword for this technology is "dhtml", "ajax" or "web 2.0" doesn't really matter. this fact
remains: the web is changing to become more interactive and less like a bunch of plain documents. firefox is currently the only browser to support the newly evolving standards for making these web applications accessible. companies such as yahoo! have announced they are already working with the technology their new richer interfaces accessible with this new technology. developers, please see our dhtm...
Accessibility/LiveRegionDevGuide
module is the priority queue. it is responsible for queuing messages derived from live region events, where priority is determined by chronological order and the live politeness properties. in addition to the standard priority queue methods, additional methods will need to be implemented that purge the queue based on one of the priority criterion. the "purge by timestamp" method will be used to
remove old messages that are no longer deemed relevant while "purge by politeness" is used to satisfy the aria live politeness specification. the later method will be explained in detail below. event types the table for web page mutation event types lists the two major event types associated with live regions, namely text-changed and object changed events. both will be discussed in detail below. ...
...d iaccessible2. in at-spi, the object changed event are called object:children-changed events because the event is triggered on the parent of the object. the actual object that change can then be found in the event.any_data field. in iaccessible2, the event_object_* events are triggered on the actual object that changed. the object changed events can be further subdivided into object addition and
removal events. in at-spi, this is accomplished by appending ":add" or ":
remove" to the event string. in iaccessible2, there are two separate event types, namely event_object_show and event_object_hide. text changed the text changed events are quite similar in at-spi and iaccessible2 with both having an insert and delete or
removal events. the text changed event type in at-spi has a similar scheme...
...the text associated with an at-spi text changed event is directly in the event object. the event.any_data field holds the entire text string while event.detail1 is the start index while event.detail2 is the text string length. ...
Accessible Toolkit Checklist
thing for free in terms of keyboard, api or os-theme support. in this case, adding a complete or even a partial accessibility solution is major work, and will require more than one full time person as well as cooperation from windows assistive technology vendors when parts of your msaa solution isn't working. often these kinds of toolkits don't use a separate window for each control; in that case
remember to generate a unique 32 bit child id for each control so that the msaa event system can call back for the right iaccessible for each event. the checklist this checklist is currently only for microsoft windows, but should be expanded to include information about linux and os x. it is maintained by the mozilla accessibility community. contributions are welcome. general dialogs/windows/gene...
... in autocomplete text fields, make sure that the left or right arrow closes the popup and starts moving through the text letter by letter msaa support, including accessible value that holds text, protected for password fields and readonly for read-only fields checkboxes space bar to toggle msaa support, including checkbox...
...n order to provide ease of access for the user. the "l" and "of" will be parsed out by the assistive technology, so don't localize it. mac os x difference: option+left and option+right should do deep expand/collapse mac os x difference: user should be able to select multiple rows and expand them with one keystroke. after the expansion, the multiple (now discontiguous) selection should
remain. ...
Application cache implementation overview
load. it synchronously returns an nsiapplicationcache object representing the most recent cache version from the most recent cache group containing the entry under the url or a matching namespace. if no nsiapplicationcache object has been found, there is no offline cache to load from and the load continues a usual way by loading from normal http cache, further steps are not executed. the channel
remembers the nsiapplicationcache object. nsiapplicationcache is then queried a client id (= the manifest url + a unique time stamp). then, nsicacheservice is asked to open nsicachesession with store_offline policy and the given client id. entry is queried using that session. nshttpchannel::onofflinecacheentryavailable is then invoked. when aentrystatus is a success code, entry has been found and we ...
...ntryavailable is then invoked. when aentrystatus is a success code, entry has been found and we are loading it from the cache. loadedfromapplicationcache flag is now set true on the channel. when aentrystatus is a failure code, entry has not been found, but the url is falling under one of the network or fallback namespaces. when matching fallback namespace, the associated fallback entry for it is
remembered. the load then continues from the network as a usual load, using http cache. when load of the resource fails fallback steps are performed (see “falling back on a resource load failure” chapter). associating the top level document with offline cache this happens between document load start and the first sub-resource download start and is not about associating nsiapplicationcache object ...
...lowing loading process decisions are then the same as for the top level load with one addition: when the entry is neither found in the cache nor matches any namespace in that cache we fail the resource load with document_not_found. falling back on a resource load failure when a resource previously matching a fallback namespace failed to load from the network, we perform fallback to the previously
remembered fallback entry. it's actually a redirect to the fallback url loading from the associated nsiapplicationcache. updating an existing cache or first download of an offline cache the process of updating or first caching is invoked asynchronously from nscontentsink::processofflinemanifest() using nsofflinecacheupdateservice. the implementation of offline cache update is in /uriloader/prefetch. ...
Testopia
are upgrading, please reverse the existing version's patch before installing. a fresh install only requires that you untar the tarball in your bugzilla root directory and run checksetup. thanks go to lpsolit from the bugzilla team for his work in making this possible. testopia 2.4 this version supports bugzilla 3.6. important notice: if you are upgrading on a case sensitive filesystem you must
remove the existing testopia folder in the extensions directory. if you have made modifications to the testopia source code, you will need to merge them into the new testopia folder (capital t). if you are on windows or another case insensitive file system you should first rename the folder (testopia-old for example) and then unzip the tarball. you can then merge your changes before deleting the old ...
...ing the old version. api users take note: positional parameters are now deprecated. all params should now be sent in a hash (struct, dict, hashmap or whatever your language of choice calls key, value pairs). though all attempts have been made to provide continuing support for positional parameters, please be aware that some api calls may fail until you make this change. also, future versions may
remove this support completely. as always please backup your installation before attempting to install or upgrade. testopia 2.3 this version supports bugzilla 3.4. the main new features are: support xml export and import of test plans and children support csv export of test cases and results. new reports: worst offender and case roll-up set priorities on indidual case-runs new clone options...
...grates with bugzilla products, components, versions, and milestones to allow a single management interface for high level objects. testopia allows users to login to one tool and uses bugzilla group permissions to limit access to modifying test objects. testopia allows users to attach bugs to test case run results for centralized management of the software engineering process. requi
rements as our development has moved forward, we have decided to try to keep abreast of the latest stable release from bugzilla (currently 5.0). this gives us a stable code base to work from. developing plugins or extensions for any software is like trying to hit a moving target. this decision allows us to focus our time more on releasing new features often and early rather than back porting. howeve...
Creating JavaScript callbacks in components
to the parser somehow */ stringparser.addobserver(wordhandler); stringparser.parse("pay no attention to the man behind the curtain"); you can find examples of this pattern all over the mozilla codebase. in fact, there is even a specific interface for this form of push callbacks, nsiobserverservice. ...
...ind examples of this pattern all over the mozilla codebase. in fact, there is even a specific interface for this form of push callbacks, nsiobserverservice. javascript functions as callbacks another common use of the pattern is found in addeventlistener /
removeeventlistener. a nice feature of addeventlistener is that you can pass a javascript function in place of the callback listener interface. ...
...a nice feature of addeventlistener is that you can pass a javascript function in place of the callback listener interface.
remember (or discover) that addeventlistener is a method of the nsidomeventtarget interface and is defined as such: void addeventlistener(in domstring type, in nsidomeventlistener listener, in boolean usecapture); however, it is ext
remely common to see developers pass a normal javascript function for the listener instead of an nsidomeventlistener implementation: function doload(event) { // do something here } window.addeventlistener("load", doload, false); revealing the magic how is this possible? is nsidomeventlistener magical? well, it actually is a little magical. but you can use the same magic in your own idl callbacks.
Creating a Language Pack
d. it is only useful if you want to preview the contents of the mergedir. you'll see that it contains the files which in your localization were missing some entities. all other files will be taken from x-testing directly. it's now time to create a langpack with: $ make langpack-x-testing locale_mergedir=$(pwd)/mergedir each time you need to generate a new langpack, you need to run this command.
remember that you need to be in the directory obj-firefox-build/browser/locales. $ make langpack-x-testing locale_mergedir=$(pwd)/mergedir now go to the dist directory to find your langpack ready to use! $ cd ../../dist the xpi file can be found in the directory win32/xpi on windows, linux-i686/xpi or linux-x86_64 on linux or mac/xpi on mac. open the xpi file contained in this directory with fi...
... end of the process, you should see the following success message. ... done unpacking let's check which revision the binary was built from. $ make ident fx_revision 237dccbcb967 buildid 20091126033851 you can now go back to your source hg clone. $ cd ../../../mozilla-aurora and update the source code to this revision. $ hg update -r 237dccbcb967 3 files updated, 0 files merged, 0 files
removed, 0 files unresolved the source code has been updated to the revision the binary was built from. let's go to the build directory again and continue the repacking. $ cd ../obj-firefox-build/browser/locales we will now merge the localized files from x-testing locale with the en-us files from the original source. issue the following command: $ make merge-x-testing locale_mergedir=$(pwd)/mer...
...iles which in your localization were missing some entities. all other files will be taken from en-us directly. it's now time to repackage the en-us binary with $ make installers-x-testing locale_mergedir=$(pwd)/mergedir again, for 64-bit mac, append moz_pkg_platform=mac to this command. each time you want to generate a new binary (often called a "repack"), you need to run these two commands.
remember that you need to be in the directory firefox-build/browser/locales. $ make merge-x-testing locale_mergedir=$(pwd)/mergedir $ make installers-x-testing locale_mergedir=$(pwd)/mergedir at the end of the process, you should see the following success message. mv -f "../../dist/l10n-stage/firefox-3.6b5pre.x-testing.mac.dmg" "../../dist/firefox-3.6b5pre.x-testing.mac.dmg" repackaging done no...
Debugging on Mac OS X
try build and downloading the dmg generated by the "rpk" shippable build job. a debugger can be attached to firefox processes of these builds. try builds use the developer.entitlements.xml file from the source tree while production builds use production.entitlements.xml. on macos 10.15+, downloaded try builds will not launch by default because notarization is required. to workaround this problem,
remove the quarantine extended attribute from the downloaded nightly: $ xattr -r -d com.apple.quarantine /path/to/nightly.app local builds local builds of mozilla-central do not enable hardened runtime and hence do not have debugging restrictions. as a result, some functionality will be permitted on local builds, but blocked on production builds which have hardened runtime enabled. bug 1522409 w...
...ation that supports multiple profiles, using a separate profile for debugging purposes is recommended. see "having a profile for debugging purposes" below. select the "arguments" tab in the scheme editor, and click the '+' below the "arguments passed on launch" field. add "-p profilename", where profilename is the name of a profile you created previously. repeat that to also add the argument "-no-
remote". also in the "arguments" panel, you may want to add an environment variable moz_debug_child_process set to the value 1 to help with debugging e10s. select "build" from the left of the scheme editor window, and check that there is nothing listed under targets (otherwise it may cause problems when you try to run the executable for debugging since you will get build errors). click "close" to ...
...scriptive name than "copy of scheme" select "run" on the left-hand side of the settings window, then select the "info" tab. set the executable by clicking on the "executable" drop-down, and selecting the plugin-container.app that is inside the app bundle of the copy of firefox you want to debug. on the same tab, under "launch" select "wait for executable to be launched" on the "arguments" tab,
remove all arguments passed on launch. now you're ready to start debugging: from the "product" menu, ensure the scheme you created above is selected under "scheme" click the "run" button. the information area at the top of the window will show "waiting for plugin-container to launch" from a command line, run your build of firefox. when that launches a child process (for example, when you start...
Makefiles - Best practices and suggestions
prefer library rules whenever possible or create library rules that are missing. dependency builds - a second invocation of make within a sandbox should always be a nop. hardcoded values - avoid them like the plague. use variable assignments, autogen paths and dynamic file gathering. platform specific - avoid this logic whenever possible. code as little platform specific logic within a makefile as possible, a conditional and compiler flags at most should be needed. for ex use defines within sources to shift platform logic into your source code. ...
...ass of hardware. for classes of hardware (unix/windows) place your makefile in a subdirectory, unix/makefile.in always include dependencies when creating a target initial make call should always be the workhorse: build, generate, deploy, install, etc. all subsequent make calls must become a nop unless sources or dependencies change or have been
removed. incorrect dependencies will contribute to wasted cycles and can contribute to circular dependencies. directory dependencies do not use directories as a dependency for generated targets, ever. any activity within a directory will alter inodes forcing targets to always be stale. for ex, individual unit tests would invalidate all prior test activit...
...condition. # transient directory for storing timestamps ts=.ts ##################################################### ## extra dep needed to synchronize parallel execution ##################################################### $(ts): $(ts)/.done $(ts)/.done: $(mkdir) -p $(dir $@) touch $@ # "clean" target garbage_dirs += $(ts) maintain clean targets - makefiles should be able to
remove all content that is generated so "make clean" will return the sandbox/directory back to a clean state. targets = foo bar tans timestampdir = .ts all: $(timestampdir) $(targets) %: %.c $(cc) -o $@ $< $(timestampdir): $(mkdir) $@ # "clean" target garbage += $(targets) garbage_dirs += $(timestampdir) wrapper check/unit tests with a enable_tests conditional so tests can be disable...
Simple Thunderbird build
8 gb or more is recommended. while you can build thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less ram. good internet connection for the initial source download. ...
... moz_objdir it cannot be a sibling folder to your source directory. use an absolute path to be sure! to also build lightning when building thunderbird (deprecated) note: the lightning calendar add-on was integrated into thunderbird starting with version 74. the `--enable-calendar` option is now deprecated and no longer has any effect. if it is in your `mozconfig` file, you should go ahead and
remove it when building thunderbird 74 or later, since support for it will eventually be
removed completely. add the following line to your mozconfig file: ac_add_options --enable-calendar to add that line you can do this in the source/ directory: echo 'ac_add_options --enable-calendar' >> mozconfig building before you start, make sure that the version you checked out is not busted. for hg ti...
...pported. check for @topsrcdir@ or relative paths in your mozconfig. those have caused several problems historically and tend to be poorly tested when the build system changes. if on windows you get link errors like "lnk1102: out of memory" or "lnk1318: unexpected pdb error; ok (0)", try deleting the largest .pdb files before rushing out the door to buy more ram. clobbering (see below) will also
remove those files. try with a clean obj-dir. you can clean out previous build artefacts using ./mach clobber references general build documentation comm-central using the mozilla symbol server ...
The Firefox codebase: CSS Guidelines
omplete-item[selected] > .autocomplete-item-title would be more efficient than .autocomplete-item[selected] .autocomplete-item-title overriding css before overriding any css rules, check whether overriding is really needed. sometimes, when copy-pasting older code, it happens that the code in question contains unnecessary overrides. this could be because the css that it was overriding got
removed in the meantime. in this case, simply dropping the override should work. it is also good practice to look at whether the rule you are overriding is still needed: maybe the ux spec for the component has changed and that rule can actually be updated or
removed. when this is the case, don't be afraid to
remove or update that rule. once the two things above have been checked, check if the other...
...nset-inline-start/inset-inline-end. for rtl-aware float layouts, float: inline-start|inline-end can be used instead of float: left|right. the rtl-aware equivalents of border-{top/bottom}-{left/right}-radius are border-{start/end}-{start/end}-radius when there is no special rtl-aware property available, use the pseudo :-moz-locale-dir(ltr|rtl) (for xul files) or :dir(ltr|rtl) (for html files).
remember that while a tab content's scrollbar still shows on the right in rtl, an overflow scrollbar will show on the left. write padding: 0 3px 4px; instead of padding: 0 3px 4px 3px;. this makes it more obvious that the padding is symmetrical (so rtl won't be an issue). note: see css logical properties and values for more information. testing to test for rtl layouts, you can go to about:co...
...ents regarding page colors. part of those adjustments include making all box-shadow invisible, so this is something to be aware of if you create a focus ring or a border using the box-shadow property: consider using a border or an outline if you want the border/focus ring to stay visible in high-contrast mode. an example of such bug is bug 1516767. another adjustment to be aware of is that gecko
removes all the background-image when high contrast mode is enabled. consider using an actual <img> tag (for html documents) or list-style-image (for xul documents) if rendering the image is important. if you are not using windows, one way to test against those adjustments on other platforms is: going to about:preferences clicking on the "colors..." button in the "fonts & colors" sub-section of ...
Creating Custom Events That Can Pass Data
you want firefox to perform an action whenever something happens (i.e., something other than the standard mouse/keyboard events) and, depending on the data passed along with this event, you want firefox to react differently. note that starting with version 6, firefox supports dom level 3 customevent, which lets you dispatch custom events with arbitrary data from javascript. (see bug 427537) requi
rements in order to do this you must be able to do all of the following: download mozilla source code build mozilla creating custom firefox extensions with the mozilla build system. this is the foundation for everything we'll do. what's in a name despite whatever you may have been taught in your english class, there's a lot in a name when it's an event name. as of gecko 1.8, if your event names do ...
...ep your stuff organized. same reason as above. you need to make the following two modifications: around line 1000: ns_define_classinfo_data({truncated name}, nsdomgenericsh, dom_default_scriptable_flags) around line 2900: dom_classinfo_map_begin({truncated name}, nsidom{truncatedname}) dom_classinfo_map_entry(nsidom{truncated name}) dom_classinfo_event_map_entries dom_classinfo_map_end
remember, {truncated name} is the same as above. mozilla/content/events/src/nseventdispatcher.cpp note: in the mozilla 1.8.x branch this code is actually in mozilla/content/events/src/nseventlistenermanager.cpp this is quite an important file since this holds the createevent method which acts as a factory method dom events. the change you want to make is in nseventdispatcher::createevent(). you will ...
...developers in order for your event to work the way it is described here it must be derived from nsdomevent. the problem that extension developers will hit is that you are not allowed derive from nsdomevent in an extension. you can try to rewrite code but it will have to be a lot of code because nsdomevent uses a lot of code outside of itself which you, again, cannot access from an extension. this
remains true even if you mark you extension code as "internal". dispatching your event in javascript here is how to dispatch your event in javascript. var event = document.createevent("nsdommyevent"); event.initevent("nsdommyevent", true, true); window.dispatchevent(event); dispatching your event in c++ the following shows how to dispatch your event in c++: nscomptr<nsiwindowwatcher> wwatcher ...
Eclipse CDT Manual Setup
(common in mozilla), and if you fail to take steps to make sure the build output specifies which directory the compiler is invoked from, this will not be possible. if eclipse can successfully identify which source file was being compiled, then it can associate with that file the resolvable include paths, preprocessor defines, and pre-include files that were passed to the compiler. note the requi
rements that this method of build option discovery imposes on us. first, eclipse needs build console output for a complete build, so that it can find compiler options for as many source files as possible. the build must be explicitly instructed to output information that allows the directory, where the compiler is being invoked from to be identified (i.e., 'make' must be instructed to output "enterin...
...lly: if you configure eclipse to invoke a build process that is parallelized, silenced, or that fails to identify the directory that the compiler is being run from, then it will mess up the compiler options that eclipse associates with your files, and that in turn will significantly degrade the quality of the code assistance that eclipse will provide after it next re-indexes the code. these requi
rements aren't a very good fit with the typical mozilla developer's wish to minimize build times, implying parallelized, silenced builds. the consequences of the above observations are this: it is strongly recommended that you invoke your normal (re)builds from the command line, externally of eclipse. below we will configure eclipse's build step so that you use it only occasionally to manually ...
...ry to invoke just-print-mozilla-build.py indirectly through bash). (just-print-mozilla-build.py is a fast script that we'll download in the next section.) (append '--objdir /path/to/objdir' if your objdir lives outside your tree) set the build directory to "${projdirpath}/path/of/your/objdir/relative/to/the/root/of/your/source". select the "behavior" tab, delete the word "all" from the "build (inc
remental build)" field, and disable the clean checkbox. if you can't untick "use default build command", you must change the current builder by clicking on "tool chain editor" (in c/c++ build) and choosing another builder (e.g., "gnu make builder"). if you will not be using eclipse for debugging, select "c/c++ build > settings" on the left, select the "binary parsers" tab, and make sure that all ...
Reviewer Checklist
results in "part 0" of a bug, which is "tidy things up to make the fix easier to write and review". if qa needs to verify the fix, you should provide steps to reproduce (str). quality if you can unit-test it, you should unit-test it. if it's js, try to design and build so that xpcshell can exercise most functionality. it's quicker. make sure the patch doesn't create any unused code (e.g.,
remove strings when
removing a feature) all caught exceptions should be logged at the appropriate level, bearing in mind personally identifiable information, but also considering the expense of computing and recording log output. [fennec: checking for log levels is expensive unless you're using logger.] style follow the style guide for the language and module in question. follow local style fo...
...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: when writing tests that use paintedsurface, ensure the paintedsurface is closed when you're done with it.] performance impact check for main-thread io [fennec: android may warn about this with strictmode].
remove debug logging that is not needed in production. threading issues enormous: correct use of locking and volatility; livelock and deadlock; ownership. [fennec: all view methods should be touched only on ui thread.] [fennec: activity lifecycle awareness (works with "never keep activities"). also test with oom-fennec (https://hg.mozilla.org/users/blassey_mozilla.com/oom-fennec/)]. compatib...
...efs to disable the feature entirely in case bugs are found later in the release cycle. [fennec: "prefs" can be gecko prefs, sharedpreferences values, or build-time flags. which one you choose depends on how the feature is implemented: a pure java service can't easily check gecko prefs, for example.] strings there should be no string changes in patches that will be uplifted (including string
removals). rev entity names for string changes. when making ui changes, be aware of the fact that strings will be different lengths in different locales. documentation the commit message should describe what the patch is changing (not be a copy of the bug summary). the first line should be a short description (since only the first line is shown in the log), and additional description, if neede...
SVG Guidelines
he advantages and disadvantages of both. file size whether svg or a raster format will produce a smaller file for a given image depends very much on the image. for example, consider an image of a path with a gradient fill. the size of an svg of this image will be the same regardless of the dimensions of the image. on the other hand the size of a raster file of the same image will likely vary t
remendously depending on the dimensions of the image since the larger the dimensions the more pixel data the file needs to store. at very small dimensions (the ext
reme case being 1px x 1px) the raster file will likely be much smaller than the svg file since it only needs to store one pixel of data. at large dimensions the raster file may be much larger than the svg file. scalability, with caveats o...
...tter (xmlns:sketch, xmlns:sopodi, …) other metadata in addition to non-standard editor metadata, standard compliant metadata also exists. typical examples of this are <title> and <desc> tags. although this kind of data is supported by the browser, it can only be displayed when the svg is opened in a new tab. plus, in most of the cases, the filename is quite descriptive so it's recommended to
remove that kind of metadata since it doesn't bring much value. you shouldn't include doctypes in your svgs either; they are a source of many issues, and the svg wg recommends not to include them. see svg authoring guidelines. avoid the use of cdata sections cdata sections are used to avoid parsing some text as html. most of time, cdata isn't needed, for example, the content in <style> tags doesn'...
...-awareness. to this date, there doesn't seem to be a tool that handles all of the above. ...
Displaying Places information using views
hanging, you will want to set the view's place property dynamically using javascript. note that in the latter case it is not sufficient to call setattribute on the element; use the element's place property instead. see querying places and places query uris for information on query uris. the following example uses the built-in tree view to display bookmarks whose titles or urls contain "mozilla".
remember that, because xul is xml, any ampersands in query uris must be written as entity reference & and not simply &. <tree type="places" place="place:terms=mozilla&onlybookmarked=1&querytype=1"> <treecols> <treecol id="title" label="my bookmarks" flex="1" primary="true" /> </treecols> <treechildren /> </tree> the next example does the same as the last but uses javascript t...
...t or a query, and you would execute the query and add your view as an observing client using addobserver(). (that's how the load method of the built-in tree view works.) when you let your view observe the result, the result will in turn set the result property on the given nsinavhistoryresultobserver. you should not set the result property explicitly. to disconnect a viewer from its result, call
removeobserver(view) on your result. be careful about reference cycles. the viewer and the result both hold owning references to each other. for these objects to be freed during javascript garbage collection, you must clear this cycle by calling result.
removeobserver(view). (for example, the built-in tree view does this automatically. when the tree is destroyed or a different nsitreeview is associat...
...take a look at using the tree view above to get an idea of what's required. ...
Limitations of chrome scripts
ontent from the chrome process, the browser will return a cross process object wrapper that gives the chrome code synchronous access to the content. you'll get the shims for your add-on by default, unless you set the multiprocesscompatible flag in your add-on's install manifest. however, these shims are not a substitute for migrating extensions: they are only a temporary measure, and will be
removed eventually they can have a bad effect on responsiveness there are likely to be edge cases in which they don't work properly you can see all the places where your add-on uses compatibility shims by setting the dom.ipc.shims.enabledwarnings preference and watching the browser console as you use the add-on. the rest of this page documents patterns that don't work in multiprocess firefox as ...
... ...
... ...
Frame script loading and lifetime
sage manager, you should always pass true here. because a browser message manager only corresponds to a single browser tab, its loadframescript() function will only ever load the frame script into that one tab. passing allowdelayedload is a way to ensure that the script is loaded correctly, in case the tab is not ready when making the call. if you use allowdelayedload, you can cancel it by using
removedelayedframescript: var mm = window.messagemanager; mm.
removedelayedframescript("chrome://my-e10s-extension/content/frame-script.js"); this means we will stop loading the script into new tabs. note that this function will not
remove any scripts which have been loaded earlier. frame script lifetime frame scripts are loaded as soon as loadframescript() is called. if you've set allowdelayedloa...
... there is a bug in non-e10s wher...
... there is a bug in non-e10s where this order is not true. in e10s framescripts work fine on updating. for non-e10s waiting for bug 1202125 - framescripts are not backwards loaded in message order in non-e10s. ...
MozBeforePaint
alled this, the mozbeforepaint event will be fired one time, when it's time for animations to be updated for the window's next animation frame. the timestamp property of this event will be set to the time when the animation frame is sampled; this is relevant when trying to synchronize mozrequestanimationframe animations with smil animations or css transitions. this allows multiple animations to
remain in sync with one another within the context of a given window. frame rate control mozbeforepaint won't fire more than a fixed number of times per second, e.g. 50 or 60. this is intentional, because modern operating systems and hardware won't let the browser display more frames than that anyway. limiting the frame rate avoids wasting work, thereby saving cpu usage and power and improving over...
...this computes the current position for the animating box and updates the box's position on screen, and, if the animation sequence is not ye...
... you may take a look at this example live if you like. ...
Infallible memory allocation
ation or not. eventually, however, the generic memory allocators (malloc() and realloc()) will become infallible. how can memory allocation be infallible? the term "infallible" means that your memory allocation request is guaranteed to succeed: your code can never see a failed request, and so doesn't need to check for failure. inside the allocation routine, the situation is different. under ext
reme memory conditions, it's possible that the allocation will fail; however, the allocation routine will not, in this scenario, return to your code. instead, the application will terminate. this should be rare, because the memory management system will do everything it can to find the memory you've asked for. choosing a memory allocator as you write new code that needs to allocate memory, there ar...
...e new code that needs to allocate memory, there are some simple rules to follow to help you decide whether to use a fallible or an infallible memory allocator: if you're allocating what may be a large chunk of memory, you should allocate the memory fallibly (using malloc() for example), and check the result to be sure it's not null. you should do this for large memory allocations because in ext
remely low memory conditions, as described in how can memory allocation be infallible?, the application may terminate if an infallible allocator can't find the memory you requested. if you don't know whether or not the memory will be large, use the standard malloc() routine. be sure to check the result for null. be warned that any allocation that's controlled by the user or web content may grow bigg...
...ising things all the time! when instantiating objects, the new operator creates them infallibly by default. if you want to allocate them fallibly, use the syntax new (fallible) foo(). when in doubt, use the infallible allocator and don't null check. ns_alloc() is also infallible. explicitly infallible memory allocators the following memory allocators are explicitly infallible, and will
remain so; they are guaranteed to return a valid memory pointer. p = moz_xmalloc(); p = moz_xcalloc(); p = moz_xrealloc(); p = moz_xstrdup(); f = new foo(); farray = new foo[]; n = ::operator new(...); narray = ::operator new[](...); explicitly fallible memory allocators these memory allocators are explicitly fallible, and will
remain so. when using these, you must check to ensure the resulti...
Webapps.jsm
nction notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid)
removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: funct...
...runupdate) _registeractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister: function(amanifest, aapp, aentrypoint) _unregisteractivitiesforapps: function(aappstounregister) _unregisteractivities: function(amanifest, aapp) _processmanifestforids: function(aids, arunupdate) observe: function(asubject, atopic, adata) addmessagelistener: function(amsgnames, aapp, amm)
removemessagelistener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _write...
...ptforuninstall: function(adata) confirmuninstall: function(adata) denyuninstall: function(adata, areason = "error_unknown_failure") getself: function(adata, amm) checkinstalled: function(adata, amm) getinstalled: function(adata, amm) getnotinstalled: function(adata, amm) geticon: function(adata, amm) getall: function(acallback) isreceipt: function(data) addreceipt: function(adata, amm)
removereceipt: function(adata, amm) replacereceipt: function(adata, amm) setenabled: function(adata) getmanifestfor: function(amanifesturl, aentrypoint) getappbymanifesturl: function(amanifesturl) getfullappbymanifesturl: function(amanifesturl, aentrypoint, alang) getmanifestcspbylocalid: function(alocalid) getdefaultcspbylocalid: function(alocalid) getapplocalidbystoreid: function(astoreid) ...
Index
y want to see your work but you want to make sure it's accurate! if you don't have a lot of experience with code, you might even be concerned that you've broken something (oops!). now we'll walk you through performing some quality assurance testing on your work to make sure you're on the right track. 15 release phase localization you've made it! you've setup up your local and
remote environments, you've selected your l10n tools and projects, done some localization and even some testing! now you're ready for the final phase: becoming an official l10n release. here, we'll continue to stay true to the original intent of this guide and only present you with the technical information you need to become an official release. we'll primarily focus on getting your release reposito...
...face using koala, an add-on for komodo edit created to help localizing mozilla. 24 localizing with mercurial build documentation, internationalization, localization in mozilla, we use the the mercurial version control system (hg) to manage our source code and localizations. mercurial allows localizers to work locally (on their machines) and then push (an hg term) changes to a
remote repository, which usually is hosted on the mozilla servers (hg.mozilla.org). localizing current versions of firefox, thunderbird and seamonkey includes working with mercurial. if the documentation is incomplete or you have questions, please drop by the #l10n or #hg channels on irc.mozilla.org. the mercurial faq are also worth a read, should you run into trouble. 25 localizing with m...
...zed in your language localization, mdn, mozilla, reference, style guide no summary! 30 mozilla content localized in your language localization this section of the style guide is for you to author. the content here should be what you and your localization team have decided, together, to follow when localizing mozilla products and web sites. you are free to add, edit,
remove, and localize everything in this section according to how the localization team for your language agrees. all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. enjoy developing your style guide! 31 patching a localization localization say you have found a problem with an existing lo...
BloatView
tistics on allocations and refcounts, and provides gross numbers on the amount of memory being leaked broken down by class. here's a sample of the bloatview output. ...
... bytes per-inst - the number of bytes returned if you were to write sizeof(class). note that this number does not reflect any memory held onto by the class, such as internal buffers, etc. (e.g. for nsstring you'll see the size of the header struct, not the size of the string contents!) bytes leaked - the number of bytes per instance times the number of objects leaked: (bytes per-inst) x (objects
rem). use this number to look for the worst offenders. (should be zero!) objects total - the total count of objects allocated of a given class. objects
rem - the number of objects allocated of a given class that weren't deleted. (should be zero!) interesting things to look for: are your classes in the list? - look! if they aren't, then you're not using the ns_impl_addref and ns_impl_release (o...
...xpcom objects, or moz_count_ctor and moz_count_dtor for non-xpcom objects. not having your classes in the list is not ok. that means no one is looking at them, and we won't be able to tell if someone introduces a leak. (see below for how to fix this.) the bytes leaked for your classes should be zero! - need i say more? if it isn't, you should use the other tools to fix it. the number of objects
remaining might not be equal to the total number of objects. this could indicate a hand-written release method (that doesn't use the ns_log_release macro from nstracerefcnt.h), or perhaps you're just not freeing any of the instances you've allocated. these sorts of leaks are easy to fix. the total number of objects might be 1. this might indicate a global variable or service. usually this will have ...
Gecko Profiler FAQ
his hooked up for nsthreads, and as of very recently also for rayon threads (used in stylo). we have not attempted to register other threads with the profiler. bug 1341811 suggests hooking platform thread spawning functions but nobody has looked at it yet. profiling all nsthreads - how bad is the overhead? [mstange] i don’t know. i think julian seward has done some measu
rements on this, i think. [ehsan] try clicking the toolbar icon for the extension, expanding the settings section, and enter the secret cheat code “,” in the threads field and click on “apply (restart profiler)”. this will capture all of the threads that the gecko profiler has been hooked to. this mode is usually recommended when you want to find a thread you want to ...
...cko profiler has a “mainthreadio” feature which will cause markers for main thread io to be inserted into the profile. however, the profiler add-on currently doesn’t have a checkbox to enable this feature. are the timer probes synchronized, or random/independent? (i'd guess they're independent). when profiling hundred(s) of threads at low intervals, does this distort the measu
rement or operation? (i.e. i want to profile all threads, not just main plus a couple of others) we haven’t done any measu
rements of how frequent sampling distorts measu
rement or operation. there is only one sampler thread. it runs a loop that works like this: iterate over all threads. for each thread, suspend it, walk its stack, resume it. ...
...gecko profiler does not know which thread is used at which time. it interrupts all threads based on wall-clock time. [jesup] ok, that's the equivalent to itimer_real, kinda, except that per the previous question it doesn't interrupt every thread at once and snapshot the thread you started the itimer on, it interrupts each thread one at a time, which likely means distortion of the measu
rement if the number of threads monitored is significant (especially at high sample rates). a cleaner snapshot would stop all threads, walk all their stacks, and then resume all threads, especially on high-core systems. (itimer_real (due to posix) requires the signal occur on the calling thread, not a random thread. itimer_prof interrupts the then-running thread, whichever one it is. ...
tools/power/rapl
s follows. sudo $objdir/dist/bin/rapl alternatively, it can be run without root privileges by setting the contents of /proc/sys/kernel/perf_event_paranoid to 0. note that if you do change this file, its contents may reset when the machine is next rebooted. you must be running linux kernel version 3.14 or later for rapl to work. otherwise, it will fail with an error message explaining this requi
rement. windows unfortunately, rapl does not work on windows, and porting it would be difficult because windows does not have apis that allow easy access to the relevant model-specific registers. output the following is 10 seconds of output from a default invocation of rapl. total w = _pkg_ (cores + _gpu_ + other) + _ram_ w #01 5.17 w = 1.78 ( 0.12 + 0.10 + 1.56) + 3.39 w #02 9.43 w = ...
... 0.43 + 3.10) + 3.86 w #05 14.63 w = 10.43 ( 4.41 + 0.81 + 5.22) + 4.19 w #06 11.16 w = 6.90 ( 1.91 + 1.68 + 3.31) + 4.26 w #07 5.40 w = 1.97 ( 0.20 + 0.10 + 1.67) + 3.44 w #08 5.17 w = 1.76 ( 0.07 + 0.08 + 1.60) + 3.41 w #09 5.17 w = 1.76 ( 0.09 + 0.08 + 1.58) + 3.42 w #10 8.13 w = 4.40 ( 1.55 + 0.11 + 2.74) + 3.73 w things to note include the following. all measu
rements are in watts. the first line indicates the meaning of each column. the underscores in _pkg_, _gpu_ and _ram_ are present so that each column's name has five characters. the total power is the sum of the package power and the ram power. the package estimate is divided into three parts: cores, gpu, and "other". "other" is computed as the package power minus the cores power and gpu power. i...
...iseconds. defaults to 1000. a warning is given if you set it below 50 because that is likely to lead to inaccurate estimates. -n --sample-count. the number of samples to take. the default is 0, which is interpreted as "unlimited". combining with powermetrics on mac, you can use the mach power command to run rapl in combination with powermetrics in a way that gives the most useful summary measu
rements for each of firefox, chrome and safari. ...
turbostat
this article provides an introduction to using it. note: the power profiling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. ...
... 2 784 21.29 3681 3398 0 11.78 3.10 1.13 62.70 40 2 6 782 21.15 3698 3398 0 11.92 3 3 702 19.14 3670 3398 0 8.39 3.09 2.03 67.36 39 3 7 648 17.67 3667 3398 0 9.85 the man page has good explanations of what each column measures. ...
... 782 21.15 3698 3398 0 11.92 3 3 702 19.14 3670 3398 0 8.39 3.09 2.03 67.36 39 3 7 648 17.67 3667 3398 0 9.85 the man page has good explanations of what each column measures. the various "watt" measu
rements come from the intel rapl msrs. ...
L20n Javascript API
etsync and ctx.getentitysync to get translations synchronously. alternatively, you can register callbacks to execute when the context is ready (or when globals change and translations need to be updated) with ctx.localize. ctx.localize(['hello', 'new'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.
remove('hidden'); }); ctx.registerlocales(defaultlocale: string?, availablelocales: array<string>?) register the default locale of the context instance, as well as all other locales available to the context instance before the language negotiation. locales are referenced by their bcp 47 language codes. ctx.registerlocales('en-us', ['ar', 'es-ar', 'es-es', 'en-us', 'fr', 'pl']); defaultlocale...
...les; the context instance will try to retrieve a fallback translation from the next locale in the fallback chain, compiler.error, when l20n is unable to evaluate an entity to a string; there are two types of errors in this category: compiler.valueerror, when l20n can still try to use the literal source string of the entity as fallback, and compiler.indexerror otherwise. ctx.
removeeventlistener(event: string, callback: function)
remove an event listener previously registered with addeventlistener. ctx.updatedata(ctxdata: object) update the context data which will be available to all entities in the context. the ctxdata is an object which extends the context data per key and per level of hierarchy. in other words, the following two calls: ctx.updatedata({ user: { na...
... if the entity couldn't be evaluated and a fallback translation had to be used. ctx.localize(ids: array<string>, callback: function) registers a callback which fires when all entities listed in ids have been retrieved. ctx.localize(['hello', 'about'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.
remove('hidden'); }); the callback becomes bound to the entities on the ids list. it will be called when the entities become available (asynchronously) or whenever the translation of any of the entities changes. localize should be the preferred way of localizing the ui. the callback function is passed an l10n object with the following properties: entities: an object whose keys are the identif...
AsyncTestUtils extended framework
messages should be in each thread? the default is that every message is its own thread; no message is a reply to any other message. if you pass a number greater than 1, then you get a direct reply-chain that long. for example, if you pass 3, then 1 <- 2 <- 3 is what the reply chain looks like. if you need more complicated threads you will need to use the messagescenariofactory. age: (strictly inc
rementing from arbitrary origin) the default starts at jan 1, 2000 and adds an hour for every message. if you pass an object, it should be an object with one or more of the following attributes: minutes, hours, days, weeks. these attributes specify how old the message should be. for example, {weeks: 2, days: 3} would be a message sent exactly 17 days ago. if you pass age, you should also pass age_in...
...origin) the default starts at jan 1, 2000 and adds an hour for every message. if you pass an object, it should be an object with one or more of the following attributes: minutes, hours, days, weeks. these attributes specify how old the message should be. for example, {weeks: 2, days: 3} would be a message sent exactly 17 days ago. if you pass age, you should also pass age_incr. age_incr: (no inc
rement) takes an object of the same style taken by age. this specifies the time interval we should add to the date for each message. due to a bug, you should pass negative values. (we will probably auto-correct that in the future.) if your set definition was {count: 3, age: {days: 7}, age_incr: {days: -1}}, then you would generate messages from 7, 6, and 5 days ago. subject: (automatically generate...
...tarred ("flagged" in imap parlance), setstarred(false) makes them not be starred. addtag(atagkey) adds the given tag to all the messages in the set. the tag key must correspond to an existing tag. the tag key is not the label, but what is actually stored on the imap server. for example, all our default tags are actually things like $label1 and $label2, but that is not what we show to the user.
removetag(atagkey)
removes the given tag from all the messages in the set. see the addtag notes. setjunk(abejunk) sets the junk score for the messages in the set as junk (true) / not junk (false). this does not involves the bayesian classifier and does not do anything like moving the message to the junk folder. it does, however, send a junkstatuschanged notification via the nsimsgfoldernotificatio...
About NSPR
/o, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. history a good portion of the library's purpose, and perhaps the primary purpose in the gromit environment, was to provide the underpinnings of the java vm, more or less mapping the sys layer that sun defined for the porting of the java vm to various platforms. nspr went beyond that requi
rement in some areas and since it was also the platform independent layer for most of the servers produced by netscape. it was expected and preferred that existing code be restructured and perhaps even rewritten in order to use the nspr api. it is not a goal to provide a platform for the porting into netscape of externally developed code. at the time of writing the current generation of nspr was kno...
...s produced by netscape. it was expected and preferred that existing code be restructured and perhaps even rewritten in order to use the nspr api. it is not a goal to provide a platform for the porting into netscape of externally developed code. at the time of writing the current generation of nspr was known as nspr20. the first generation of nspr was originally conceived just to satisfy the requi
rements of porting java to various host environments. nspr20, an effort started in 1996, built on that original idea, though very little is left of the original code. (the "20" in "nspr20" does not mean "version 2.0" but rather "second generation".) many of the concepts have been reformed, expanded, and matured. today nspr may still be appropriate as the platform dependent layer under java, but its p...
...ases this is simply a smoothing over of the facilities offered by the various platform providers. where it's headed nspr is applicable as a platform on which to write threaded applications that need to be ported to multiple platforms. the current implementation supports macintosh (ppc), win-32 (winnt, win9x) and 20 versions of unix and is still expanding. the basic api is stable and expected to
remain that way. nspr is functionally complete and has entered a mode of sustaining engineering. as operating system vendors issue new releases of their operating systems, nspr will be moved forward to these new releases by interested players. original document information author: larryh@netscape.com last updated date: 2000 (portions of the introduction moved to the history section in 2012) ...
Linked Lists
this chapter describes the nspr api for managing linked lists. the api is a set of macros for initializing a circular (doubly linked) list, inserting and
removing elements from the list. the macros are not thread safe. the caller must provide for mutually-exclusive access to the list, and for the nodes being added and
removed from the list. linked list types linked list macros linked list types the prclist type represents a circular linked list. ...
...t provide for mutually-exclusive access to the list, and for the nodes being added and
removed from the list. linked list types linked list macros linked list types the prclist type represents a circular linked list. ...
...tually-exclusive access to the list, and for the nodes being added and
removed from the list. linked list types linked list macros linked list types the prclist type represents a circular linked list. ...
PRLinger
structure used with the pr_sockopt_linger socket option to specify the time interval (in printervaltime units) to linger on closing a socket if any data
remain in the socket send buffer. syntax #include <prio.h> typedef struct prlinger { prbool polarity; printervaltime linger; } prlinger; fields the structure has the following fields: polarity polarity of the option's setting: pr_false means the option is off, in which case the value of linger is ignored. pr_true means the option is on, and the value of linger will be used to determine how long pr_close waits before returning. ...
...altime linger; } prlinger; fields the structure has the following fields: polarity polarity of the option's setting: pr_false means the option is off, in which case the value of linger is ignored. pr_true means the option is on, and the value of linger will be used to determine how long pr_close waits before returning. linger time (in printervaltime units) to linger before closing if any data
remain in the socket send buffer. description by default, pr_close returns immediately, but if there are any data
remaining in the socket send buffer, the system attempts to deliver the data to the peer. the pr_sockopt_linger socket option, with a value represented by a structure of type prlinger, makes it possible to change this default as follows: if polarity is set to pr_false, pr_close retur...
...on by default, pr_close returns immediately, but if there are any data
remaining in the socket send buffer, the system attempts to deliver the data to the peer. the pr_sockopt_linger socket option, with a value represented by a structure of type prlinger, makes it possible to change this default as follows: if polarity is set to pr_false, pr_close returns immediately, but if there are any data
remaining in the socket send buffer, the runtime attempts to deliver the data to the peer. if polarity is set to pr_true and linger is set to 0 (pr_interval_no_wait), the runtime aborts the connection when it is closed and discards any data
remaining in the socket send buffer. if polarity is set to pr_true and linger is nonzero, the runtime lingers when the socket is closed. that is, if any data re...
PR_RmDir
the directory must be empty. if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error. ...
...the directory must be empty. if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error. ...
...the directory must be empty. if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error. ...
Encrypt Decrypt MAC Keys As Session Objects
c_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and
remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { ...
...only and we have authenticated to it * open input file, read in header, get iv and cka_ids of two keys from it * find those keys in the db token * open output file * loop until eof(input): * read a buffer of ciphertext from input file, * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv, * compute and check mac, then
remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to output file * close files * report success */ secstatus rv; secitem ivitem; secitem enckeyitem; secitem mackeyitem; secitem cipheritem; secitem macitem; secitem ...
... pr_fprintf(pr_stderr, "mac has data has 0 length\n"); /*rv = secfailure; goto cleanup;*/ } rv = readfromheaderfile(headerfilename, pad, &paditem, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not retrieve pad detail from header file\n"); goto cleanup; } if (rv == secsuccess) { /* decrypt and
remove mac */ rv = decryptandverifymac(outfilename, encryptedfilename, &cipheritem, &macitem, enckey, mackey, &ivitem, &paditem); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed while decrypting and
removing mac\n"); } } cleanup: if (slot) { pk11_freeslot(slot); } if (enckey) { pk11_freesymkey(enckey); } ...
Encrypt and decrypt MAC using token
c_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and
remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { ...
...only and we have authenticated to it * open input file, read in header, get iv and cka_ids of two keys from it * find those keys in the db token * open output file * loop until eof(input): * read a buffer of ciphertext from input file, * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv, * compute and check mac, then
remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to output file * close files * report success */ secstatus rv; secitem ivitem; secitem enckeyitem; secitem mackeyitem; secitem cipheritem; secitem macitem; secitem ...
... pr_fprintf(pr_stderr, "mac has data has 0 length\n"); /*rv = secfailure; goto cleanup;*/ } rv = readfromheaderfile(headerfilename, pad, &paditem, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not retrieve pad detail from header file\n"); goto cleanup; } if (rv == secsuccess) { /* decrypt and
remove mac */ rv = decryptandverifymac(outfilename, encryptedfilename, &cipheritem, &macitem, enckey, mackey, &ivitem, &paditem); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed while decrypting and
removing mac\n"); } } cleanup: if (slot) { pk11_freeslot(slot); } if (enckey) { pk11_freesymkey(enckey); } ...
NSS_3.12.2_release_notes.html
nsertion of e-identity smartcard bug 447563: modutil -add prints no error explanation on failure bug 448431: pk11_createmergelog() declaration causes gcc warning when compiling with -wstrict-prototypes bug 449334: pk12util has duplicate options letters bug 449725: signver is still using static libraries. ...
... duplicate options letters bug 449725: signver is still using static libraries. bug 450427: add comodo ecc certification authority certificate to nss bug 450536:
remove obsolete xp_mac code bug 451024: certutil.exe crashes with segmentation fault inside pr_cleanup bug 451927: security/coreconf/winnt6.0.mk has invalid defines bug 452751: slot leak in pk11_findslotsbynames bug 452865:
remove obsolete linker flags needed when libnss3 was linked with libsoftokn3 bug 454961: fix the implementation and use of pr_fgets in signtool bug 455348: change hyphens to underscores in debug_$(shell whoami). bug 455424: nssilckt.h defines the enumeration constant 'lock' bug 456036: stubs for deprecated functions in lib/certdb/stanpcertdb.c should set the pr_not_implemented_error error. ...
...ns for nss 3.11.4 and above nss shared db compatibility nss 3.12.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). ...
NSS 3.12.5 release_notes
tinit returns. if the string parameter is null (as opposed to empty, zero length), then the softoken default is used. these are equivalent to the parameters for pk11_configurepkcs11(). see the following struct in nss.h for details: nssinitparametersstr other new functions in secmod.h: secmod_getskipfirstflag secmod_getdefaultmoddbflag in prlink.h nss_secu
rememcmp port_loadlibraryfromorigin modified functions sgn_update (see cryptohi.h) the parameter "input" of this function is changed from unsigned char * to const unsigned char *. pk11_configurepkcs11 (see nss.h) the name of some parameters have been slightly changed ("des" became "desc"). deprecated headers the header file key.h is deprecated. please use ...
...ld free the data buffer pointed to by dest with a secitem_freeitem(dest, pr_false) or port_free(dest->data) call. environment variables nss_fips will start nss in fips mode. nss_ssl_enable_renegotiation nss_ssl_require_safe_negotiation see ssl3 & tls renegotiation vulnerability. bugs fixed the following bugs have been fixed in nss 3.12.5. ...
...g: build instructions nss shared db compatibility nss 3.12.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.5 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). this document was generated by genma teruaki on november 28, 2010 using texi2html 1.82. ...
NSS 3.12.6 release notes
bug 542538: nss: add function for recording ocsp stapled replies bug 544191: use system zlib on mac os x bug 544584: segmentation fault when enumerating the nss database bug 544586: various nss-sys-init patches from fedora ...
...e nspr version check in lib/util/secport.c bug 541231: nssinit.c doesn't need to include ssl.h and sslproto.h. bug 542538: nss: add function for recording ocsp stapled replies bug 544191: use system zlib on mac os x bug 544584: segmentation fault when enumerating the nss database bug 544586: various nss-sys-init patches from fedora bug 545273:
remove unused function sec_init bug 546389: nsssysinit binary built inside source tree documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation. new and revised documents available since the release of nss 3.11 include the following: build instructions nss shared db ...
... compatibility nss 3.12.6 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.6 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). ...
NSS 3.12.9 release notes
ure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3.12.9_rtm/src/. you also need to download the nspr 4.8.7 binary distributions to get the nspr 4.8.7 header files and shared libraries, which nss 3.12.9 requires. nspr 4.8.7 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.7/. new in nss 3.12.9
removed functions new ssl options new error codes bugs fixed the following bugs have been fixed in nss 3.12.9. bug 609068: implement j-pake in freebl bug 607058: crash [@ nss_cms_decoder_work_data] bug 613394: november/december 2010 batch of nss root ca changes bug 610843: need way to recover softoken in child after fork() bug 617492: add pk11_keygenwithtemplate funct...
...d partial private keys. bug 596798: win_rand.c (among others) uses unsafe _snwprintf bug 597622: do not use the sec_error_bad_info_access_location error code for bad crl distribution point urls bug 619268: memory leaks in cert_changecerttrust and cert_savesmimeprofile bug 585518: addtrust qualified ca root serial wrong in certdata.txt trust entry bug 337433: need cert_findcertbynicknameo
remailaddrbyusage bug 592939: expired cas in certdata.txt documentation <for a="" class="new " documentation="" href="/en/index.html#documentation" list="" nss="" of="" pages="" primary="" rel="internal" see="" the="" title="en/index.html#documentation">nss documentation. new and revised documents available since the release of nss 3.11 include the following:</for> build instructions for ...
...for nss 3.11.4 and above nss shared db compatibility nss 3.12.9 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.9 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). ...
NSS 3.17.3 release notes
la.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_3_rtm/src/ new in nss 3.17.3 new functionality support for tls_fallback_scsv has been added to the ssltap and tstclnt utilities. notable changes in nss 3.17.3 the quickder decoder now decodes lengths robustly (cve-2014-1569). ...
...n nss 3.17.3 the quickder decoder now decodes lengths robustly (cve-2014-1569). ...
...=advanced&product=nss&target_milestone=3.17.3 compatibility nss 3.17.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.17.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.21 release notes
strings. in ssl.h ssl_getpreliminarychannelinfo - obtains information about a tls channel prior to the handshake being completed, for use with the callbacks that are invoked during the handshake ssl_signatureprefset - configures the enabled signature and hash algorithms for tls ssl_signatureprefget - retrieves the currently configured signature and hash algorithms ssl_signatu
remaxcount - obtains the maximum number signature algorithms that can be configured with ssl_signatureprefset in utilpars.h nssutil_argparsemodulespecex - takes a module spec and breaks it into shared library string, module name string, module parameters string, nss specific parameters string, and nss configuration parameter strings. the returned strings must be freed by the caller. the d...
... sslpreliminarychannelinfo to indicate that a tls cipher suite has been selected ssl_preinfo_all - used with sslpreliminarychannelinfo to indicate that all preliminary information has been set notable changes in nss 3.21 nss now builds with elliptic curve ciphers enabled by default (bug 1205688) nss now builds with warnings as errors (bug 1182667) the following ca certificates were
removed cn = verisign class 4 public primary certification authority - g3 sha1 fingerprint: c8:ec:8c:87:92:69:cb:4b:ab:39:e9:8d:7e:57:67:f3:14:95:73:9d cn = utn-userfirst-network applications sha1 fingerprint: 5d:98:9c:db:15:96:11:36:51:65:64:1b:56:0f:db:ea:2a:c2:3e:f1 cn = tc trustcenter universal ca iii sha1 fingerprint: 96:56:cd:7b:57:96:...
... responsibly disclosing the issue in bug 1158489. compatibility nss 3.21 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.21 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.25 release notes
ource distributions are available on ftp.mozilla.org for secure https download at the following location. source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_25_rtm/src/ new in nss 3.25 new functionality implemented dhe key agreement for tls 1.3. added support for chacha with tls 1.3. added support for tls 1.2 ciphersuites that use sha384 as the prf.
removed the limitation that allowed nss to only support certificate_verify messages that used the same signature hash algorithm as the prf when using tls 1.2 client authentication. several functions have been added to the public api of the nss cryptoki framework. new functions in nssckfw.h nssckfwslot_getslotid nssckfwsession_getfwslot nssckfwinstance_destroysessionhandle nssckf...
... nssckfwinstance_destroysessionhandle nssckfwinstance_findsessionhandle notable changes in nss 3.25 an ssl socket can no longer be configured to allow both tls 1.3 and ssl v3. regression fix: nss no longer reports a failure if an application attempts to disable the ssl v2 protocol. the trusted ca certificate list has been updated to version 2.8. ...
...format=advanced&product=nss&target_milestone=3.25 compatibility nss 3.25 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.25 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.28.1 release notes
tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_28_1_rtm/src/ new in nss 3.28.1 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates, and address a minor tls compatibility issue, that some applications experienced with nss 3.28. ...
... bugs fixed in nss 3.28.1 bug 1296697 - december 2016 batch of root ca changes bug 1322496 - internal error assert when the other side closes connection before reading eoed compatibility nss 3.28.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older ns...
...er side closes connection before reading eoed compatibility nss 3.28.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.28 release notes
bled signature schemes for a socket. request to test and prepare for tls 1.3 this release contains improved support for tls 1.3, however, the code that supports tls 1.3 is still disabled by default (not built). for the future nss 3.29 release, it is planned that standard builds of nss will support the tls 1.3 protocol (although the maximum tls protocol version enabled by default will
remain at tls 1.2). we know that some applications which use nss, query nss for the supported range of ssl/tls protocols, and will enable the maximum enabled protocol version. in nss 3.29, those applications will therefore enable support for the tls 1.3 protocol. in order to prepare for this future change, we'd like to encourage all users of nss to override the standard nss 3.28 build configuration...
...certain nss source files. nss will now detect the presence of tokens that support additional elliptic curves and enable those curves for use in tls (bug 1303648). note that this detection has a one-off performance cost, which can be avoided by using the ssl_namedgroupconfig function, to limit supported groups to those that nss provides. pkcs#11 bypass for tls is no longer supported and has been
removed (bug 1303224). support for "export" grade ssl/tls cipher suites has been
removed (bug 1252849). nss now uses the signature schemes definition in tls 1.3 (bug 1309446). this also affects tls 1.2. nss will now only generate signatures with the combinations of hash and signature scheme that are defined in tls 1.3, even when negotiating tls 1.2. this means that sha-256 will only be used ...
...format=advanced&product=nss&target_milestone=3.28 compatibility nss 3.28 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.37 release notes
/pub/mozilla.org/security/nss/releases/nss_3_37_rtm/src/ notable changes in nss 3.37 the tls 1.3 implementation was updated to draft 28. an issue where nss erroneously accepted hrr requests was resolved. this issue was found by oss fuzz. added hacl* poly1305 32-bit the code to support the npn protocol, which had already been disabled in a previous release, has been fully
removed. nss allows servers now to register alpn handling callbacks to select a protocol. nss supports opening sql databases in read-only mode. nss now requires the sqlite apis of version 3.5.0 or newer. starting with nss version 3.31, an alternative implementation for rng seeding on the linux/unix platform was available (bug 1346735), which performed seeding exclusively based on /d...
...elected in "make" builds by defining the environment variable nss_seed_only_dev_urandom. with nss 3.37, this alternative implementation for linux has been enhanced to use the glibc function getentropy(), instead of reading from /dev/urandom directly, if the build and runtime linux platform supports it. the ca certificates list was updated to version 2.24. ...
...format=advanced&product=nss&target_milestone=3.37 compatibility nss 3.37 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.37 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.39 release notes
the tls 1.3 implementation uses the final version number from rfc 8446. previous versions of nss accepted an rsa pkcs#1 v1.5 signature where the digestinfo structure was missing the null parameter. starting with version 3.39, nss requires the encoding to contain the null parameter. the tstclnt and selfserv test utilities no longer accept the -z parameter, as support for tls compression was
removed in a previous nss version. the ca certificates list was updated to version 2.26. the following ca certificates were added: ou = globalsign root ca - r6 sha-256 fingerprint: 2cabeafe37d06ca22aba7391c0033d25982952c453647349763a3ab5ad6ccf69 cn = oiste wisekey global root gc ca sha-256 fingerprint: 8560f91c3624daba9570b5fea0dbe36ff11a8323be9486854fb3f34a557...
...ist was updated to version 2.26. ...
...format=advanced&product=nss&target_milestone=3.39 compatibility nss 3.39 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.39 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.48 release notes
g 1599545 - fix assertion and add test for early key update bug 1597799 - fix a crash in nssckfwobject_getattributesize bug 1591178 - add entrust root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 -
remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey if key length > max_key_len (256) b...
...decrypt length in constant time bug 1562671 - increase nss mp kdf default iteration count, by default for modern key4 storage, optionally for legacy key3.db storage bug 1590972 - use -std=c99 rather than -std=gnu99 bug 1590676 - fix build if arm doesn't support neon bug 1575411 - enable tls extended master secret by default bug 1590970 - ssl_settimefunc has incomplete coverage bug 1590678 -
remove -wmaybe-uninitialized warning in tls13esni.c bug 1588244 - nss changes for delegated credential key strength checks bug 1459141 - add more cbc padding tests that missed nss 3.47 bug 1590339 - fix a memory leak in btoa.c bug 1589810 - fix uninitialized variable warnings from certdata.perl bug 1573118 - enable tls 1.3 by default in nss this bugzilla query returns all the bugs fixed in nss...
...format=advanced&product=nss&target_milestone=3.48 compatibility nss 3.48 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.48 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.54 release notes
b518ae2ea1b99 bug 1641716 - microsoft ecc root certificate authority 2017 sha-256 fingerprint: 358df39d764af9e1b766e9c972df352ee15cfac227af6ad1d70e8e4a6edcba02 bug 1641716 - microsoft rsa root certificate authority 2017 sha-256 fingerprint: c741f70f4b2a8d88bf2e71c14122ef53ef10eba0cfa5e64cfa20f418853073e0 the following ca certificates were
removed: bug 1645199 - addtrust class 1 ca root sha-256 fingerprint: 8c7209279ac04e275e16d07fd3b775e80154b5968046e31f52dd25766324e9a7 bug 1645199 - addtrust external ca root sha-256 fingerprint: 687fa451382278fff0c8b11f8d43d576671c6eb2bceab413fb83d965d06d2ff2 bug 1641718 - luxtrust global root 2 sha-256 fingerprint: 54455f7129c20...
...tls 1.3 external psk support. bug 1642802 - add uint128 support for hacl* curve25519 on windows. bug 1645186 - add "certsign root ca g2" root certificate. bug 1645174 - add microsec's "e-szigno root ca 2017" root certificate. bug 1641716 - add microsoft's non-ev root certificates. bug 1621151 - disable email trust bit for "o=government root certification authority; c=tw" root. bug 1645199 -
remove addtrust root certificates. bug 1641718 -
remove "luxtrust global root 2" root certificate. bug 1639987 -
remove "staat der nederlanden root ca - g2" root certificate. bug 1618402 -
remove symantec root certificates and disable email trust bit. bug 1640516 - nss 3.54 should depend on nspr 4.26. bug 1642146 - fix undefined reference to `port_zalloc_stub' in seed.c. bug 1642153 - fix infin...
...format=advanced&product=nss&target_milestone=3.54 compatibility nss 3.54 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.54 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.55 release notes
otential workaround is to use the gyp-based build.sh script. if this affects you, please help us narrow down the cause in bug 1653975. bugs fixed in nss 3.55 bug 1631583 (cve-2020-6829, cve-2020-12400) - replace p384 and p521 with new, verifiable implementations from fiat-crypto and ecckiila. bug 1649487 - move overzealous assertion in vfy_endwithsignature. bug 1631573 (cve-2020-12401) -
remove unnecessary scalar padding. bug 1636771 (cve-2020-12403) - explicitly disable multi-part chacha20 (which was not functioning correctly) and more strictly enforce tag length. bug 1649648 - don't memcpy zero bytes (sanitizer fix). bug 1649316 - don't memcpy zero bytes (sanitizer fix). bug 1649322 - don't memcpy zero bytes (sanitizer fix). bug 1653202 - fix initialization bug in blapitest ...
...ion in makefile builds. bug 1649633 - add pk11_findcertinslot to search a given slot for a der-encoded certificate. bug 1651520 - fix slotlock race in nsc_gettokeninfo. bug 1647752 - update dtls 1.3 implementation to draft-38. bug 1649190 - run cipher, sdr, and ocsp tests under standard test cycle in ci. bug 1649226 - add wycheproof ecdsa tests. bug 1637222 - consistently enforce iv requi
rements for des and 3des. bug 1067214 - enforce minimum pkcs#1 v1.5 padding length in rsa_checksignrecover. bug 1643528 - fix compilation error with -werror=strict-prototypes. bug 1646324 - advertise pkcs#1 schemes for certificates in the signature_algorithms extension. bug 1652331 - update nss 3.55 nspr version to 4.27. this bugzilla query returns all the bugs fixed in nss 3.55: https:...
...format=advanced&product=nss&target_milestone=3.55 compatibility nss 3.55 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.55 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS Developer Tutorial
nss coding style formatting line length should not exceed 80 characters. indentation level is 4. tabs are used heavily in many nss source files. try to stay consistent when you modify existing code. the proper use of tabs has often been confusing for new nss developers, so in nss/lib/ssl, we're gradually
removing the use of tabs. curly braces: both of the following styles are allowed: if (condition) { action1(); } else { action2(); } or: if (condition) { action1(); } else { action2(); } the former style is more common. when modifying existing code, try to stay consistent. in new code, prefer the former style, as it conserves vertical space. when a block of code consists of a single statement, nss doesn’t require curly braces, so both of these examples a...
... c++11 features. the mozilla c++ language features guide, and the chromium c++ usage guide, list c++ features that are known to be widely available and compatible. you should limit features to those that appear in both guides. ask on nss-dev@ if you think this is restrictive, or if you wish to prohibit a specific feature. nss c abi backward compatibility functions exported functions cannot be
removed. the function prototype of an exported function, cannot be changed, with these exceptions: a foo * parameter can be changed to const foo *. this change is always safe. sometimes an int parameter can be changed to unsigned int, or an int * parameter can be changed to unsigned int *. whether such a change is safe needs to be reviewed on a case-by-case basis. types structs mem...
...on, cannot be changed, with these exceptions: a foo * parameter can be changed to const foo *. this change is always safe. sometimes an int parameter can be changed to unsigned int, or an int * parameter can be changed to unsigned int *. whether such a change is safe needs to be reviewed on a case-by-case basis. types structs members of an exported struct, cannot be reordered or
removed. under certain circumstances, it is safe to add new members to an exported struct at the end. opaque structs give us complete freedom to change them, but require applications to call nss functions, to allocate and free them. enums the numeric values of public enumerators cannot be changed. to stress this fact, we often explicitly assign numeric values to enumerators, rather than relying o...
Encrypt Decrypt_MAC_Using Token
*/ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file. */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { ...
...and we have authenticated to it: * open input file, read in header, get iv and cka_ids of two keys from it. * find those keys in the db token. * open output file. * loop until eof(input): * read a buffer of ciphertext from input file. * save last block of ciphertext. * decrypt ciphertext buffer using cbc and iv. * compute and check mac, then
remove mac from plaintext. * replace iv with saved last block of ciphertext. * write the plain text to output file. * close files. * report success. */ secstatus rv; secitem ivitem; secitem enckeyitem; secitem mackeyitem; secitem cipheritem; secitem macitem; secitem ...
... pr_fprintf(pr_stderr, "mac has data has 0 length\n"); /*rv = secfailure; goto cleanup;*/ } rv = readfromheaderfile(headerfilename, pad, &paditem, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not retrieve pad detail from header file\n"); goto cleanup; } if (rv == secsuccess) { /* decrypt and
remove mac */ rv = decryptandverifymac(outfilename, encryptedfilename, &cipheritem, &macitem, enckey, mackey, &ivitem, &paditem); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed while decrypting and
removing mac\n"); } } cleanup: if (slot) { pk11_freeslot(slot); } if (enckey) { pk11_freesymkey(enckey); } ...
NSS Sample Code Sample_3_Basic Encryption and MACing
c_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and
remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { ...
...d only and we have authenticated to it * open input file, read in header, get iv and cka_ids of two keys from it * find those keys in the db token * open output file * loop until eof(input): * read a buffer of ciphertext from input file * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv * compute and check mac, then
remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to output file * close files * report success */ secstatus rv; secitem ivitem; secitem enckeyitem; secitem mackeyitem; secitem cipheritem; secitem macitem; secitem ...
... pr_fprintf(pr_stderr, "mac has data has 0 length\n"); /*rv = secfailure; goto cleanup;*/ } rv = readfromheaderfile(headerfilename, pad, &paditem, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not retrieve pad detail from header file\n"); goto cleanup; } if (rv == secsuccess) { /* decrypt and
remove mac */ rv = decryptandverifymac(outfilename, encryptedfilename, &cipheritem, &macitem, enckey, mackey, &ivitem, &paditem); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed while decrypting and
removing mac\n"); } } cleanup: if (slot) { pk11_freeslot(slot); } if (enckey) { pk11_freesymkey(enckey); } ...
EncDecMAC using token object - sample 3
(trailer, iv_trailer); break; case mac: strcpy(header, mac_header); strcpy(trailer, mac_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } rv = filetoitem(&filedata, file); nonbody = (char *)filedata.data; if (!nonbody) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); rv = secfailure; goto cleanup; } /* check for headers and trailers and
remove them */ if ((body = strstr(nonbody, header)) != null) { char *trail = null; nonbody = body; body = port_strchr(body, '\n'); if (!body) body = port_strchr(nonbody, '\r'); /* maybe this is a mac file */ if (body) trail = strstr(++body, trailer); if (trail != null) { *trail = '\0'; } else { pr_fprintf(pr_stderr, "input has header but no trailer\n"); port_free(filedata.data); return secfailure; } ...
...wdata *pwdata, prbool ascii) { /* * the db is open read only and we have authenticated to it * open input file, read in header, get iv and cka_ids of two keys from it * find those keys in the db token * open output file * loop until eof(input): * read a buffer of ciphertext from input file, * save last block of ciphertext * decrypt ciphertext buffer using cbc and iv, * compute and check mac, then
remove mac from plaintext * replace iv with saved last block of ciphertext * write the plain text to output file * close files * report success */ secstatus rv; secitem ivitem; secitem enckeyitem; secitem mackeyitem; secitem cipheritem; secitem macitem; secitem paditem; pk11symkey *enckey = null; pk11symkey *mackey = null; /* open intermediate file, read in header, get iv and cka_ids of two keys * fr...
..._stderr, "mac has null data\n"); rv = secfailure; goto cleanup; } if (macitem.len == 0) { pr_fprintf(pr_stderr, "mac has data has 0 length\n"); /*rv = secfailure; goto cleanup;*/ } rv = readfromheaderfile(headerfilename, pad, &paditem, pr_true); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not retrieve pad detail from header file\n"); goto cleanup; } if (rv == secsuccess) { /* decrypt and
remove mac */ rv = decryptandverifymac(outfilename, encryptedfilename, &cipheritem, &macitem, enckey, mackey, &ivitem, &paditem); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed while decrypting and
removing mac\n"); } } cleanup: if (slot) { pk11_freeslot(slot); } if (enckey) { pk11_freesymkey(enckey); } if (mackey) { pk11_freesymkey(mackey); } return rv; } /* * encryptfile */ secstatus encrypt...
Migration to HG
ercurial) server. each project now lives in its own separate space, they can be found at: https://hg.mozilla.org/projects/nspr/ https://hg.mozilla.org/projects/nss/ https://hg.mozilla.org/projects/jss/ https://hg.mozilla.org/projects/python-nss/ this migration has been used as an opportunity to change the layout of the source directories. for nspr, "mozilla/nsprpub" has been
removed from the directory hierarchy, all files now live in the top directory of the nspr repository. likewise for nss and jss, "mozilla/security" has been
removed and files now live at the top level. in addition for nss, we have merged the contents of directories mozilla/dbm and mozilla/security/dbm into the new directory lib/dbm. besides the new layout, the build system hasn't cha...
...w live in the top directory of the nspr repository. likewise for nss and jss, "mozilla/security" has been
removed and files now live at the top level. in addition for nss, we have merged the contents of directories mozilla/dbm and mozilla/security/dbm into the new directory lib/dbm. besides the new layout, the build system hasn't changed. most parts of the nss build instructions
remain valid, especially the instructions about setting environment variables. updated instructions for building nss with nspr can be found at: /docs/nss_reference/building_and_installing_nss/build_instructions it's best to refer to the above document to learn about the various environment variables that you might have to set to build on your platform (this part hasn't changed). ho...
... because of the changes described above, we have decided to use a new series of (minor) version numbers. the first releases using the new code layout will be nspr 4.10 and nss 3.15 ...
sslcrt.html
icates: * matches anything ? matches one character \ escapes a special character $ matches the end of the string [abc] matches one occurrence of a, b, or c. the only character that needs to be escaped in this is ], all others are not special. [a-z] matches any character between a and z [^az] matches any character except a or z ~ followed by another shell expression
removes any pattern matching the shell expression from the match list (foo|bar) matches either the substring foo or the substring bar. these can be shell expressions as well. cert_checkcertvalidtimes checks whether a specified time is within a certificate's validity period. syntax #include <cert.h> #include <certt.h> seccerttimevalidity cert_checkcertvalidtimes( certcertificate *cert...
...ert.h> certcertificate *cert_dupcertificate(certcertificate *c) parameter this function has the following parameter: c a pointer to the certificate object to be duplicated. returns if successful, the function returns a pointer to a certificate object of type certcertificate. description the cert_dupcertificate function inc
rements the reference count for the certificate passed in the c parameter. cert_destroycertificate destroys a certificate object. syntax #include <cert.h> #include <certt.h> void cert_destroycertificate(certcertificate *cert); parameters this function has the following parameter: cert a pointer to the certificate to destroy. ...
...icate *cert); parameters this function has the following parameter: cert a pointer to the certificate to destroy. description certificate and key structures are shared objects. when an application makes a copy of a particular certificate or key structure that already exists in memory, ssl makes a shallow copy--that is, it inc
rements the reference count for that object rather than making a whole new copy. when you call cert_destroycertificate or seckey_destroyprivatekey, the function dec
rements the reference count and, if the reference count reaches zero as a result, both frees the memory and sets all the bits to zero. the use of the word "destroy" in function names or in the description of a function implies reference co...
Small Footprint
a few changes can be made to reduce the footprint of rhino for embeddings where space is at a p
remium. on a recent build, the length of js.jar was 603,127 bytes corresponding to 1,171,708 bytes of all uncompressed rhino classes with debug information included. with various changes js.jar size can be reduced to 204,689 bytes corresponding to 424,774 bytes of uncompressed classes. tools most embeddings won't need any of the classes in org.mozilla.javascript.tools or any of its sub-packages. optimizer it is possible to run rhino with interpreter mode only, allowing you to
remove code for classfile generation that include all the classes from <tt>org.mozilla.javascript.optimizer</tt> package. javaadapter implementing the javaadapter functionality requires the ability to generate cla...
...need any of the classes in org.mozilla.javascript.tools or any of its sub-packages. optimizer it is possible to run rhino with interpreter mode only, allowing you to
remove code for classfile generation that include all the classes from <tt>org.mozilla.javascript.optimizer</tt> package. javaadapter implementing the javaadapter functionality requires the ability to generate classes on the fly.
removing org.mozilla.javascript.javaadapter will disable this functionality, but rhino will otherwise run correctly. class generation library if you do not include optimizer or javaadapter, nor do you use policysecuritycontroller then you do not need rhino library for class file generation and you can
remove all the classes from in org.mozilla.classfile package. regular expressions the package or...
...apter will disable this functionality, but rhino will otherwise run correctly. class generation library if you do not include optimizer or javaadapter, nor do you use policysecuritycontroller then you do not need rhino library for class file generation and you can
remove all the classes from in org.mozilla.classfile package. regular expressions the package org.mozilla.javascript.regexp can be
removed. rhino will continue to run, although it will not be able to execute any regular expression matches. this change saves 47,984 bytes of class files. debug information debug information in rhino classes consumes about 25% of code size and if you can live without that, you can recompile rhino to
remove it. smalljs.jar ant build script in rhino supports smalljar target that will generate smal...
Exact Stack Rooting
); storing a gcpointer on the cheap todo: tracing and heapptr storing a gcpointer on the cstack gcpointers stored on the cstack are special. unlike other gcpointers, they are not traced as part of the gc. instead, every pointer on the cstack should be considered part of the rootset. to that end, we have a special "rooting" mechanism for stack pointers that is very efficiently able to add and
remove gcpointers to the rootedset. the downside of this efficiency is that gcpointers must be added to and
removed from this rootedset tracking structure in lifo order. for this reason it is highly recommended that this rooting mechanism only be used on the cstack. js::rooted<t> typedef js::rooted<t> rootedt; -> rootedobject, rootedstring, rootedscript, etc. because of the lifo restriction, usin...
... the downside of this efficiency is that gcpointers must be added to and
removed from this rootedset tracking structure in lifo order. for this reason it is highly recommended that this rooting mechanism only be used on the cstack. js::rooted<t> typedef js::rooted<t> rootedt; -> rootedobject, rootedstring, rootedscript, etc. because of the lifo restriction, using this interface manually is ext
remely cumbersome. instead, spidermonkey has a convenient suite of c++ raii classes to do this for you, called js::rootedt: rootedstring str1(cx, js_valuetostring(cx, val)); rootedstring str2(rt, js_valuetostring(cx, val)); note 1: c++ insists that an initializing assignment (e.g., the default constructor followed by operator=) must have a copy constructor available, even if it is not used. since...
...etc.) gcheap - the graph of gcthings allocated by spidermonkey's allocator. the goal of spidermonkey's gc is to partition this heap into regions reachable from the rootset and not. root - a gcpointer held live because it is a member of the rootset. rootset - this is a set of gcpointers that are de-facto alive, regardless of the gcthing's reachability. gcpointers must be explicitly added to and
removed from the rootset. liveset - the set of all gcthings that are reachable from roots. deadset - the set of all gcthings that are not reachable from roots. cheap - the c/c++ program heap: e.g., memory allocated by malloc/calloc/realloc. cstack - the c/c++ program stack. rooted - a gcthing in the liveset is said to be "rooted" even if it is not a root as such, but is only reachable from roots...
JS_DeleteElement
syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index, js::objectopresult &result); name type 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. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. result js::objectopresult & (out parameter) receives the result of the operation. ...
... runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. result js::objectopresult & (out parameter) receives the result of the operation. description js_deleteelement
removes a specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is
removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement returns true. otherwise it returns false. for javascript 1.2 and earlier, if failure occurs because you attempt to delete a pe...
...e's element is not deleted. if deletion is successful, js_deleteelement returns true. otherwise it returns false. for javascript 1.2 and earlier, if failure occurs because you attempt to delete a permanent or read-only element, js_deleteelement reports the error before returning false. for javascript 1.3 and later, the attempt is silently ignored. to truncate an array, use js_setarraylength. to
remove all elements and properties from an object, call js_clearscope. see also mxr id search for js_deleteelement bug 1113369 -- added result parameter ...
JS_MapGCRoots
obsolete since jsapi 19this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. perform some action for each object in a jsruntime's gc root set. syntax uint32 js_mapgcroots(jsruntime *rt, jsgcrootmapfun map, void *data); callback syntax #define js_map_gcroot_next 0 /* continue mapping entries */ #define js_map_gcroot_stop 1 /* stop mapping entries */ #define js_map_gcroot_
remove 2 /*
remove and free the current entry */ typedef int (*jsgcrootmapfun)(void *rp, const char *name, void *data); description call js_mapgcroots to map the gc's roots table using map(rp, name, data). the root is pointed at by rp; if the root is unnamed, name is null; data is ...
...to stop enumeration, return js_map_gcroot_stop. to continue mapping, return js_map_gcroot_next. these constants are flags; you can or them together. this function acquires and releases rt's gc lock around the mapping of the roots table, so the map function should run to completion in as few cycles as possible. ...
...to stop enumeration, return js_map_gcroot_stop. ...
JS_NewCompartmentAndGlobalObject
use js_newglobalobject instead. create a new global object in a new compartment. ...
...use js_newglobalobject instead. create a new global object in a new compartment. ...
... name type description cx jscontext * the context in which to create the new global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. clasp jsclass * the class to use for the new global object. clasp->flags must have the jsclass_global_flags bits set. the caller must ensure that the jsclass
remains alive throughout the lifetime of the new object, including the garbage collection cycle that finally frees it. the usual way to do this is to make jsclasses global or static. principals jsprincipals * the security information to associate with this compartment. description js_newcompartmentandglobalobject creates a new compartment, and then creates a new global obje...
JSDBGAPI
see bug 1069694. ...
... js_connectshark js_disconnectshark js_startshark js_stopshark ...
... js_connectshark js_disconnectshark js_startshark js_stopshark ...
SpiderMonkey 1.8
perty on a prototype, that result can be cached. future lookups for the same property on the same sort of object may bypass the resolve hook. js_newdouble is now deprecated. use js_newdoublevalue. the security apis js_setcheckobjectaccesscallback, js_setprincipalstranscoder, and js_setobjectprincipalsfinder are still present but are deprecated in this release. in spidermonkey 1.8.1 they will be
removed and replaced with a new set of apis (js_getsecuritycallbacks and friends, bug 451729). js.mak, an old windows-specific nmake file, has been deleted. it hasn't worked for a long time. it is fairly easy to create a microsoft visual studio project file for spidermonkey 1.8 from scratch. (if you would like to contribute and maintain a project file, please feel free to contact the spidermonkey te...
...rying to do something that would require more memory than the implementation is designed to handle. the main difference is that js_reportallocationoverflow throws an exception which the application may catch. js_throwstopiteration throws the appropriate stopiteration exception object for the given context. two new context options can be used with js_setoptions: jsoption_relimit, which causes ext
remely long-running regular expression searches to fail with an error, and jsoption_anonfunfix, which bans anonymous functions from appearing anyplace where a statement could appear, such as in the argument to eval(). functions that were js_threadsafe-only in spidermonkey 1.7 (js_beginrequest, for example) are now present, but do nothing, in non-js_threadsafe builds. this is to help applications sha...
...are documented but obscure. many new memory management features have been added as well. the new function js_setscriptstackquota limits the size of the javascript stack. two new functions, js_setgczeal and js_dumpheap, aim to help developers debug gc-related problems. these functions are only present in debug builds. js_setgczeal is especially helpful. when gc zeal is enabled, gc happens ext
remely frequently. this makes gc-related problems easier to reproduce, reveals gc problems that you may not have noticed before, and causes gc-safety bugs to surface much closer to their cause. js_dumpheap dumps parts of the gc heap and can help detect leaks. a new gc parameter, jsgc_stackpool_lifespan, controls how eagerly spidermonkey returns unused memory back to the system. the new function js_...
SpiderMonkey 31
tion. the js::handle<js::value> and js::mutablehandle<js::value> classes have been specialized to implement the same interface as js::value, for simplicity and to ease migration pain. changes to introduce handles to the jsapi are not individually documented, because of the breadth of the changes involved. the following features in earlier versions of spidermonkey have been dropped. xxx list
removed features here spidermonkey 31 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most functions that have changed still have the same names and implement essentially unchanged functionality. applications will need significant changes, but most of those changes will be detected by the c/...
...ard job. here is a list of the most significant changes: many of the garbage collector changes require type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types. these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.). the jsbool type has been
removed, along with the corresponding js_true and js_false constants. they have been replaced by bool, true, and false respectively. many jsclass and js::class instances are now explicitly const, and several apis have been updated to use const jsclass * and const js::class * pointers. all references to shortid/tinyid have been
removed. that includes the apis js_definepropertywithtinyid and js_defi...
... all the other existing spidermonkey apis as usual. once all jsapi operation has completed, the corresponding js_shutdown method uninitializes spidermonkey, cleaning up memory and allocations performed by js_init. it is not required to call js_shutdown at present, but it is strongly recommended: calling it may be required in a future spidermonkey release. javascript shell changes detail added/
removed methods here... on posix platforms, building a threadsafe shell no longer requires nspr. embedders still need to build with nspr, as the new wrappers require using spidermonkey internal functions which are not exposed to the public api. known issues detail any known issues here... future direction ...insert details on future plans... spidermonkey embedders should be aware that mozill...
Web Replay
rs to wait on locks and notify each other, instead of using the native implementation for locking and condition variables. at least on mac, pthreads locks/cvars seem to use a mix of process-local and kernel state, and sometimes don't work correctly after rewinding the process. some behaviors are changed to simplify recording, in ways that should not affect observable behaviors. for example, inc
remental gcs (a non-deterministic component) work by posting events to the main thread (a deterministic component), so for now inc
remental gcs are disabled. many of these behavioral changes should eventually be
removable. graphics rendering is entirely local to the content process. instead of communicating via ipc with a compositor in the ui process, there is a compositor in the recording process ...
... ipdl communication is greatly simplified. the chrome and middleman processes communicate using the standard browser protocols (pcontent, pbrowser, etc.) and implementations for their actors, while the middleman and child processes communicate with their own channel and messages, which is tuned to the demands of the recording/replaying process. the middleman can perform actions that would be ext
remely difficult to manage in a replaying process without going out of sync with the recording. this mainly includes running devtools content-side scripts. the middleman can spawn multiple child processes at once, and coordinate their behavior so they run in parallel. there can be up to one recording child and two replaying children at once. the advantage of spawning both recording and replaying ...
...llocation functions) so that any newly addressable memory is known — anonymous mappings would not otherwise be intercepted or included in the recording, as heap allocation is non-deterministic while replaying. mprotect is intercepted and nop'ed to avoid interference with the dirty memory mechanism, and munmap is intercepted with no actual unmapping performed, so that memory does not need to be
remapped when restoring a snapshot (a set of free regions is maintained to allow reusing this memory). all snapshots are taken from the main thread. before taking the snapshot, all threads participating in the recording must enter an idle state, waiting on a thread-specific condition variable. threads enter this state whenever they are waiting to acquire a lock or perform an atomic action that is ...
Manipulating bookmarks using Places
nd bookmarks for a given uri), you can use the nsinavbookmarksservice.getfolderidforitem() method. ...
...use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.
removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
...parent, aoldindex, anewparent, anewindex) {}, queryinterface: xpcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.
removeobserver(myext_bookmarklistener); }, dosomething: function() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using xpcom without chrome - bookmark observer ...
Querying Places
result directly, for example, if you are creating your own view or are processing the results instead of displaying them. note: be careful when accessing nodes and do not keep references to them around. notifications sent to the result from the history and bookmarks system, as well as commands executed by the programmer such as sorting may cause the structure to change and nodes may be inserted,
removed, or replaced. the nsinavhistoryresult object returned by executequery()/executequeries() contains the list of matches to the given history or bookmarks query. these results are contained in a tree structure made up of nodes. a node's type can be retrieved using its type attribute. this type tells you what interface you can queryinterface the node to in order to get at more detailed informati...
...e.queryinterface(ci.nsinavhistoryfullvisitresultnode); dump("full visit result " + node.uri + " session = " + fullvisit.sessionid + " transitiontype = " + fullvisit.transitiontype + "\n"); break; case node.result_type_host: var container = node.queryinterface(ci.nsinavhistorycontainerresultnode); dump("host " + container.title + "\n"); break; case node.result_type_
remote_container: var container = node.queryinterface(ci.nsinavhistorycontainerresultnode); dump("
remote container " + container.title + " type = " + container.
remotecontainertype + "\n"); break; case node.result_type_query: var query = node.queryinterface(ci.nsinavhistoryqueryresultnode); dump("query, place uri = " + query.uri + "\n"); break; case node.result_type_folder:...
...d attach it to the result with the nsinavhistoryresult.viewer attribute. this viewer will be called when the result tree changes, either as a result of user action or as a result of notifications from the bookmarks and history systems. your implementation would then reflect these changes in the ui. a prepackaged view interface for a nsitreeboxobject is provided that manages the complex view requi
rements of a tree. this object's interface is nsinavhistoryresulttreeviewer (a descendent of nsinavhistoryresultviewer). see displaying places information using views for more information and examples. containers containers hold lists of other containers and result nodes. each result has a container representing the root of the query. it can be retrieved using the root attribute of the result. for ...
Using the Places keywords API
single entry, to fetch all of the entries it's necessary to provide a callback function. ...
...all of the entries it's necessary to provide a callback function. ...
.... ...
Using XPCOM Utilities to Make Things Easier
mponents[] = { { "pretty class name", sample_cid, "@company.com/sample", sampleconstructor } } ns_impl_nsgetmodule(nssamplemodule, components) most of the components in the mozilla browser client use this approach. common implementation macros every xpcom object implements nsisupports, but writing this implementation over and over is tedious. unless you have very special requi
rements for managing reference counting or handling interface discovery, theimplementation macros that xpcom provides can be used. instead of implementing the nsisupports yourself, ns_impl_isupports1 can expand to the implementation of addref, release, and queryinterface for any object. ns_impl_isupports1(classname, interface1) also, if you implement more than one interface, you can simply change ...
...myenumerator : public nsisimpleenumerator { public: ns_decl_isupports ns_decl_nsisimpleenumerator myenumerator(); virtual ~myenumerator() {} }; the declaration of this nsisimpleenumerator class doesn't include any methods other than the contructor and destructor. instead, the class uses the ns_decl_ macro[nsisupports-warning]. using these declaration macros not only saves a t
remendous amount of time when you're writing the code, it can also save time if you make changes to your idl file, since the c++ header file will then automatically include the updated list of methods to be supported. the ns_init_isupports macro is also a bit of a special case. historically, it gets called in the constructor for your class and sets mrefcnt to zero. however, a change in xpcom that o...
... nsisupports* value = nsnull; object->method(&value); if (!value) return; // ... if (ns_failed(error)) return; // <------------ leaks |value| //... ns_release(value); // release our reference } a method returns an nsisupports interface pointer that has been reference counted before it is returned (assuming it wasn't nsnull). if you handle an error condition by returning p
rematurely, whatever value points at will leak-it will never be deleted. this is a trivial fix in this example, but in real code, this can easily happen in goto constructs, or in deep nesting with early returns. having more than one interface pointer that needs to be released when a block goes out of scope begs for a tool that can aid the developer. in xpcom, this tool is the nscomptr, orsmart point...
Components.utils
f various useful xpconnect features. its interface is defined at js/xpconnect/idl/xpccomponents.idl. the object currently has the following members: editors! please keep this list in sync with the components object page methods method description cloneinto() create a structured clone of an object in a different javascript context. createarrayin()
removed in gecko 31 returns an array created in specified compartment. createobjectin() creates a new object, created in the scope of the specified object's compartment. dispatch() dispatches a runnable to the current/main thread. if the parameter is passed, the runnable will be dispatch in the compartment of the parameter, which affects which error reporter g...
...ecified object's compartment. dispatch() dispatches a runnable to the current/main thread. if the parameter is passed, the runnable will be dispatch in the compartment of the parameter, which affects which error reporter gets called. evalinsandbox() runs javascript code in a sandbox, usually used to run code with restricted privileges. evalinwindow()
removed in gecko 34. evaluate javascript code in a less-privileged javascript context. exportfunction() export a javascript function from a more-privileged to a less-privileged scope, allowing it to be called in the less-privileged scope. forcegc() forces a garbage collection cycle. forcecc() forces a cycle collection cycle. forceshrinkin...
...ck so you can be notified once the garbage collection cycle has been performed. setgczeal() sets the level of garbage collection level for full garbage collection. see js_setgczeal for details; this method calls through to that with the specified value as the zeal value. unwaivexrays() undoes waivexrays(): reapplies the xray filtering protection. waivexrays()
removes the filtering provided by an xray. properties property type description sandbox nsixpccomponents_utils_sandbox creates sandbox objects for use with evalinsandbox(). ion boolean read only. strict boolean strict mode is enabled. this reflects the value of the javascript environment's option by the same name. read only. ...
nsIAccessNode
ters childnum zero-based child index. return value the nth nsiaccessnode child. exceptions thrown ns_error_failure indicates that the access node is unattached from the accessible tree. getcomputedstylecssvalue() retrieve the computed style value as nsidomcssprimitivevalue for the dom node this access node is associated with. note: the meanings of width, height and other size measu
rements depend on the version of css being used. therefore, for bounds information, it is better to use nsiaccessible.getbounds(). nsidomcssprimitivevalue getcomputedstylecssvalue( in domstring pseudoelt, in domstring propertyname ); parameters pseudoelt the pseudo element to retrieve style for, or empty string for general computed style information for the node. propertyname retrieve th...
...me retrieve the computed style value for this property name. return value the nsidomcssprimitivevalue computed style value. exceptions thrown ns_error_failure indicates that the access node is unattached from the accessible tree. getcomputedstylevalue() retrieve the computed style value for this dom node, if it is a dom element. note: the meanings of width, height and other size measu
rements depend on the version of css being used. therefore, for bounds information, it is better to use nsiaccessible.getbounds(). domstring getcomputedstylevalue( in domstring pseudoelt, in domstring propertyname ); parameters pseudoelt the pseudo element to retrieve style for, or null for general computed style information for this node. propertyname retrieve the computed style value f...
... ...
nsIAccessibleSelectable
cessibility module and in-process accessibility clients for dealing with getting and changing the selection of accessible nodes. ...
...if the specified object is already selected, then it does nothing. ...
...g index ); parameters index the zero-based accessible child index. return value true if the child is selected, false if not. refselection() returns a reference to the accessible object representing the specified selected child of the object. nsiaccessible refselection( in long index ); parameters index zero-based selected accessible child index. return value the selected accessible child.
removechildfromselection()
removes the specified child of the object from the object's selection. if the specified object was not selected, then it does nothing. void
removechildfromselection( in long index ); parameters index zero-based accessible child index. exceptions thrown ns_error_failure if the specified object is not selectable. selectallselection() select all children. boolean select...
nsIAccessibleText
ng gettextatoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); nsipersistentproperties gettextattributes(in boolean includedefattrs, in long offset, out long rangestartoffset, out long rangeendoffset); astring gettextbeforeoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); void
removeselection(in long selectionnum); void scrollsubstringto(in long startindex, in long endindex, in unsigned long scrolltype); void scrollsubstringtopoint(in long startindex, in long endindex, in unsigned long coordinatetype, in long x, in long y); void setselectionbounds(in long selectionnum, in long startoffset, in long endoffset); attributes attribute type description caretoffse...
...start 1 boundary_word_end 2 boundary_sentence_start 3 do not use in new code. boundary_sentence_end 4 do not use in new code. boundary_line_start 5 boundary_line_end 6 boundary_attribute_range 7 coordinate type constants obsolete since gecko 1.9 (firefox 3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. constant value description coord_type_screen 0 coord_type_window 1 methods addselection() void addselection( in long startoffset, in long endoffset ); parameters startoffset endoffset getattributerange() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) get the accessible and start/en...
... return multibyte-encoded strings, since some locales can't be encoded using 16-bit chars. so this method might return utf-16 strings, or it could return "string" values which are utf-8. astring gettextbeforeoffset( in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset ); parameters offset boundarytype startoffset endoffset return value
removeselection() void
removeselection( in long selectionnum ); parameters selectionnum scrollsubstringto() makes a specific part of string visible on screen. void scrollsubstringto( in long startindex, in long endindex, in unsigned long scrolltype ); parameters startindex 0-based character offset. endindex 0-based character offset - the offset of the character just past the last charac...
nsIAnnotationObserver
toolkit/components/places/public/nsiannotationservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void onitemannotation
removed(in long long aitemid, in autf8string aname); void onitemannotationset(in long long aitemid, in autf8string aname); void onpageannotation
removed(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotation
removed() this method is called when an annotation is deleted for an item. if aname is empty, then all annotations for the given item have been deleted. this is not called when annotations are expired (normally happens when the applica...
...aname the annotation name. onitemannotationset() this method is called when an annotation value is set for an item. ...
... deleted. aname the annotation name. onitemannotationset() this method is called when an annotation value is set for an item. it could be a new annotation, or it could be a new value for an existing annotation. void onitemannotationset( in long long aitemid, in autf8string aname ); parameters aitemid the item on which the annotation is to be set. aname the annotation name. onpageannotation
removed() called when an annotation is deleted for a uri. if aname is empty, then all annotations for the given uri have been deleted. this is not called when annotations are expired (normally happens when the application exits). void onpageannotation
removed( in nsiuri auri, in autf8string aname ); parameters auri the uri whose annotation is to be deleted. aname the annotation name. onpageanno...
nsIApplicationCache
3 / seamonkey 2.1) each application cache has a unique client id for use with nsicacheservice.opensession() method, to access the cache's entries. each entry in the cache can be marked with a set of types, specified in the constants section. all application caches with the same group id belong to a cache group. each group has one "active" cache that will service future loads. inactive caches are
removed from the cache when no longer referenced. method overview void activate(); void addnamespaces(in nsiarray namespaces); void discard(); void gatherentries(in pruint32 typebits, out unsigned long count, [array, size_is(count)] out string keys); nsiapplicationcachenamespace getmatchingnamespace(in acstring key); unsigned long gettypes(in acstring key); void initashandle(in acstrin...
...rom this cache. other caches from this cache group will be deactivated. void activate(); parameters none. addnamespaces() add a set of namespace entries to the application cache. void addnamespaces( in nsiarray namespaces ); parameters namespaces an nsiarray of nsiapplicationcachenamespace objects describing the namespaces to add to the cache. discard() discards this application cache. this
removes all resources it has cached. if this is the active application cache for the group, the group is
removed. void discard(); parameters none. gatherentries() returns a list of entries in the cache whose type matches one or more of the specified types. void gatherentries( in pruint32 typebits, out unsigned long count, [array, size_is(count)] out string keys ); parameters typebits a bit f...
... groupid, in acstring clientid ); parameters groupid missing description clientid missing description markentry() adds item types to a given entry. void markentry( in acstring key, in unsigned long typebits ); parameters key the key for the cache entry to which to add types. typebits a bit field indicating the types to add to the entry. see constants for a list of types. unmarkentry()
removes types from a given entry. if the resulting entry has no types left, the entry is
removed. void unmarkentry( in acstring key, in unsigned long typebits ); parameters key the key for the cache entry from which to
remove types. typebits a bit field indicating the types to
remove from the entry. see constants for a list of types. see also offline resources in firefox nsiapplicationcachena...
nsIClipboardDragDropHookList
widget/public/nsiclipboarddragdrophooklist.idlscriptable this interface is an internal gecko component. it provides basic operations such as adding,
removing and enumerating clipboard hooks for the nsiclipboarddragdrophooks interface. inherits from: nsisupports last changed in gecko 1.7 note: this interface is not intended for direct use by embedders; it is an implementation detail. you should access these capabilities indirectly by sending commands using the nsiclipboarddragdrophooks interface. within gecko, this interface is used by calling get_interface on a docshell. ...
...use by embedders; it is an implementation detail. you should access these capabilities indirectly by sending commands using the nsiclipboarddragdrophooks interface. within gecko, this interface is used by calling get_interface on a docshell. method overview void addclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); nsisimpleenumerator gethookenumerator(); void
removeclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); methods addclipboarddragdrophooks() this method adds a hook to the list. void addclipboarddragdrophooks( in nsiclipboarddragdrophooks ahooks ); parameters ahooks implementation of hooks. gethookenumerator() this method retrieves an enumerator for all hooks which have been added. nsisimpleenumerator gethookenumerator...
...drophooks() this method adds a hook to the list. void addclipboarddragdrophooks( in nsiclipboarddragdrophooks ahooks ); parameters ahooks implementation of hooks. gethookenumerator() this method retrieves an enumerator for all hooks which have been added. nsisimpleenumerator gethookenumerator(); parameters none. return value returns nsisimpleenumerator for nsiclipboarddragdrophooks.
removeclipboarddragdrophooks() this method
removes a hook from the list. note: if this implementation is not present in the list then
removal will be ignored. void
removeclipboarddragdrophooks( in nsiclipboarddragdrophooks ahooks ); parameters ahooks implementation of hooks. see also nsiclipboarddragdrophooks nsiclipboard nsisimpleenumerator ...
nsICookiePromptService
e is to open a dialog to ask to permission to accept the cookie. extensions/cookie/nsicookiepromptservice.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean
rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie. accept_cookie 1 holds the value for accepting the cookie. accept_session_cookie 2 holds the value for accepting the session cookie. methods cookiedialog() opens a dialog that asks for permission to accept a cookie. long cookiedialog( in nsidomwindow parent, in nsicooki...
... cookie. accept_cookie 1 holds the value for accepting the cookie. accept_session_cookie 2 holds the value for accepting the session cookie. methods cookiedialog() opens a dialog that asks for permission to accept a cookie. ...
...esfromhost, in boolean changingcookie, out boolean
rememberdecision ); parameters parent the parent window for the dialog. cookie the cookie about which permission is being requested. hostname the host that wants to set the cookie, not the domain; this is part of the cookie. cookiesfromhost the number of cookies there are already for this host. changingcookie are we changing this cookie?
rememberdecision should we set the matching permission for this host? return value returns 0 for denying a cookie, 1 for accepting a cookie, and 2 for accepting cookie for the current session only. see also nsicookie nsicookie2 nsicookiemanager nsicookiemanager2 ...
nsICookieService
cookie, in nsichannel achannel); void setcookiestringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in string acookie, in string aservertime, in nsichannel achannel); attributes attribute type description cookieiconisvisible boolean this attribute really doesn't belong on this interface. cvs blame will tell you why it is here. it
remains until we can find a better home for it. methods getcookiestring() get the complete cookie string associated with the uri. string getcookiestring( in nsiuri auri, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. achannel the channel used to load the document. this parameter may be null, but it is strongly recommend...
...d. achannel the channel used to load the document. this parameter may be null, but it is strongly recommended that a non-null value be provided to ensure that the cookie privacy preferences are honored. return value returns the resulting cookie string. getcookiestringfromhttp() get the complete cookie string associated with the uri. note: this function is redundant and will most likely be
removed in a future revision of this interface. getcookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, so getcookiestring() can be used in place of this method. string getcookiestringfromhttp( in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. afirstur...
... notifications. acookie the cookie string to set. achannel the channel used to load the document. this parameter may be null, but it is strongly recommended that a non-null value be provided to ensure that the cookie privacy preferences are honored. setcookiestringfromhttp() set the cookie string and expires associated with the uri. note: this function is redundant and will most likely be
removed in a future revision of this interface. setcookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, and setcookiestring() could also query the date header from the channel if achannel supports nsihttpchannel. void setcookiestringfromhttp( in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in string acookie, in string aservertime, ...
nsIDOMNode
ree. inherits from: nsisupports last changed in gecko 0.9.6 method overview nsidomnode appendchild(in nsidomnode newchild) nsidomnode clonenode(in boolean deep); boolean hasattributes(); boolean haschildnodes(); nsidomnode insertbefore(in nsidomnode newchild, in nsidomnode refchild) boolean issupported(in domstring feature, in domstring version); void normalize(); nsidomnode
removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only. childnodes nsidomnodelist read only. firstchild nsidomnode read only. lastchild nsidomnode read only. localname domstring read only. namespaceuri domstring read only. nextsibling nsidomnode read...
...alue haschildnodes() boolean haschildnodes(); parameters none. ...
...lean haschildnodes(); parameters none. ...
nsIDOMOfflineResourceList
the nsidomofflineresourcelist interface provides access to the application cache that allows web content's resources to be cached locally for use while offline. it includes methods for adding resources to and
removing resources from the cache, as well as for enumerating the dynamically managed resource list. dom/interfaces/offline/nsidomofflineresourcelist.idlscriptable please add a summary to this article. ...
...rce list. dom/interfaces/offline/nsidomofflineresourcelist.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void moz
remove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list. read only. mozlength unsigned long the number of entries in the dynamically managed offline resource list. read only. o...
... the item at the specific offset into the list of cached resources. note: this method is deprecated in firefox 3.5; you should instead access the list directly using the items attribute. domstring mozitem( in unsigned long index ); parameters index the index of the cached item whose uri should be returned. return value an domstring containing the uri of the specified resource. moz
remove()
removes an item from the list of dynamically managed entries. if this was the last reference to the given uri in the application cache, the cache entry is
removed. void moz
remove( in domstring uri ); parameters uri the uri of the item to
remove from the list. swapcache() swaps in the newest version of the application cache. the newest version of resources are updated on first...
nsIDOMStorage
erested party in the same browsing context. 1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) a dom window's session storage object can be retrieved from the window's sessionstorage attribute. a storage object stores an arbitrary set of key-value pairs, which may be retrieved, modified and
removed as needed. a key may only exist once within a storage object, and only one value may be associated with a particular key. keys are stored in a particular order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or
removed. method overview void clear(); domstring getitem(in domstring key); domst...
... within a storage object, and only one value may be associated with a particular key. keys are stored in a particular order with the condition that this order not change by merely changing the value associated with a key, but the order may change when a key is added or
removed. method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void
removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store. read only. methods clear() clear the content of this storage bound to a domain or an origin. void clear(); parameters none. getitem() returns from session storage the data corresponding to the specifie...
...the specified key, or null if no data exists for the given key. key() returns the key for the item stored at the specified index in the data store. domstring key( in unsigned long index ); parameters index the index for which the corresponding key should be returned. return value a string containing the requested key. exceptions thrown index_size_err there is no key at the specified index.
removeitem() given a key,
removes the corresponding entry from the session store. void
removeitem( in domstring key ); parameters key the key for which data should be
removed from storage. setitem() sets the value corresponding to a given key. if the key does not already exist, a new key is added, associated with the specified value. if the key already exists, the existing value is replaced with...
nsIDynamicContainer
o create additional containers for each container, registered to its service. method overview void oncontainermoved(in long long aitemid, in long long anewparent, in long anewindex); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void oncontainer
removing(in long long aitemid); methods oncontainermoved() this method is called when the given container has just been moved, in case the service needs to do any bookkeeping. it is called after the container has been moved. void oncontainermoved( in long long aitemid, in long long anewparent, in long anewindex ); parameters aitemid the item-id of the container item. anewparent the item of...
...only happens when the container itself goes from the open state to the closed state. a service with large numbers of dynamically populated items might use this to do some cleanup so those items don't hang around. void oncontainernodeclosed( in nsinavhistorycontainerresultnode acontainer ); parameters acontainer the container node of the container being closed. the service need not worry about
removing any created nodes, they will be automatically
removed when this call completes. oncontainernodeopening() this method is called when the given container node is about to be populated so that the service can populate the container if necessary. note: all result nodes implement a property bag if you need to store state. void oncontainernodeopening( in nsinavhistorycontainerresultnode acontai...
...iner, in nsinavhistoryqueryoptions aoptions ); parameters acontainer the container node for the container being opened. aoptions the options used to generate this query. containers should follow these when possible, for example, whether to expand queries, etc. implementations should use this when possible if adding query and folder nodes to the container. do not modify this value. oncontainer
removing() this method is called when the given container is about to be deleted from the bookmarks table, so that the service can do any necessary cleanup. it is called before the container is deleted, so that the service can still reference it. void oncontainer
removing( in long long aitemid ); parameters aitemid the item-id of the container item. see also places nsinavhistorycontainerresultno...
nsIEventListenerService
read only. obsolete since gecko 7.0 methods geteventtargetchainfor() returns an array of event ta...
...rget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture ); parameters target the nsidomeventtarget for the event target to listen an event. type the event name to listen. listener the nsidomeventlistener which listens the event. usecapture true if to listen the event in capture phase, otherwise, false.
removesystemeventlistener()
remove a system-group eventlistener from a event target. void
removesystemeventlistener( in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture ); parameters target the nsidomeventtarget for the event target listening the event. type the listening event name. listener the n...
...see also nsieventlistenerinfo nsieventtarget ...
nsIFocusManager
obsolete since gecko 2.0 void firedelayedevents(in nsidocument adocument); native code only! void focusplugin(in nsicontent aplugin); native code only! nsidomelement getfocusedelementforwindow(in nsidomwindow awindow, in prbool adeep, out nsidomwindow afocusedwindow); pruint32 getlastfocu...
...links as the caret moves over them in caret browsing mode. methods clearfocus() clears the focused element within awindow. if the current focusedwindow is a descendant of awindow, sets the current focusedwindow to awindow. void clearfocus( in nsidomwindow awindow ); parameters awindow exceptions thrown ns_error_invalid_arg if awindow is null. ...
...he current focusedwindow to awindow. void clearfocus( in nsidomwindow awindow ); parameters awindow exceptions thrown ns_error_invalid_arg if awindow is null. native code only!content
removed obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. called when content has been
removed. void content
removed( in nsidocument adocument, in nsicontent aelement ); parameters adocument aelement native code only!firedelayedevents fire any events that have been delayed due to synchronized actions. void firedelayedevents( in nsidocument adocument ); parameters adocument ...
nsIFrameLoader
ed gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: this interface works in tandem with the nsicontentview interface to manage frames across processes if electrolysis is in use to support per-frame processes. ...
...this can be used to decide what operations may or may not be allowed on the loader's docshell. read only. docshell nsidocshell get the docshell from the frame loader. read only. messagemanager nsichromeframemessagemanager the me...
...ee. this can be used to decide what operations may or may not be allowed on the loader's docshell. read only. docshell nsidocshell get the docshell from the frame loader. read only. messagemanager nsichromeframemessagemanager the message manager handling messages for this frame. read only. methods activateframeevent() activates event forwarding from client (
remote frame) to parent. void activateframeevent( in astring atype, in boolean capture ); parameters atype the event type for which to enable forwarding. capture whether or not to capture these events. activate
remoteframe() activates the
remote frame. void activate
remoteframe(); parameters none. exceptions thrown throws an exception with non-
remote frames. destroy() destroys t...
nsIInstallLocation
this is different from restricted because it's not whether or not the location *might* be restricted, it's whether or not it actually *is* restricted right now. ...
...turn value a file object at the requested location. the file does not necessarily have to exist. getitemlocation() gets the directory that contains an item. nsifile getitemlocation( in astring id ); parameters id the guid of the item. return value the location of the item. getstagefile() returns the most recently staged package (for example the last xpi or jar in a directory) for an item and
removes items that do not qualify. nsifile getstagefile( in astring id ); parameters id the id of the staged package. return value an nsifile if the package exists otherwise null. itemismanagedindependently() determines whether or not an item's resources are managed by the extension system or by some other user or process. for example, items linked to by text links are managed by the user, and i...
...r user or process. for example, items linked to by text links are managed by the user, and items linked to from registry install locations are usually managed by other applications or installers. boolean itemismanagedindependently( in astring id ); parameters id the guid of the item. return value true if the item's resources are managed independently of the extension system, false otherwise.
removefile()
removes a file from the stage. this cleans up the stage if there is nothing else left after the
remove operation. void
removefile( in nsifile file ); parameters file the file to
remove. stagefile() stages the specified file by copying it to some location from where it can be retrieved later to complete installation. nsifile stagefile( in nsifile file, in astring id ); parameter...
nsILocalFile
fclose(fp); return rv; } native code only! opennsprfiledesc returns the result of pr_open() on the file. the caller is responsible for calling pr_close() on the result. prfiledescstar opennsprfiledesc( in long flags, in long mode ); parameters flags the pr_open() flags from nsprpub/pr/include/prio.h, plus optionally delete_on_close. delete_on_close may be implemented by
removing the file (by path name) immediately after opening it, so beware of possible races; the file should be exclusively owned by this process. a bitwise combination of the following open flags: pr_rdonly open for reading only. pr_wronly open for writing only. pr_rdwr open for reading and writing. pr_create_file if the file does not exist, the file is created. if the file exists, this ...
... print32 n; while ((n = pr_read(fd, buf, sizeof(buf))) > 0) { // do something with n-byte block of data from file... } if (n < 0) rv = ns_error_unexpected; pr_close(fd); return rv; } reveal() ask the operating system to open the folder which contains this file or folder. this routine only works on platforms which support the ability to open a folder. see the note in the
remarks below. void reveal(); parameters none. setrelativedescriptor() initializes the file to the location relative to fromfile using a string returned by getrelativedescriptor(). void setrelativedescriptor( in nsilocalfile fromfile, in acstring relativedesc ); parameters fromfile the file to which the descriptor is relative. relativedesc the relative descriptor obtained from getr...
...l(); parameters none. setrelativedescriptor() initializes the file to the location relative to fromfile using a string returned by getrelativedescriptor(). void setrelativedescriptor( in nsilocalfile fromfile, in acstring relativedesc ); parameters fromfile the file to which the descriptor is relative. relativedesc the relative descriptor obtained from getrelativedescriptor().
remarks the methods initwithnativepath() and appendrelativenativepath() take string valued parameters that are encoded using the native character encoding. that means, you cannot deal with files whose name contain characters outside the default code page on windows even though windows 2000 or later has no problem with them. therefore, never use these functions unless you are absolutely sure that the...
nsIMicrosummaryService
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides methods for managing installed microsummaries, and the bookmarks they apply to. ...
...callable by content via nsisidebar.addmicrosummarygenerator(). void addgenerator( in nsiuri generatoruri ); parameters generatoruri the uri of the resourc...
.... if its value is null, then it's an async refresh, and the caller should register itself as an nsimicrosummaryobserver via nsimicrosummary.addobserver() to find out when the refresh completes. nsimicrosummary refreshmicrosummary( in long long bookmarkid ); parameters bookmarkid the bookmark whose microsummary is being refreshed. return value returns the microsummary being refreshed.
removemicrosummary()
remove the current microsummary for the given bookmark. void
removemicrosummary( in long long bookmarkid ); parameters bookmarkid the bookmark for which to
remove the current microsummary. setmicrosummary() set the current microsummary for the given bookmark. void setmicrosummary( in long long bookmarkid, in nsimicrosummary microsummary ); parameters bookma...
nsIMsgCustomColumnHandler
astring getsortstri...
... astring getsortstringforrow(in nsimsgdbhdr ahdr); ...
... astring getsortstringforrow(in nsimsgdbhdr ahdr); parameters ahdr the message's nsimsgd...
nsIObserverService
inherits from: nsisupports last changed in gecko 0.9.6 the xpcom nsobserverservice implements this interface to provide global notifications for a variety of subsystems. ...
...see nsiobserver for a javascript example. void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak ); parameters anobserver the nsiobserver object which will receive notifications. atopic th...
...is usually corresponds to the source of the notification, but could be defined differently depending on the notification topic and may even be null. atopic the notification topic. this string-valued key uniquely identifies the notification. this parameter must not be null. somedata a notification specific string value. the meaning of this parameter is dependent on the topic. it may be null.
removeobserver() this method is called to unregister an observer for a particular topic. void
removeobserver( in nsiobserver anobserver, in string atopic ); parameters anobserver the nsiobserver instance to
remove. atopic the notification topic or subject. this string-valued key uniquely identifies the notification. this parameter must not be null. example this notifies all nsiobserv...
nsIPasswordManager
nsipasswordmanager for examples. implemented by: @mozilla.org/passwordmanager;1. to create an instance, use: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getservice(components.interfaces.nsipasswordmanager); method overview void adduser(in autf8string ahost, in astring auser, in astring apassword); void
removeuser(in autf8string ahost, in astring auser); void addreject(in autf8string ahost); void
removereject(in autf8string ahost); attributes attribute type description enumerator nsisimpleenumerator readonly: an enumeration of the stored usernames and passwords as nsipassword objects. enum...
...objects. only the host portion of these objects is relevant. methods adduser() stores a password. astring adduser(in autf8string ahost, in astring auser, in astring apassword); parameters ahost the hostname of the password to store. auser the username of the password to store. apassword the password to store.
removeuser()
removes a stored password. void
removeuser(in autf8string ahost, in astring auser); parameters ahost the hostname of the password to
remove. auser the username of the password to
remove. addreject() blocks a hostname from having its passwords saved. void addreject(in autf8string ahost); parameters ahost the name of the hos...
...in autf8string ahost, in astring auser); parameters ahost the hostname of the password to
remove. auser the username of the password to
remove. addreject() blocks a hostname from having its passwords saved. void addreject(in autf8string ahost); parameters ahost the name of the hostname for which passwords should no longer be saved.
removereject() unblocks a hostname from having its passwords saved. void
removereject(in autf8string ahost); parameters ahost the name of the hostname for which passwords can be saved again. ...
nsIPlacesImportExportService
arameters none. exporthtmltofile() saves the current bookmarks hierarchy to a bookmarks.html file. void exporthtmltofile( in nsilocalfile afile ); parameters afile an nsilocalfile indicating where to save the new bookmarks.html file. importhtmlfromfile() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) note: this method has been
removed; use the bookmarkhtmlutils.jsm javascript code module instead. loads the given bookmarks.html file and replaces it with the current bookmarks hierarchy (if aisinitialimport is true) or appends it (if aisinitialimport is false). three nsiobserverservice notifications are fired as a result of the import. "bookmarks-restore-begin" is fired just before the import is started. "bookmarks-restore-...
...e observer subject will be null. void importhtmlfromfile( in nsilocalfile afile, in boolean aisinitialimport ); parameters afile the html file to import into places. aisinitialimport whether this is an initial import or not. importhtmlfromfiletofolder() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) note: this method has been
removed; use the bookmarkhtmlutils.jsm javascript code module instead.loads the given bookmarks.html file and puts it in the given folder. three nsiobserverservice notifications are fired as a result of the import. "bookmarks-restore-begin" is fired just before the import is started. "bookmarks-restore-success" is fired right after the bookmarks are successfully imported. "bookmarks-restore-failed" ...
...rt ); parameters afile the file to import. afolder the id of the bookmarks folder into which to import the bookmarks. aisinitialimport whether or not this is an initial import. importhtmlfromuri() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. note: this method has been
removed; use the bookmarkhtmlutils.jsm javascript code module instead. same thing as importhtmlfromfile(), but takes a uri instead. void importhtmlfromuri( in nsiuri auri, in boolean aisinitialimport ); parameters auri the uri from which to import bookmarks. aisinitialimport whether or not this is an initial import.
nsIPrivateBrowsingService
netwerk/base/public/nsiprivatebrowsingservice.idlscriptable provides access to information about the state of the private browsing service. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is deprecated since firefox 20, and will probably be completely
removed in firefox 21. the nsiprivatebrowsingservice interface provides access to information about the state of the private browsing feature offered in firefox 3.5 and later. when firefox is in private browsing mode, firefox shouldn't save any potentially private information. the browser itself stops caching, and also doesn't record history information. in addition, temporary, databases are created to be ...
...he npnvprivatemodebool variable. implemented by: @mozilla.org/privatebrowsing;1. to get access to the service from javascript, use: var pbs = components.classes["@mozilla.org/privatebrowsing;1"] .getservice(components.interfaces.nsiprivatebrowsingservice); c++ callers should use the contract id @mozilla.org/privatebrowsing-wrapper;1 instead. method overview void
removedatafromdomain(in autf8string adomain); attributes attribute type description autostarted boolean indicates whether or not private browsing was started automatically at application launch time. this is only ever true if privatebrowsingenabled is also true. read only. lastchangedbycommandline boolean in...
...interface. read only. privatebrowsingenabled boolean indicates whether or not private browsing mode is currently enabled. you may also turn private browsing mode on and off by setting the value of this attribute. changing this value while handling one of the notifications generated by the private browsing service throws an ns_error_failure exception. methods
removedatafromdomain()
removes all data stored for the specified domain, including its subdomains. void
removedatafromdomain( in autf8string adomain ); parameters adomain the domain for which data should be
removed. ...
nsIProcess
his is only valid after the process has exited. read only. isrunning boolean true if the process is running, otherwise false. only accurate if the process was run with blocking disabled. read only. location nsifile the location of the executable file on disk. read only. gecko 1.9.1 note this attribute is no longer implemented as of gecko 1.9.1, and is
removed entirely in gecko 1.9.2. pid unsigned long the process id of the process. this value is only available after the process has started; in addition, some platforms may not offer this value at all. read only. processname string the name of the process. read only. gecko 1.9.1 note this attribute is no longer implemented as of gecko 1.9.1, and is r...
... methods init() initializes the nsiprocess with the specified executable file. once initialized, you can start the process executing by calling run(). ...
...xecutable ); parameters executable the nsifile executable file to be represented by the nsiprocess object. initwithpid() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) initializes the nsiprocess to represent an existing process, given that process's id. gecko 1.9.1 note this method is no longer implemented as of gecko 1.9.1, and is
removed entirely in gecko 1.9.2. void initwithpid( in unsigned long pid ); parameters pid the process id to begin to represent. kill() immediately terminates the process represented by the nsiprocess object. this only works if the process was run without blocking enabled. gecko 1.9.1 note prior to gecko 1.9.1 (firefox 3.5), this method did not work on windows or mac os x. now it do...
nsIProcessScriptLoader
nsimessagemanager.idl inherits from: nsisupports this interface is used by parent process message managers to load scripts into a child process. the scripts run only once per process. the global object for process scripts is a contentprocessmessagemanager. methods void loadprocessscript(in astring aurl, in boolean aallowdelayedload) void
removedelayedprocessscript(in astring aurl); jsval getdelayedprocessscripts(); loadprocessscript() load a script in the child process. process scripts are loaded as soon as loadprocessscript() is called. if this function is called on a chromemessagebroadcaster, : it will load the process script into all child processes. if aallowdelayedload is true, then the script will also be ...
...he absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if this flag is false, the process script will only be loaded into child processes that are already running at the time of the call. if this flag is true, the process script will be loaded into any new child processes created after the loadprocessscript() call, until
removedelayedprocessscript() is called for that script. if you are calling loadprocessscript() on a chromemessagesender, you should always pass true here.
removedelayedprocessscript()
removes aurl from the list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new child processes.
...which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new child processes. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for the script to
remove. getdelayedprocessscripts() returns all delayed scripts that will be loaded once a child process becomes available. the return value is a list of pairs [<url>, false]. returns list of the delayed scripts. each script is returned as a pair: [<url>, false]. ...
nsIPushService
nsipushservice supports the push api implementation in firefox, and can be used directly from privileged code to create system subscriptions. ...
...nsipushservice supports the push api implementation in firefox, and can be used directly from privileged code to create system subscriptions. ...
...ssed to nsipushservice.subscribe(). callback the callback to call when the nsipushsubscription is dropped. example pushservice.unsubscribe( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, ok) => { if (!components.issuccesscode(code)) { cu.reporterror("error unsubscribing: " + code); return; } // `ok === true` if the subscription was
removed, or `false` if the // `(scope, principal)` pair didn't have a subscription. } ); receiving push messages subscriptions created from privileged code use xpcom observer notifications instead of service worker events. you can use the global nsiobserverservice to listen for these notifications. messages sent to system subscriptions are broadcasted to all push-message observers. your ns...
nsIRequest
cached content is automatically validated if necessary before reuse. note: these flags are intended for normal browsing, and they should therefore not apply to content that must be validated before each use. consider, for example, a http response with a "cache-control: no-cache" header. according to rfc2616, this response must be validated before it can be taken from a cache. breaking this requi
rement could result in incorrect and potentially undesirable side-effects. constant value description validate_always 1 << 11 forces validation of any cached content independent of its expiration time. validate_never 1 << 12 disables validation of expired content. validate_once_per_session 1 << 13 disables validation of expired content, pro...
... cancels the current request. this will close any open input or output streams and terminate any async requests. users should normally pass ns_binding_aborted, although other errors may also be passed. the error passed in will become the value of the status attribute. implementations must not send any notifications (for example via nsirequestobserver) synchronously from this function. similarly,
removal from the load group (if any) must also happen asynchronously. requests that use nsistreamlistener must not call ondataavailable anymore after cancel has been called. note: most nsirequest implementations expect astatus to be a failure code; however, some implementations may allow astatus to be a success code such as ns_ok. in general, astatus should be a failure code. void cancel( in nsr...
...he request has yet to reach completion. resume() resumes the current request. this may have the effect of re-opening any underlying transport and will resume the delivery of data to any open streams. void resume(); parameters none. suspend() suspends the current request. this may have the effect of closing any underlying transport (in order to free up resources), although any open streams
remain logically opened and will continue delivering data when the transport is resumed. calling cancel() on a suspended request must not send any notifications (such as onstoprequest) until the request is resumed. note: some implementations are unable to immediately suspend, and may continue to deliver events already posted to an event queue. in general, callers should be capable of handling event...
nsISHistoryListener
docshell/shistory/public/nsishistorylistener.idlscriptable an interface you can implement to receive notifications about activities that occur in session history, and optionally cancel them. inherits from: nsisupports last changed in gecko 1.7 a session history listener is notified when pages are added to,
removed from, and loaded from session history. the listener can prevent any action (except adding a new session history entry) from happening by returning false from the corresponding callback method. a session history listener can be registered on a particular nsishistory instance via the nsishistory.addshistorylistener() method. method overview boolean onhistorygoback(in nsiuri abackuri); boolean onhistorygoforward(in nsiuri aforwarduri); boolean onhistorygotoindex(...
...t is added to session history. new documents are added to session history by the docshell when new pages are loaded in a frame or content area; for example by calling nsiwebnavigation.loaduri(). note: you can't cancel this operation. void onhistorynewentry( in nsiuri anewuri ); parameters anewuri the uri of the document to be added to session history. onhistorypurge() called when entries are
removed from session history. entries can be
removed from session history for various reasons; for example to control the browser's memory usage, to prevent users from loading documents from history, to erase evidence of prior page loads, etc. to purge documents from session history call nsishistory.purgehistory(). boolean onhistorypurge( in long anumentries ); parameters anumentries the number o...
... return value true to allow the purge operation to proceed or false to cancel it. onhistoryreload() called when the current document is reloaded, for example due to an nsiwebnavigation.reload() call. boolean onhistoryreload( in nsiuri areloaduri, in unsigned long areloadflags ); parameters areloaduri the uri of the document to be reloaded. ...
nsIScriptableInputStream
parameters acount the maximum number of bytes to read. return value the data from the stream, which will be an empty string if eof has been reached. exceptions thrown ns_error_failure if there are not enough bytes available to read acount amount of data. ns_base_stream_would_block if reading from the input stream would block the calling thread (non-blocking mode only).
remarks this interface provides javascript with a way to read ascii text from a nsiinputstream. however, it does not address the problem of reading arbitrary binary data from a stream. for binary input see nsibinaryinputstream. note: starting in gecko 2.0, you can use the netutils.jsm javascript code module and its readinputstreamtostring() method to read arbitrary binary data into a javascript str...
...putstream component implements this interface. this interface was frozen for gecko 1.2. from gecko 2.0 interfaces are no longer frozen. examples list contents of xpi and read file contents this example here uses the read function. it takes a input stream from the zip reader and outputs the text in it. full example using the zip interfaces is seen here: list contents of xpi and read file contents.
remember: the nsiscriptableinputstream has a contract where `init` should only be called once, and should always be closed. excerpt of the stream for this stream article is here, this is only an excerpt so cannot copy paste this code into scratchpad. var {classes: cc, interfaces: ci, results: cr, constructor: cc, utils: cu } = components; var scriptableinputstream = cc("@mozilla.org/scriptableinputst...
...var scriptableinputstream = cc("@mozilla.org/scriptableinputstream;1", "nsiscriptableinputstream", "init"); var blah = { data: '', onstartrequest: function (arequest, acontext) { this.data = ''; }, ondataavailable: function(request, context, inputstream,...
nsISelectionPrivate
node, in print32 endoffset, in boolean allowadjacent, in rangearray results); native code only! void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code only! obsolete since gecko 12.0 long gettableselectiontype(in nsidomrange range); void
removeselectionlistener(in nsiselectionlistener listenerto
remove); void scrollintoview(in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent); void setancestorlimiter(in nsicontent acontent); native code only! void setpresshell(in nsipresshell apresshell); native code only! void settextrangestyle(in nsidomrange range, in consttextran...
...ing it. resultcount returns the number of ranges that overlap (or touch) the input range. results returns the ranges that overlap (or touch) the input range. native code only!getrangesforintervalcomarray obsolete since gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. this method became obsolete in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9). use getrangesforintervalarray() instead. void getrangesforintervalcomarray( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results ); parameters beginnode be...
...lowed to touch the input range rather than merely overlapping it. results returns the ranges that overlap (or touch) the input range. gettableselectiontype() test if supplied range points to a single table element. long gettableselectiontype( in nsidomrange range ); parameters range return value one of tableselection_* constants. "none" means a table element is not selected.
removeselectionlistener() void
removeselectionlistener( in nsiselectionlistener listenerto
remove ); parameters listenerto
remove scrollintoview() scrolls a region of the selection, so that it is visible in the scrolled view. void scrollintoview( in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent ); parameters aregion the region inside the s...
nsITransferable
isp...
...is value contains the size of the returned data. init() initializes a transferable object. this should be called on all transferable objects. failure to do so will result in fatal assertions in debug builds. void init( in nsiloadcontext acontext ); parameters acontext the load context associated with the transferable object. this can be set to null if a load context is not available.
remarks the load context is used to track whether the transferable is storing privacy-sensitive information. for example, we try to delete data that you copy to the clipboard when you close a private browsing window. to get the appropriate load context in javascript callers, one needs to get to the document that the transferable corresponds to, and then get the load context from the document like t...
...erface(ci.nsiwebnavigation) .queryinterface(ci.nsiloadcontext); in c++ callers, if you have the corresponding document, you can just call nsidocument.getloadcontext() to get to the load context object. islargedataset() returns true if the data is large. boolean islargedataset(); parameters none. return value true if the data is large; otherwise, the result is false.
removedataflavor()
removes the data flavor matching the given one (as determined by a string comparison), along with the corresponding data. void
removedataflavor( in string adataflavor ); parameters adataflavor the data flavor to
remove. settransferdata() sets the data in the transferable with the specified flavor. the transferable maintains its own copy of the data, so you can safely d...
nsIWebBrowser
so be used at runtime to obtain the content dom window and from that the rest of the dom. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) warning: this interface was frozen for a very long time, but was unfrozen for gecko 2.0. method overview void addwebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); void
removewebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); attributes attribute type description containerwindow nsiwebbrowserchrome the chrome object associated with the browser instance. the embedder must create one chrome object for each browser object that is instantiated. the embedder must associate the two by setting this property to poin...
...nterface. the chrome object must also implement nsiembeddingsitewindow. the chrome may optionally implement nsiinterfacerequestor, nsiwebbrowserchromefocus, nsicontextmenulistener and nsitooltiplistener to receive additional notifications from the browser object. the chrome object may optionally implement nsiwebprogresslistener instead of explicitly calling addwebbrowserlistener() and
removewebbrowserlistener() to register a progress listener object. if the implementation does this, it must also implement nsiweakreference. note: the implementation should not refcount the supplied chrome object; it should assume that a non nsnull value is always valid. the embedder must explicitly set this value back to nsnull if the chrome object is destroyed before the browser object. note: n...
...ner( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be added. aiid the iid of the interface that will be called on the listener as appropriate. return value ns_ok listener was successfully added. ns_error_invalid_arg one of the arguments was invalid or the object did not implement the interface specified by the iid.
removewebbrowserlistener()
removes a previously registered listener. void
removewebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be
removed. aiid the iid of the interface on the listener that will no longer be called. return value ns_ok listener was successfully added. ns_error_invalid_arg one of the ar...
nsIWebProgress
nsiwebprogress instances may be arranged in a parent-child configuration, corresponding to the parent-child configuration of their respective dom windows. however, in some cases a nsiwebprogress instance may not have an associated dom window. the parent-child relationship of nsiwebprogress instances is not made explicit by this interface, but the relationship may exist in some implementations. ...
...ed itself, and it may also receive notifications from any nsiwebprogress instances that are children of that nsiwebprogress instance. uriloader/base/nsiwebprogress.idlscriptable please add a summary to this article. last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogresslistener(in nsiwebprogresslistener alistener, in unsigned long anotifymask); void
removeprogresslistener(in nsiwebprogresslistener alistener); attributes attribute type description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance. read only. exceptions thrown ns_error_failure indicates that there is no associated dom window. isloadingdocument prbool indicates whether or not a document is currently being loaded in the context of this n...
...mask ); parameters alistener the listener interface to be called when a progress event occurs. this object must also implement nsisupportsweakreference. anotifymask the types of notifications to receive. exceptions thrown ns_error_invalid_arg indicates that alistener was either null or that it does not support weak references. ns_error_failure indicates that alistener was already registered.
removeprogresslistener()
removes a previously registered listener of progress events. void
removeprogresslistener( in nsiwebprogresslistener alistener ); parameters alistener the listener interface previously registered with a call to addprogresslistener(). exceptions thrown ns_error_failure indicates that alistener was not registered. ...
nsIWindowWatcher
keep a (xpcom) reference to any windows; the implementation will claim no ownership. windows must notify this component when they are created or destroyed, so only a weak reference is kept. note that there is no interface for such notifications (not a public one, anyway). this is taken care of both in mozilla and by common embedding code. embedding clients need do nothing special about that requi
rement. this component must be initialized at application startup by calling setwindowcreator(). method overview nsiwebbrowserchrome getchromeforwindow(in nsidomwindow awindow); nsiauthprompt getnewauthprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurren...
...boutmyextension", "chrome,centerscreen", null); note: versions of gecko before gecko 2.0 would ignore some of the chrome flags when opening a chrome window without an opener window, instead behaving as if the "all" flag was present. this was fixed in bug 509124. registernotification() clients of this service can register themselves to be notified when a window is opened or closed (added to or
removed from this service). this method adds an nsiobserver to the list of objects to be notified. void registernotification( in nsiobserver aobserver ); parameters note: be careful about generating open/close window events inside nsiobserver.observe(). for example the following code will block the system because it will open windows continuously: function mywindowobserver() { this.observe=...
...d in by the app. openwindow() will use it to create new windows. void setwindowcreator( in nsiwindowcreator creator ); parameters creator the nsiwindowcreator callback. if this is null the callback will be cleared and window creation capabilities lost. unregisternotification() clients of this service can register themselves to be notified when a window is opened or closed (added to or
removed from this service). this method
removes an nsiobserver from the list of objects to be notified. void unregisternotification( in nsiobserver aobserver ); parameters aobserver the nsiobserver to be
removed. ...
nsIWindowsRegKey
void open(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey openchild(in astring relpath, in unsigned long mode); acstring readbinaryvalue(in astring name); unsigned long long readint64value(in astring name); unsigned long readintvalue(in astring name); astring readstringvalue(in astring name); void
removechild(in astring relpath); void
removevalue(in astring name); void startwatching(in boolean recurse); void stopwatching(); void writebinaryvalue(in astring name, in acstring data); void writeint64value(in astring name, in unsigned long long data); void writeintvalue(in astring name, in unsigned long data); void writestringvalue(in a...
...s name the name of the value to query. this parameter can be the empty string to request the key's default value. return value the string contents of the named value as a unicode string. note: unlike writestringvalue(), readstringvalue() will work with reg_multi_sz and reg_expand_sz types. note: in gecko 2.0, readstringvalue() calls expandenvironmentstrings() on a reg_expand_sz type. ...
...f the value to query. this parameter can be the empty string to request the key's default value. return value the string contents of the named value as a unicode string. note: unlike writestringvalue(), readstringvalue() will work with reg_multi_sz and reg_expand_sz types. note: in gecko 2.0, readstringvalue() calls expandenvironmentstrings() on a reg_expand_sz type.
removechild() this method
removes a child key and all of its values. this method will fail if the key has any children of its own. void
removechild( in astring relpath ); parameters relpath the relative path from this key to the key to be
removed.
removevalue() this method
removes the value with the given name. void
removevalue( in astring name ); parameters name the name of the value to be
removed. ...
Setting HTTP request headers
the second statement does the actual registering. we are saying we want httprequestobserver to be notified (by calling its observe method) when a "http-on-modify-request" topic takes place (which we know happens just before each http request). unregistering you should unregister the observer on shutdown. failing to do that may cause memory leaks. to unregister the observer use nsiobserverservice.
removeobserver as follows: observerservice.
removeobserver(httprequestobserver, "http-on-modify-request"); all-in-one example here is a slightly different version of our httprequestobserver object. while the previous version we showed before was good for learning, in an actual real-world application, you'd probably want to code it more like the following. var httprequestobserver = { observe: functio...
...xpcom components you need to register a single http-on-modify-request observer per...
...xpcom components you need to register a single http-on-modify-request observer per application (and not one per window). ...
Troubleshooting XPCOM components registration
ror, the component was successfully registered and this is the wrong page. load failure of binary components on the mozilla trunk (firefox 3, xulrunner 1.9), components that fail to load will print an error to the error console. chrome errors must be enabled. if the error appears, you can use nspr logging to see additional information about the failure by running firefox from a command prompt:
rem close all firefox windows! set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may provide valuable clues why the component failed to load. if using firefox 4 / xulrunner 2.0, make sure that your extension is unpacked and you declared the binary component in your chrome.manifes...
...right version. if you are testing with a release from mozilla.org, use the gecko sdk (and not your own compile of trunk firefox, etc.). if you are compiling your own firefox (or xulrunner, etc.), use the artifacts from that compilation to build your component. if you are testing a build from your linux distribution (or other vendor-supplied build), look for -dev packages from them.
remember to check that the directory the component is in is named correctly i.e. $profile/extensions/$plugindirectory/components! double check your guids in your install.rdf with your sourcecode, and then check them again. windows-specific hints use dependency walker to check that your dependent libraries are loaded correctly. in dependency walker, open the options menu and select...
...embedded to find the runtime. please refer to msdn for details. if you have the option, you can manually copy these dependencies to firefox.exe's directory, to windows\system32, or to any directory is the system's path. a google groups thread on the matter is located here. the dllmain code that msvc 8 (and probably earlier versions too) generates for you doesn't need to be there, you can
remove it. you may be able build your component using use_static_libs=1 in order to
remove c runtime library dependencies. linux-specific hints check if you have missing dependent libraries: from your firefox (/xulrunner) install directory, run "./run-mozilla.sh `which ldd` -r path/to/your/component.so". there should be no "not found" entries and no undefined symbols. (the -r switc...
Creating a gloda message query
the max number of messages which are returned is governed by a preference: "mailnews.database.global...
... the max number of messages which are returned is governed by a preference: "mailnews.database.global.search.msg.limit" although you can...
...s provided by fundattr.js: from: a single glodaidentity corresponding to the author of the message. to: a list of glodaidentity instances corresponding to the email addresses found on the to line of the message. cc: ditto, but cc. involves: a list of all glodaidentity instances associated with this message. effectively, this is the contents of from/to/cc in a single list and with duplicates
removed. attachmenttypes: a list of the attachment mime types found on this message. attributes provided by explattr.js: tags: a list of the nsimsgtags applied to this message. starred: a boolean indicating whether this message is starred/flagged or not. read: a boolean indicating whether this message is read or not. want a glodamessage when you already have an nsimsgdbhdr? gloda.getmessag...
Index
w. we could just hide it on send, and then show it on the next compose. if the user opens (but never sends or closes compose windows), this trick will not apply to them. but this is not a common usage model. how do i test it? on window and mac, the cached compose window is on by default. to test it 17 content tabs thunderbird content tabs enable thunderbird to display
remote content in a tab, which users can browse in (mostly) the same way as with a browser. for example, invoking thunderbird's help | what's new menu option opens a tab that displays web content. the thunderbird team can update this content via the website at any time. 18 cookies in thunderbird cookies, guide, thunderbird in versions of thunderbird prior to 3 the cookie policy w...
...nd nsmailboxprotocol. this may seem like a lot of infrastructure just to read messages from a flat file, but it allows us to do it asynchronously, and to have reading local messages fit into the same kind of mechanisms that reading nntp and imap messages do - running urls, getting onstart/stoprunningurl notifications when the url starts/stops, etc. 43 mailnews and mail code review requi
rements this document describes the process for reviewing patches to the mozilla/mailnews and mozilla/mail directories. thunderbird and seamonkey are the primary users of the code in mozilla/mailnews. thunderbird's front-end code is stored in mozilla/mail. (a fair amount of this code is forked from code in the mailnews/ directory). 44 main windows thunderbird the base...
.... bug 493414), but in the meantime, it would be helpful to be able to get useful output on stderr about exceptions, events and pretty-printed objects. 86 faq add-ons, extensions, thunderbird the old contents of this faq page were duplicated in the setting up extension development environment article and the building a thunderbird extension article. (duplicate content has been
removed from this page.) 87 finding the code for a feature add-ons, extensions, thunderbird frequently you are trying to figure out the code that implements a specific feature of the user interface. how do you find that out? as an example, i received the following inquiry, and i decided to follow my usual path and document what i do: 88 styling the folder pane ...
Working with windows in chrome code
n the current status text as well as the maximum and current progress values. note that using nsiwindowwatcher.openwindow is a bit less trivial . ...
....canceloperation(); close();" /> using a callback function. alternatively, the opener window can pass a callback function to the progress dialog in the same way we passed the status string in the previous example: function oncancel() { alert("operation canceled!"); } ... ...
...e the nsiwindowmediator interface, introduced above. one case in which you might want to use nsiwindowmediator is in an extension's options window. suppose you're developing a browser extension that consists of a browser.xul overlay and an options window. suppose the overlay contains a button to open the extension's options window which needs to read some data from the browser window. as you may
remember, firefox's extension manager can also be used to open your options dialog. this means the value of window.opener in your options dialog is not necessarily the browser window -- instead, it might be the extension manager window. you could check the location property of the opener and use opener.opener in case it's the extension manager window, but a better way is to use nsiwindowmediator: v...
Debugger.Frame - Firefox Developer Tools
e (say, because a function call has returned or an exception has been thrown from it), the debugger.frame instance referring to that frame becomes inactive: its live property becomes false, and accessing its other properties or calling its methods throws an exception. note that frames only become inactive at times that are predictable for the debugger: when the debuggee runs, or when the debugger
removes frames from the stack itself. visible frames when inspecting the call stack, debugger does not reveal all the frames that are actually present on the stack: while it does reveal all frames running debuggee code, it omits frames running the debugger’s own code, and omits most frames running non-debuggee code. we call those stack frames a debugger does reveal visible frames. a frame is a v...
...depending on the implementation, but it is fine-grained enough to implement useful “step” and “next” behavior. if multiple debugger instances each have debugger.frame instances for a given stack frame with onstep handlers set, their handlers are run in an unspecified order. if any onstep handler forces the frame to return early (by returning a resumption value other than undefined), any
remaining debuggers’ onstep handlers do not run. this property is ignored on frames that are not executing debuggee code, like "call" frames for calls to host functions and "debugger" frames. onpop this property must be either undefined or a function. if it is a function, spidermonkey calls it just before this frame is popped, passing a completion value indicating how this frame’s executi...
...erring to a debugger.frame instance; they may not be used as methods of other kinds of objects. eval(code, [options]) evaluatecode in the execution context of this frame, and return a completion value describing how it completed.code is a string. if this frame’s environment property is null or type property is wasmcall, throw a typeerror. all extant handler methods, breakpoints, and so on
remain active during the call. this function follows the invocation function conventions. codeis interpreted as strict mode code when it contains a use strict directive, or the code executing in this frame is strict mode code. ifcode is not strict mode code, then variable declarations incode affect the environment of this frame. (in the terms used by the ecmascript specification, the variableenvi...
Debugger.Script - Firefox Developer Tools
andler object. breakpoint handler method calls are cross-compartment, intra-thread calls: the call takes place in the same thread that hit the breakpoint, and in the compartment containing the handler function (typically the debugger’s compartment). the new breakpoint belongs to the debugger instance to which this script belongs. disabling the debugger instance disables this breakpoint; and
removing a global from the debugger instance’s set of debuggees clears all the breakpoints belonging to that debugger instance in that global’s scripts. getbreakpoints([offset]) if the instance refers to a jsscript, return an array containing the handler objects for all the breakpoints set atoffset in this script. ifoffset is omitted, return the handlers of all breakpoints set anywhere in t...
... array containing the handler objects for all the breakpoints set atoffset in this script. ifoffset is omitted, return the handlers of all breakpoints set anywhere in this script. ifoffset is present, but not a valid offset in this script, throw an error. if the instance refers to webassembly code, throw a typeerror. clearbreakpoint(handler, [offset]) if the instance refers to a jsscript,
remove all breakpoints set in this debugger instance that usehandler as their handler. ifoffset is given,
remove only those breakpoints set atoffset that usehandler; ifoffset is not a valid offset in this script, throw an error. note that, if breakpoints using other handler objects are set at the same location(s) ashandler, they
remain in place. clearallbreakpoints([offset]) if the instance ref...
... set in this debugger instance that usehandler as their handler. ifoffset is given,
remove only those breakpoints set atoffset that usehandler; ifoffset is not a valid offset in this script, throw an error. note that, if breakpoints using other handler objects are set at the same location(s) ashandler, they
remain in place. clearallbreakpoints([offset]) if the instance refers to a jsscript,
remove all breakpoints set in this script. ifoffset is present,
remove all breakpoints set at that offset in this script; ifoffset is not a valid bytecode offset in this script, throw an error. isincatchscope([offset]) if the instance refers to a jsscript, this is true if this offset falls within the scope of a try block, and false otherwise. if the instance refers to webassembly code, throw a ...
The Firefox JavaScript Debugger - Firefox Developer Tools
to find your way around the debugger, here's a quick tour of the ui. how to to find out what you can do with the debugger, refer to the following how-to guides. ...
... to find your way around the debugger, here's a quick tour of the ui. how to to find out what you can do with the debugger, refer to the following how-to guides. ...
... to find your way around the debugger, here's a quick tour of the ui. how to to find out what you can do with the debugger, refer to the following how-to guides. ...
All keyboard shortcuts - Firefox Developer Tools
return or space enter or space cycle up and down through auto-complete suggestions (rules view only, when a property or value is being edited) up arrow , down arrow up arrow , down arrow up arrow , down arrow choose current auto-complete suggestion (rules view only, when a property or value is being edited) enter or tab return or tab enter or tab inc
rement selected value by 1 up arrow up arrow up arrow dec
rement selected value by 1 down arrow down arrow down arrow inc
rement selected value by 100 shift + page up shift + page up shift + page up dec
rement selected value by 100 shift + page down shift + page down shift + page down inc
rement selected value by 10 shift + up arr...
...rrow dec
rement selected value by 1 down arrow down arrow down arrow inc
rement selected value by 100 shift + page up shift + page up shift + page up dec
rement selected value by 100 shift + page down shift + page down shift + page down inc
rement selected value by 10 shift + up arrow shift + up arrow shift + up arrow dec
rement selected value by 10 shift + down arrow shift + down arrow shift + down arrow inc
rement selected value by 0.1 alt + up arrow (ctrl + up arrow from firefox 60 onwards.) alt + up arrow alt + up arrow (ctrl + up arrow from firefox 60 onwards.) dec
rement selected value by 0.1 alt + down arrow (ctrl + down arrow from firefox 60 onwards). alt + down arrow ...
... f10 1 f10 step into f11 f11 1 f11 step out shift + f11 shift + f11 1 shift + f11 toggle breakpoint on the currently selected line ctrl + b cmd + b ctrl + b toggle conditional breakpoint on the currently selected line ctrl + shift + b cmd + shift + b ctrl + shift + b 1. by default, on some macs, the function key is
remapped to use a special feature: for example, to change the screen brightness or the volume. see this guide to using these keys as standard function keys. to use a
remapped key as a standard function key, hold the function key down as well (so to open the profiler, use shift + function + f5). note: before firefox 66, the combination ctrl + shift + s on windows and linux or cmd + opt + s on macos ...
Network request list - Firefox Developer Tools
ip explains the problem. you can configure the threshhold in the configuration editor (about:config) by modifying the devtools.netmonitor.audits.slow setting. url: the url of the file requested. protocol: the network protocol used to transfer the data, this column is hidden by default. scheme: the scheme (https/http/ftp/...) of the path requested. this column is hidden by default.
remote ip: the ip address of the server answering the request. this column is hidden by default. type: content-type of the response. cookies: the number of request cookies associated to the request. this column is hidden by default. this is new in firefox 55. set-cookies: the number of response cookies associated to the request. this column is hidden by default. this is new in firefox 55. transfe...
...enable request blocking. to turn a specific block off or on: toggle the checkbox next to that item. to delete a blocked item, click the x icon that appears when you focus the item. (starting with firefox 77) right-click any item in the list and choose from the context menu: enable all enables blocking of all items in the list. disable all disables blocking of all items in the list.
remove all deletes all items in the list. blocking a specific url from the request list you can also block a url from the request list: hover over the item you want to block in the request list. select block url from the context menu. when you refresh the page, that specific url will be blocked and a message will be added to the item in the list indicating that it has been blocked by t...
...filters together by separating them with a space. keyword meaning examples status-code shows resources that have the specific http status code. status-code:304 method shows resources that have were requested via the specific http request method. method:post domain shows resources coming from a specifc domain. domain:mozilla.org
remote-ip shows resources coming from a server with the specified ip.
remote-ip:63.245.215.53
remote-ip:[2400:cb00:2048:1::6810:2802] cause shows resources matching a specific cause type. the types can be found in the description of the cause column. cause:js cause:stylesheet cause:img transferred shows resources having a specific transferred size or a tra...
Examine and edit HTML - Firefox Developer Tools
an perform certain common tasks on a specific node using a popup context menu. to activate this menu, context-click the element. ...
...enu, context-click the element. the menu contains the following items — click on the links to find the description of each command in the context menu reference: edit as html create new node duplicate node delete node attributes add attribute copy attribute value edit attribute
remove attribute break on ... ...
...urrently selected element. see inserting new nodes. duplicate node create a copy of this element, and insert the copy immediately after this element. delete node delete the element from the dom. attribute/add attribute add an attribute to the element. attribute/edit attribute (only when invoked on an attribute) edit the attribute. attribute/
remove attribute (only when invoked on an attribute)
remove the attribute. open link in new tab (only when invoked over a link, such as an href attribute) opens the linked item in a new tab. open file in debugger (only when invoked over a link to a js source) opens the linked source in the debugger. open file in style-editor (only when invoked over a link to a c...
Web Audio Editor - Firefox Developer Tools
for details, see deprecated tools. with the web audio api, developers create an audio context. within that context they then construct a number of audio nodes, including: nodes providing the audio source, such as an oscillator or a data buffer source nodes performing transformations such as delay and gain nodes representing the destination of the audio stream, such as the speakers each node has zero or more audioparam properties that configure its operation. for example, the gainnode has a single gain property, while the oscillatornode has frequency and detune properties. ...
...ault in firefox 32. to enable it, open the developer tool settings and check "web audio". now there should be an extra tab in the toolbox toolbar labeled "web audio". click the tab and load a page that constructs an audio context. two good demos are: the voice-change-o-matic, which can apply various effects to the microphone input and also provides a visualisation of the result the violent the
remin, which changes the pitch and volume of a sine wave as you move the mouse pointer visualizing the graph the web audio editor will now display the graph for the loaded audio context. here's the graph for the violent the
remin demo: you can see that it uses three nodes: an oscillatornode as the source, a gainnode to control the volume, and an gainnode as the destination. connections to audiopa...
...m in another node, then the connection is shown as a dashed line between the nodes, and is labeled with the name of the audioparam: inspecting and modifying audionodes if you click on a node, it's highlighted and you get a node inspector on the right hand side. this list the values of that node's audioparam properties. for example, here's what the oscillatornode looks like: with the violent the
remin demo, the frequency parameter is modified as the user moves the mouse left and right, and you can see this reflected in the node inspector. however, the value isn't updated in real time: you have to click the node again to see the updated value. if you click on a value in the node inspector you can modify it: press enter or tab and the new value takes effect immediately. bypassing nodes new...
about:debugging (before Firefox 68) - Firefox Developer Tools
see a dialog asking you to accept an incoming connection. click "ok", and the add-on debugger will start in a separate window. note that sometimes the debugger window is hidden by the main firefox window. see the page on the add-on debugger for all the things you can do with this tool. the "enable add-on debugging" button works by turning on the devtools.chrome.enabled and devtools.debugger.
remote-enabled preferences. both preferences must be true to enable add-on debugging. checking the box sets both preferences to true, and unchecking it sets them both to false. you can also modify the preferences directly in about:config, or by checking "enable browser chrome and add-on debugging toolboxes" and "enable
remote debugging" in the developer tools settings. loading a temporary add-on ...
... instance. each tab entry has a debug button next to it — when clicked, this will open up a toolbox specific to that tab, allowing you to debug that tab's contents. note that this feature isn't that immediately useful to debugging desktop tabs — you can open up a toolbox to debug a tab easily enough already — but this will become far more useful when about:debugging starts to support
remote debugging, and this page can begin to list tabs available for debugging on mobile device browsers, simulators, etc. see bug 1212802 for the latest on this work. workers the workers page shows your workers, categorised as follows: all registered service workers all registered shared workers other workers, including chrome workers and dedicated workers you can connect the developer too...
... if the dom.serviceworkers.enable preference is set to false in about:config. ...
AddressErrors - Web APIs
tion of the validation failure, and ideally suggestions to correct the problem. sortingcode a domstring which, if present, indicates that the sortingcode property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. obsolete properties these properties have been
removed from the specification and should no longer be used. languagecode a domstring which, if present, indicates that the languagecode property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. usage notes keep in mind that some violation errors may be outs...
...ericaddresserror, shippingaddresserrors, ...defaultpaymentdetails }; } ev.updatewith(updatedetails); } the shippingaddresschange event doesn't receive the paymentrequest object directly, so we fetch it from the target property of the event. if the request's shippingaddress has a value for country which isn't in the array validcountries, we generate the error. that's done by
removing all shipping options currently set on the request, then set up an object named shippingaddresserrors which contains a country property which is an error message describing why the stated country isn't being permitted as a value. then a paymentdetailsupdate object is created with its error set to a generic message about address errors and with the reset of the object's values taken from ship...
...dresserrors which contains a country property which is an error message describing why the stated country isn't being permitted as a value. then a paymentdetailsupdate object is created with its error set to a generic message about address errors and with the reset of the object's values taken from shippingaddresserrors, and, using "...defaultpaymentdetails" as the final entry in the object, the
remeainder of the properties' values are taken from defaultpaymentdetails. the final step is to call the event's updatewith() method, passing along the updatedetails object. this lets the payment request api know to present the specified error or errors but to allow the user to keep trying to edit the address. setting up the donate now button this code creates a handler for the load event on the w...
Animation.oncancel - Web APIs
the oncancel property of the web animations api's animation interface is the event handler for the cancel event. the cancel event can be triggered manually with animation.cancel() when the animation enters the "idle" play state from another state, such as when the animation is
removed from an element before it finishes playing creating a new animation that is initially idle does not trigger a cancel event on the new animation. ...
... working draft editor's draft. ...
...on that is initially idle does not trigger a cancel event on the new animation. syntax var cancelhandler = animation.oncancel; animation.oncancel = cancelhandler; value a function to be executed when the animation is cancelled, or null if there is no cancel event handler. examples if this animation is canceled,
remove its element. animation.oncancel = function() { animation.effect.target.
remove(); }; specifications specification status comment web animationsthe definition of 'animation.oncancel' in that specification. working draft editor's draft. ...
Animation.persist() - Web APIs
the persist() method of the web animations api's animation interface explicitly persists an animation, when it would otherwise be
removed due to the browser's automatically
removing filling animations behavior. syntax animation.persist(); parameters none. return value none. ...
...ne. examples in our simple replace indefinite animations demo, you can see the following code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.on
remove = function() { console.log('animation
removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak.
...moved'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically
remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. this will be active for each animation by default, or persisted if the persist() call is uncommented. specifications specification status comment web animationsthe definition of 'persist()' in that specification. working draft ...
Animation.replaceState - Web APIs
the read-only animation.replacestate property of the web animations api returns the replace state of the animation. this will be active if the animation has been
removed, or persisted if animation.persist() has been invoked on it. syntax let myreplacestate = animation.replacestate; value a string that represents the replace state of the anmation. the value can be one of: active: the initial value of the animation's replace state; when the animation has been
removed by the browser's automatically
removing filling animations behavior. persisted: the animation has been explicitly persisted by invoking animation.persist() on it.
removed: the animation has been explicitly
removed. examples in our simple replace indefinite animations demo, you can see the following code: const dive...
...oved. examples in our simple replace indefinite animations demo, you can see the following code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.on
remove = function() { console.log('animation
removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak.
...moved'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an animation that animates the <div> element to the position of the mouse pointer. this could result in a huge animations list, which could create a memory leak. for this reason, modern browsers automatically
remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. this will be active for each animation by default, or persisted if the persist() call is uncommented. specifications specification status comment web animationsthe definition of 'animation.replacestate' in that specification. working draft ...
BluetoothCharacteristicProperties - Web APIs
properties authenticatedsignedwritesread only returns a boolean that is true if signed writing to the characteristic value is permitted. broadcastread only returns a boolean that is true if the broadcast of the characteristic value is permitted using the server characteristic configuration descriptor. ...
...sponse is permitted. examples the following example shows how tell if a gatt characteristic supports value change notifications. ...
... draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contri...
CharacterData - Web APIs
ts parent's children list, or null if the specified element is the first one in the list. methods inherits methods from its parent, node, and implements the childnode and nondocumenttypechildnode interface. characterdata.appenddata() appends the given domstring to the characterdata.data string; when this method returns, data contains the concatenated domstring. ...
... characterdata.replacedata() replaces the specified amount of characters, starting at the specified offset, with the specified domstring; when this method returns, data contains the modified domstring. ...
... characterdata.replacedata() replaces the specified amount of characters, starting at the specified offset, with the specified domstring; when this method returns, data contains the modified domstring. ...
DataTransfer.clearData() - Web APIs
the datatransfer.cleardata() method
removes the drag operation's drag data for the given type. if data for the given type does not exist, this method does nothing. if this method is called with no arguments or the format is an empty string, the data of all types will be
removed. this method does not
remove files from the drag operation, so it's possible for there still to be an entry with the type "files" left in the object's datatransfer.types list if there are any files included in the drag. this method can only be used in the handler for the dragstart event, because that's the only time the drag operation's data store is writeable. syntax datatransfer.cleardata([format]); parameters format optional a string which specifies the type of data to
remove. if this parameter is an e...
...here are any files included in the drag. this method can only be used in the handler for the dragstart event, because that's the only time the drag operation's data store is writeable. syntax datatransfer.cleardata([format]); parameters format optional a string which specifies the type of data to
remove. if this parameter is an empty string or is not provided, the data for all types is
removed. example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods. html <span class="tweaked" id="source" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element. </span> <span class="tweaked" id="target">drop zone</span> <div>status: <span id="status">drag to start</span></div> <div>...
...); data.innerhtml = event.datatransfer.getdata('text/plain'); } function dragendhandler (event) { if (!dropped) { status.innerhtml = 'drag canceled'; } data.innerhtml = event.datatransfer.getdata('text/plain') || 'empty'; // change border to signify drag is no longer in process event.currenttarget.style.border = '1px solid black'; if (dropped) { //
remove all event listeners draggable.
removeeventlistener('dragstart', dragstarthandler); draggable.
removeeventlistener('dragend', dragendhandler); dropable.
removeeventlistener('dragover', dragoverhandler); dropable.
removeeventlistener('dragleave', dragleavehandler); dropable.
removeeventlistener('drop', drophandler); } } function dragoverhandler (event) { sta...
DataTransfer.mozClearDataAt() - Web APIs
the datatransfer.mozcleardataat() method
removes the data associated with the given format for an item at the specified index. the index must be in the range from zero to the number of items minus one. if the format argument is not provided, then the data associated with all formats is
removed. if the format is not found, then this method has no effect. if the last format for the item is
removed, the entire item is
removed, reducing mozitemcount by one.
removing the last format for a particular index
removes that item entirely, shifting the
remaining items down and changing their indices. note: this method is gecko-specific. ...
...st format for the item is
removed, the entire item is
removed, reducing mozitemcount by one.
removing the last format for a particular index
removes that item entirely, shifting the
remaining items down and changing their indices. note: this method is gecko-specific. syntax void datatransfer.mozcleardataat([type], index); arguments type a string representing the type of the drag data to
remove from the drag data object. index a unsigned long representing the index of the data to
remove. return value void example this example shows the use of the mozcleardataat() method in a dragend event handler. ...
...mozcleardataat([type], index); arguments type a string representing the type of the drag data to
remove from the drag data object. index a unsigned long representing the index of the data to
remove. return value void example this example shows the use of the mozcleardataat() method in a dragend event handler. function dragend_handler(event) { var dt = event.datatransfer; //
remove a text/html item dt.mozcleardataat("text/html", 1); } specifications this method is not defined in any web standard. ...
Document.open() - Web APIs
syntax document.open(); parameters none. return value a document object instance. examples the following simple code opens the document and replaces its content with a number of different html fragments, before closing it again. ...
... syntax document.open(); parameters none. return value a document object instance. examples the following simple code opens the document and replaces its content with a number of different html fragments, before closing it again. ...
... before closing it again. document.open(); document.write("<p>hello world!</p>"); document.write("<p>i am a fish</p>"); document.write("<p>the number is 42</p>"); document.close(); notes an automatic document.open() call happens when document.write() is called after the page has loaded. for years firefox and internet explorer additionally erased all javascript variables, etc., in addition to
removing all nodes. this is no longer the case.document non-spec'ed parameters to document.open gecko-specific notes starting with gecko 1.9, this method is subject to the same same-origin policy as other properties, and does not work if doing so would change the document's origin. starting with gecko 1.9.2, document.open() uses the principal of the document whose uri it uses, instead of fetching ...
Document.xmlEncoding - Web APIs
obsolete since gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. returns the encoding as determined by the xml declaration. should be null if unspecified or unknown. warning: do not use this attribute; it has been
removed from the dom level 4 specification and is no longer supported in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7). ...
...tribute; it has been
removed from the dom level 4 specification and is no longer supported in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7). if the xml declaration states: <?xml version="1.0" encoding="utf-16"?> ...the result should be "utf-16". however, firefox 3.0 includes information on endianness (e.g., utf-16be for big endian encoding), and while this extra information is
removed as of firefox 3.1b3, firefox 3.1b3 is still consulting the file's encoding, rather than the xml declaration as the spec defines it ("an attribute specifying, as part of the xml declaration, the encoding of this document."). ...
...ss (e.g., utf-16be for big endian encoding), and while this extra information is
removed as of firefox 3.1b3, firefox 3.1b3 is still consulting the file's encoding, rather than the xml declaration as the spec defines it ("an attribute specifying, as part of the xml declaration, the encoding of this document."). ...
Document.xmlVersion - Web APIs
as such, firefox 10 no longer implements it. ...
...as such, firefox 10 no longer implements it. its primary use in the past was to detect whether or not the document was being rendered as xml rather than html. ...
...ing rendered as xml rather than html. to detect this, you can create an element with its name in lower case, then check to see if it gets converted into all upper case (in which case the document is in the non-xml html mode): if (document.createelement("foo").tagname == "foo") { /* document is not xml */ } specifications http://www.w3.org/tr/dom-level-3-cor...ument3-version this has been
removed from dom core level 4wd ...
Document - Web APIs
tionchange property. selectstart fired when the user begins a new selection. also available via the onselectstart property. touch events touchcancel fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created). also available via the ontouchcancel property. touchend fired when one or more touch points are
removed from the touch surface. also available via the ontouchend property touchmove fired when one or more touch points are moved along the touch surface. also available via the ontouchmove property touchstart fired when one or more touch points are placed on the touch surface. also available via the ontouchstart property transition events transitioncancel fired when a css transition is...
...n privileged javascript code (with universalxpconnect privileges). document.popupnode returns the node upon which a popup was invoked. document.tooltipnode returns the node which is the target of the current tooltip. ...
... internet explorer notes microsoft defines some non-standard properties: document.filesize* returns size in bytes of the document. starting with internet explorer 11, that property is no longer supported. see msdn. ...
Element: copy event - Web APIs
e clipboard data. it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard. ...
...t's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard. ...
...nstruct and dispatch a synthetic copy event, but this will not affect the system clipboard. ...
Element.getAttributeNS() - Web APIs
living standard document object model (dom) level 3 core specificationthe definition of 'element.getattributens()' in that specification. obsolete specifies that a not_...
... living standard document object model (dom) level 3 core specificationthe definition of 'element.getattributens()' in that specification. obsolete specifies that a not_supported_err exception ...
... living standard document object model (dom) level 3 core specificationthe definition of 'element.getattributens()' in that specification. obsolete specifies that a not_supported_err exception is thrown if the u...
Element.hasAttribute() - Web APIs
living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe definition of 'eleme...
... living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe definition of 'element.hasattribute()' in th...
... living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe definition of 'element.hasattribute()' in that specification. ...
Element: paste event - Web APIs
data manually. it's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents. ...
... possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents. ...
...ruct and dispatch a synthetic paste event, but this will not affect the document's contents. ...
Element.setAttributeNS() - Web APIs
"namespace:localname". specifications specification status comment domthe definition of 'document.setattributens' in that specification. living standard ...
..."namespace:localname". specifications specification status comment domthe definition of 'document.setattributens' in that specification. living standard ...
..."namespace:localname". specifications specification status comment domthe definition of 'document.setattributens' in that specification. living standard ...
Element.toggleAttribute() - Web APIs
return value true if attribute name is eventually present, and false otherwise. ...
...t is not present) on the given element. syntax element.toggleattribute(name [, force]); parameters name a domstring specifying the name of the attribute to be toggled. the attribute name is automatically converted to all lower-case when toggleattribute() is called on an html element in an html document. force optional a boolean value to determine whether the attribute should be added or
removed, no matter whether the attribute is present or not at the moment. return value true if attribute name is eventually present, and false otherwise. exceptions invalidcharactererror the specified attribute name contains one or more characters which are not valid in attribute names. example in the following example, toggleattribute() is used to toggle the readonly attribute of a <input...
... methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - -
removeattribute (dom 1)
removeattributens
removeattributenode - polyfill if (!element.prototype.toggleattribute) { element.prototype.toggleattribute = function(name, force) { if(force !== void 0) force = !!force if (this.hasattribute(name)) { if (force) return true; this.
removeattribute(name); return false; } if (force === false) return false; this.seta...
FileSystemDirectoryEntry - Web APIs
the entries in this directory. getdirectory() returns a filesystemdirectoryentry object representing a directory located at a given path, relative to the directory on which the method is called. getfile() returns a filesystemfileentry object representing a file located within the directory's hierarchy, given a path relative to the directory on which the method is called. obsolete methods
removerecursively() deletes a directory and all of its contents, including the contents of subdirectories. this has been
removed from the spec. specifications specification status comment file and directory entries apithe definition of 'filesystemdirectoryentry' in that specification. draft browser compatibility the compatibility table on this page is ge...
... full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yes
removerecursively deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the
removerecursively() method existed, it immediately called the error callback with ns_error_dom_security...
... no support nosafari no support nowebview android full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the
removerecursively() method existed, it immediately called the error callback with ns_error_dom_security_err.opera android no support nosafari ios no support nosamsung internet android full support yeslegend full support ...
Fullscreen API - Web APIs
see the article guide to the fullscreen api for details on how to use the api. ...
...the document interface document.exitfullscreen() requests that the user agent switch from full-screen mode back to windowed mode. returns a promise which is resolved once full-screen mode has been completely shut off. methods on the element interface element.requestfullscreen() asks the user agent to place the specified element (and, by extension, its descendants) into full-screen mode,
removing all of the browser's ui elements as well as all other applications from the screen. returns a promise which is resolved once full-screen mode has been activated. properties the document interface provides properties that can be used to determine if full-screen mode is supported and available, and if full-screen mode is currently active, which element is using the screen. documentorshad...
...ument.onfullscreenerror an event handler for the fullscreenerror event that gets sent to a document when an error occurs while trying to enable or disable full-screen mode for the entire document. event handlers on elements element.onfullscreenchange an event handler which is called when the fullscreenchange event is sent to the element, indicating that the element has been placed into, or
removed from, full-screen mode. element.onfullscreenerror an event handler for the fullscreenerror event when sent to an element which has encountered an error while transitioning into or out of full-screen mode. obsolete properties document.fullscreen a boolean value which is true if the document has an element currently being displayed in full-screen mode; otherwise, this returns false. ...
GlobalEventHandlers.onscroll - Web APIs
ole argument. only one onscroll handler can be assigned to an object at a time. for greater flexibility, you can pass a scroll event to the eventtarget.addeventlistener() method instead. example this example monitors scrolling on a <textarea>, and logs the element's vertical scroll position accordingly. ...
...only one onscroll handler can be assigned to an object at a time. for greater flexibility, you can pass a scroll event to the eventtarget.addeventlistener() method instead. example this example monitors scrolling on a <textarea>, and logs the element's vertical scroll position accordingly. ...
...andler can be assigned to an object at a time. for greater flexibility, you can pass a scroll event to the eventtarget.addeventlistener() method instead. example this example monitors scrolling on a <textarea>, and logs the element's vertical scroll position accordingly. html <textarea>1 2 3 4 5 6 7 8 9</textarea> <p id="log"></p> css textarea { width: 4
rem; height: 8
rem; font-size: 3
rem; } javascript const textarea = document.queryselector('textarea'); const log = document.getelementbyid('log'); textarea.onscroll = logscroll; function logscroll(e) { log.textcontent = `scroll position: ${e.target.scrolltop}`; } result specifications specification status comment html living standardthe definition of 'onscroll' in that specification. living...
HTMLElement: animationcancel event - Web APIs
therefore, either directly or because any of its containing nodes are hidden. an event handler for this event can be added by setting the onanimationcancel property, or using addeventlistener(). ...
...cel = () => { console.log('animation canceled'); }; animated.style.display = 'none'; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3
rem; } .event-log { width: 25
rem; height: 2
rem; border: 1px solid black; margin: 0.2
rem; padding: 0.2
rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselecto...
...ntlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.
remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.clas...
HTMLElement: animationend event - Web APIs
the animationend event is fired when a css animation has completed. if the animation aborts before reaching completion, such as if the element is
removed from the dom or the animation is
removed from the element, the animationend event is not fired. bubbles yes cancelable no interface animationevent event handler property onanimationend examples this example gets an element that's being animated and listens for the animationend event: const animated = document.queryselector('.animated'); animated.addeventlistener('animationend', () => { console.log('animation ended'); }); the same, but using the onanimationend event handler property: const animated = document.queryselector('.animated'); animated.onanimationend = () => { consol...
...r('.animated'); animated.onanimationend = () => { console.log('animation ended'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3
rem; } .event-log { width: 25
rem; height: 2
rem; border: 1px solid black; margin: .2
rem; padding: .2
rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { margin-left: 100%; width: 300%; } to { margin-left: 0%; width: 100%; } } js const animation = document.queryselector('p.a...
...ntlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.
remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.clas...
HTMLMediaElement.play() - Web APIs
it tries to play the video, and if successful sets the class name of the playbutton element to "playing". if playback fails to ...
...("playbutton"); playbutton.addeventlistener("click", handleplaybutton, false); playvideo(); async function playvideo() { try { await videoelem.play(); playbutton.classlist.add("playing"); } catch(err) { playbutton.classlist.
remove("playing"); } } function handleplaybutton() { if (videoelem.paused) { playvideo(); } else { videoelem.pause(); playbutton.classlist.
remove("playing"); } } in this example, playback of video is toggled off and on by the async playvideo() function. it tries to play the video, and if successful sets the class name of the playbutton element to "playing". if playback fails to start, the playbutton element's class is cleared, restoring its default appearance. this ensures that the play button matches the actual state of playback by ...
...ck by watching for the resolution or rejection of the promise returned by play(). when this example is executed, it begins by collecting references to the <video> element as well as the <button> used to toggle playback on and off. it then sets up an event handler for the click event on the play toggle button and attempts to automatically begin playback by calling playvideo(). you can try out or
remix this example in real time on glitch. specifications specification status comment html living standardthe definition of 'play()' in that specification. living standard initial definition; living specification. html5the definition of 'play()' in that specification. recommendation initial definition. note: the whatwg and w3c versions of the sp...
HTMLMediaElement - Web APIs
ols html attribute, indicating whether user interface items for controlling the resource should be displayed. htmlmediaelement.controlslist read only returns a domtokenlist that helps the user agent select what controls to show on the media element whenever the user agent shows its own set of controls. the domtokenlist takes one or more of three possible values: nodownload, nofullscreen, and no
remoteplayback. htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element. htmlmediaelement.currentsrc read only returns a domstring with the absolute url of the chosen media resource. htmlmediaelement.currenttime a double-precision floating-point value indicating the current playback time in seconds; if the media has not started to play and has not been seeke...
...setting this value seeks the media to the new time. the time is specified relative to the media's timeline. htmlmediaelement.defaultmuted a boolean that reflects the muted html attribute, which indicates whether the media element's audio output should be muted by default. htmlmediaelement.defaultplaybackrate a double indicating the default playback rate for the media. htmlmediaelement.disable
remoteplayback a boolean that sets or returns the
remote playback state, indicating whether the media element is allowed to have a
remote playback ui. htmlmediaelement.duration read only a read-only double-precision floating-point value indicating the total duration of the media in seconds. if no media data is available, the returned value is nan. if the media is of indefinite length (such as str...
...onds. htmlmediaelement.mozchannels read only returns a double representing the number of channels in the audio resource (e.g., 2 for stereo). obsolete event handlers htmlmediaelement.onmozinterruptbegin sets the eventhandler called when the media element is interrupted because of the audio channel manager. this was firefox-specific, having been implemented for firefox os, and was
removed in firefox 55. htmlmediaelement.onmozinterruptend sets the eventhandler called when the interruption is concluded. this was firefox-specific, having been implemented for firefox os, and was
removed in firefox 55. methods this interface also inherits methods from its ancestors htmlelement, element, node, and eventtarget. htmlmediaelement.addtexttrack() adds a text track (such as a...
HTMLTextAreaElement - Web APIs
s the wrap html attribute, indicating how the control wraps text. htmltextareaelement.labelsread only nodelist: returns a list of label elements associated with this element. the two properties tabindex and accesskey are inherited from htmlelement from html5 on, but were defined on htmltextareaelement in dom level 2 html and earlier specifications. methods blur()
removes focus from the control; keystrokes will subsequently go nowhere. focus() gives focus to the control; keystrokes will subsequently go to this element. select() selects the contents of the control. setrangetext() replaces a range of text in the element with new text. setselectionrange() selects a range of text in the element (but does not focus it...
...r the link');if(newurl){insertmetachars('<a href=\u0022'+newurl+'\u0022>','<\/a>');}else{document.myform.mytxtarea.focus();}">url</span> | <span class="intlink" onclick="insertmetachars('\n<code>\n','\n<\/code>\n');">code</span> | <span class="intlink" onclick="insertmetachars(' :-)');">smile</span> | etc. etc. ]</p> <p><textarea name="mytxtarea" rows="10" cols="50">lo
rem ipsum dolor sit amet, consectetur adipiscing elit. ut facilisis, arcu vitae adipiscing placerat, nisl lectus accumsan nisi, vitae iaculis sem neque vel lectus. praesent tristique commodo lo
rem quis fringilla. sed ac tellus eros. sed consectetur eleifend felis vitae luctus. praesent sagittis, est eget bibendum tincidunt, ligula diam tincidunt augue, a fermentum odio velit eget mi. phasellus mattis...
...cus augue sit amet dui. pellentesque lacinia odio id nisi pulvinar commodo tempus at odio. ut consectetur eros porttitor nunc mollis ultrices. aenean porttitor, purus sollicitudin viverra auctor, neque erat blandit sapien, sit amet tincidunt massa mi ac nibh. proin nibh sem, bibendum ut placerat nec, cursus et lacus. phasellus vel augue turpis. nunc eu mauris eu leo blandit mollis interdum eget lo
rem. </textarea></p> </form> maximum length and number of lines example create a textarea with a maximum number of characters per line and a maximum number of lines: first, create a function that takes the text field and a key event as input and determines if any of the limits have been reached. if the limit has not been reached, it will return the key. function checkrows(ofield, okeyevent) { ...
Dragging and Dropping Multiple Items - Web APIs
re gecko specific interfaces. these interfaces will only work with gecko based browsers. mozilla supports the ability to drag multiple items using some additional non-standard methods. these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the index of the item to retrieve, modify or
remove. the drag processing described in this document use the datatransfer interface. this processing does not use the datatransferitem interface nor the datatransferitemlist interface. setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event. this function similarly to setdata() var dt = event.datatransfer; dt.mozsetdataat("text/plain"...
... the index of the item to add. you should add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added. using 0 as the index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution:
removing the last format for a particular index will
remove that item entirely, shifting the
remaining items down, so the later items will have different indices. for example: var dt = event.datatransfer; dt.mozsetdataat("text/uri-list", "url1", 0); dt.mozsetdataat("text/plain", "url1", 0); dt.mozsetdataat("text/uri-list", "url2", 1); dt.mozsetdataat("text/plain", "url2", 1); dt.mozsetdataat("...
... // [item1] data=url1, index=0 // [item2] data=url3, index=1 fortunately, you don't normally need to clear items often; it's more common to just add the items only when you know they are needed. common cases where dragging multiple items is used is when dragging multiple files or b...
IDBCursorSync - Web APIs
important: the synchronous version of the indexeddb api was originally intended for use only with web workers, and was eventually
removed from the spec because its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbcursorsync interface of the indexeddb api represents a cursor for iterating over multiple records in a database. you can have only one instance of idbcursorsync representing a cursor, but you can have an unlimited number of cursors at the same time. operations are performed on the underlying index or object store. ...
...tiple records in a database. you can have only one instance of idbcursorsync representing a cursor, but you can have an unlimited number of cursors at the same time. operations are performed on the underlying index or object store. it enables an application to synchronously process all the records in the cursor's range. method overview bool continue (in optional any key); void
remove () raises (idbdatabaseexception); attributes attribute type description count readonly unsigned long long the total number of objects that share the current key. direction readonly unsigned short the direction of traversal of the cursor. see constants for possible values. key readonly any the key for the record at the curs...
...ods continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is specified, advance to the immediate next position. returns false if the cursor has reached the end of its range; otherwise returns true. bool continue ( in optional any key ); parameters key the key to which to move the cursor's position.
remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this method can raise an idbdatabaseexception with the following code: not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode. ...
IDBDatabase.createObjectStore() - Web APIs
l an options object whose attributes are optional parameters to the method. it includes the following properties: attribute description keypath the key path to be used by the new object store. if empty or not specified, the object store is created without a key path and uses out-of-line keys. you can also pass in an array as a keypath. autoinc
rement if true, the object store has a key generator. defaults to false. unknown parameters are ignored. returns a new idbobjectstore. exceptions this method may raise a domexception with a domerror of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback. for...
...may raise a domexception with a domerror of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback. for older webkit browsers, you must call first. transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g. ...
...tabase that doesn't exist (e.g. has been deleted or
removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database. invalidaccesserror if autoinc
rement is set to true and keypath is either an empty string or an array containing an empty string. example // let us open our database var request = window.indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version number is submitted by calling // window.indexeddb.open(). //...
IDBIndexSync - Web APIs
it may however be reintroduced in the future if there is enough demand from web developers. the idbindexsync interface of the indexeddb api provides synchronous access to an index in a database. ...
...if this attribute is null, this index is not auto-populated. name readonly domstring the name of this index. storename readonly domstring this index's referenced object store. un...
...() stores the given value in this index and returns the key for the stored record. if a record already exists with the given key, the record is overwritten. any put ( in any value, in optional any key) raises (idbdatabaseexception); parameters value the value to be stored in the record. key the key to be used to identify the record. returns any the key for the stored record.
remove()
removes from this index any records that correspond to the given key. void
remove ( in any key ) raises (idbdatabaseexception); parameters key key of the records to be
removed. exceptions this method can raise a databaseexception with the following code: not_found_err if a record does not exist in this index with the given key. ...
IDBObjectStore.clear() - Web APIs
note: this feature is available in web workers. ...
... note: this feature is available in web workers. ...
... note: this feature is available in web workers. ...
IndexedDB API - Web APIs
follows a same-origin policy. so while you can access stored data within a domain, you cannot access data across different domains. synchronous and asynchronous operations performed using indexeddb are done asynchronously, so as not to block applications. indexeddb originally included both synchronous and asynchronous apis. the synchronous api was intended for use only with web workers but was
removed from the spec because it was unclear whether it was needed. however, the synchronous api may be reintroduced if there is enough demand from web developers. storage limits and eviction criteria there are a number of web technologies that store data of one kind or another on the client side (i.e. on your local disk). indexeddb is most commonly talked about. the process by which the browser wo...
... specification. custom event interfaces this specification fires events with the following custom interface: idbversionchangeevent the idbversionchangeevent interface indicates that the version of the database has changed, as the result of an idbopendbrequest.onupgradeneeded event handler function. ...
... idbdatabaseexception represents exception conditions that can be encountered while performing database operations. idbtransactionsync sync version of idbtransaction. idbobjectstoresync sync version of idbobjectstore. idbindexsync sync version of idbindex. idbfactorysync sync version of idbfactory. ...
KeyboardEvent.key - Web APIs
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 holdi...
...ype, because of the active modifier shift key. the beforeinput and input events are fired next because a character key has been produced. as we release the 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...
...t 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" because the modifier shift key is no longer active. the same goes for the inputevent.data property of the beforeinput and input events. as we finally release the key 2, a keyup event is fired but the key property will be set to the string value 2 for both keyboard layout...
MutationObserver.MutationObserver() - Web APIs
objects, describing each change that occurred; and the mutationobserver which invoked the callback. see the example below for more details. return value a new mutationobserver object, configured to call the specified callback when dom mutations occur. example this example simply creates a new mutationobserver configured to watch a node and all of its children for additions and
removals of elements to the tree, as well as any changes to attributes on any of the elements in the tree. the callback function function callback(mutationlist, observer) { mutationlist.foreach( (mutation) => { switch(mutation.type) { case 'childlist': /* one or more children have been added to and/or
removed from the tree. (see mutation.addednodes and muta...
... of elements to the tree, as well as any changes to attributes on any of the elements in the tree. the callback function function callback(mutationlist, observer) { mutationlist.foreach( (mutation) => { switch(mutation.type) { case 'childlist': /* one or more children have been added to and/or
removed from the tree. (see mutation.addednodes and mutation.
removednodes.) */ break; case 'attributes': /* an attribute value changed on the element in mutation.target. the attribute name is in mutation.attributename, and its previous value is in mutation.oldvalue. */ break; } }); } the callback() function is invoked when the observer sees changes matching the configuration of the observat...
... it, we specify values of true for both childlist and attributes, so we get the information we want. then the observer is instantiated, specifying the callback() function. we begin observing the dom nodes of interest by calling observe(), specifying the target node and the options object. from this point until disconnect() is called, callback() will be called each time an element is added to or
removed from the dom tree rooted at targetnode, or any of those elements' attributes are changed. specifications specification status comment domthe definition of 'mutationobserver()' in that specification. living standard ...
NamedNodeMap - Web APIs
mplementations. properties this interface doesn't inherit any property. namednodemap.length read only returns the amount of objects in the map. methods this interface doesn't inherit any method. namednodemap.getnameditem() returns a attr, corresponding to the given name. namednodemap.setnameditem() replaces, or adds, the attr identified in the map by the given name. namednodemap.
removenameditem()
removes the attr identified by the given map. namednodemap.item() returns the attr at the given index, or null if the index is higher or equal to the number of nodes. namednodemap.getnameditemns() returns a attr identified by a namespace and related local name. namednodemap.setnameditemns() replaces, or adds, the attr identified in the map by the given namespace and related l...
...he attr identified by the given map. namednodemap.item() returns the attr at the given index, or null if the index is higher or equal to the number of nodes. namednodemap.getnameditemns() returns a attr identified by a namespace and related local name. namednodemap.setnameditemns() replaces, or adds, the attr identified in the map by the given namespace and related local name. namednodemap.
removenameditemns()
removes the attr identified by the given namespace and related local name. specifications specification status comment domthe definition of 'namednodemap' in that specification. living standard deals with attr instead of node document object model (dom) level 3 core specificationthe definition of 'namednodemap' in that specification. o...
... instead of node document object model (dom) level 3 core specificationthe definition of 'namednodemap' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe definition of 'namednodemap' in that specification. obsolete added getnameditemns(), setnameditemns() and
removenameditemns() document object model (dom) level 1 specificationthe definition of 'namednodemap' in that specification. obsolete initial definition ...
OVR_multiview2 - Web APIs
ber of views supported by multiview. framebuffer_incomplete_view_targets_ovr if baseviewindex is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete. calling checkframebufferstatus for a framebuffer in this state returns framebuffer_incomplete_view_targets_ovr. methods framebuffertextu
remultiviewovr() simultaneously renders to multiple elements of a 2d texture array. examples this example is taken from the specification. see also this three.js demo for a live multiview example. const gl = document.createelement('canvas').getcontext( 'webgl2', { antialias: false } ); const ext = gl.getextension('ovr_multiview2'); const fb = gl.createframebuffer(); gl.bindframebuffer(gl.draw_fr...
...iew example. ...
...ndtexture(gl.texture_2d_array, colortex); gl.texstorage3d(gl.texture_2d_array, 1, gl.rgba8, 512, 512, 2); ext.framebuffertextu
remultiviewovr(gl.draw_framebuffer, gl.color_attachment0, colortex, 0, 0, 2); const depthstenciltex = gl.createtexture(); gl.bindtexture(gl.texture_2d_array, depthstenciltex); gl.texstorage3d(gl.texture_2d_array, 1, gl.depth32f_stencil8, 512, 512, 2); ext.framebuffertextu
remultiviewovr(gl.draw_framebuffer, gl.depth_stencil_attachment, depthstenciltex, 0, 0, 2); gl.drawelements(...); // draw will be broadcasted to the layers of colortex and depthstenciltex. shader code #version 300 es #extension gl_ovr_multiview2 : require precision mediump float; layout (num_views = 2) in; in vec4 inpos; uniform mat4 u_viewmatrices[2]; void main() { gl_position = u_viewmatri...
PasswordCredential - Web APIs
l contexts and cannot be used from an <iframe>. constructor passwordcredential()secure context creates a new passwordcredential object. properties inherits properties from its ancestor, credential. passwordcredential.additionaldata secure context one of a formdata instance, a urlsearchparams instance, or null. the data in the objects will be added to the request body and sent to the
remote endpoint with the credentials. passwordcredential.iconurl read only secure context a usvstring containing a url pointing to an image for an icon. this image is intended for display in a credential chooser. the url must be accessible without authentication. passwordcredential.idname secure context a usvstring containing the name that will be used for the id field when submitting the curren...
...ith the credentials. passwordcredential.iconurl read only secure context a usvstring containing a url pointing to an image for an icon. this image is intended for display in a credential chooser. the url must be accessible without authentication. passwordcredential.idname secure context a usvstring containing the name that will be used for the id field when submitting the current object to a
remote endpoint via fetch. this property defaults to 'username', but may be overridden to match whatever the backend service expects. passwordcredential.name read only secure context a usvstring containing a human-readable public name for display in a credential chooser. passwordcredential.password read only secure context a usvstring containing the password of the credential. passwordcredential...
...tial.name read only secure context a usvstring containing a human-readable public name for display in a credential chooser. passwordcredential.password read only secure context a usvstring containing the password of the credential. passwordcredential.passwordname secure context a usvstring representing the name that will be used for the password field when submitting the current object to a
remote endpoint via fetch. this property defaults to 'password', but may be overridden to match whatever the backend service expects. event handlers none. methods none. examples var cred = new passwordcredential({ id: id, password: password, name: name, iconurl: iconurl }); navigator.credentials.store(cred) .then(function() { // do something else. }); specifications spec...
performance.clearMarks() - Web APIs
return value void example the following example shows both uses of the clearmarks() method. // create a small helper to show how many performancemark entries there are. ...
... return value void example the following example shows both uses of the clearmarks() method. // create a small helper to show how many performancemark entries there are. ...
... return value void example the following example shows both uses of the clearmarks() method. // create a small helper to show how many performancemark entries there are. ...
performance.clearMeasures() - Web APIs
return value void example the following example shows both uses of the clearmeasures() method. // create a small helper to show how many performancemeasure entries there are. ...
... return value void example the following example shows both uses of the clearmeasures() method. // create a small helper to show how many performancemeasure entries there are. ...
... return value void example the following example shows both uses of the clearmeasures() method. // create a small helper to show how many performancemeasure entries there are. ...
PerformanceResourceTiming.decodedBodySize - Web APIs
example the following example, the value of the size properties of all "resource" type events are logged. ...
... example the following example, the value of the size properties of all "resource" type events are logged. ...
... example the following example, the value of the size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the *size properties and print their values // if supported. ...
RTCDataChannel - Web APIs
the rtcdatachannel interface represents a network channel which can be used for bidirectional peer-to-peer transfers of arbitrary data. every data channel is associated with an rtcpeerconnection, and each peer connection can have up to a theoretical maximum of 65,534 data channels (the actual limit may vary from browser to browser). to create a data channel and ask a
remote peer to join you, call the rtcpeerconnection's createdatachannel() method. the peer being invited to exchange data receives a datachannel event (which has type rtcdatachannelevent) to let it know the data channel has been added to the connection. propertiesalso inherits properties from: eventtargetbinarytype the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript ob...
... data transport—the link over which the rtcdatachannel's messages flow—is established or re-established.methodsalso inherits methods from: eventtargetclose()the rtcdatachannel.close() method closes the rtcdatachannel. either peer is permitted to call this method to initiate closure of the channel.send()the send() method of the rtcdatachannel interface sends data across the data channel to the
remote peer. events bufferedamountlow sent to the channel's onbufferedamountlow event handler when the number of bytes of data in the outgoing data buffer falls below the value specified by bufferedamountlowthreshold. close sent to the onclose event handler when the underlying data transport closes. error sent to the onerror event handler when an error occurs on the data channel. message s...
...tlow event handler when the number of bytes of data in the outgoing data buffer falls below the value specified by bufferedamountlowthreshold. close sent to the onclose event handler when the underlying data transport closes. error sent to the onerror event handler when an error occurs on the data channel. message sent to the onmessage event handler when a message has been received from the
remote peer. the message contents can be found in the event's data property. open sent to the onopen event handler when the data channel is first opened, or when an existing data channel's underlying connection re-opens. data format the underlying data format is defined by the ieee draft specification draft-ietf-mmusic-sctp-sdp. the current format specifies its protocol as either "udp/dtls/sctp"...
RTCDtlsTransport - Web APIs
tains a reference to the underlying rtcicetransport.state read only the state read-only property of the rtcdtlstransport interface provides information which describes a datagram transport layer security (dtls) transport state.methodsthis interface has no methods. description allocation of dtls transports rtcdtlstransport objects are created when an app calls either setlocaldescription() or set
remotedescription(). the number of dtls transports created and how they're used depends on the bundling mode used when creating the rtcpeerconnection. whether bundling is used depends on what the other endpoint is able to negotiate. all browsers support bundling, so when both endpoints are browsers, you can rest assured that bundling will be used. some non-browser legacy endpoints, however, may not...
...andling all of the communications for a given type of media (audio, video, or data channel). thus, a connection that has any number of audio and video channels will always have exactly one dtls transport for audio and one for video communications. because transports are established early in the negotiation process, it's likely that it won't be known until after they're created whether or not the
remote peer supports bundling or not. for this reason, you'll sometimes see separate transports created at first, one for each track, then see them get bundled up once it's known that bundling is possible. if your code accesses rtcrtpsenders and/or rtcrtpreceivers directly, you may encounter situations where they're initially separate, then half or more of them get closed and the senders and receive...
...this reason, you'll sometimes see separate transports created at first, one for each track, then see them get bundled up once it's known that bundling is possible. if your code accesses rtcrtpsenders and/or rtcrtpreceivers directly, you may encounter situations where they're initially separate, then half or more of them get closed and the senders and receivers updated to refer to the appropriate
remaining rtcdtlstransport objects. data channels rtcdatachannels use sctp to communicate. all of a peer connection's data channels share a single rtcsctptransport, found in the connection's sctp property. you can, in turn, identify the rtcdtlstransport used to securely encapsulate the data channels' sctp communications by looking at the rtcsctptransport object's transport property. examples thi...
RTCIceCandidate.address - Web APIs
null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. ...
...) will fail, throwing an operationerror exception. security notes it's important to note here that although webrtc does not require the two peers on an rtcpeerconnection to know one another's true ip addresses, the address property on rtcicecandidate can expose more information about the source of the
remote peer than the user expects. the ip address can be used to derive information about the
remote device's location, network topology, and so forth. it can also be used for fingerprinting purposes. the candidate ip addresses are always exposed to the application through address, and unsavory applications can in turn potentially reveal the address to the user. this can occur without the
remote peer's consent. applications being built with user privacy and security in mind can choose to li...
...r fingerprinting purposes. the candidate ip addresses are always exposed to the application through address, and unsavory applications can in turn potentially reveal the address to the user. this can occur without the
remote peer's consent. applications being built with user privacy and security in mind can choose to limit the permitted candidates to relay candidates only. doing so prevents the
remote user's address from being exposed, but reduces the pool of available candidates to choose from. to do this, configure the ice agent's ice transport policy using rtcconfiguration, like this: var rtcconfig = { iceservers: [ { urls: "turn:myturn.server.ip", username: "username", credential: "password" } ], icetransportpolicy: "relay" } by setting rtcconfiguratio...
RTCIceCandidate.priority - Web APIs
the rtcicecandidate interface's read-only priority property specifies the candidate's priority according to the
remote peer; the higher this value is, the better the
remote peer considers the candidate to be. as is the case with most of rtcicecandidate's properties, the value of priority is extracted from the candidate a-line string specified when creating the rtcicecandidate. the a-line string is obtained either from the rtcicecandidateinit property candidate or from an a-line string passed into rtcpeerconnection.addicecandidate() instead of an rtcicecandidate. ...
...date a-line string specified when creating the rtcicecandidate. the a-line string is obtained either from the rtcicecandidateinit property candidate or from an a-line string passed into rtcpeerconnection.addicecandidate() instead of an rtcicecandidate. syntax var priority = rtcicecandidate.priority; value a long, unsigned integer value indicating the priority of the candidate according to the
remote peer. the larger this value is, the more preferable the
remote peer considers this candidate to be. priority is initialized to null if it is not specified in the candidate, or if the candidate string can't be parsed propertly. note: if priority is null, passing the candidate to addicecandidate() will fail, throwing an operationerror exception. this applies only if the candidate implements t...
...bute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the priority is the number after the protocol, so it's the fourth field in the candidate string. in this example, the priority is 2043278322. example this candidate examines the priority of the candidate and, if it's greater than the priority of a previously-seen candidate,
remembers the candidate for later use. var bestcandidate = { candidate: "", sdpmid: null, sdpmlineindex: null, priority: 0 }; function handlecandidate(candidatestring) { var candidate = new rtcicecandidate(candidatestring); if (candidate.priority > bestcandidate.priority) { bestcandidate = candidate; } } specifications specification status comment webrt...
RTCIceCandidateInit.candidate - Web APIs
ed by a single space character, and are in a specific order. ...
...priority = 2043278322 ip = "192.168.0.56" port = 44323 type = "host" example when a new ice candidate is received by your signaling code from the
remote peer, you need to construct the rtcicecandidate object that encapsulates it. this is done in the event handler for the icecandidate event. ...
...8322 ip = "192.168.0.56" port = 44323 type = "host" example when a new ice candidate is received by your signaling code from the
remote peer, you need to construct the rtcicecandidate object that encapsulates it. this is done in the event handler for the icecandidate event. ...
RTCIceTransport - Web APIs
among other states. see the rtcicetransportstate enumerated type for a complete list of states. methods also includes methods from eventtarget, the parent interface. getlocalcandidates() returns an array of rtcicecandidate objects, each describing one of the ice candidates that have been gathered so far for the local device. ...
... for the local device. these are the same candidates which have already been sent to the
remote peer by sending an icecandidate event to the rtcpeerconnection for transmission. getlocalparameters() returns a rtciceparameters object describing the ice parameters established by a call to the rtcpeerconnection.setlocaldescription() method. returns null if parameters have not yet been received. get
remotecandidates() returns an array of rtcicecandidate objects, one for each of the
remote device's ice candidates that have been received by the local end of the rtcpeerconnection and delivered to ice by calling addicecandidate(). ...
...cribing the ice parameters established by a call to the rtcpeerconnection.setlocaldescription() method. returns null if parameters have not yet been received. get
remotecandidates() returns an array of rtcicecandidate objects, one for each of the
remote device's ice candidates that have been received by the local end of the rtcpeerconnection and delivered to ice by calling addicecandidate(). get
remoteparameters() returns a rtciceparameters object containing the ice parameters for the
remote device, as set by a call to rtcpeerconnection.set
remotedescription(). if set
remotedescription() hasn't been called yet, the return value is null. getselectedcandidatepair() returns a rtcicecandidatepair object that identifies the two candidates—one for each end of the connection—that have been sel...
RTCOutboundRtpStreamStats.pliCount - Web APIs
these are sent by the receiver's decoder to notify the sender's encoder that an undefined amount of coded video data, which may span frame boundaries, has been lost. ...
...the
remote peer's rtcrtpreceiver sent a picture loss indication (pli) packet to the rtcrtpsender for which this object provides statistics. a pli packet indicates that some amount of encoded video data has been lost for one or more frames. syntax var plicount = rtcoutboundrtpstreamstats.plicount; value an integer value indicating the number of times a pli packet was sent to this sender by the
remote peer's rtcrtpreceiver. these are sent by the receiver's decoder to notify the sender's encoder that an undefined amount of coded video data, which may span frame boundaries, has been lost. note: this property is only used for video streams. ...
...however, the primary purpose of a pli packet is to allow the rtcrtpsender for which this rtcoutboundrtpstreamstats object provides statistics to consider techniques to mitigate network performance issues. ...
RTCPeerConnection() - Web APIs
this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. ...
...this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. ...
...s the connection to local peers. icetransportpolicy optional the current ice transport policy; this must be one of the values from the rtcicetransportpolicy enum. if this isn't specified, "all" is assumed. peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection. if this value is set (it defaults to null), the rtcpeerconnection will not connect to a
remote peer unless it can successfully authenticate with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the rtcrtcpmuxpolicy enum. the default is "require". return value a newly-created rtcpeerconnection object, configured as described by configuration, if specified; ot...
RTCPeerConnection.addStream() - Web APIs
if the signalingstate is set to closed, an invalidstateerror is raised. if the signalingstate is set to stable, the event negotiationneeded is sent on the rtcpeerconnection to indicate that ice negotiation must be repeated to consider the new stream. ...
...at other browsers do not have it. ...
...tion instead: // add a track to a stream and the peer connection said stream was added to: stream.addtrack(track); if (pc.addtrack) { pc.addtrack(track, stream); } else { // if you have code listening for negotiationneeded events: settimeout(() => pc.dispatchevent(new event('negotiationneeded'))); } //
remove a track from a stream and the peer connection said stream was added to: stream.
removetrack(track); if (pc.
removetrack) { pc.
removetrack(pc.getsenders().find(sender => sender.track == track)); } else { // if you have code listening for negotiationneeded events: settimeout(() => pc.dispatchevent(new event('negotiationneeded'))); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of ...
RTCPeerConnection: negotiationneeded event - Web APIs
begin exchanging ice candidates through the signaling server. see signaling transaction flow in signaling and video calling for a description of the signaling process that begins with a negotiationneeded event. examples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the
remote peer. pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then...
... you can also set an event handler for the negotiationneeded event by assigning the event handler f...
...rr => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the
remote peer through the signaling server, to share that offer with the other peer. the other peer should recognize this message and follow up by creating its own rtcpeerconnection, setting the
remote description with set
remotedescription(), and then creating an answer to send back to the offering peer. you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsign...
RTCPeerConnection.peerIdentity - Web APIs
the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the
remote peer. once this promise resolves successfully, the resulting identity is the target peer identity and cannot change for the duration of the connection. syntax var identity = rtcpeerconnection.peeridentity; value a javascript promise which resolves to an rtcidentityassertion that describes the
remote peer's identity. if an error occcurs while attempting to validate an incoming identity assertion (that is, the information describing a peer's identity), the promise is rejected. if there isn't already a target peer identity, peeridentity is set to a newly created promise and the process begins again, until the process ...
...ity. if an error occcurs while attempting to validate an incoming identity assertion (that is, the information describing a peer's identity), the promise is rejected. if there isn't already a target peer identity, peeridentity is set to a newly created promise and the process begins again, until the process succeeds or no further attempts to authenticate occur. note: the promise returned by set
remotedescription() cannot resolve until any target peer identity that's been set is validated. if the identity hasn't been validated yet, the promise returned by set
remotedescription() will be rejected. if there's no target peer identity, set
remotedescription() doesn't need to wait for validation to occur before it resolves. example in this example, a function, getidentityassertion(), is created ...
...er's identity to be verified, then returns the identity to the caller. if an error occurs and the promise is rejected, this logs the error to the console and returns null to the caller. let pc = new rtcpeerconnection(); /* ... */ async function getidentityassertion(pc) { try { const identity = await pc.peeridentity; return identity; } catch(err) { console.log("error identifying
remote peer: ", err); return null; } } specifications specification status comment identity for webrtc candidate recommendation initial specification. ...
RTCPeerConnection.restartIce() - Web APIs
ice candidate gathering be redone on both ends of the connection. this simplifies the process by allowing the same method to be used by either the caller or the receiver to trigger an ice restart. after restartice() returns, the offer returned by the next call to createoffer() is automatically configured to trigger ice restart on both the local peer (once the local peer has been set) and on the
remote peer, once the offer is sent across your signaling mechanism and the
remote peer has set its description as well. restartice() causes the negotiationneeded event to be fired on the rtcpeerconnection to inform the application that it should perform negotiation using its signaling channel. if negotiation fails to complete—either due to rollback or because incoming offers are in the process o...
...the next time the connection's signalingstate changes to stable, the connection will fire the negotiationneeded event. this process continues until an ice restart has been successfully completed. syntax rtcpeerconnection.restartice(); parameters none. return value undefined. ...
...ime the connection's signalingstate changes to stable, the connection will fire the negotiationneeded event. this process continues until an ice restart has been successfully completed. syntax rtcpeerconnection.restartice(); parameters none. return value undefined. usage notes after calling restartice(), the next offer created using createoffer() will initiate ice restart once sent to the
remote peer over your signaling mechanism. restarting ice essentially resets ice so that it creates all new candidates using new credentials. existing media transmissions continue uninterrupted during this process. for details about how ice restart works, see ice restart in lifetime of a webrtc session and rfc 5245, section 9.1.1.1: ice specification. example this example creates a handler for the...
RTCRtpSender - Web APIs
the rtcrtpsender interface provides the ability to control and obtain details about how a particular mediastreamtrack is encoded and sent to a
remote peer. with it, you can configure the encoding used for the corresponding track, get information about the device's media capabilities, and so forth. you can also obtain access to an rtcdtmfsender which can be used to send dtmf codes (to simulate the user pressing buttons on a telephone's dial pad) to the
remote peer. properties rtcrtpsender.dtmf read only an rtcdtmfsender which can be used to send dtmf tones using telephone-event payloads on the rtp session represented by the rtcrtpsender object. if null, the track and/or the connection doesn't support dtmf. only audio tracks can support dtmf. rtcrtpsender.track read only the mediast...
...ransmit anything. rtcrtpsender.transport read only the rtcdtlstransport over which the sender is exchanging the rtp and rtcp packets used to manage transmission of media and control data. this value is null until the transport is established. when bundling is in use, more than transceiver may be sharing the same transport object. obsolete properties rtcptransport this property has been
removed; the rtp and rtcp transports have been combined into a single transport. use the transport property instead. methods rtcrtpsender.getparameters() returns a rtcrtpparameters object describing the current configuration for the encoding and transmission of media on the track. rtcrtpsender.getstats() returns a promise which is fulfilled with a rtcstatsreport which provides statistics da...
...ect describing the current configuration for the encoding and transmission of media on the track. rtcrtpsender.getstats() returns a promise which is fulfilled with a rtcstatsreport which provides statistics data for all outbound streams being sent using this rtcrtpsender. rtcrtpsender.setparameters() applies changes to parameters which configure how the track is encoded and transmitted to the
remote peer. rtcrtpsender.setstreams() sets the mediastream(s) associated with the track being transmitted by this sender. rtcrtpsender.replacetrack() attempts to replace the track currently being sent by the rtcrtpsender with another track, without performing renegotiation. this method can be used, for example, to toggle between the front- and rear-facing cameras on a device. static methods ...
Request.cache - Web APIs
quest will interact with the browser's http cache. syntax var currentcachemode = request.cache; value a requestcache value. the available values are: default — the browser looks for a matching request in its http cache. if there is a match and it is fresh, it will be returned from the cache. ...
... no-cache — the browser looks for a matching request in its http cache. ...
...loaded from the server and the cache will be updated. if there is no match, the browser will make a normal request, and will update the cache with the downloaded resource. no-store — the browser fetches the resource from the
remote server without first looking in the cache, and will not update the cache with the downloaded resource. reload — the browser fetches the resource from the
remote server without first looking in the cache, but then will update the cache with the downloaded resource. no-cache — the browser looks for a matching request in its http cache. if there is a match, fresh or stale, the browser will make a conditional request to the
remote server. if the server indicates that the resource has not changed, it will be returned from the cache. otherwise the ...
ResizeObserver.unobserve() - Web APIs
a reference to an element or svgelement to be unobserved. return value void. exceptions none. ...
...ions none. ...
...ource) example: const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + '
rem'; pelem.style.fontsize = math.max(1, entry.contentboxsize.inlinesize/600) + '
rem'; } else { h1elem.style.fontsize = math.max(1.5, entry.contentrect.width/200) + '
rem'; pelem.style.fontsize = math.max(1, entry.contentrect.width/600) + '
rem'; } } }); resizeobserver.observe(divelem); checkbox.addeventlistener('change', () => { if(checkbox.checked) { resizeobserver.observe(divelem); } else { resizeobserver.unobserve(divelem); } }); specifications specification status comment resize observerthe definition of '...
Using the Resource Timing API - Web APIs
onse end t = (resources[i].requeststart > 0) ? (resources[i].responseend - resources[i].requeststart) : "0"; console.log("... request start until response end time = " + t); // start until reponse end t = (resources[i].starttime > 0) ? (resources[i].responseend - resources[i].starttime) : "0"; console.log("... start until response end time = " + t); } } resource size measu
rements the size of an application's resources can affect an application's performance so getting accurate data on resource size can be important (especially for non-hosted resources). the performanceresourcetiming interface has three properties that can be used to obtain size data about a resource. the transfersize property returns the size (in octets) of the fetched resource including the response...
...ources). the performanceresourcetiming interface has three properties that can be used to obtain size data about a resource. the transfersize property returns the size (in octets) of the fetched resource including the response header fields plus the response payload body. the encodedbodysize property returns the size (in octets) received from the fetch (http or cache), of the payload body, before
removing any applied content-codings. decodedbodysize returns the size (in octets) received from the fetch (http or cache) of the message body, after
removing any applied content-codings. the following example demonstrates using these three properties. function display_size_data(){ // check for support of the performanceresourcetiming.*size properties and print their values // if supported. i...
... + "] = not supported"); } } managing the resource buffer although the browser is required to support at least 150 resource timing performance entries in its resource timing buffer, some applications may use more resources than that limit. to help the developer manage the buffer size, resource timing defines two methods that extend the performance interface. the clearresourcetimings() method
removes all "resource" type performance entries from the browser's resource performance entry buffer. the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the specified number of resource performance entries. the following example demonstrates the usage of these two methods. function clear_resource_timings() { if (performance === undefined) { console.log...
Using Service Workers - Web APIs
this article provides information on getting started with service workers, including basic architecture, registering a service worker, the install and activation process for a new service worker, updating your service worker, cache control and custom responses, all in the context of a simple app with offline functionality. the p
remise of service workers one overriding problem that web users have suffered with for years is loss of connectivity. the best web app in the world will provide a terrible user experience if you can’t download it. there have been various attempts to create technologies to solve this problem, and some of the issues have been solved. but the overriding problem is that there still isn’t a good overall control mechanism for asset caching and custom network reques...
...lling the new cache v2, so the previous v1 cache isn't disturbed. when no pages are using the current version, the new worker activates and becomes responsible for fetches. deleting old caches you also get an activate event. this is a generally used to do stuff that would have broken the previous version while it was still running, for example getting rid of old caches. this is also useful for
removing data that is no longer needed to avoid filling up too much disk space — each browser has a hard limit on the amount of cache storage that a given service worker can use. the browser does its best to manage disk space, but it may delete the cache storage for an origin. the browser will generally delete all of the data for an origin or none of the data for an origin. promises passed into w...
...iceworker-internals, which shows more detail and allows you to start/stop/debug the worker process. in the future they will have throttling/offline modes to simulate bad or non-existent connections, which will be a really good thing. firefox has also started to implement some useful tools related to service workers: you can navigate to about:debugging to see what sws are registered and update/
remove them. when testing you can get around the https restriction by checking the "enable service workers over http (when toolbox is open)" option in the firefox developer tools settings. the "forget" button, available in firefox's customization options, can be used to clear service workers and their caches (bug 1252998). note: you may serve your app from http://localhost (e.g. using me@localho...
SourceBuffer - Web APIs
buffer.trackdefaults specifies the default values to use if kind, label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.
remove() operation is currently in progress. sourcebuffer.videotracks read only a list of the video tracks currently contained inside the sourcebuffer. event handlers sourcebuffer.onabort fired whenever sourcebuffer.appendbuffer() or sourcebuffer.appendstream() is ended by a call to sourcebuffer.abort(). sourcebuffer.updating changes from true to false. sourcebuffer.onerror fired whenever ...
...dbuffer() or sourcebuffer.appendstream() is ended by a call to sourcebuffer.abort(). sourcebuffer.updating changes from true to false. sourcebuffer.onerror fired whenever an error occurs during sourcebuffer.appendbuffer() or sourcebuffer.appendstream(). sourcebuffer.updating changes from true to false. sourcebuffer.onupdate fired whenever sourcebuffer.appendbuffer() method or the sourcebuffer.
remove() completes. sourcebuffer.updating changes from true to false. this event is fired before onupdateend. sourcebuffer.onupdateend fired whenever sourcebuffer.appendbuffer() method or the sourcebuffer.
remove() has ended. this event is fired after onupdate. sourcebuffer.onupdatestart fired whenever the value of sourcebuffer.updating transitions from false to true. methods inherits methods f...
...he process of asynchronously appending the specified buffer to the sourcebuffer. returns a promise which is fulfilled once the buffer has been appended. sourcebuffer.appendstream() appends media segment data from a readablestream object to the sourcebuffer. sourcebuffer.changetype() changes the mime type that future calls to appendbuffer() will expect the new data to conform to. sourcebuffer.
remove()
removes media segments within a specific time range from the sourcebuffer. sourcebuffer.
removeasync() starts the process of asynchronously
removing media segments in the specified range from the sourcebuffer. returns a promise which is fulfilled once all matching segments have been
removed. examples the following simple example loads a video chunk by chunk as fast as possible, playin...
SpeechSynthesisVoice.localService - Web APIs
syntax var amilocal = speechsynthesisvoiceinstance.localservice; value a boolean. ...
... syntax var amilocal = speechsynthesisvoiceinstance.localservice; value a boolean. ...
... syntax var amilocal = speechsynthesisvoiceinstance.localservice; value a boolean. ...
TouchEvent - Web APIs
the touchevent interface represents an uievent which is sent when the state of contacts with a touch-sensitive surface changes. this surface can be a touch screen or trackpad, for example. the event can describe one or more points of contact with the screen and includes support for detecting movement, addition and
removal of contact points, and so forth. touches are represented by the touch object; each touch is described by a position, size and shape, amount of pressure, and target element. lists of touches are represented by touchlist objects. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" v...
....0 touch event types there are several types of event that can be fired to indicate that touch-related changes have occurred. you can determine which of these has happened by looking at the event's touchevent.type property. touchstart sent when the user places a touch point on the touch surface. the event's target will be the element in which the touch occurred. touchend sent when the user
removes a touch point from the surface (that is, when they lift a finger or stylus from the surface). this is also sent if the touch point moves off the edge of the surface; for example, if the user's finger slides off the edge of the screen. the event's target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that elem...
..., when they lift a finger or stylus from the surface). this is also sent if the touch point moves off the edge of the surface; for example, if the user's finger slides off the edge of the screen. the event's target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that element. the touch point (or points) that were
removed from the surface can be found in the touchlist specified by the changedtouches attribute. touchmove sent when the user moves a touch point along the surface. the event's target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that element. this event is also sent if the values of the radius, rotation angle, o...
Using Touch Events - Web APIs
h surface), thus enhancing user experiences. the touch events interfaces support application specific single and multi-touch interactions such as a two-finger gesture. a multi-touch interaction starts when a finger (or stylus) first touches the contact surface. other fingers may subsequently touch the surface and optionally move across the touch surface. the interaction ends when the fingers are
removed from the surface. during this interaction, an application receives touch events during the start, move, and end phases. the application may apply its own semantics to the touch inputs. interfaces touch events consist of three interfaces (touch, touchevent and touchlist) and the following event types: touchstart - fired when a touch point is placed on the touch surface. touchmove - fired...
...e start, move, and end phases. the application may apply its own semantics to the touch inputs. interfaces touch events consist of three interfaces (touch, touchevent and touchlist) and the following event types: touchstart - fired when a touch point is placed on the touch surface. touchmove - fired when a touch point is moved along the touch surface. touchend - fired when a touch point is
removed from the touch surface. touchcancel - fired when a touch point has been disrupted in an implementation-specific manner (for example, too many touch points are created). the touch interface represents a single contact point on a touch-sensitive device. the contact point is typically referred to as a touch point or just a touch. a touch is usually generated by a finger or stylus on a touchsc...
... target dom element. changedtouches - a list of the touch points whose items depends on the associated event type: for the touchstart event, it is a list of the touch points that became active with the current event. for the touchmove event, it is a list of the touch points that have changed since the last event. for the touchend event, it is a list of the touch points that have been
removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface). together, these interfaces define a relatively low-level set of features, yet they support many kinds of touch-based interaction, including the familiar multi-touch gestures such as multi-finger swipe, rotation, pinch and zoom. from interfaces to gestures an application may co...
Using the User Timing API - Web APIs
re named by the application and can be set at any location in an application. measure events are also named by the application but they are placed between two marks thus they are effectively a midpoint between two marks. this document shows how to create mark and measure performance entry types and how to use user timing methods (which are extensions of the performance interface) to retrieve and
remove entries from the browser's performance timeline. a live version of the examples is available on github, as is the source code. pull requests, enhancement requests and bug reports are welcome. performance marks a performance mark is a named performance entry that is created by the application at some location in an application. the mark is a timestamp in the browser's performance timeline. ...
...nce.getentriesbyname("mark-1","mark"); for (var i=0; i < entries.length; i++) { if (i == 0) log("= getentriesbyname('mark-1', 'mark')", 0); log("... " + entries[i].name, 0); } entries = performance.getentriesbyname("mark-2","mark"); for (var i=0; i < entries.length; i++) { if (i == 0) log("= getentriesbyname('mark-2', 'mark')", 0); log("... " + entries[i].name, 0); } }
removing performance marks the performance.clearmarks() method is used to
remove one or more marks from the browser's performance timeline. if a specific mark name is given to this method, only the mark(s) with that name will be
removed. however, if no argument is given, then all performance entries of type "mark" will be
removed from the performance timeline. the following example demostrates both ...
...asure-1","measure"); for (var i=0; i < entries.length; i++) { if (i == 0) log("= getentriesbyname('measure-1', 'measure')", 1); log("... " + entries[i].name, 1); } entries = performance.getentriesbyname("measure-2","measure"); for (var i=0; i < entries.length; i++) { if (i == 0) log("= getentriesbyname('measure-2', 'measure')", 1); log("... " + entries[i].name, 1); } }
removing performance measures the performance.clearmeasures() method is used to
remove measures from the browser's performance timeline. if the method is called with a specific measure name, all measures with that name will be
removed from the timeline. if the method is called with no arguments, all performance entries with a type of "measure" will be
removed from the timeline. the following example...
Using bounded reference spaces - Web APIs
which the user is able to move around physically in the real world while being tracked by the xr hardware, with their movements being then transposed into the simulation. the boundaries established by the bounded reference space, then, represent the edges of the safely passable, tracked space in the user's real world environment that are available for their movement while in the simulation. requi
rements because a bounded reference space establishes a limited area in which the user can move, it naturally imposes a limit on how large the simulated environment can be. it's difficult (and would probably be fairly confusing) to create a virtual world that's larger than the physical space available to the user if you're mapping their real-world movement into the virtual environment. imagine how u...
... move, it naturally imposes a limit on how large the simulated environment can be. it's difficult (and would probably be fairly confusing) to create a virtual world that's larger than the physical space available to the user if you're mapping their real-world movement into the virtual environment. imagine how uncomfortable it would feel if you moved 100 meters each time you took a step! the requi
rements, then, for a bounded reference space are: xr hardware that can track the user's movement in the real world, such as a camera-based system. a physical space with enough room to move around safely. basics the xrreferencespacetype of all bounded reference spaces is bounded-floor. this is the only type of bounded reference space currently available; in all others, if you need boundaries, y...
...audio warning, or the like. and if the user actually collides with the boundary, don't let them continue past it. <<<--- example --->>> creating a bounded reference space before creating a project that relies on bounded reference spaces, it's important to keep in mind that not all xr devices are capable of creating them. by their very nature, bounded reference spaces have special hardware requi
rements, since they need to allow for the user to physically move around in space while their movements are tracked. in this section, we'll look at how to safely create a session that will work whether bounded spaces are supported or not. safely creating a bounded-preferred space before actually attempting to create a bounded reference space, you need to create a session that supports them. since n...
Fundamentals of WebXR - Web APIs
ognizing and reproducing into the virtual scene. diagram showing the movements possible with 3 degree of freedom hardware: yaw, roll, and pitch. freedom of rotational movement the first three degrees of freedom are rotational. the rotational degrees of freedom are: pitch: looking up and down yaw: looking left and right roll: tilting left and right in all of these cases, the viewer
remains in the same location in space while pivoting on one or more of the three axes to alter the direction in which they're looking. a system with two degrees of freedom can sense when the user looks left and right or up and down, but can't report any other kind of movement. a typical baseline headset offers three degrees of freedom, recognizing rotation around all three axes. this is often referr...
...creasingly commonly, using infrared cameras that detect the user's movements. speakers placed around the chamber provide immersive sound as well. these are not common among everyday users; they're mostly either experimental, used for demonstration purposes, or used by larger organizations. one drawback is that the cave can't simulate anything closer than the wall. important health and safety
reminders because the entire act of creating a virtual 3d world is, in essence, a trick which takes advantage of our understanding of how eyes collect light and how the brain interprets the collected data, it is important to keep in mind that as such, software designers and developers have a responsibility to be even more careful than usual to ensure that the results are correct. virtual reality si...
..., it's a good idea to try to ensure that the user isn't prompted or tempted to move in such a way that they pull or yank on the headset cord, which could not only cause injury, but could cause significant damage to the user's headset or device (whether it's a phone or a computer). if you have any content that may be of risk to any users, you should provide a warning message. likewise, it's worth
reminding users to
remain seated if possible, and to be cautious about moving around while wearing a headset if the experience is fully-immersive virtual reality. it's always better to be safe than sorry! the role of frameworks because 3d graphics—and mixed reality in particular—involve a lot of often intricate math, data management, and other complex tasks, it's unlikely that you'll directly u...
Lighting a WebXR setting - Web APIs
ed upon it—to perform all rendering, texturing, and lighting of a scene, the same general lighting concepts apply to webxr settings or scenes as to any other webgl-generated display. however, there are issues and details to keep in mind while creating your lighting code, especially for augmented reality (ar) applications. this guide discusses these topics. and while this article provides brief
reminders as to how lighting works in general, it is not by any means a tutorial in lighting or a guide to how to create a properly-lit 3d scene. flashback: simulating lighting in 3d although this article isn't a comprehensive guide to lighting a 3d scene, it's useful to provide a brief
reminder as to how lighting works in general. fundamentally, simulating lighting in a virtual scene involves comp...
...mation, avoiding having that information directly correlate to the state of the lighting is another way browsers can protect users from fingerprinting attacks. by simply ensuring that the compass direction and the light directionality aren't identical on every device that's near (or claims to be near) the user's location, the ability to find users based on the state of the lighting around them is
removed. wwhen the browser provides details about a very bright, directional light source, that source probably represents the sun. the directionality of this bright light source combined with the time of day can be used to determine the user's geographic location without involving the geolocation api. by ensuring that the coordinates of the ar scene don't align with compass coordinates, and by redu...
...cation can no longer be accurately estimated using this technique. temporal and spatial filtering consider an attack that uses a building's automated lighting system to flash the lights on and off quickly in a known pattern. without proper precautions, the lighting estimation data could be used to detect this pattern and thus determine that a user is in a particular location. this could be done
remotely, or it could be performed by an attacker who's located in the same room but wants to determine if the other person is also in the same room. another scenario in which lighting estimation can be used to obtain information about the user without permission: if the light sensor is close enough to the user's display to detect lighting changes caused by the contents of the display, an algorithm ...
Movement, orientation, and motion: A WebXR example - Web APIs
we do is call requestanimationframe() to request that drawframe() be called again for the next frame to be rendered. then we pass the object's reference space into the applyviewercontrols() function, which returns a revised xrreferencespace that transforms the position and orientation of the object to take into account the movement, pitch, and yaw applied by the user using the keyboard and mouse.
remember that, as always, the world's objects are moved and reoriented, not the viewer. the returned reference space makes it easy for us to do just that. with the new reference space in hand, we get the xrviewerpose representing the viewer's point of view—for both of their eyes. if that's successful, we begin preparing to render by getting the xrwebgllayer being used by the session and binding it...
...poses, but to also move and reorient it to simulate the viewer's motion through the space. then the view's normal matrix is computed by taking the model view matrix, inverting it, and transposing it (swapping its columns and rows). the last few lines of code added for this example are four calls to displaymatrix(), a function which displays the contents of a matrix for analysis by the user. the
remainder of the function is identical or essentially identical to the older webgl sample from which this code is derived. displaying a matrix for instructive purposes, this example displays the contents of the important matrices used while rendering the scene. the displaymatrix() method is used for this; this function uses mathml to render the matrix, falling back to a more array-like format if ma...
...extures whose dimensions are powers of two in webgl 1. webgl 2 supports arbitratily-sized textures for mipmapping. ispowerof2() returns true if the specified value is a power of two; otherwise returns false. putting it all together when you take all of this code and add in the html and the other javascript code not included above, you get what you see when you try out this example on glitch.
remember: as you wander around, if you get lost, just hit the r key to reset yourself to the beginning. a tip: if you don't have an xr device, you may be able to get some of the 3d effect if you bring your face very close to the screen, with your nose centered along the border between the left and right eye images in the canvas. by carefully focusing through the screen at the image, and slowly movin...
Advanced techniques: Creating and sequencing audio - Web APIs
ce.buffer = audiobuffer; samplesource.playbackrate.setvalueattime(playbackrate, audioctx.currenttime); samplesource.connect(audiocontext.destination) samplesource.start(); return samplesource; } note: the sound file was sourced from soundbible.com. playing the audio in time a common problem with digital audio applications is getting the sounds to play in time so that the beat
remains consistent, and things do not slip out of time. audiocontext object instances have a currenttime property, which allows us to retrieve the number of seconds after we first created the context. this is what we shall use for timing within our step sequencer — it's ext
remely accurate, returning a float value accurate to about 15 decimal places. we could schedule our voices to play within a f...
...w.settimeout(scheduler, lookahead); } we also need a draw function to update the ui, so we can see when the beat progresses. let lastnotedrawn = 3; function draw() { let drawnote = lastnotedrawn; let currenttime = audioctx.currenttime; while (notesinqueue.length && notesinqueue[0].time < currenttime) { drawnote = notesinqueue[0].note; notesinqueue.splice(0,1); //
remove note from queue } // we only need to draw if the note has moved. if (lastnotedrawn != drawnote) { pads.foreach(function(el, i) { el.children[lastnotedrawn].style.bordercolor = 'hsla(0, 0%, 10%, 1)'; el.children[drawnote].style.bordercolor = 'hsla(49, 99%, 50%, 1)'; }); lastnotedrawn = drawnote; } // set up to draw again ...
...en that disappears when the file has been fetched and decoded, then we can allow the scheduler to start using the play button click event. ...
Web Bluetooth API - Web APIs
the web bluetooth api provides the ability to connect and interact with bluetooth low energy peripherals. interfaces bluetooth returns a promise to a bluetoothdevice object with the specified options. bluetoothadvertisingdata provides advertising data about a particular bluetooth device. bluetoothcharacteristicproperties provides properties of a particular bluetooth
remotegattcharacteristic. ...
...es bluetooth returns a promise to a bluetoothdevice object with the specified options. bluetoothadvertisingdata provides advertising data about a particular bluetooth device. bluetoothcharacteristicproperties provides properties of a particular bluetooth
remotegattcharacteristic. bluetoothdevice represents a bluetooth device inside a particular script execution environment. ...
... bluetooth device. bluetoothcharacteristicproperties provides properties of a particular bluetooth
remotegattcharacteristic. bluetoothdevice represents a bluetooth device inside a particular script execution environment. bluetooth
remotegattcharacteristic represents a gatt characteristic, which is a basic data element that provides further information about a peripheral’s service. bluetooth
remotegattdescriptor represents a gatt descriptor, which provides further information about a characteristic’s value. bluetooth
remotegattserver represents a gatt server on a
remote device. bluetooth
remotegattservice represents a service provided by a gatt server, including a device, a list of referenced services, and a list of the characteristics of this service. specifications spe...
Web Storage API - Web APIs
a different storage object is used for the sessionstorage and localstorage for each origin — they function and are controlled separately. note: from firefox 45 onwards, when the browser crashes/restarts, the amount of data saved per origin is limited to 10mb. this has been done to avoid memory issues caused by excessive usage of web storage. note: access to web storage from third-part...
...e: access to web storage from third-party iframes is denied if the user has disabled third-party cookies (firefox implements this behaviour from version 43 onwards.) note: web storage is not the same as mozstorage (mozilla's xpcom interfaces to sqlite) or the session store api (an xpcom storage utility for use by extensions). web storage interfaces storage allows you to set, retrieve and
remove data for a specific domain and storage type (session or local.) window the web storage api extends the window object with two new properties — window.sessionstorage and window.localstorage — which provide access to the current domain's session and local storage objects respectively, and a window.onstorage event handler that fires when a storage area changes (e.g. a new item is stored.) ...
...typical web storage usage, we have created a simple example, imaginatively called web storage demo. the landing page provides controls that can be used to customize the colour, font and decorative image. when you choose different options, the page is instantly updated; in addition your choices are stored in localstorage, so that when you leave the page then load it again later on your choices are
remembered. in addition, we have provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage information outputted as the storageevent is fired. specifications specification status comment html living standard living standard ...
Window.pageYOffset - Web APIs
precise, so it may not be an integer. a value of 0.0 indicates that the window is not scrolled vertically, and that the top of the document is located at the top edge of the window's content area. since this property is an alias for window.scrolly, see that article for additional details on this value and its use. example var contenthtml = ` <h2 id="introduction">introduction</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. aenean volutpat vitae felis non dictum. ut auctor eros tortor, vel elementum arcu rhoncus nec. donec non laoreet massa. donec pretium nisi et condimentum convallis. nullam dictum molestie finibus. nullam vitae lo
rem non augue mattis cursus.</p> <p>maecenas nec tortor tincidunt, sollicitudin mi eget, fermentum turpis. vestibulum ac ante et liber...
... fermentum turpis. vestibulum ac ante et libero efficitur faucibus id eget ex. pellentesque tempor pharetra tincidunt. suspendisse potenti. nulla vulputate nunc sit amet hendrerit faucibus. nullam metus dui, venenatis lacinia nunc nec, vestibulum viverra nunc. quisque interdum quam tortor, sit amet varius neque consectetur at. quisque vel turpis justo.</p> <h2 id="overview">overview</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. etiam dui dolor, pulvinar sed diam id, eleifend dapibus odio. duis vitae ante nibh. integer bibendum imperdiet suscipit. fusce ligula leo, consectetur ac ante eget, gravida laoreet purus. cras sodales efficitur risus, sed feugiat sem. pellentesque justo augue, placerat non leo sit amet, laoreet fringilla arcu.</p> <p>class aptent taciti sociosq...
...cinia.</p> `; document.getelementbyid("frame").contentdocument .body.innerhtml = contenthtml; in this example, an <iframe> is created and filled with content, then a specific element within the document is scrolled into view in the frame. once that's done, the vertical scroll position is checked by looking at the value of pageyoffset in the frame's contentwindow. html the html is ext
remely simple and has just two elements: an <iframe> that contains the document we're going to scroll, and a <div> into which we'll output the value of pageyoffset when we've finished the scroll. <iframe id="frame"> </iframe> <div id="info"> </div> javascript var frame = document.getelementbyid("frame"); var framedoc = frame.contentdocument; var info = document.getelementbyid("info"); var target...
XRInputSourcesChangeEvent.added - Web APIs
nput sources, each identified using an xrinputsource object, which have been newly made available for use. syntax let addedinputs = xrinputsourceschangeevent.added; value an array of zero or more xrinputsource objects, each representing one input device added to the xr system. ...
... object, which have been newly made available for use. syntax let addedinputs = xrinputsourceschangeevent.added; value an array of zero or more xrinputsource objects, each representing one input device added to the xr system. examples the example below creates a handler for the inputsourceschange event that processes the lists of added and
removed from the webxr system. it looks for new and
removed devices whose targetraymode is tracked-pointer. ...
... creates a handler for the inputsourceschange event that processes the lists of added and
removed from the webxr system. it looks for new and
removed devices whose targetraymode is tracked-pointer. xrsession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetraymode == "tracked-pointer") { addedpointerdevice(input); } } for (let input of event.
removed) { if (input.targetraymode == "tracked-pointer") {
removedpointerdevice(input); } } }; specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeevent.added' in that specification. working draft initial definition. ...
Web APIs
udioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse authenticatorresponse b baseaudiocontext basiccardrequest basiccardresponse batterymanager beforeinstallpromptevent beforeunloadevent biquadfilternode blob blobbuilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetooth
remotegattcharacteristic bluetooth
remotegattdescriptor bluetooth
remotegattserver bluetooth
remotegattservice body broadcastchannel budgetservice budgetstate buffersource bytelengthqueuingstrategy bytestring c cdatasection css cssconditionrule csscounterstylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathva...
...e cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyledeclaration cssstylerule cssstylesheet cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascaptu
remediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode cou...
...dentialtype rtcicegathererstate rtciceparameters rtciceprotocol rtcicerole rtciceserver rtcicetcpcandidatetype rtcicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtc
remoteoutboundrtpstreamstats rtcrtcpparameters rtcrtpcapabilities rtcrtpcodeccapability rtcrtpcodecparameters rtcrtpcontributingsource rtcrtpencodingparameters rtcrtpparameters rtcrtpreceiveparameters rtcrtpreceiver rtcrtpsendparameters rtcrtpsender rtcrtpstreamstats rtcrtpsynchronizationsource rtcrtptransceiver rtcrtptransceiverdirection rtcrtptransceiverinit rtcsctptransport rtcsessiondescription...
Using the aria-hidden attribute - Accessibility
this technique demonstrates how to use the aria-hidden attribute. the aria-hidden attribute can either expose or hide non-interactive content from the accessibility api. description adding aria-hidden="true" to an element
removes that element and all of its children from the accessibility tree. this can improve the experience for assistive technology users by hiding: purely decorative content, such as icons or images duplicated content, such as repeated text offscreen or collapsed content, such as menus according to the fourth rule of aria, aria-hidden="true" should not be used on a focusable element. additionally, since this attribute is inherited by an element's children, it should not be added onto the parent or ancestor of a focusable element. using aria-hidden="false" wil...
...ue", role="presentation", and role="none" on the surface, the aria-hidden="true", role="presentation", and role="none" attributes seem similar because they: hide content from assistive technology cannot be used on a focusable element cannot be used on the parent of an interactive element despite these similarities, the intent behind each attribute is different. aria-hidden="true" will
remove the entire element from the accessibility api. role="presentation" and role="none" will
remove the semantic meaning of an element while still exposing it to assistive technology. values false (default) the element is exposed to the accessibility api. true the element is not exposed to the accessibility api. undefined (default) the user agent determines if the element is exposed...
... specifications see also using the presentation role role="none" ...
ARIA: timer role - Accessibility
the timer role indicates to assistive technologies that an element is a numerical counter listing the amount of elapsed time from a starting point or the
remaining time until an end point. <div role="timer" id="eggtimer">0</div> this defines this div element as a timer with no
remaining time. description the timer role indicates to assistive technologies that this part of the web content is a live region containing a timer listing the time
remaining or elapsed time. a timer's inner text should be an updating current time measu
rement. while the value does not necessarily need to be machine parsable, it should continuously update at regular intervals unless the timer is paused or reaches its end-point. associated wai-aria roles, states, and properties aria-label used to provide the...
...her parts of the page, must be handled. use wisely, and cautiously! examples some prominent web timers include clocks, stop watches and countdowns, such as ticketing websites, e-commerce sites, and event countdowns (see https://countingdownto.com/). as an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes. ...
...ted each minute, with the new
remaining time simply overwriting the current content. <div id="clock" role="timer" aria-live="off">20</div> <button onclick="starttimer('clock')">start</button> /* basic javascript to update a timer */ function starttimer(timername) { // get the number of seconds let timer = document.getelementbyid(timername), seconds = parseint(timer.innertext); //
remove a second // updated the content of timer timer.innertext = --seconds // if timer != 0, settimeout if (seconds) { settimeout( function() { starttimer(timername); }, 1000); } } the first time the function executes, the entirety of the string that is added will be announced. on subsequent calls, only the parts of the content that changed compared to the previous conten...
ARIA: gridcell role - Accessibility
-619-5098</div> … </div> the first rule of aria is if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding aria. instead use the native html td element in conjunction with the and contenteditable attribute: <td>potato</td> <td>cabbage</td> <td>onion</td> description gridcells with dynamically added, hidden, or
removed rows and columns any element with a role="gridcell" applied to it should use aria to describe its order in the table-style grouping, provided the table, grid, or treegrid has the ability to have rows and/or columns dynamically added, hidden, or
removed. use aria-colindex to describe a gridcell's order in the list of columns, and aria-rowindex to describe a gridcell's order in the list of ro...
...
removed. use aria-colindex to describe a gridcell's order in the list of columns, and aria-rowindex to describe a gridcell's order in the list of rows. use aria-colcount and aria-rowcount on the parent element with role="grid" applied to it to set the total number of columns or rows. this sample code demonstrates a table-style grouping of information where the third and fourth columns have been
removed. ...
... use aria-colcount and aria-rowcount on the parent element with role="grid" applied to it to set the total number of columns or rows. this sample code demonstrates a table-style grouping of information where the third and fourth columns have been
removed. ...
ARIA: switch role - Accessibility
n accessible event is fired using the system's accessibility api if one is available and it supports the switch role. all elements that are descendants of an element with the switch role applied to it are automatically assigned role presentation. this prevents elements that are used to construct the switch from being interacted with individually by assistive technologies. text in these elements
remains visible to the user agent and may be read or otherwise delivered to the user, unless it's expressly hidden using display: none or aria-hidden="true". the assistive technology, if it supports the switch role, responds by doing the following: screen readers should announce the element as a switch, optionally providing instructions as to how to activate the switch. there are varying opin...
...are varying opinions on how assistive technologies should handle this role; the above is a suggested practice and may differ from other sources. examples the following examples should help you understand how to apply and use the switch role. adding the switch role in aria this simple example just creates a widget and assigns the aria switch role to it. the button is styled with an appearance
reminiscent of an on/off power switch. html the html is fairly simple here. the switch is implemented as a <button> element which is initially checked courtesy of its aria-checked attribute being set to "true". the switch has two child elements containing the "off" and "on" labels and is followed by a <label> identifying the switch. <button role="switch" aria-checked="true" id="speakerpower"...
... button.switch { margin: 0; padding: 0; width: 70px; height: 26px; border: 2px solid black; display: inline-block; margin-right: 0.25em; line-height: 20px; vertical-align: middle; text-align: center; font: 12px "open sans", "arial", serif; } button.switch span { padding: 0 4px; pointer-events: none; } [role="switch"][aria-checked="...
ARIA: button role - Accessibility
essed="true" is used the button is a toggle button that is currently pressed. if aria-pressed="mixed" is used, the button is considered to be partially pressed. as an example, the mute button on an audio player labeled "mute" could indicate that sound is muted by setting the aria-pressed state true. the label of a toggle button should not change when its state changes. in our example the label
remains "mute" with a screen reader reading "mute toggle button pressed" or "mute toggle button not pressed" depending on the value of aria-pressed. if the design were to call for the button label to change from "mute" to "unmute," a toggle button would not be appropriate, so the the aria-pressed attribute would be omitted. keyboard interactions key function enter activates ...
... focus is set depending on the type of action the button performs. for example, if clicking the button opens a dialog, the focus should move to the dialog. if the button closes a dialog, focus should returns to the button that opened the dialog unless the function performed in the dialog context logically leads to a different element. if the button alters the current context, then focus typically
remains on the button, such as muting and unmuting an audio file. required javascript features required event handlers buttons can be operated by mouse, touch, and keyboard users. for native html <button> elements, the button's onclick event fires for mouse clicks and when the user presses space or enter while the button has focus. but if another tag is used to create a button, the onclick event o...
...tter solution is to adjust the visual design so it matches the function and aria role. where possible, it is recommended to use native html buttons (<button>, <input type="button">, <input type="submit">, <input type="reset"> and <input type="image">) rather than the button role, as native html buttons are supported by all user agents and assistive technology and provide keyboard and focus requi
rements by default, without need for additional customization. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'button' in that specification. recommendation wai-aria authoring practicesthe definition of 'button' in that specification. working draft notes aria attributes used button aria-press...
ARIA: checkbox role - Accessibility
the checkbox role is used for checkable interactive controls. elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology. ...
...similarly, an element with role="checkbox" can expose three states through the aria-checked attribute: true, false, or mixed. ...
...amples the following example creates a simple checkbox element using css and javascript to handle the checked or unchecked status of the element. ...
An overview of accessible web applications and widgets - Accessibility
te that there is no custom classname used, only the status of the aria-hidden attribute on line 1. example 2b. attribute-based selector for indicating state div.tooltip[aria-hidden="true"] { display: none; } the javascript to update the aria-hidden property has the form shown in example 2c. ...
... for example, consider an "inline edit" widget: a component that allows users to edit a piece of text in place, without switching contexts. ...
...dit a piece of text in place, without switching contexts. this component has a "view" mode, in which the text is not editable, but is activatable, and an "edit" mode, in which the text can be edited. a developer might be tempted to implement the "view" mode using a read-only text <input> element and setting its aria role to button, then switching to "edit" mode by making the element writable and
removing the role attribute in "edit" mode (since <input> elements have their own role semantics). do not do this. instead, implement the "view" mode using a different element altogether, such as a <div> or <span> with a role of button, and the « edit » mode using a text <input> element. asynchronous content changes under construction. see also live regions keyboard navigation often times dev...
Accessibility documentation index - Accessibility
ns, the document role can inform assistive technologies to switch context to a reading mode: the document role tells assistive technologies with reading or browse modes to use the document mode to read the content contained within this element. 61 aria: feed role aria, aria role, reference, feed a feed is a dynamic scrollable list of articles in which articles are added to or
removed from either end of the list as the user scrolls. a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads. 62 aria: figure role aria, aria role, aria figure, accessibility, reference, rôle, figure the aria figure role can be...
... 76 aria: textbox role aria, accessibility, needscontent the textbox role is used to identify an element that allows the input of free-form text. 77 aria: timer role aria, aria role, aria widget, reference, role timer the timer role indicates to assistive technologies that an element is a numerical counter the amount of elapsed time from a starting point or the
remaining time until an end point. 78 web applications and aria faq aria, accessibility, guide wai-aria is the accessible rich internet applications specification from the web accessibility initiative at the w3c. aria provides a means to make web applications and widgets more accessible to a diverse range of users, including those who use assistive technologies such as screen rea...
...sed of <div> and <span> elements that do not, by nature, offer the same keyboard functionality that their desktop counterparts do. this document describes techniques to make javascript widgets accessible with the keyboard. 94 mobile accessibility checklist accessibility, firefox os, guidelines, mobile, checklist this document provides a concise checklist of accessibility requi
rements for mobile app developers. it is intended to continuously evolve as more patterns arise. 95 understanding the web content accessibility guidelines wcag, web content accessibility guidelines this set of articles provides quick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility ...
Keyboard-navigable JavaScript widgets - Accessibility
keyboards. authors can also make a <div> or <span> keyboard accessible by adding a tabindex of 0. this is particularly useful for components that use interactive elements that do not exist in html. grouping controls for grouping widgets such as menus, tablists, grids, or tree views, the parent element should be in the tab order (tabindex="0"), and each descendent choice/tab/cell/row should be
removed from the tab order (tabindex="-1"). users should be able to navigate the descendent elements using arrow keys. (for a full description of the keyboard support that is normally expected for typical widgets, see the wai-aria authoring practices.) the example below shows this technique used with a nested menu control. once keyboard focus lands on the containing <ul> element, the javascript deve...
... managing focus inside groups when a user tabs away from a widget and returns, focus should return to the specific element that had focus, for example, the tree item or grid cell. there are two techniques for accomplishing th...
...ft" tabindex="-1">left</li> <li id="center" tabindex="-1">centered</li> <li id="right" tabindex="-1">right</li> <li id="justify" tabindex="-1">justify</li> </ul> </li> </ul> disabled controls when a custom control becomes disabled,
remove it from the tab order by setting tabindex="-1". note that disabled items within a grouped widget (such as menu items in a menu) should
remain navigable using arrow keys. managing focus inside groups when a user tabs away from a widget and returns, focus should return to the specific element that had focus, for example, the tree item or grid cell. there are two techniques for accomplishing this: roving tabindex: programmatically moving focus aria-activedescendant: managing a 'virtual' focus technique 1: roving tabindex setti...
:target - CSS: Cascading Style Sheets
e. once targeted, the css changes their display so that they are shown. note: a more complete pure-css lightbox based on the :target pseudo-class is available on github (demo). html <ul> <li><a href="#example1">open example #1</a></li> <li><a href="#example2">open example #2</a></li> </ul> <div class="lightbox" id="example1"> <figure> <a href="#" class="close"></a> <figcaption>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. donec felis enim, placerat id eleifend eu, semper vel sem.</figcaption> </figure> </div> <div class="lightbox" id="example2"> <figure> <a href="#" class="close"></a> <figcaption>cras risus odio, pharetra nec ultricies et, mollis ac augue. nunc et diam quis sapien dignissim auctor. quisque quis neque arcu, nec gravid...
...issim auctor. ...
...{ position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } /* lightbox content */ .lightbox figcaption { width: 25
rem; position: relative; padding: 1.5em; background-color: lightpink; } /* close button */ .lightbox .close { position: relative; display: block; } .lightbox .close::after { right: -1
rem; top: -1
rem; width: 2
rem; height: 2
rem; position: absolute; display: flex; z-index: 1; align-items: center; justify-content: center; background-color: black; border-radius: 50%; color: white; content: "×"; cursor: pointer; } /* lightbox overlay */ .lightbox .close::before { left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(...
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
ve the same in grid by combining auto-fit and the minmax() function. in this next example, i create auto filled tracks with minmax. i want my tracks to be a minimum of 200 pixels, so i set the maximum to be 1fr. once the browser has worked out how many times 200 pixels will fit into the container–also taking account of grid gaps–it will treat the 1fr maximum as an instruction to share out the
remaining space between the items. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> </div> .wrapper { display: g...
...hat the item is taking the area from grid column line 2 to 4, and starting after line 1. then it is offset in that area using the top and left properties. however, it has been taken out of flow as is usual for absolutely positioned items and so the auto-placement rules now place items into the same space. the item also doesn’t cause the additional row to be created to span to row line 3. if we
remove position: absolute from the rules for .box3 you can see how it would display without the positioning. a grid container as parent if the absolutely positioned child has a grid container as a parent but that container does not create a new positioning context, then it is taken out of flow as in the previous example. the positioning context will be whatever element creates a positioning context...
...e how it would display without the positioning. a grid container as parent if the absolutely positioned child has a grid container as a parent but that container does not create a new positioning context, then it is taken out of flow as in the previous example. the positioning context will be whatever element creates a positioning context as is common to other layout methods. in our case, if we
remove position: relative from the wrapper above, positioning context is from the viewport, as shown in this image. once again the item no longer participates in the grid layout in terms of sizing or when other items are auto-placed. with a grid area as the parent if the absolutely positioned item is nested inside a grid area then you can create a positioning context on that area. in the below e...
Consistent list indentation - CSS: Cascading Style Sheets
problem altogether, it's necessary to examine the details of list construction. making a list first, we consider a single, pure list item. this list item has no marker (otherwise known as a "bullet") and is not yet part of a list itself. it hangs alone in the void, simple and unadorned, as shown in figure 1. that dotted red border represents outer edges of the content-area of the list item.
remember that, at this point, the list item has no padding or borders. if we add two more list items, we get a result like that shown in figure 2. now we wrap these in a parent element; in this case, we'll wrap them in an unordered list (i.e., <ul>). according to the css box model, the list items' boxes must be displayed within the parent element's content area. since that parent has no padding or...
...e <ul> element. if we apply a background color to the <ul> element and leave the list item and <ul> borders in place, we get the result shown in figure 5. gecko, on the other hand, sets a left padding of 40 pixels for the <ul> element, so given the exact same styles as were used to produce figure 5, loading the example into a gecko-based browser gives us figure 6. as we can see, the markers
remain attached to the <li> elements, no matter where they are. the difference is entirely in how the <ul> is styled. we can only see the difference if we try to set a background or border on the <ul> element. finding consistency boil it all down, and what we're left with is this: if you want consistent rendering of lists between gecko, internet explorer, and opera, you need to set both the left ma...
...ollowing the internet explorer/opera model, then: ul {margin-left: 40px; padding-left: 0;} of course, you can fill in your own preferred values. set both to 1.25em, if you like -- there's no reason why you have to stick with pixel-based indentation. if you want to reset lists to have no indentation, then you still have to zero out both padding and margin: ul {margin-left: 0; padding-left: 0;}
remember, though, that in so doing, you'll have the bullets hanging outside the list and its parent element. if the parent is the body, there's a strong chance your bullets will be completely outside the browser window, and thus will not be visible. conclusion in the end, we can see that none of the browsers mentioned in this article is right or wrong about how they lay out lists. they use differen...
Column layouts - CSS: Cascading Style Sheets
you will often need to create a layout which has a number of columns, and css provides several ways to do this. whether you use grid, flexbox or multi-column layout will depend on what you are trying to achieve, and in this recipe we explore these options. requi
rements there are a number of design patterns you might want to achieve with your columns: a continuous thread of content broken up into newspaper-style columns. a single row of items arranged as columns, with all heights being equal. ...
...the columns must all be the same size, and you are unable to target an individual column or the content of an individual column. ...
...ad of content broken up into newspaper-style columns. a single row of items arranged as columns, with all heights being equal. multiple rows of columns lined up by row and column. the recipes you need to choose different layout methods in order to achieve your requi
rements. a continuous thread of content — multi-column layout if you create columns using multi-column layout your text will
remain as a continuous stream filling each column in turn. the columns must all be the same size, and you are unable to target an individual column or the content of an individual column. you can control the gaps between columns with the column-gap property, and add a rule between columns using column-rule. download this example use multicol when: you want your text to display in newspaper-...
Grid wrapper - CSS: Cascading Style Sheets
the grid wrapper pattern is useful for aligning grid content within a central wrapper, while also allowing items to break out and align to the edge of the containing element or page when desired. requi
rements items placed on the grid should be able to align to a horizontally-centered max-width wrapper and/or the outer edges of the grid. recipe download this example choices made this recipe uses the css grid minmax() function to define the grid track sizes in the grid-template-columns property. ...
...outer edges of the grid. recipe download this example choices made this recipe uses the css grid minmax() function to define the grid track sizes in the grid-template-columns property. for the central columns with a maximum width we can set a minimum value of 0 or greater and a maximum value that specifies the maximum size the column tracks will grow to. using a numeric unit (pixels, ems,
rems) will create a fixed maximum size for the central wrapper, whereas using percentage values or viewport units will mean this wrapper grows or shrinks in response to its context. the outer two columns have a maximum size of 1fr, meaning that they will each expand to fill the
remaining available space in the grid container. useful fallbacks or alternative methods when using this recipe at page l...
... maximum size of 1fr, meaning that they will each expand to fill the
remaining available space in the grid container. ...
Viewport concepts - CSS: Cascading Style Sheets
ls, of the browser window viewport including, if rendered, the vertical scrollbar. the window.outerwidth is the width of the outside of the browser window including all the window chrome. in an experiment with these, the innerwidth and outerwidth was seen to be the same, but the outerheight was 100px taller than the innerheight. this is because the outerheight includes the browser chrome: measu
rements were taken on a browser with an address bar and bookmarks bar totalling 100px in height, but no chrome on the left or right of the window. the area within the innerheight and innerwidth is generally considered the layout viewport. the browser chrome is not considered part of the viewport. when zoomed in, both firefox and chrome report the new css pixel size for innerwidth and clientwidth. t...
...900 in chrome */ the viewport was originally 1200 x 800 pixels. upon zooming in, the viewport became 800 x 533 pixels. this is the layout viewport. sticky headers or footers, with the following styles, will stick to the top and bottom of the layout viewport respectively. body > header { position: fixed; top: 0; } body > footer { position: fixed; bottom: 0; } we got the 800 x 533 measu
rement when we zoomed in using the keyboard. the header and footer stayed flush against the top and bottom of the window. but what if we had pinched-zoomed on a tablet? what if a dynamic keyboard pops open on a phone? the web contains two viewports, the layout viewport and the visual viewport. the visual viewport is the part of the web page that is currently visible in the browser and can change. wh...
......
border-image-outset - CSS: Cascading Style Sheets
ide the element's border box with border-image-outset do not trigger overflow scrollbars and don't capture mouse events. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
..., and the third to the bottom. if four values are specified, they apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the border-image outset as a dimension — a number with a unit. <number> the size of the border-image outset as a multiple of the element's corresponding border-widths. for example, if an element has border-width: 1em 2px 0 1.5
rem, and border-image-outset: 2, the final border-image-outset would be calculated as 2em 4px 0 3
rem. formal definition initial value0applies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typeby computed value type formal sy...
...al table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typeby computed value type formal syntax [ <length> | <number> ]{1,4} examples outsetting a border image html <div id="outset">this element has an outset border image!</div> css #outset { width: 10
rem; background: #cef; border: 1.4
rem solid; border-image: radial-gradient(#ff2, #55f) 40; border-image-outset: 1.5; /* 1.5 × 1.4
rem = 2.1
rem */ margin: 2.1
rem; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-outset' in that specification. candidate recommendation initial ...
border-image-repeat - CSS: Cascading Style Sheets
stributed in between tiles to achieve the proper fit. formal definition initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse. ...
...les to achieve the proper fit. formal definition initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse. ...
...e proper fit. formal definition initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse. ...
border-image-width - CSS: Cascading Style Sheets
epository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if this property's value is greater than the element's border-width, the border image will extend beyond the padding (and/or content) edge. ...
...elative lengths converted into absolute lengthsanimation typeby computed value type formal syntax [ <length-percentage> | <number> | auto ]{1,4}where <length-percentage> = <length> | <percentage> examples tiling a border image this example creates a border image using the following ".png" file, which is 90 by 90 pixels: thus, each circle in the source image is 30 by 30 pixels. ...
... following ".png" file, which is 90 by 90 pixels: thus, each circle in the source image is 30 by 30 pixels. html <p>lo
rem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. ...
break-inside - CSS: Cascading Style Sheets
s of paragraphs laid out in multiple columns using column-width: 200px. we also have a <figure> containing an image and a caption. by default, it is possible for you to get a break between the image and its caption, which is not what we want. to avoid this, we have set break-inside: avoid on the <figure>, which causes them to always stay together. html <article> <h1>main heading</h1> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla vitae fringilla mauris. quisque commodo eget nisi sed pretium. mauris luctus nec lacus in ultricies. mauris vitae hendrerit arcu, ac scelerisque lacus. aliquam lobortis in lacus sit amet posuere. fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <figure> <img src="https://udn.realityripple.com/samples/fe/4508d88f78.p...
...pit. quisque consequat velit eu orci malesuada, ut interdum tortor molestie. proin sed pellentesque augue. nam risus justo, faucibus non porta a, congue vel massa. cras luctus lacus nisl, sed tincidunt velit pharetra ac. ...
... candidate recommendation no change. ...
counter() - CSS: Cascading Style Sheets
unter() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse. check the browser compatibility table carefully before using this in production. syntax values <custom-ident> a name identifying the counter, which is the same case-sensitive name used for the counter-reset and counter-inc
rement. the name cannot start with two dashes and can't be none, unset, initial, or inherit. <counter-style> a counter style name or symbols() function, where a counter style name is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east asian or ethiopic predefined counter style, or other predefined counter style. if omitted, the counter-style defaults to decim...
...predefined counter style. ...
...i></li> <li></li> <li></li> </ol> css ol { counter-reset: listcounter; } li { counter-inc
rement: listcounter; } li::after { content: "[" counter(listcounter) "] == [" counter(listcounter, upper-roman) "]"; } result decimal-leading-zero compared to lower-alpha html <ol> <li></li> <li></li> <li></li> </ol> css ol { counter-reset: count; } li { counter-inc
rement: count; } li::after { content: "[" counter(count, decimal-leading-zero) "] == [" counter(count, lower-alpha) "]"; } result specifications specification status comment css lists module level 3the definition of 'css counters' in that specification. working draft no change css level 2 (revision 1)the definition of 'css counters' in ...
counters() - CSS: Cascading Style Sheets
ters() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse. check the browser compatibility table carefully before using this in production. syntax values <custom-ident> a name identifying the counters, which is the same case-sensitive name used for the counter-reset and counter-inc
rement. the name cannot start with two dashes and can't be none, unset, initial, or inherit. <counter-style> a counter style name or symbols() function, where a counter style name is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east asian or ethiopic predefined counter style, or other predefined counter style. if omitted, the counter-style defaults to decim...
...red to upper roman html <ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li></li> <li></li> <li> <ol> <li></li> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> </ol> </li> </ol> css ol { counter-reset: listcounter; } li { counter-inc
rement: listcounter; } li::marker { content: counters(listcounter, '.', upper-roman) ') '; } li::before { content: counters(listcounter, ".") " == " counters(listcounter, ".", lower-roman) ; } result decimal-leading-zero compared to lower-alpha html <ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li></li> <li></li> <li> <ol> ...
... working draft no change css l...
display - CSS: Cascading Style Sheets
selves. they are replaced by their pseudo-box and their child boxes. please note that the css display level 3 spec defines how the contents value should affect "unusual elements" — elements that aren’t rendered purely by css box concepts such as replaced elements. see appendix b: effects of display: contents on unusual elements for more details. due to a bug in browsers this will currently
remove the element from the accessibility tree — screen readers will not look at what's inside. see the accessibility concerns section below for more details. none turns off the display of an element so that it has no effect on layout (the document is rendered as though the element did not exist). all descendant elements also have their display turned off. to have an element take up the space th...
... display: contents current i...
...nt realizing common layouts using grids accessibility concerns display: none using a display value of none on an element will
remove it from the accessibility tree. this will cause the element and all its descendant elements to no longer be announced by screen reading technology. if you want to visually hide the element, a more accessible alternative is to use a combination of properties to
remove it visually from the screen but keep it parseable by assistive technology such as screen readers. display: contents current implementations in most browsers will
remove from the accessibility tree any element with a display value of contents (but descendants will
remain). this will cause the element itself to no longer be announced by screen reading technology. this is incorrect behavior acc...
font-size - CSS: Cascading Style Sheets
larger, smaller relative-size keywords. the font will be larger or smaller relative to the parent element's font size, roughly by the ratio used to separate the absolute-size keywords above. <length> a positive <length> value. for most font-relative units (such as em and ex), the font size is relative to the parent element's font size. for font-relative units that are root-based (such as
rem), the font size is relative to the size of the font used by the <html> (root) element. <percentage> a positive <percentage> value, relative to the parent element's font size. note: to maximize accessibility, it is generally best to use values that are relative to the user's default font size. description there are several ways to specify the font size, including with keywords or num...
...n>inner</span> outer</span> </div> the result is: assuming that the browser's default font-size is 16px, the words “outer” would be rendered at 16px, but the word “inner” would be rendered at 25.6px. this is because the inner <span>'s font-size is 1.6em which is relative to its parent's font-size, which is in turn relative to its parent's font-size. this is often called compounding.
rems
rem values were invented in order to sidestep the compounding problem.
rem values are relative to the root html element, not the parent element. in other words, it lets you specify a font size in a relative fashion without being affected by the size of the parent, thereby eliminating compounding. the css below is nearly identical to the previous example. the only exception is that the unit has...
...e invented in order to sidestep the compounding problem.
rem values are relative to the root html element, not the parent element. in other words, it lets you specify a font size in a relative fashion without being affected by the size of the parent, thereby eliminating compounding. the css below is nearly identical to the previous example. the only exception is that the unit has been changed to
rem. html { font-size: 62.5%; /* font-size 1em = 10px on default browser settings */ } span { font-size: 1.6
rem; } then we apply this css to the same html, which looks like this: <span>outer <span>inner</span> outer</span> in this example, the words “outer inner outer” are all displayed at 16px (assuming that the browser's font-size has been left at the default value of 10px). formal ...
hyphens - CSS: Cascading Style Sheets
formal definition initial valuemanualapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | manual | auto examples specifying text hyphenation this example uses three classes, one for each possible configuration of the hyphens property. ...
...o examples specifying text hyphenation this example uses three classes, one for each possible configuration of the hyphens property. ...
... <dt><code>none</code>: no hyphen; overflow if needed</dt> <dd lang="en" class="none">an ext
reme­ly long english word</dd> <dt><code>manual</code>: hyphen only at &hyphen; or &shy; (if needed)</dt> <dd lang="en" class="manual">an ext
reme­ly long english word</dd> <dt><code>auto</code>: hyphens where the algorithm decides (if needed)</dt> <dd lang="en" class="auto">an ext
reme­ly long english word</dd> </dl> css dd { width: 55px; border: 1px solid black; } dd.none { -webkit-hyphens: none; -ms-hyphens: none; hyphens: none; } dd.manual { -webkit-hyphens: manual; -ms-hyphens: manual; hyphens: manual; } dd.auto { -webkit-hyphens: auto; -ms-hyphens: auto; hyphens: auto; } result specifications specification status commen...
margin - CSS: Cascading Style Sheets
in to use. for example, in certain cases this value can be used to center an element. ...
... for example, in certain cases this value can be used to center an element. ...
... margin that is equal to the larger of the two margins. see mastering margin collapsing for more information. specifications specification status comment css basic box modelthe definition of 'margin' in that specification. working draft no significant change. css level 2 (revision 1)the definition of 'margin' in that specification. recommendation
removes the effect of top and bottom margins on inline elements. css level 1the definition of 'margin' in that specification. recommendation initial definition. initial valueas each of the properties of the shorthand:margin-bottom: 0margin-left: 0margin-right: 0margin-top: 0applies toall elements, except elements with table display types other than table-caption, table and inlin...
revert - CSS: Cascading Style Sheets
s current value to the value the property would have had if no changes had been made by the current style origin to the current element. thus, it resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent's stylesheet (or by user styles, if any exist). it can be applied to any css property, including the css shorthand all. this
removes from the cascade all of the styles that have been overridden until the style being rolled back to is reached. if used by a site's own styles (the author origin), revert rolls back the property's cascaded value to the user's custom style, if one exists; otherwise, it rolls the style back to the user agent's default style. if used in a user's custom stylesheet, or if the style was applied b...
...tyle. if used within the user agent's default styles, this keyword is functionally equivalent to unset. the revert keyword works exactly the same as unset in many cases. the only difference is for properties that have values set by the browser or by custom stylesheets created by users (set on the browser side). revert will not affect rules applied to children of an element you reset (but will
remove effects of a parent rule on a child). so if you have a color: green for all sections and all: revert on a specific section the color of the section will be black. but if you have a rule to make all paragraphs red then all paragraphs will still be red in all sections. revert is just a value. it is still possible to override revert value using specificity. the revert keyword is different fr...
... iterate on above example instead of reverting font-weight and color separately you could just revert all of them. h3 { font-weight: normal; color: blue; border-bottom: 1px solid grey; } <h3>this will have custom styles</h3> <p>just some text</p> <h3 style="all: revert">this should be reverted to browser/user defaults</h3> <p>just some text</p> revert on a parent reverting effectively
removes the value for the element you select with some rule and only for that element. to illustrate this we will set a green color on a section and red color on a paragraph. section { color: darkgreen } p { color: red } section.with-revert { color: revert } <section> <h3>this will be dark green</h3> <p>text in paragraph will be red.</p> this will also be dark green. </section> <section clas...
scroll-margin-inline - CSS: Cascading Style Sheets
:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: end, which specifies that the right-hand edges (the "ends" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin-inline: 1
rem; } .scroller > div:nth-child(3) { scroll-margin-inline: 2
rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1
rem outside the inline end edge of the second <div>, and 2
rems outside the inline end edge of the third <div>. note: here we are setting scroll-margin on the start and end of the inline axis (x in our case), but only the end edge is reall...
... result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-inline' in that specification. ...
... result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-inline' in that specification. ...
scroll-margin - CSS: Cascading Style Sheets
gin: inherit; scroll-margin: initial; scroll-margin: unset; values <length> an outset from the corresponding edge of the scroll container. description you can see the effect of scroll-margin by scrolling to a point partway between two of the "pages" of the example's content. the value specified for scroll-margin determines how much of the page that's primarily outside the snapport should
remain visible. thus, the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets. formal definition initial value0applies toall e...
... div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points. last of all we specify the scroll margin-values, a different one for the second and third child elements: .scroller > div:nth-child(2) { scroll-margin: 1
rem; } .scroller > div:nth-child(3) { scroll-margin: 2
rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1
rem outside the left edge of the second <div>, and 2
rems outside the left edge of the third <div>. note: here we are setting scroll-margin on all sides at once, but only the start edge is really relevant. it would work just as well here to only ...
...crolling past the middle child elements, the scrolling will snap to 1
rem outside the left edge of the second <div>, and 2
rems outside the left edge of the third <div>. note: here we are setting scroll-margin on all sides at once, but only the start edge is really relevant. it would work just as well here to only set a scroll margin on that one edge, for example with scroll-margin-inline-start: 1
rem, or scroll-margin: 0 0 0 1
rem. result try it for yourself: specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin' in that specification. candidate recommendation initial definition ...
text-indent - CSS: Cascading Style Sheets
n initial value0applies toblock containersinheritedyespercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute length, plus any keywords as specifiedanimation typea length, percentage or calc(); formal syntax <length-percentage> && hanging? ...
... absolute length, plus any keywords as specifiedanimation typea length, percentage or calc(); formal syntax <length-percentage> && hanging? ...
...um dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> <p>lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> css p { text-indent: 5em; background: powderblue; } result percentage indent html <p>lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> <p>lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> css p { text-indent: 30%; background: plum; } result specifications specific...
text-justify - CSS: Cascading Style Sheets
like japanese. distribute exhibits the same behaviour as inter-character; this value is kept for backwards compatibility. formal definition initial valueautoapplies toinline-level and table-cell elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | inter-character | inter-word | none examples <p class="none"><code>text-justify: none</code> —<br>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, lobortis pretium quam. quisque sed nisi pulvinar, consequat justo id, feugiat leo. cras eu elementum dui.</p> <p class="auto"><code>text-justify: auto</code> —<br>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, dictum i...
...id, feugiat leo. cras eu elementum dui.</p> <p class="auto"><code>text-justify: auto</code> —<br>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, lobortis pretium quam. quisque sed nisi pulvinar, consequat justo id, feugiat leo. cras eu elementum dui.</p> <p class="dist"><code>text-justify: distribute</code> —<br>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, lobortis pretium quam. quisque sed nisi pulvinar, consequat justo id, feugiat leo. cras eu elementum dui.</p> <p class="word"><code>text-justify: inter-word</code> —<br>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, di...
...nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, lobortis pretium quam. quisque sed nisi pulvinar, consequat justo id, feugiat leo. ...
text-overflow - CSS: Cascading Style Sheets
ng are required for text-overflow */ white-space: nowrap; overflow: hidden; } .overflow-visible { white-space: initial; } .overflow-clip { text-overflow: clip; } .overflow-ellipsis { text-overflow: ellipsis; } .overflow-string { /* not supported in most browsers, see the 'browser compatibility' section below */ text-overflow: " [..]"; } html <p class="overflow-visible">lo
rem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-clip">lo
rem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-ellipsis">lo
rem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-string">lo
rem ipsum dolor sit amet, consectetur adipisicing elit.</p> result note: live results in the following table may be shown incorrect...
...elit.</p> <p class="overflow-clip">lo
rem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-ellipsis">lo
rem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-string">lo
rem ipsum dolor sit amet, consectetur adipisicing elit.</p> result note: live results in the following table may be shown incorrectly due to a limitation of the mdn editor which
removes the all contents of style attributes which have text-overflow properties with string value. css value direction: ltr direction: rtl expected result live result expected result live result visible overflow 1234567890 1234567890 0987654321 1234567890 text-overflow: clip 1234567890 1...
... ...
text-underline-position - CSS: Cascading Style Sheets
ne to be below the text. when used with alphabetic text, using the auto keyword will lead to a similar effect. ...
...nition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | from-font | [ under | [ left | right ] ] examples a simple example let's take a couple of simple example paragraphs: <p class="horizontal">lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur ac turpis vel laoreet. nullam volutpat pharetra lo
rem, sit amet feugiat tortor volutpat quis. nam eget sodales quam. aliquam accumsan tellus ac erat posuere.</p> <p class="vertical">lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur ac turpis vel laoreet. nullam volutpat pharetra lo
rem, sit amet feugiat tortor volutpat quis. nam eget sodales quam. aliquam accumsan tellus ac erat posuere.</p> our css looks like this: p { ...
...iat tortor volutpat quis. nam eget sodales quam. aliquam accumsan tellus ac erat posuere.</p> <p class="vertical">lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur ac turpis vel laoreet. nullam volutpat pharetra lo
rem, sit amet feugiat tortor volutpat quis. nam eget sodales quam. aliquam accumsan tellus ac erat posuere.</p> our css looks like this: p { font-size: 1.5
rem; text-transform: capitalize; text-decoration: underline; text-decoration-thickness: 2px; } .horizontal { text-underline-position: under; } .vertical { writing-mode: vertical-rl; text-underline-position: left; } in this example we set both the paragraphs to have a thick underline. in the horizontal text we use text-underline-position: under; to put the underline below all the descen...
visibility - CSS: Cascading Style Sheets
lity css property shows or hides an element without changing the layout of a document. the property can also hide rows or columns in a <table>. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. to both hide an element and
remove it from the document layout, set the display property to none instead of using visibility. syntax /* keyword values */ visibility: visible; visibility: hidden; visibility: collapse; /* global values */ visibility: inherit; visibility: initial; visibility: unset; the visibility property is specified as one of the keyword values listed below. values visible the element box is visible. ...
... hidden the element box is invisible (not drawn), but still affects layout as normal. descendants of the element will be visible if they have visibility set to visible. the element cannot receive focus (such as when navigating through tab indexes). collapse for <table> rows, columns, column groups, and row groups, the row(s) or column(s) are hidden and the space they would have occupied is
removed (as if display: none were applied to the column/row of the table). however, the size of other rows and columns is still calculated as though the cells in the collapsed row(s) or column(s) are present. this value allows for the fast
removal of a row or column from a table without forcing the recalculation of widths and heights for the entire table. collapsed flex items are hidden, and the spa...
...applied to the column/row of the table). however, the size of other rows and columns is still calculated as though the cells in the collapsed row(s) or column(s) are present. this value allows for the fast
removal of a row or column from a table without forcing the recalculation of widths and heights for the entire table. collapsed flex items are hidden, and the space they would have occupied is
removed. for xul elements, the computed size of the element is always zero, regardless of other styles that would normally affect the size, although margins still take effect. for other elements, collapse is treated the same as hidden. accessibility concerns using a visibility value of hidden on an element will
remove it from the accessibility tree. this will cause the element and all its descen...
Making content editable - Developer guides
, you can transform your web page into a full and fast rich text editor. this article provides some information about this functionality. note: in firefox 63 beta/dev edition, some of the rich-text editing features have been disabled by default, for better cross-browser compatibility. these are object resizing on <img>, <table>, and absolutely-positioned elements; inline table editing to add or
remove rows and columns; and the grabber that allows moving of absolutely-positioned elements. see bug 1449564 and firefox-specific html editing ui has been deprecated for additional details. how does it work? all you have to do is set the contenteditable attribute on nearly any html element to make it editable. here's a simple example which creates a <div> element whose contents the user can edi...
...nes4eeujvigapwyac0csocq7sdlwjkakca6tomywiargqf3mrqviejkksvlibsfewhdrih4fh/dzmice3/c4nbqbads=" /> <img class="intlink" title="redo" onclick="formatdoc('redo');" src="data:image/gif;base64,r0lgodlhfgawamihab1chdljwl9vj1ie34kl8apd+7/i1////yh5baekaacalaaaaaawabyaaankelrc/jdksesyphi7siegsvxzeatdicqbvjjpqwzt9naednbqk1wcqsxlynxmaimhydofaeljasrrvazvrqqqxuy7cgx4tc6bswkaow==" /> <img class="intlink" title="
remove formatting" onclick="formatdoc('
removeformat')" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8f...
...rly2txqf9vj414wzwibxmorpqbmpgjudclfaezxsa0cb/i1+3yitha7prkiphvbups+/fvrvv8/f///////////////////////////////////////////////yh5baeaab8alaaaaaawabyaaawn4ceozgmeakqubgsuspvbsyfjjvds6njlb0khr4akbcmfscgbqaocwjf5gwquvyksfbwze+awibv0ghfog2ewidchjwriqo9e2fx4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lo
rem ipsum</p></div> <p id="editmode"><input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your editor in your page, please see our more complete rich-text editor examp...
Introduction to HTML5 - Developer guides
html5 is the fifth revision and newest version of the html standard. it offers new features that provide not only rich media support but also enhance support for creating web applications that can interact with users, their local data, and servers more easily and effectively than was previously possible. some html5 features
remain unsupported by some browsers. however, gecko, and by extension, firefox, has very good support for html5, and work continues toward supporting more of its features. gecko began supporting some html5 features in version 1.8.1. you can find a list of all of the html5 features that gecko currently supports on the main html5 page. for detailed information about multiple browsers' support of html5 features, refer to the caniuse website. declaring that the docum...
...t your html content uses html5, simply use: <!doctype html> doing so will cause even browsers that don't presently support html5 to enter into standards mode, which means that they'll interpret the long-established parts of html in an html5-compliant way while ignoring the new features of html5 they don't support. this is much simpler than the former doctypes, and shorter, making it easier to
remember and reducing the amount of bytes that must be downloaded. declaring the character set with the <meta charset> the first thing done on a page is usually indicating the character set that is used. in previous versions of html, it was done using a very complex <meta> element. now, it is very simple: <meta charset="utf-8"> place this right after your <head>, as some browsers restart the pars...
...he introduction of html5, only the meaning of valid mark-up was defined, meaning that as soon as one small error was made in the mark-up (most websites have at least one), the behavior was undefined. essentially, it meant that all browsers behaved differently, which is no longer the case. now, faced with errors in the mark-up, all compliant browsers must behave exactly in the same way. this requi
rement helps web developers quite a bit. while it is true that all modern browsers now use these html5 parsing rules, non-html5-compliant browsers are still used by some. keep in mind that it's still highly recommended that one writes valid mark-up, as such code is easier to read and maintain, and it greatly decreases the prominence of incompatibilities that exists in various older browsers. don't w...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
vel browsing context (the one named _top). allow-top-navigation-by-user-activation: lets the resource navigate the top-level browsing context, but only if initiated by a user gesture. notes about sandboxing: when the embedded document has the same origin as the embedding page, it is strongly discouraged to use both allow-scripts and allow-same-origin, as that lets the embedded document
remove the sandbox attribute — making it no more secure than not using the sandbox attribute at all. sandboxing is useless if the attacker can display content outside a sandboxed iframe — such as if the viewer opens the frame in a new tab. such content should be also served from a separate origin to limit potential damage. the sandbox attribute is unsupported in internet explorer 9 and earlie...
... a sandboxed iframe — such as if the viewer opens the frame in a new tab. such content should be also served from a separate origin to limit potential damage. the sandbox attribute is unsupported in internet explorer 9 and earlier. src the url of the page to embed. use a value of about:blank to embed an empty page that conforms to the same-origin policy. also note that programatically
removing an <iframe>'s src attribute (e.g. via element.
removeattribute()) causes about:blank to be loaded in the frame in firefox (from version 65), chromium-based browsers, and safari/ios. srcdoc inline html to embed, overriding the src attribute. if a browser does not support the srcdoc attribute, it will fall back to the url in the src attribute. width the width of the frame in css pixels. def...
...nd safari/ios. srcdoc inline html to embed, overriding the src attribute. if a browser does not support the srcdoc attribute, it will fall back to the url in the src attribute. width the width of the frame in css pixels. default is 300. deprecated attributes these attributes are deprecated and may no longer be supported by all user agents. you should not use them in new content, and try to
remove them from existing content. align the alignment of this element with respect to the surrounding context. frameborder the value 1 (the default) draws a border around this frame. the value 0
removes the border around this frame, but you should instead use the css property border to control <iframe> borders. longdesc a url of a long description of the frame's content. due to widespr...
<input type="date"> - HTML: Hypertext Markup Language
e: <input type="date" name="party" min="2017-04-01" max="2017-04-30"> </label> </form> the result is that only days in april 2017 can be selected — the month and year parts of the textbox will be uneditable, and dates outside april 2017 can't be selected in tte picker widget. note: you should be able to use the step attribute to vary the number of days jumped each time the date is inc
remented (e.g. to only make saturdays selectable). however, this does not seem to be in any implementation at the time of writing. controlling input size <input type="date"> doesn't support form sizing attributes such as size. prefer css for sizing it. validation by default, <input type="date"> doesn't validate the entered value beyond its format. the interfaces generally don't let you enter any...
... if(month === 'january' | month === 'march' | month === 'may' | month === 'july' | month === 'august' | month === 'october' | month === 'december') { daynum = 31; } else if(month === 'april' | month === 'june' | month === 'september' | month === 'november') { ...
... specifications specification status comments html living standardthe definition of '<input type="date">' in that specification. living standard html5the definition of '<input type="date">' in that specification...
<input type="password"> - HTML: Hypertext Markup Language
hat the pattern is treated as a sequence of unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requi
rements are to match the pattern. you should also include other explanatory text nearby. use of a pattern is strongly recommended for password inputs, in order to help ensure that valid passwords using a wide assortment of character classes are selected and used by your users. with a pattern, you can mandate case rules, require the use of some number of digits and/or punctuation characters, and so ...
...). mobile devices with virtual keyboards, for example, may opt to switch to a numeric keypad layout instead of a full keyboard, to make entering the password easier. if the pin is for one-time use, set the autocomplete attribute to either off or one-time-code to suggest that it's not saved. <label for="pin">pin: </label> <input id="pin" type="password" inputmode="numeric"> setting length requi
rements as usual, you can use the minlength and maxlength attributes to establish minimum and maximum acceptable lengths for the password. this example expands on the previous one by specifying that the user's pin must be at least four and no more than eight digits. the size attribute is used to ensure that the password entry control is eight characters wide. <label for="pin">pin:</label> <input id...
...) what range of characters in the control are currently selected, and selectiondirection to know which direction selection occurred in (or will be extended in, depending on your platform; see its documentation for an explanation). however, given that the text is obscured, the usefulness of these is somewhat limited. validation if your application has character set restrictions or any other requi
rement for the actual content of the entered password, you can use the pattern attribute to establish a regular expression to be used to automatically ensure that your passwords meet those requi
rements. in this example, only values consisting of at least four and no more than eight hexadecimal digits are valid. <label for="hexid">hex id: </label> <input id="hexid" type="password" pattern="[0-9a-fa...
<input type="week"> - HTML: Hypertext Markup Language
: <form> <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week"> </form> controlling input size <input type="week"> doesn't support form sizing attributes such as size. you'll have to resort to css for sizing needs. using the step attribute you should be able to use the step attribute to vary the number of weeks jumped whenever they are inc
remented or dec
remented, however it doesn't seem to have any effect on supporting browsers. validation by default, <input type="week"> does not apply any validation to entered values. the ui implementations generally don't let you specify anything that isn't a valid week/year, which is helpful, but it's still possible to submit with the field empty, and you might want to restrict the range of choos...
...orm with no value, the browser displays an error. try playing with the example now: here's'a screenshot for those of you who aren't using a supporting browser: important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to
remove it entirely. it's also possible for someone to simply bypass your html entirely and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data is submitted (or data which is too large, of the wrong type, and so forth). handling browser support as mentioned above, the major problem with using ...
... specifications specification status comments html living standardthe definition of '<input type="week">' in that specification. living standard ...
Clear-Site-Data - HTTP
d be cleared, the wildcard directive ("*") can be used. // single directive clear-site-data: "cache" // multiple directives (comma separated) clear-site-data: "cache", "cookies" // wild card clear-site-data: "*" directives all directives must comply with the quoted-string grammar. a directive that does not include the double quotes is invalid. "cache" indicates that the server wishes to
remove locally cached data (i.e. the browser cache, see http caching) for the origin of the response url. depending on the browser, this might also clear out things like pre-rendered pages, script caches, webgl shader caches, or address bar suggestions. "cookies" indicates that the server wishes to
remove all cookies for the origin of the response url. http authentication credentials are also clear...
...hader caches, or address bar suggestions. "cookies" indicates that the server wishes to
remove all cookies for the origin of the response url. http authentication credentials are also cleared out. this affects the entire registered domain, including subdomains. so https://example.com as well as https://stage.example.com, will have cookies cleared. "storage" indicates that the server wishes to
remove all dom storage for the origin of the response url. this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql...
...rver wishes to reload all browsing contexts for the origin of the response (location.reload). "*" (wildcard) indicates that the server wishes to clear all types of data for the origin of the response. if more data types are added in future versions of this header, they will also be covered by it. examples sign out of web site if a user signs out of your website or service, you might want to
remove locally stored data. you can achieve that by adding the clear-site-data header when sending the page confirming that logging out from the site has been accomplished successfully (https://example.com/logout, for example): clear-site-data: "cache", "cookies", "storage", "executioncontexts" clearing cookies if this header is delivered with the response at https://example.com/clear-cookies, all...
Set-Cookie - HTTP
like the following: ( ) < > @ , ; : \ " / [ ] ? = { }. a <cookie-value> can optionally be wrapped in double quotes and include any us-ascii characters excluding control characters, whitespace, double quotes, comma, semicolon, and backslash. encoding: many implementations perform url encoding on cookie values, however it is not required per the rfc specification. it does help satisfying the requi
rements about which characters are allowed for <cookie-value> though. __secure- prefix: cookies names starting with __secure- (dash is part of the prefix) must be set with the secure flag from a secure page (https). __host- prefix: cookies with names starting with __host- must be set with the secure flag, must be from a secure page (https), must not have a domain specified (and therefore aren't s...
...g, must be from a secure page (https), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /. expires=<date> optional the maximum lifetime of the cookie as an http-date timestamp. see date for the required formatting. if unspecified, the cookie becomes a session cookie. a session finishes when the client shuts down, and session cookies will be
removed. warning: many web browsers have a session restore feature that will save all tabs and restore them next time the browser is used. session cookies will also be restored, as if the browser was never closed. when an expires date is set, the deadline is relative to the client the cookie is being set on, not the server. max-age=<number> optional number of seconds until the cookie expi...
...t a cookie must not be sent with cross-origin requests, providing some protection against cross-site request forgery attacks (csrf). browsers are migrating to have cookies default to samesite=lax. if a cookie is needed to be sent cross-origin, opt out of the samesite restriction using the none value. the none value requires the secure attribute. examples session cookie session cookies are
removed when the client shuts down. cookies are session cookies if they don't specify the expires or max-age attributes. set-cookie: sessionid=38afes7a8 permanent cookie instead of expiring when the client is closed, permanent cookies expire at a specific date (expires) or after a specific length of time (max-age). set-cookie: id=a3fwa; expires=wed, 21 oct 2015 07:28:00 gmt set-cookie: id=a3fwa...
Proxy Auto-Configuration (PAC) file - HTTP
ainhostname(host) || dnsdomainis(host, ".mydomain.com") || isinnet(host, "198.95.0.0", "255.255.0.0") ) { return "direct"; } else { return "proxy proxy.mydomain.com:8080"; } } example 5 load balancing/routing based on url patterns this example is more sophisticated. there are four (4) proxy servers; one of them is a hot stand-by for all of the other ones, so if any of the
remaining three goes down the fourth one will take over. furthermore, the three
remaining proxy servers share the load based on url patterns, which makes their caching more effective (there is only one copy of any document on the three servers - as opposed to one copy on each of them). the load is distributed like this: proxy purpose #1 .com domain #2 .edu domain ...
...any document on the three servers - as opposed to one copy on each of them). the load is distributed like this: proxy purpose #1 .com domain #2 .edu domain #3 all other domains #4 hot stand-by all local accesses are desired to be direct. all proxy servers run on the port 8080 (they don't need to, you can just change your port but
remember to modify your configuations on both side). note how strings can be concatenated with the + operator in javascript. function findproxyforurl(url, host) { if (isplainhostname(host) || dnsdomainis(host, ".mydomain.com")) return "direct"; else if (shexpmatch(host, "*.com")) return "proxy proxy1.mydomain.com:8080; " + "proxy proxy4.mydomain.com:8080"; else if (shexpm...
...; else return "direct"; } note: the same can be accomplished using the shexpmatch() function described earlier. for example: // ... if (shexpmatch(url, "http:*")) { return "proxy http-proxy.mydomain.com:8080"; } // ... the autoconfig file can be output by a cgi script. this is useful, for example, when making the autoconfig file act differently based on the client ip address (the
remote_addr environment variable in cgi). usage of isinnet(), isresolvable() and dnsresolve() functions should be carefully considered, as they require the dns server to be consulted. all the other autoconfig-related functions are mere string-matching functions that don't require the use of a dns server. if a proxy is used, the proxy will perform its dns lookup which would double the impact on the d...
Grammar and types - JavaScript
element: fish[0] is "lion" fish[1] is undefined fish[2] is "angel" if you include a trailing comma at the end of the list of elements, the comma is ignored. in the following example, the length of the array is three. there is no mylist[3]. all other commas in the list indicate a new element. note : trailing commas can create errors in older browser versions and it is a best practice to
remove them. let mylist = ['home', , 'school', ]; in the following example, the length of the array is four, and mylist[0] and mylist[2] are missing. let mylist = [ ,'home', , 'school']; in the following example, the length of the array is four, and mylist[1] and mylist[3] are missing. only the last comma is ignored. let mylist = ['home', , 'school', , ]; understanding the behavior of extra...
...example, \u{2f804} is the same as the simple unicode escapes \ud87e\udc04. escaping characters for characters not listed in the table, a preceding backslash is ignored, but this usage is deprecated and should be avoided. you can insert a quotation mark inside a string by preceding it with a backslash. this is known as escaping the quotation mark. for example: var quote = "he read \"the c
remation of sam mcgee\" by r.w. service."; console.log(quote); the result of this would be: he read "the c
remation of sam mcgee" by r.w. service. to include a literal backslash inside a string, you must escape the backslash character. for example, to assign the file path c:\temp to a string, use the following: var home = 'c:\\temp'; you can also escape line breaks by preceding them with backs...
... var str = 'this string \ is broken \ across multiple \ lines.' console.log(str); // this string is broken across multiple lines. ...
JavaScript modules - JavaScript
yntaxerror: import declarations may only appear at top level of a module". you can only use import and export statements inside modules, not regular scripts. other differences between modules and standard scripts you need to pay attention to local testing — if you try to load the html file locally (i.e. with a file:// url), you'll run into cors errors due to javascript module security requi
rements. you need to do your testing through a server. also, note that you might get different behavior from sections of script defined inside modules as opposed to in standard scripts. this is because modules use strict mode automatically. there is no need to use the defer attribute (see <script> attributes) when loading a module script; modules are deferred automatically. modules are only execut...
...ample based on our classes example. this time however we are not drawing anything on the canvas when the example loads. instead, we include three buttons — "circle", "square", and "triangle" — that, when pressed, dynamically load the required module and then use it to draw the associated shape. in this example we've only made changes to our index.html and main.js files — the module exports
remain the same as before. over in main.js we've grabbed a reference to each button using a document.queryselector() call, for example: let squarebtn = document.queryselector('.square'); we then attach an event listener to each button so that when pressed, the relevant module is dynamically loaded and used to draw the shape: squarebtn.addeventlistener('click', () => { import('./modules/square.j...
...: .js files need to be loaded with a mime-type of text/javascript (or another javascript-compatible mime-type, but text/javascript is recommended), otherwise you'll get a strict mime type checking error like "the server responded with a non-javascript mime type". if you try to load the html file locally (i.e. with a file:// url), you'll run into cors errors due to javascript module security requi
rements. you need to do your testing through a server. github pages is ideal as it also serves .js files with the correct mime type. because .mjs is a non-standard file extension, some operating systems might not recognise it, or try to replace it with something else. for example, we found that macos was silently adding on .js to the end of .mjs files and then automatically hiding the file extension...
getter - JavaScript
roperty latest for object obj, which will return the last array item in log. const obj = { log: ['example','test'], get latest() { if (this.log.length === 0) return undefined; return this.log[this.log.length - 1]; } } console.log(obj.latest); // "test" note that attempting to assign a value to latest will not change it. deleting a getter using the delete operator if you want to
remove the getter, you can just delete it: delete obj.latest; defining a getter on existing objects using defineproperty to append a getter to an existing object later at any time, use object.defineproperty(). const o = {a: 0}; object.defineproperty(o, 'b', { get: function() { return this.a + 1; } }); console.log(o.b) // runs the getter, which yields a + 1 (which is 1) using a computed proper...
... of a property value and cache it for later access are smart (or "memoized") getters. the value is calculated the first time the getter is called, and is then cached so subsequent accesses return the cached value without recalculating it. this is useful in the following situations: if the calculation of a property value is expensive (takes much ram or cpu time, spawns worker threads, retrieves
remote file, etc). if the value isn't needed just now. it will be used later, or in some case it's not used at all. if it's used, it will be accessed several times, and there is no need to re-calculate that value will never be changed or shouldn't be re-calculated. this means that you shouldn’t write a lazy getter for a property whose value you expect to change, because if the getter is lazy t...
... you shouldn’t write a lazy getter for a property whose value you expect to change, because if the getter is lazy then it will not recalculate the value. note that getters are not “lazy” or “memozied” by nature; you must implement this technique if you desire this behavior. in the following example, the object has a getter as its own property. on getting the property, the property is
removed from the object and re-added, but implicitly as a data property this time. finally, the value gets returned. get notifier() { delete this.notifier; return this.notifier = document.getelementbyid('bookmarked-notification-anchor'); }, for firefox code, see also the xpcomutils.jsm code module, which defines the definelazygetter() function. get vs. defineproperty while using the get keywo...
Array.prototype.reduce() - JavaScript
is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the reducer function takes four arguments: accumulator (acc) current value (cur) current index (idx) source array (src) your reducer function's returned value is assigned to the accumulator, whose value is
remembered across each iteration throughout the array, and ultimately becomes the final, single resulting value. syntax arr.reduce(callback( accumulator, currentvalue, [, index[, array]] )[, initialvalue]) parameters callback a function to execute on each element in the array (except for the first, if no initialvalue is supplied). it takes four arguments: accumulator the accumulator...
... let myarray = ['a', 'b', 'a', 'b', 'c', 'e', 'e', 'c', 'd', 'd', 'd', 'd'] let myorderedarray = myarray.reduce(function (accumulator, currentvalue) { if (accumulator.i...
...e.books] }, ['alphabet']) // allbooks = [ // 'alphabet', 'bible', 'harry potter', 'war and peace', // 'romeo and juliet', 'the lord of the rings', // 'the shining' // ]
remove duplicate items in an array note: if you are using an environment compatible with set and array.from(), you could use let orderedarray = array.from(new set(myarray)) to get an array where duplicate items have been
removed. let myarray = ['a', 'b', 'a', 'b', 'c', 'e', 'e', 'c', 'd', 'd', 'd', 'd'] let myorderedarray = myarray.reduce(function (accumulator, currentvalue) { if (accumulator.indexof(currentvalue) === -1) { accumulator.push(currentvalue) } return accumulator }, []) console.log(myorderedarray) replace .filter().map() with .reduce() using array.filter() then array.map() traverses the arr...
Array.prototype.flatMap() - JavaScript
ple that better showcases the use of flatmap. let's generate a list of words from a list of sentences. let arr1 = ["it's sunny in", "", "california"]; arr1.map(x => x.split(" ")); // [["it's","sunny","in"],[""],["california"]] arr1.flatmap(x => x.split(" ")); // ["it's","sunny","in", "", "california"] notice, the output list length can be different from the input list length. for adding and
removing items during a map() flatmap can be used as a way to add and
remove items (modify the number of items) during a map. in other words, it allows you to map many items to many items (by handling each input item separately), rather than always one-to-one. in this sense, it works like the opposite of filter. simply return a 1-element array to keep the item, a multiple-element array to add items,...
...) flatmap can be used as a way to add and
remove items (modify the number of items) during a map. in other words, it allows you to map many items to many items (by handling each input item separately), rather than always one-to-one. in this sense, it works like the opposite of filter. simply return a 1-element array to keep the item, a multiple-element array to add items, or a 0-element array to
remove the item. ...
...
remove items (modify the number of items) during a map. in other words, it allows you to map many items to many items (by handling each input item separately), rather than always one-to-one. in this sense, it works like the opposite of filter. simply return a 1-element array to keep the item, a multiple-element array to add items, or a 0-element array to
remove the item. ...
Date.prototype.setHours() - JavaScript
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.sethours(hoursvalue[, minutesvalue[, secondsvalue[, msvalue]]]) versions prior to javascript 1.3 dateobj.sethours(hoursvalue) parameters hoursvalue ideally, an integer between 0 and 23, representing the hour. if a value greater than 23 is provided, the datetime will be inc
remented by the extra hours. minutesvalue optional. ideally, an integer between 0 and 59, representing the minutes. if a value greater than 59 is provided, the datetime will be inc
remented by the extra minutes. secondsvalue optional. ideally, an integer between 0 and 59, representing the seconds. if a value greater than 59 is provided, the datetime will be inc
remented by the extra seconds. if you...
...if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. ...
...scription if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getminutes(), getseconds(), and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, sethours() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be inc
remented by 1 (minutesvalue + 1), and 40 will be used for seconds. examples using sethours() var thebigday = new date(); thebigday.sethours(7); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.sethours' in that specification. ...
Map.prototype.delete() - JavaScript
mymap.has('bar'); // returns false. the "bar" element is no longer present. ...
...mymap.has('bar'); // returns false. the "bar" element is no longer present. ...
...the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax mymap.delete(key); parameters key the key of the element to
remove from the map object. return value true if an element in the map object existed and has been
removed, or false if the element does not exist. examples using delete() var mymap = new map(); mymap.set('bar', 'foo'); mymap.delete('bar'); // returns true. successfully
removed. mymap.has('bar'); // returns false. the "bar" element is no longer present. specifications specification ecmascript (ecma-262)the definition of 'map.prototype.delete' in that specification. ...
Map - JavaScript
any value (both objects and primitive values) may be used as either a key or a value. description a map object iterates its elements in insertion order — a for...of loop returns an array of [key, value] for each iteration. key equality key equality is based on the samevaluezero algorithm. nan is considered the same as nan (even though nan !== nan) and all other values are considered equal according to the semantics of the === operator. in the current ecmascript specification, -0 and +0 are considered equal, although this was not so in earlier drafts. see "value equality for -0 and 0" in the browser compatibility table for details. objects vs. ...
...e number of items in a map is easily retrieved from its size property. the number of items in an object must be determined manually. iteration a map is an iterable, so it can be directly iterated. iterating over an object requires obtaining its keys in some fashion and iterating over them. performance performs better in scenarios involving frequent additions and
removals of key-value pairs. not optimized for frequent additions and
removals of key-value pairs. setting object properties setting object properties works for map objects as well, and can cause considerable confusion. therefore, this appears to work in a way: let wrongmap = new map() wrongmap['bla'] = 'blaa' wrongmap['bla2'] = 'blaaa2' console.log(wrongmap) // map { bla:...
....delete('raymond') // false contacts.delete('jessie') // true console.log(contacts.size) // 1 constructor map() creates a new map object. static properties get map[@@species] the constructor function that is used to create derived objects. instance properties map.prototype.size returns the number of key/value pairs in the map object. instance methods map.prototype.clear()
removes all key-value pairs from the map object. map.prototype.delete(key) returns true if an element in the map object existed and has been
removed, or false if the element does not exist. map.prototype.has(key) will return false afterwards. map.prototype.get(key) returns the value associated to the key, or undefined if there is none. map.prototype.has(key) returns a boolean asserting whether ...
Object.prototype.constructor - JavaScript
the constructor of an object the following example shows how to modify the constructor value of generic objects. only true, 1, and "test" will not be affected (as they have read-only native constructors). this example shows that it is not always safe to rely on the constructor property of an object. ...
...d "test" will not be affected (as they have read-only native constructors). this example shows that it is not always safe to rely on the constructor property of an object. ...
...s not always safe to rely on the constructor property of an object. ...
Set.prototype.delete() - JavaScript
myset.has('foo'); // returns false. the "foo" element is no longer present. ...
... myset.has('foo'); // returns false. the "foo" element is no longer present. ...
...cified element from a set object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax myset.delete(value); parameters value the value to
remove from myset. return value returns true if value was successfully
removed from myset; otherwise false. examples using the delete() method const myset = new set(); myset.add('foo'); myset.delete('bar'); // returns false. no "bar" element found to be deleted. myset.delete('foo'); // returns true. successfully
removed. myset.has('foo'); // returns false. the "foo" element is no longer present. let's checkout below how to delete an object from a set. const ...
Planned changes to shared memory - JavaScript
or sharedarraybuffer objects throws by default). these changes provide further isolation between sites and help reduce the impact of attacks with high-resolution timers, which can be created with shared memory. starting with firefox 79, the features described in this document are enabled by default. chrome intends to implement similar restrictions. new http header bonanza as a baseline requi
rement, documents will need to be in a secure context. for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and sha...
...s. api changes as a result of this newly required environment, there are a couple api implications: the atomics object is always available. sharedarraybuffer objects are in principle always available, but unfortunately the constructor on the global object is hidden, unless the two headers mentioned above are set, for compatibility with web content. there is hope that this restriction can be
removed in the future. webassembly.memory can still be used to get an instance. unless the two headers mentioned above are set, the various postmessage() apis will throw for sharedarraybuffer objects. if they are set, postmessage() on window objects and dedicated workers will function and allow for memory sharing. to avoid having to check whether postmessage() throws, self.crossoriginisolated is be...
...indow and worker contexts. webassembly shared memory the webassembly threads proposal allows webassembly.memory objects to be created with a new shared constructor flag. when this flag is set to true, the constructed memory object can be shared between workers via postmessage(), just like sharedarraybuffer, and the backing buffer of the memory object is a sharedarraybuffer. therefore, the requi
rements listed above for sharing a sharedarraybuffer between workers also apply to sharing a webassembly.memory. the webassembly threads proposal also defines a new set of atomic instructions. just as sharedarraybuffer and its methods are unconditionally enabled (and only sharing between threads is gated on the new headers), the webassembly atomic instructions are also unconditionally allowed. furt...
String.prototype.charAt() - JavaScript
let str = 'a\ud87e\udc04z' // we could also use a non-bmp character directly for (let i = 0, chr; i < str.length; i++) { [chr, i] = getwholecharandi(str, i) // adapt this line at the top of each loop, passing in the whole string and // the current iteration and returning an array with ...
... let str = 'a\ud87e\udc04z' // we could also use a non-bmp character directly for (let i = 0, chr; i < str.length; i++) { [chr, i] = getwholecharandi(str, i) // adapt this line at the top of each loop, passing in the whole string and // the current iteration and returning an array with the individual ch...
...0xdc00 <= code && code <= 0xdfff) if (i === 0) { throw 'low surrogate without preceding high surrogate' } let prev = str.charcodeat(i - 1) // (could change last hex to 0xdb7f to treat high private surrogates // as single characters) if (0xd800 > prev || prev > 0xdbff) { throw 'low surrogate without preceding high surrogate' } // return the next character instead (and inc
rement) return [str.charat(i + 1), i + 1] } fixing charat() to support non-basic-multilingual-plane (bmp) characters while the previous example may be more useful for programs that must support non-bmp characters (since it does not require the caller to know where any non-bmp character might appear), in the event that one does wish, in choosing a character by index, to treat the surrogate pairs ...
WeakMap.prototype.delete() - JavaScript
wm.has(window); // returns false. ...
... wm.has(window); // returns false. ...
...ct. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax wm.delete(key); parameters key the key of the element to
remove from the weakmap object. return value true if an element in the weakmap object has been
removed successfully. false if the key is not found in the weakmap or if the key is not an object. examples using the delete method var wm = new weakmap(); wm.set(window, 'foo'); wm.delete(window); // returns true. successfully
removed. wm.has(window); // returns false. the window object is no longer in the weakmap. specifications specification ecmascript (ecma-262)the de...
WeakRef - JavaScript
leanup callback] in a timely, predictable manner, it's likely to be disappointed: the cleanup may happen much later than expected, or not at all. sources of variability include: one object might be garbage-collected much sooner than another object, even if they become unreachable at the same time, e.g., due to generational collection. garbage collection work can be split up over time using inc
remental and concurrent techniques. various runtime heuristics can be used to balance memory usage, responsiveness. the javascript engine may hold references to things which look like they are unreachable (e.g., in closures, or inline caches). different javascript engines may do these things differently, or the same engine may change its algorithms across versions. complex factors may lead to obj...
...undefined when that target has been reclaimed. a weakref might never return undefined from deref, even if nothing strongly holds the target, because the garbage collector may never decide to reclaim the object. ...
... ...
WeakSet - JavaScript
ameter). the number of objects or their traversal order is immaterial, so a weakset is more suitable (and performant) than a set for tracking object references, especially if a very large number of objects is involved. constructor weakset() creates a new weakset object. instance methods weakset.prototype.add(value) appends value to the weakset object. ...
...while they are similar objects, they are not the same object. and so they are both added to the set. specifications specification ecmascript (ecma-262)the definition of 'weakset' in that specification. ...
...will return false afterwards. weakset.prototype.has(value) returns a boolean asserting whether value is present in the weakset object or not. examples using the weakset object const ws = new weakset(); const foo = {}; const bar = {}; ws.add(foo); ws.add(bar); ws.has(foo); // true ws.has(bar); // true ws.delete(foo); //
removes foo from the set ws.has(foo); // false, foo has been
removed ws.has(bar); // true, bar is retained note that foo !== bar. while they are similar objects, they are not the same object. and so they are both added to the set. specifications specification ecmascript (ecma-262)the definition of 'weakset' in that specification. ...
this - JavaScript
is called. since the following code is not in strict mode, and because the value of this is not set by the call, this will default to the global object, which is window in a browser. function f1() { return this; } // in a browser: f1() === window; // true // in node: f1() === globalthis; // true in strict mode, however, if the value of this is not set when entering an execution context, it
remains as undefined, as shown in the following example: function f2() { 'use strict'; // see strict mode return this; } f2() === undefined; // true in the second example, this should be undefined, because f2 was called directly and not as a method or property of an object (e.g. window.f2()). this feature wasn't implemented in some browsers when they first started to support strict mode. as a...
...alobject); // true // attempt to set this using call console.log(foo.call(obj) === globalobject); // true // attempt to set this using bind foo = foo.bind(obj); console.log(foo() === globalobject); // true no matter what, foo's this is set to what it was when it was created (in the example above, the global object). the same applies to arrow functions created inside other functions: their this
remains that of the enclosing lexical context. // create obj with a method bar that returns a function that // returns its this. the returned function is created as // an arrow function, so its this is permanently bound to the // this of its enclosing function. the value of bar can be set // in the call, which in turn sets the value of the // returned function. var obj = { bar: function() { va...
... obj.bar returns another function (call it anonymous function b) that is created as an arrow function. as a result, function b's this is permanently set to the this of obj.bar (function a) when called. when the returned function (function b) is called, its this will always be what it was set to initially. in the above code example, function b's this is set to function a's this which is obj, so it
remains set to obj even when called in a manner that would normally set its this to undefined or the global object (or any other method as in the previous example in the global execution context). as an object method when a function is called as a method of an object, its this is set to the object the method is called on. in the following example, when o.f() is invoked, inside the function this is...
Expressions and operators - JavaScript
["property"]). new the new operator creates an instance of a constructor. new.target in constructors, new.target refers to the constructor that was invoked by new. super the super keyword calls the parent constructor. ...obj spread syntax allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected. inc
rement and dec
rement postfix/prefix inc
rement and postfix/prefix dec
rement operators. a++ postfix inc
rement operator. a-- postfix dec
rement operator. ++a prefix inc
rement operator. --a prefix dec
rement operator. unary operators a unary operation is operation with only one operand. delete the delete operator deletes a property from an object. void the void operator discards an expr...
...- the unary negation operator converts its operand to number type and then negates it. ~ bitwise not operator. ! logical not operator. arithmetic operators arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value. + addition operator. - subtraction operator. / division operator. * multiplication operator. %
remainder operator. ** exponentiation operator. relational operators a comparison operator compares its operands and returns a boolean value based on whether the comparison is true. in the in operator determines whether an object has a given property. instanceof the instanceof operator determines whether an object is an instance of another object. < less than operator. > greater than o...
... || logical or. conditional (ternary) operator (condition ? iftrue : iffalse) the conditional operator returns one of two values based on the logical value of the condition. assignment operators an assignment operator assigns a value to its left operand based on the value of its right operand. = assignment operator. *= multiplication assignment. /= division assignment. %=
remainder assignment. += addition assignment. -= subtraction assignment <<= left shift assignment. >>= right shift assignment. >>>= unsigned right shift assignment. &= bitwise and assignment. ^= bitwise xor assignment. |= bitwise or assignment. &&= logical and assignment. ||= logical or assignment. ??= logical nullish assignment. [a, b] = [1, 2] {a, b} = {a:1, b:2} destruct...
Authoring MathML - MathML
upport. for example the following function verifies the mathml support by testing the mspace element (you may replace mspace with mpadded): function hasmathmlsupport() { var div = document.createelement("div"), box; div.innerhtml = "<math><mspace height='23px' width='77px'/></math>"; document.body.appendchild(div); box = div.firstchild.firstchild.getboundingclientrect(); document.body.
removechild(div); return math.abs(box.height - 23) <= 1 && math.abs(box.width - 77) <= 1; } alternatively, the following ua string sniffing will allow to detect the rendering engines with native mathml support (gecko and webkit). note that ua string sniffing is not the most reliable method and might break from version to version: var ua = navigator.useragent; var isgecko = ua.indexof("gecko") > ...
...amily: latin modern math; } you can then use the @font-face rule as usual to provide woff fallback for latin modern and latin modern math. see this github repository to get woff fonts and sample css stylesheets to use on your web site and check its test page. mathml in xml documents (xhtml, epub, etc) if for some reason you need to use mathml in xml documents, be sure to satisfy the usual requi
rements: well-formed document, use of correct mime type, mathml namespace "http://www.w3.org/1998/math/mathml" on <math> roots. for example, the xhtml version of the previous example looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1 plus mathml 2.0//en" "http://www.w3.org/math/dtd/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999...
...erfaces, including a ckeditor plugin used on mdn, an online demo, a firefox add-on or a firefoxos webapp. it has also been integrated into seamonkey since version 2.28 and into thunderbird since version 31. abiword contains a small equation editor, based on itex2mml. finally, bluegriffon has an add-on to insert mathml formulas in your document, using ascii/latex-like syntax. wysiywg editors fi
remath is an extension for firefox that provides a wysiwyg mathml editor. a preview of the formula is displayed using the rendering engine of mozilla. the generated mathml code is available at the bottom. use the text field for token elements and buttons to build advanced constructions. once you are done, you can save your document as a xhtml page. lyx is a graphical latex editor, which has built-in...
<mpadded> - MathML
the mathml <mpadded> element is used to add extra padding and to set the general adjustment of position and size of enclosed contents. attributes class, id, style provided for use with stylesheets. depth sets or inc
rements the depth. possible values: any length or an inc
rement/dec
rement (a length prefixed with "+" or "-") . height sets or inc
rements the height. possible values: any length or an inc
rement/dec
rement (a length prefixed with "+" or "-") . href used to set a hyperlink to a specified uri. lspace sets or inc
rements the horizontal position. possible values: any length or an inc
rement/dec
rement (a length prefixed with "+" or "-") . mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb ...
... with "+" or "-") . href used to set a hyperlink to a specified uri. lspace sets or inc
rements the horizontal position. possible values: any length or an inc
rement/dec
rement (a length prefixed with "+" or "-") . mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. voffset sets or inc
rements the vertical position. possible values: any length or an inc
rement/dec
rement (a length prefixed with "+" or "-") . width sets or inc
rements the width. possible values: any length or an inc
rement/dec
rement (a length prefixed with "+" or "-") . pseudo-units it is possible to use the keywords "depth", "height", and "width" as a pseudo-unit for the attributes depth, height, lspace, voffset, ...
... pseudo-units it is possible to use the keywords "depth", "height", and "width" as a pseudo-unit for the attributes depth, height, lspace, voffset, and width. they represent each length of the same-named dimension. prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) the mathml2 pseudo-unit lspace was allowed, which is no longer present in the mathml3 recommendation and has been
removed now. examples <math> <mpadded height="+150px" width="100px" lspace="2height"> <mi> x </mi> <mo> + </mo> <mi> y </mi> </mpadded> </math> specifications specification status comment mathml 3.0the definition of 'mpadded' in that specification. recommendation current specification mathml 2.0the definition of 'mpadded' in that speci...
The "codecs" parameter in common media types - Web media technologies
ally colocated with the (0, 0) luma sample; and a value of 2 indicating that the sample position is colocated with (0, 0) luma. the default value is 110 (4:2:0 chroma subsampling). cp the two-digit color_primaries value indicates the color system used by the media. for example, bt.2020/bt.2100 color, as used for hdr video, is 09. the information for this—and for each of the
remaining components—is found in the color config semantics section of the av1 specification. the default value is 01 (itu-r bt.709). tc the two-digit transfer_characteristics value. this value defines the function used to map the gamma (delightfully called the "opto-electrical transfer function" in technical parlance) from the source to the display. for example, 10-bit bt.2020 is 14. t...
...e above. some example av1 codec strings: av01.2.15m.10.0.100.09.16.09.0 av1 professional profile, level 5.3, main tier, 10 bits per color component, 4:2:2 chroma subsampling using itu-r bt.2100 color primaries, transfer characteristics, and ycbcr color matrix. the studio swing representation is indicated. av01.0.15m.10 av1 main profile, level 5.3, main tier, 10 bits per color component. the
remaining properties are taken from the defaults: 4:2:0 chroma subsampling, bt.709 color primaries, transfer characteristics, and matrix coefficients. studio swing representation. iso base media file format: mp4, quicktime, and 3gp all media types based upon the iso base media file format (iso bmff) share the same syntax for the codecs parameter. these media types include mpeg-4 (and, in fact, the...
...d right eye). otherwise, provides the same features as the high profile. 80 00 multiview high profile supports two or more views using both temporal and mvc inter-view prediction. does not support field pictures or macroblock-adaptive frame-field coding. 76 00 multiview depth high profile based on the high profile, to which the main substream must adhere. the
remaining substreams must match the stereo high profile. 8a 00 mpeg-4 audio when the value of an entry in the codecs list begins with mp4a, the syntax of the value should be: mp4a.oo[.a] here, oo is the two-digit hexadecimal object type indication which specifies the codec class being used for the media. the otis are assigned by the mp4 registration authority, which maintains a list o...
OpenSearch description format
age height="16" width="16" type="image/x-icon">https://example.com/favicon.ico</image> <!-- or --> <image height="16" width="16">data:image/x-icon;base64,aaabaaeaebaaa … daaa=</image> firefox caches the icon as a base64 data: uri (search plug-ins are stored in the profile's searchplugins/ folder). http: and https: urls are converted to data: uris when this is done. note: for icons loaded
remotely (that is, from https:// uris as opposed to data: uris), firefox will reject icons larger than 10 kilobytes. url describes the url or urls to use for the search. the template attribute indicates the base url for the search query. firefox supports three url types: type="text/html" specifies the url for the actual search query. type="application/x-suggestions+json" specifies the u...
...="self". the template attribute should be the url of the opensearch document to automatically update to. for example: <url type="application/opensearchdescription+xml" rel="self" template="https://example.com/mysearchdescription.xml" /> note: at this time, addons.mozilla.org (amo) doesn't support automatic updating of opensearch plugins. if you want to put your search plugin on amo,
remove the auto-updating feature before submitting it. troubleshooting tips if there is a mistake in your search plugin xml, you could run into errors when adding a discovered plugin. if the error message isn't be helpful, the following tips could help you find the problem. your server should serve opensearch plugins using content-type: application/opensearchdescription+xml. be sure that your s...
...d tags must be closed with a trailing slash or matching end tag. the xmlns attribute is important — without it you could get the error message "firefox could not download the search plugin". you must include a text/html url — search plugins including only atom or rss url types (which is valid, but firefox doesn't support) will also generate the "could not download the search plugin" error.
remotely fetched favicons must not be larger than 10kb (see bug 361923). in addition, the search plugin service provides a logging mechanism that may be useful to plugin developers. use about:config to set the pref 'browser.search.log' to true. then, logging information will appear in firefox's error console (tools 〉 error console) when search plugins are added. reference material opensearch ...
How to make PWAs installable - Progressive web apps (PWAs)
gies allow the app to be launched directly from the device's home screen, rather than the user having to open the browser and then navigate to the site by using a bookmark or typing the url. your web app can sit next to native applications as first class citizens. ...
...ate to the site by using a bookmark or typing the url. your web app can sit next to native applications as first class citizens. this makes the web app easier to access; additionally, you can specify that the app be launched in fullscreen or standalone mode, thus
removing the default browser user interface that would otherwise be present, creating an even more seamless and native-like feel. ...
...ou can use than listed above — be sure to check the web app manifest reference for details. add to home screen "add to home screen" (or a2hs for short) is a feature implemented by mobile browsers that takes the information found in an app's web manifest and uses them to represent the app on the device's home screen with an icon and name. this only works if the app meets all the necessary requi
rements, as described above. when the user visits the pwa with a supporting mobile browser, it should display a notification (such as a banner or dialog box) indicating that it's possible to install the app as a pwa. after the user indicates they wish to proceed with installation, the install banner is shown. that banner is automatically created by the browser, based on the information from the m...
Media - Progressive web apps (PWAs)
owed by curly braces that enclose the rules. example a document on a website has a navigation area that contains the primary site menu. in the markup language, the navigation area's parent element has the id nav-area. (in html5, this can be marked up with the <nav> element instead of <div> with an id attribute.) when printing the document, the navigation area has no purpose. this css (below)
removes the navigation area when printing the document: @media print { #nav-area {display: none;} } some common media types are: screen color device display print printed paged media projection projected display all all media (the default) more details there are other ways to specify the media type for a set of rules. the document's m...
...when it has keyboard focus. it might also have a hover effect when the pointer is over it. more details for more information about user interfaces in css, see user interface in the css specification. in part ii of this tutorial, there is an example of mozilla's markup language for user interfaces. action: printing a document note: this snippet only works on firefox since it erroneously inc
rements the css counter for fix-position elemnts. it shouldn not work in other browsers. see issue on css3-page. make a new html document, doc4.html. copy and paste the content from here: <!doctype html> <html> <head> <title>print sample</title> <link rel="stylesheet" href="style4.css"> </head> <body> <h1>section a</h1> <p>this is the first section...</p> <h1>section ...
...it uses your browser's default style. print (or print preview) the document. the stylesheet places each section on a separate page, and it adds a header and footer to each page. if your browser supports counters, it adds a page number in the footer. ...
begin - SVG: Scalable Vector Graphics
e animation will be determined by a beginelement() method call or a hyperlink targeted to the element. discard for <discard>, begin defines when the target element will be discarded. the <discard> element has an implicit simple duration of indefinite. as soon as the element's active duration starts, the element identified by the href attribute is discarded. ...
...scard for <discard>, begin defines when the target element will be discarded. the <discard> element has an implicit simple duration of indefinite. as soon as the element's active duration starts, the element identified by the href attribute is discarded. the behavior is the same as if node.
removechild() were called on the parent of the target element with the target element as parameter. after
removal of the target element, the <discard> element is no longer useful, therefore it is also discarded after the target element's
removal. if the href attribute has an invalid url reference (e.g. the target element did not exist), the <discard> element itself is still
removed after the activation. seeking backwards in the timeline doesn't re-insert the discarded elements. so, authors are encourage...
... value <begin-value-list> default value 0s animatable no the definition of <begin-value-list> is the same as for the other animation elements. ...
dominant-baseline - SVG: Scalable Vector Graphics
ds on the value of the writing-mode attribute. if the writing-mode is horizontal, then the value of the dominant-baseline component is alphabetic. otherwise, if the writing-mode is vertical, then the value of the dominant-baseline component is central. if this property occurs on a <tspan>, <tref>, <altglyph>, or <textpath> element, then the dominant-baseline and the baseline-table components
remain the same as those of the parent text content element. if the computed baseline-shift value actually shifts the baseline, then the baseline-table font-size component is set to the value of the font-size attribute on the element on which the dominant-baseline attribute occurs, otherwise the baseline-table font-size
remains the same as that of the element. if there is no parent text content e...
...ical, is used to select the appropriate set of baseline-tables and the dominant baseline is used to select the baseline-table that corresponds to that baseline. the baseline-table font-size component is set to the value of the font-size attribute on the element on which the dominant-baseline attribute occurs. no-change the dominant-baseline, the baseline-table, and the baseline-table font-size
remain the same as that of the parent text content element. reset-size the dominant-baseline and the baseline-table
remain the same, but the baseline-table font-size is changed to the value of the font-size attribute on this element. this re-scales the baseline-table for the current font-size. ideographic the baseline-identifier for the dominant-baseline is set to be ideographic, the derived bas...
...d" /> <style><![cdata[ text { font: bold 30px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> result specifications specification status comment scalable vector graphics (svg) 2the definition of 'dominant-baseline' in that specification. candidate recommendation refers to the specification in working draft and explicitly mentions the
removal of the values use-script, no-change, and reset-size. css inline layoutthe definition of 'dominant-baseline' in that specification. working draft
removed the values use-script, no-change, and reset-size and introduced the text-top value. scalable vector graphics (svg) 1.1 (second edition)the definition of 'dominant-baseline' in that specification. recommendation i...
x - SVG: Scalable Vector Graphics
efines the x coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, x defines the x coordinate of each individual glyph from the text. if there are less values than glyphes, the
remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value list of (<length> | <percentage>) default value 0 animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized th...
...efines the x coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, x defines the x coordinate of each individual glyph from the text. if there are less values than glyphes, the
remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value list of (<length> | <percentage>) default value 0 animatable yes tspan for <tspan>, if it contain a single value, x defines the x coordinate on where the content text position must be placed. the content text p...
...efines the x coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, x defines the x coordinate of each individual glyph from the text. if there are less values than glyphes, the
remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value list of (<length> | <percentage>) default value none animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized...
y - SVG: Scalable Vector Graphics
efines the y coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, y defines the y coordinate of each individual glyph from the text. if there are less values than glyphes, the
remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value list of (<length> | <percentage>) default value 0 animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized th...
...efines the y coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, y defines the y coordinate of each individual glyph from the text. if there are less values than glyphes, the
remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value list of (<length> | <percentage>) default value 0 animatable yes tspan for <tspan>, if it contain a single value, y defines the y coordinate on where the content text position must be placed. the content text p...
...efines the y coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, y defines the y coordinate of each individual glyph from the text. if there are less values than glyphes, the
remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value list of (<length> | <percentage>) default value none animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized...
Content type - SVG: Scalable Vector Graphics
(css2, section 18.2). the format of an rgb value in hexadecimal notation is a "#" immediately followed by either three or six hexadecimal characters. the three-digit rgb notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. for example, #fb0 expands to #ffbb00. this ensures that white (#ffffff) can be specified with the short notation (#fff) and
removes any dependencies on the color depth of the display. the format of an rgb value in the functional notation is an rgb start-function, followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")". an rgb start-function is the case-insensitive string "rgb(", for example "rgb(" or "rgb(". for compatibility, the all-lowercase ...
...does not contain an <absoluteiri> or <relativeiri> and thus only contains a fragment identifier (i.e., #<elementid> or #xpointer(id<elementid>)). non-local iri references, where the iri reference does contain an <absoluteiri> or <relativeiri>. for the full specification of iri references in svg, see svg 1.1 (2nd edition): iri references. length <length> a length is a distance measu
rement, given as a number along with a unit. lengths are specified in one of two ways. when used in a stylesheet, a <length> is defined as follows: length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")? see the css2 specification for the meanings of the unit identifiers. for properties defined in css2, a length unit identifier must be provided. for length values in s...
...mber followed by a "%" character: percentage ::= number "%" note that the definition of <number> depends on whether the percentage is specified in a stylesheet or in an attribute that is not also a presentation attribute. percentage values are always relative to another value (for example, a length). each attribute or property that allows percentages also defines the reference distance measu
rement to which the percentage refers. within the svg dom, a <percentage> is represented using an svgnumber or svganimatednumber object. time <time> a time value is a <number> immediately followed by a time unit identifier. the time unit identifiers are: ms: milliseconds s: seconds transform-list <transform-list> a <transform-list> is used to specify a list of coordinat...
SVG documentation index - SVG: Scalable Vector Graphics
the <pattern> element should be put in the <defs> section of your svg file. 282 positions beginner, coordinate systems, coordinates, drawing, graphics, needsbeginnerupdate, svg, svg:tutorial in this article, we examine how scalable vector graphics (svg) represents the positions and sizes of objects within a drawing context, including coordinate system and what a "pixel" measu
rement means in a scalable context. 283 svg filters tutorial svg filters primitives svg allows us to use similar tools as the bitmap description language such as the use of shadow, blur effects or even merging the results of different filters. with the filter element <filter> it is possible to add these effects and later on attach them to an object. 284 svg in html int...
...lormatrix> element, svg, svg filter the <fecolormatrix> svg filter element changes colors based on a transformation 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 thresholding. 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, a...
...element points to a locally installed copy of this font, identified by its name. 338 <font-face-src> deprecated, element, needsexample, reference, svg, svg font the <font-face-src> svg element corresponds to the src descriptor in css @font-face rules. it serves as container for <font-face-name>, pointing to locally installed copies of this font, and <font-face-uri>, utilizing
remotely defined fonts. 339 <font-face-uri> deprecated, element, needsexample, reference, svg, svg font the <font-face-uri> svg element points to a
remote definition of the current font. 340 <font-face> deprecated, element, needsbrowsercompatibility, needsexample, needsmobilebrowsercompatibility, reference, svg, svg font the <font-face> svg element correspond...
Certificate Transparency - Web security
r certificate misissuances. newly issued certificates are 'logged' to publicly run, often independent ct logs which maintain an append-only, cryptographically assured record of issued tls certificates. in this way, certificate authorities (cas) can be subject to much greater public scrutiny and oversight. potentially malicious certificates, such as those that violate the ca/b forum baseline requi
rements, can be detected and revoked much more quickly. browser vendors and root store maintainers are also empowered to make more informed decisions regarding problematic cas that they may decide to distrust. background ct logs are built upon the foundation of the merkle tree data structure. nodes are labelled with the cryptographic hashes of their child nodes. leaf nodes contain hashes of actual ...
...09 certificate extension, the included scts are decided by the issuing ca. there should be no need for web servers to be modified if this mechanism is used. with the latter methods, servers will need to be updated to send the required data. the advantage is that the server operator can customise the ct log sources providing the scts sent via the tls extension/stapled ocsp response. browser requi
rements google chrome requires ct log inclusion for all certificates issues with a notbefore date of after 30 april 2018. users will be prevented from visiting sites using non-compliant tls certificates. chrome had previously required ct inclusion for extended validation (ev) and symantec-issued certificates. apple requires a varying number of scts in order for safari and other servers to trust ser...
...cates. chrome had previously required ct inclusion for extended validation (ev) and symantec-issued certificates. apple requires a varying number of scts in order for safari and other servers to trust server certificates. firefox does not currently check or require the use of ct logs for sites that users visit. the expect-ct header can be used to request that a browser always enforces the requi
rement for certificate transparency (e.g. in chrome, even if the certificate was issued with a notbefore date prior to april). specifications specification status comment certificate transparency ietf rfc ...
Interacting with page scripts - Archive of obsolete content
contentscript: "console.log(unsafewindow.foo);" }) tabs.open(pageurl); be careful using unsafewindow: you can't rely on any of its properties or functions being, or doing, what you expect. any of them, even setters and getters, could have been redefined by a page script. don't use it unless you trust the page, and even then be careful. also, unsafewindow isn't a supported api, so it could be
removed or changed in a future version of the sdk. expose objects to page scripts until firefox 30, you could use unsafewindow to perform the reverse procedure, and make objects defined in content scripts available to page scripts: // content-script.js unsafewindow.contentscriptobject = {"greeting" : "hello from add-on"}; // page-script.js var button = document.getelementbyid("show-content-sc...
... the old behavior you can switch firefox back to the old behavior in which content scripts could expose objects and functions to page scripts using unsafewindow. to do this, add an option called “unsafe-content-script” under the “permissions” key in package.json, and set it to true. "permissions": { "unsafe-content-script": true } this is only a temporary migration aid, and will be
removed eventually. communicating with page scripts there are two different ways a content script can communicate with a page script: using the dom postmessage() api using custom dom events using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addeventlistener() and instead must use document.defaultview. see the secti...
Content Scripts - Archive of obsolete content
js document.body.innerhtml = "<h1>page matches ruleset</h1>"; from firefox 34 onwards, you can use "./content-script.js" as an alias for self.data.url("content-script.js"). so you can rewrite the above main.js code like this: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./content-script.js" }); unless your content script is ext
remely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. you can load multiple scripts by passing an array of strings to either contentscript or contentscriptfile...
... instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. controlling when to attach the script the contentscriptwhen option specifies when the content script(s) ...
simple-storage - Archive of obsolete content
le you are over quota, all data stored since the last time you were under quota will not be persisted. you should not let that happen. to listen for quota notifications, register a listener for the "overquota" event. it will be called when your storage goes over quota. function myonoverquotalistener() { console.log("uh oh."); } ss.on("overquota", myonoverquotalistener); listeners can also be
removed: ss.
removelistener("overquota", myonoverquotalistener); to find out how much of your quota you're using, check the module's quotausage property. it indicates the percentage of quota your storage occupies. if you're within your quota, it's a number from 0 to 1 (so a value of 0.5 means that you're using 50% of your quota and 1.0 means you're using your entire quota). if your add-on is using m...
...quotausage property. it indicates the percentage of quota your storage occupies. if you're within your quota, it's a number from 0 to 1 (so a value of 0.5 means that you're using 50% of your quota and 1.0 means you're using your entire quota). if your add-on is using more than its quota, this value is greater than 1.0. therefore, when you're notified that you're over quota, you should respond by
removing data from the storage space until your quotausage is less than or equal to 1. which particular data you
remove is up to you. for example: ss.storage.mylist = [ /* some long array */ ]; ss.on("overquota", function () { while (ss.quotausage > 1) ss.storage.mylist.pop(); }); private browsing if your storage is related to your users' web history, personal information, or other sensitive...
frame/hidden-frame - Archive of obsolete content
<iframe> elements) that are not displayed to the user. this is useful in the construction of apis that load web content not intended to be directly seen or accessed by users, like page-worker. it is also useful in the construction of apis that load web content for intermittent display, such as panel. usage the module exports a constructor function, hiddenframe, and two other functions, add and
remove. hiddenframe constructs a new hidden frame. add registers a hidden frame, preparing it to load content.
remove unregisters a frame, unloading any content that was loaded in it. the following code creates a hidden frame, loads a web page into it, and then logs its title: var hiddenframes = require("sdk/frame/hidden-frame"); let hiddenframe = hiddenframes.add(hiddenframes.hiddenframe({ onre...
...ns to call when the frame is ready to load content. you must specify an onready callback and refrain from using the hidden frame until the callback gets called, because hidden frames are not always ready to load content the moment they are added. functions add(hiddenframe) register a hidden frame, preparing it to load content. parameters hiddenframe : hiddenframe the frame to add
remove(hiddenframe) unregister a hidden frame, unloading any content that was loaded in it. parameters hiddenframe : hiddenframe the frame to
remove hiddenframe hiddenframe objects represent hidden frames. properties element the host application frame in which the page is loaded. events ready this event is emitted when the dom for a hidden frame content is ready. it is equivalent to the d...
lang/functional - Archive of obsolete content
globals functions method(lambda) takes a function and returns a method associated with an object. when the method is invoked on an instance of the object, the original function is called. it is passed the object instance (i.e. this) as the first parameter, followed by any parameters passed into the method. ...
...ent (event, value) { console.log(event + " : " + value); }); fn("click", "#home"); console.log("done"); // this will print 'done' before 'click : #home' since // we deferred the execution of the wrapped `myevent` // function, making it non-blocking and executing on the // next event loop parameters fn : function the function to be deferred. returns function : the new, deferred function.
remit() an alias for defer. invoke(callee, params, self) invokes callee, passing params as an argument and self as this. returns the value that is returned by callee. let { invoke } = require("sdk/lang/functional"); invoke(sum, [1,2,3,4,5], null); // 15 function sum () { return array.slice(arguments).reduce(function (a, b) { return a + b; }); } parameters callee : function function t...
test/utils - Archive of obsolete content
ee a particular state before running a test, and to clean up after your test. let { before, after } = require('sdk/test/utils'); let { search } = require('sdk/places/bookmarks'); exports.testcountbookmarks = function (assert, done) { search().on('end', function (results) { assert.equal(results, 0, 'should be no bookmarks'); done(); }); }; before(exports, function (name, assert) {
removeallbookmarks(); }); require('sdk/test').run(exports); both before and after may be asynchronous. to make them asynchronous, pass a third argument done, which is a function to call when you have finished: let { before, after } = require('sdk/test/utils'); let { search } = require('sdk/places/bookmarks'); exports.testcountbookmarks = function (assert, done) { search().on('end', function (re...
...may be asynchronous if beforefn accepts a third argument, which is a callback. parameters exports : object a test file's exports object beforefn : function the function to be called before each test. it has two ...
cfx - Archive of obsolete content
--no-run with this option cfx will not execute the command, but will print out the command that it would have used to execute the command. for example, if you type: cfx run ---no-run you will see something like: to launch the application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-
remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb. -o, --overload-modules in early versions of the sdk, the sdk modules used by an add-on were themselves included in the add-on. the sdk modules now ship as part of firefox. from firefox 21 onwards, sdk add-ons built with sdk 1.14 or high...
... --no-run with this option cfx will not execute the command, but will print out the command that it would have used to execute the command. for example, if you type: cfx run ---no-run you will see something like: to launch the application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-
remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb. -o, --overload-modules in early versions of the sdk, the sdk modules used by an add-on were themselves included in the add-on. the sdk modules now ship as part of firefox. from firefox 21 onwards, sdk add-ons built with sdk 1.14 or high...
jpm - Archive of obsolete content
y npm. to test your installation, run: /usr/bin/env node -v if you get an error message saying /usr/bin/env: node: no such file or directory and you have installed nodejs through a package manager, nodejs may have been installed under a different executable name. to ensure compatibility with jpm, however, it must be present in your path under the name node. on debian and ubuntu, this can be
remedied by ensuring you installed the compatibility package, nodejs-legacy: sudo apt-get install nodejs-legacy on other distributions, you may have to create a local symlink to nodejs manually: sudo ln -s "$(which nodejs)" /usr/local/bin/node installing jpm after you have npm installed and node on your path, install jpm just as you would any other npm package. installing jpm globally npm inst...
... failed validation, was not signed, and you got a link to a detailed report. after fixing the validation errors, you can run the command again. you add-on passed validation but it could not be automatically signed because your add-on is listed. listed add-ons will require a manual review before they can be signed. your add-on at this exact version number already exists, so it was not signed. inc
rement the version number in your package.json file and run the command again. under the hood, jpm sign creates an unlisted add-on inside addons.mozilla.org, which means you must distribute the xpi file yourself for your users to install it. if you need to create a listed add-on, just submit it directly to addons.mozilla.org where it is signed automatically. see the debugging section if you are exp...
Adding a Button to the Toolbar - Archive of obsolete content
"64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } now run the add-on with jpm run. the button is added to the toolbar at the top of the browser window: you can't set the initial location for the button, but the user can move it using the browser's customization feature. the id attribute is mandatory, and is used to
remember the position of the button, so you should not change it in subsequent versions of the add-on. clicking the button loads https://www.mozilla.org/ into a new tab. specifying the icon the icon property may specify a single icon or a collection of icons in different sizes, as in the example above. if you specify a collection of icons in different sizes the browser will automatically choose th...
... may specify a single icon or a collection of icons in different sizes, as in the example above. if you specify a collection of icons in different sizes the browser will automatically choose the best fit for the screen resolution and the place in the browser ui that hosts the button. read more about specifying multiple icons. the icon file must be packaged with your add-on: it may not refer to a
remote file. you can change the icon at any time by setting the button's icon property. you can change the icon, and the other state attributes, either globally, for a specific window, or for a specific tab. read more about updating state. attaching a panel if you need to attach a panel to a button, use the toggle button api. this is just like the action button api except it adds a boolean checked...
Creating annotations - Archive of obsolete content
the widget api is deprecated from firefox 29 onwards. please see the ui module for replacements. in particular, for a simple button, try the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis. we'll use two objects to create annotations: a page-mod to find page elements that the user can annotate, and a panel for the user to enter the annotation text itself. selector page-mod selector content scripts the content script for the selector page-mod uses jquery to examine and manipulate the dom. ...
... uses workers, see the page-mod documentation. in the attach handler we do three things: send the content script a message with the current activation status add the worker to an array called selectors so we can send it messages later on assign a message handler for messages from this worker. if the message is show we will just log the content for the time being. if the message is detach we
remove the worker from the selectors array. at the top of the file import the page-mod module and declare an array for the workers: var pagemod = require('sdk/page-mod'); var selectors = []; add detachworker(): function detachworker(worker, workerarray) { var index = workerarray.indexof(worker); if(index != -1) { workerarray.splice(index, 1); } } edit toggleactivation() to notify the ...
Storing annotations - Archive of obsolete content
the widget api is deprecated from firefox 29 onwards. please see the ui module for replacements. in particular, for a simple button, try the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis. now we are able to create annotations, let's store them using the simple-storage module. in this chapter we will cover three topics relating to persistent storage: using simple-storage to persist objects handling exhaustion of the storage quota allocated to you respecting private browsing storing new annotations in this section we are only touching the main.js file. ...
...uota of storage space. if the add-on exits while it is over quota, any data stored since the last time it was in quota will not be persisted. so we want to listen to the overquota event emitted by simple-storage and respond to it. add the following to your add-on's main function: simplestorage.on("overquota", function () { notifications.notify({ title: 'storage space exceeded', text: '
removing recent annotations'}); while (simplestorage.quotausage > 1) simplestorage.storage.annotations.pop(); }); because we use a notification to alert the user, we need to import the notifications module: var notifications = require("sdk/notifications"); (it should be obvious that this is an incredibly unhelpful way to deal with the problem. a real add-on should give the user a chance to c...
Using XPCOM without chrome - Archive of obsolete content
sdk/platform/xpcom , it's possible to exclude chrome and xpcomutils in some cases. below is an example for the xpcom bookmark observer. examples bookmarks observer normally, a bookmark observer would require chrome components and xpcomutils as described in the following links: (observing changes to bookmarks and tags) , (creating event targets). ...
... (observing changes to bookmarks and tags) , (creating event targets). however, with the sdk module , we can
remove this need. below is an example, where we extend the xpcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. ...
HTML in XUL for rich tooltips - Archive of obsolete content
tooltip: function(event) { //get the html tooltip string assigned to the element that the mouse is over (which will soon launch the tooltip) var txt = event.target.getattribute("tooltiphtml"); // get the html div element that is inside the custom xul tooltip var div = document.getelementbyid("myhtmltipdiv"); //clear the html div element of any prior shown custom html while(div.firstchild) div.
removechild(div.firstchild); //safely convert html string to a simple dom object, stripping it of javascript and more complex tags var injecthtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(txt, false, null, div); //attach the dom object to the html div element div.appendchild(injecthtml); } } window.addeven...
...stener('load', htmltip.onload, false); in the xul overlay, xmlns:html is used to enable html tags to be used inside the xul. our enhanced xul tooltip is an element that is written ahead of time, and it contains an html div element whose type attribute lowers its privileges to being that content element, although it is an element of chrome. this is recommended for security reasons, especially if
remote html is to be inserted. a number of menuitems have a tooltip attribute pointing to the same tooltip. that tooltip is empty now, but we will use the mouseover event to dynamically populate the tooltip (which is about to be shown) with a different message for each menuitem. this is done by calling the onmousetooltip function, which will take the tooltiphtml attribute of the element that is bein...
Miscellaneous - Archive of obsolete content
it also collapses consecutive whitespaces into a single whitespace, and returns at most 150 characters, making it ideal to display text in context menus. it is defined at //github.com/realityripple/pale-moon/blob/master/palemoon/base/content/browser.js#l5113. note that it returns the empty string (""), not false, when nothing is selected. getbrowserselection() ...
....nsiioservice); function certsservice() {} certsservice.prototype = { observe: function(asubject, atopic, adata) { switch(atopic) { case "app-startup": gobserver.addobserver(this,"xpcom-shutdown",false); gobserver.addobserver(this,"final-ui-startup",false); break; case "xpcom-shutdown": gobserver.
removeobserver(this,"final-ui-startup"); gobserver.
removeobserver(this,"xpcom-shutdown"); break; case "final-ui-startup": this.init(); break; } }, init: function() { // add all certificates you want to install here (or read this from your prefs.js ...) var certificates = "root.crt,user.crt"; ...
On page load - Archive of obsolete content
ul thunderbird chrome://messenger/content/messenger.xul navigator from seamonkey chrome://navigator/content/navigator.xul attaching a script attach a script to your overlay (see "attaching a script to an overlay") that adds a load event listener to appcontent element (browsers) or messagepane (mail): window.addeventlistener("load", function load(event){ window.
removeeventlistener("load", load, false); //
remove listener, no longer needed myextension.init(); },false); var myextension = { init: function() { var appcontent = document.getelementbyid("appcontent"); // browser if(appcontent){ appcontent.addeventlistener("domcontentloaded", myextension.onpageload, true); } var messagepane = document.getelementbyid("messagepane"); // ...
...n is the window for the doc // test desired conditions and do something // if (doc.nodename != "#document") return; // only documents // if (win != win.top) return; //only top window. // if (win.frameelement) return; // skip iframes/frames alert("page is loaded \n" +doc.location.href); } } window.addeventlistener("load", function load(event){ window.
removeeventlistener("load", load, false); //
remove listener, no longer needed myextension.init(); },false); references if you need to have a more complicated listener (not just onload), use progress listeners. see also domcontentloaded event in listening to events: simple dom events ...
Preferences - Archive of obsolete content
. this interface is described as: // "nsiprefbranch2 allows clients to observe changes to pref values." // this is only necessary prior to gecko 13 if (!("addobserver" in this.branch)) this.branch.queryinterface(components.interfaces.nsiprefbranch2); // finally add the observer. ...
...en this method is called. */ preflistener.prototype.register = function(trigger) { this._branch.addobserver('', this, false); if (trigger) { let that = this; this._branch.getchildlist('', {}). ...
Code snippets - Archive of obsolete content
sible, in theory, to use ecmascript for a smaller task: parsing exotic programming languages (i.e., creating compilers). this snippets shows a possible way to start from. browser-oriented code tabbed browser code (firefox/seamonkey) basic operations, such as page loading, with the tabbed browser, which is the heart of mozilla's browser applications cookies reading, writing, modifying, and
removing cookies page loading code used to load pages, reload pages, and listen for page loads interaction between privileged and non-privileged code how to communicate from extensions to websites and vice-versa. downloading files code to download files, images, and to monitor download progress password manager code used to read and write passwords to/from the integrated password manager boo...
... html into a xul element to attain markup in a tooltip label and description special uses and line breaking examples tree setup and manipulation of trees using xul and js scrollbar changing style of scrollbars. applies to scrollbars in browser and iframe as well. autocomplete code used to enable form autocomplete in a browser boxes tips and tricks when using boxes as containers tabbox
removing and manipulating tabs in a tabbox windows-specific finding window handles (hwnd) (firefox) how to use windows api calls to find various kinds of mozilla window handles. window handles can be used for ipc and accessibility purposes. using the windows registry with xpcom how to read, write, modify, delete, enumerate, and watch registry keys and values. external links the content at ...
Downloading JSON and JavaScript in extensions - Archive of obsolete content
once the content has been downloaded, the extension authors proceed to use eval() to decode the string content into javascript objects. this practice is dangerous and will not, in fact, pass an amo review. so the extension will not be allowed to move out of the amo sandbox. the practice is dangerous because the decoded javascript has full chrome privileges and could perform some nasty actions. ...
...orkaround the problem. downloading json if the extension is downloading json, then the developer should be using one of the json decoding methods discussed here and not using eval() at all. json is about state and does not allow functions to be decoded. the json decoding methods available to extension developers protect the extension from malicious json and javascript. downloading state from a
remote webserver using json is becoming ext
remely popular. use the json decoders, not eval()! downloading javascript of course there are times when javascript code modules are downloaded and injected into the extension. this usually happens because the extension is trying to keep some of its code fresh and dynamic, and the developers don't want to create a new version of the extension for each scri...
Extension Versioning, Update and Compatibility - Archive of obsolete content
for xhtml extension. if you are running apache server, you might consider adding addtype application/xhtml+xml .xhtml to the .htacess file. unfortunately, i've encounter cases where adding the mime type to the server didnt help either. so the solution i did, and which worked, was just to give the file a "xml" extension instead of "xhtml". securing updates gecko 1.9 has added additional requi
rements designed to protect users from man-in-the-middle attacks and the like during add-on updates. in the install.rdf of the already installed add-on updateurl must be specified in one of the following ways: the updateurl uses https, or there is no updateurl at all (which defaults to addons.mozilla.org which is https) the updateurl uses http and the updatekey entry is specified which will be us...
...ation will be rejected. in the update manifest delivered from the updateurl the updatelink must be specified in one of the following ways: the updatelink to the xpi file must use https the updatelink can use http and you must include an updatehash for the xpi file using sha1, sha256, sha384 or sha512 hash algorithms. any entries in the update manifest that do not meet one of those two requi
rements will be ignored when checking for new versions. note that https links to sites with invalid certificates or that redirect to http sites will fail for both the update.rdf and updatelink cases. updatelink using an https site with a non-builtin token ca signed certificate will fail regardless of whether or not updatehash is used. update hashes in order to verify the integrity of the download...
Inline options - Archive of obsolete content
ize your settings. for example: var observer = { observe: function(asubject, atopic, adata) { if (atopic == "addon-options-displayed" && adata == "my_addon@my_domain") { var doc = asubject; var control = doc.getelementbyid("myaddon-pref-control"); control.value = "test"; } } }; services.obs.addobserver(observer, "addon-options-displayed", false); // don't forget to
remove your observer when your add-on is shut down. this code should be in bootstrap.js (within the startup() function) for restartless extensions or in an xpcom component or a javascript code module (not an overlay!) for traditional extensions. note: starting in gecko 13.0, you can also listen for the addon-options-hidden notification, which has the same subject and data as above, to find out wh...
...ur add-on is shut down. this code should be in bootstrap.js (within the startup() function) for restartless extensions or in an xpcom component or a javascript code module (not an overlay!) for traditional extensions. note: starting in gecko 13.0, you can also listen for the addon-options-hidden notification, which has the same subject and data as above, to find out when the ui is about to be
removed. use this notification to
remove event listeners, or any other references that might otherwise be leaked. locating the options file there are two ways to let the add-on manager find your options file: method 1 name the file options.xul and put it in the extension's root folder (alongside install.rdf). this method does not require you to create a chrome.manifest and set it's path. this m...
Multiple item extension packaging - Archive of obsolete content
not load. as a consequence, these packages are no longer accepted by amo. a multiple item package provides the ability to package multiple installable bundles which can then be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. every multiple item package must provide an install.rdf file (not old-style install.js!) and has the same requi
rements as an extension except as noted below. there is currently no feature to prevent or warn the user when installing an older version of an extension. multiple item package file layout the multiple item package file layout is a simplified form of an installable bundle and requires a file extension of xpi. a multiple item package may contain both extensions (e.g. xpi file extension) and themes ...
...the extension manager will read the install.rdf install manifest to determine if this is a multiple item package and then start the installation of the individual packages it contains automatically. no other files besides the install.rdf install manifest and the files with a jar and xpi file extension will be extracted or utilized. install.rdf a multiple item package does not have the same requi
rements as an extension for its install.rdf. the only required properties are em:id, em:targetapplication, and em:type. for the firefox and thunderbird 1.5 extension manager to determine that the package is a multiple item package, the em:type specified in your install.rdf must be 32 and specified as <em:type nc:parsetype="integer">32</em:type>. the xml namespace xmlns:nc="http://home.netscape.com/n...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
d-licensed code can be redistributed under a different license creates the possibility that it will be wrapped in another proprietary program. the deleted advertising clause the original bsd license contained an advertising clause, which stated that “any advertising for software using an modification of this source code must display the name of the original developer.” this clause has been
removed. the modified bsd license is the version that does not include the advertising clause. mozilla public license (mpl) this is an oss license created by netscape and the mozilla organization. netscape created it for its open-source web browser. the common public license (cpl) and eclipse public license (epl) are similar in substance. because the cpl is written in such a way that it does not m...
...ed under this license, you are obliged to release it under the same license. however, if you develop an original module as an addition to it, that restriction does not apply. so plug-ins and the like can be released under different licenses. also, because source code released under this license may include patented code, that fact must be disclosed. pros and cons i consider the mpl to be an ext
remely well balanced oss license. it makes explicit that any modifications of code released under it must also be released under the same license, while setting practical limits. also, by requiring patent disclosures, it avoids the problem of submarine patents. gnu general public license (gpl) & gnu lesser general public license (lgpl) the free software foundation (fsf) created the gpl and lgpl li...
Adding Events and Commands - Archive of obsolete content
; be careful when doing this! you should at least validate the url of the page that is generating the custom event, so that you know that it's coming from the right place. you should also avoid this kind of events to trigger actions that could be destructive to the user's data, because a malicious site could try to trigger these events and cause damage. there's a reason for the division between
remote content and local chrome, so make sure you respect it. there's a section further ahead on intercepting page loads which complements this section very well. this should give you a solid foundation to handle interaction between web content and xul. additional information on custom events and how they can be used to effect communication between web content and xul can be found in the interactio...
...key;" observes="xulschoolhello-online-broadcaster" oncommand="xulschoolchrome.browseroverlay.sayhello(event);" /> the attribute value is set to be the id of the broadcaster element, indicating that this element will observe all attribute changes that happen in the broadcaster. you can have as many elements as you want observing a broadcaster. with that set, all you need to do now is set or
remove attributes in the broadcaster using javascript. all nodes observing it will automatically have those attribute values set or
removed as well. you can override pre-existing values, such as the label attribute value in the example. let onlinebroadcaster = document.getelementbyid("xulschoolhello-online-broadcaster"); onlinebroadcaster.setattribute("label", "something"); you can also have fine...
Adding windows and dialogs - Archive of obsolete content
his: sections are defined using groupbox elements, but their style is quite different from the default. attribute persistence user actions can change the state of your windows, such as selecting an option in a listbox, or entering text in a textbox. if the user closes and then reopens your window, all the controls are reset to their defaults, which may not be what you want. you need some way of
remembering the user-manipulated attribute values so that the window reloads it last state when opened. most xul elements support the persist attribute, which has this exact function. you set the persist attribute with a space-separated list of attribute names, indicating which attribute values must be persisted across window "sessions". <checkbox id="xulschoolhello-some-checkbox" label="&xulsc...
...atically using the document.persist function: document.persist("xulschoolhello-some-checkbox", "checked"); persistent data is stored in the user profile, in the file localstore.rdf. you may need to modify or delete this file often when testing persistent data in your extension. focus and tabbing moving through all input controls in a window using only the keyboard is an accessibility requi
rement. you can do this in most firefox windows by pressing the tab key. each tab key press moves you to the next control in the window, giving it focus. in general, there's nothing you need to do in order to have good keyboard focus management. firefox will automatically focus the first input control in your window, and tab focus advances in the order the items are found in the xul document. if you...
Appendix A: Add-on Performance - Archive of obsolete content
em a negative view of firefox. add-on developers need to make sure that they minimize their add-ons' performance impact, and here are a few simple guidelines that should be followed to achieve that. startup this is the area where add-ons have the most noticeable impact. most add-ons use the load event handler in the main overlay to initialize their objects and sometimes read files or even fetch
remote data. the problem with the onload event is that it runs before the main window becomes visible, so all handlers need to complete before the user can see the window. an add-on can normally add a few hundred milliseconds to startup time because of the load handler, and it's not hard to figure out what having several add-ons will do. luckily, minimizing your startup time is easy, if you follow t...
...s as efficient as possible. this can be tricky for some add-ons, like ad or script blockers that need to check a whitelist or blacklist. nevertheless, loading pages is pretty important in firefox, and users expect it to be fast. try your best to keep it that way. other recommendations always clean up after yourself. event listeners, observers and other handlers normally have both an add and a
remove function. don't forget to
remove what you don't need anymore! even if you need something during the whole existence of the window, you should clean everything up in the unload event handler. even the unload event should be handled efficiently. even if it is not as important as other areas, firefox shutdown can also be slowed down because of add-ons. if there's anything you can unload before s...
Appendix D: Loading Scripts - Archive of obsolete content
be given access to the global properties of any existing scope. security: sandbox objects are initialized with a security principal object, or otherwise a window or url from which to derive one. this means that evalinsandbox can be used to execute code with a specified privilege level rather than full chrome privileges. beyond this, the scope of the sandbox can be augmented or rarified to add or
remove privileges as necessary. under ordinary circumstances, native objects passed out of sandboxes are wrapped in xraywrapper objects, which means that only native properties of these objects are directly exposed to privileged code. this behavior can be reversed by setting the wantsxrays parameter to false when constructing the sandbox. disadvantages performance: there are several significant ...
...ent scope. it will also import the symbol services from the standard services.jsm module. const { services } = module("resource://gre/modules/services.jsm"); const { bar, foo } = module("my-module"); dom workers: worker and chromeworker dom workers can be used to load scripts into their own global contexts which run in their own threads. in order to ensure thread safety, these contexts are ext
remely limited, can't be passed javascript objects, and have no access to the dom. all communication between these contexts and outer contexts is marshalled through json encoding and decoding. chromeworkers also have access to ctypes and a limited number of thread safe xpcom classes, but are otherwise limited to simple computation based on data passed via messages and xmlhttprequests. advantages ...
The Box Model - Archive of obsolete content
le idea, you'll be able to use the dom inspector and css to mold xul elements and layouts with great precision and flexibility. most of the examples shown in the rest of this section were generated using the xul box alignment example. we recommend you play around with it for a while to get an idea of how the basic parts of the box model work. in order to use this page, you'll need to install the
remote xul manager extension and add developer.mozilla.org to the whitelist. boxes a xul box is very similar to an html div. it's an invisible rectangular container with no styling at all (divs may have some default styling, though). their behavior is similar. however, one of the fundamental differences between xul and html has been the fact that xul boxes can be oriented vertically or horizontally...
...ld be handled with caution. we recommended that you use proportional units (em, %) instead of absolute units (px) whenever possible. using the former allows the ui to scale proportionately depending on font size settings, which are often changed by users with accessibility limitations. a common exception to this rule is when your css is directly related to images, where you'll usually handle measu
rements in pixels (px). also, just like in html, you can control the dimensions of inflexible elements using the width and height css properties and attributes. these attributes won't have any effect on flexible elements. margins, paddings and spacers margins and paddings are frequently used in both html and xul to define spacing between elements and inside of elements. the margin determines the...
Using Dependent Libraries In Extension Components - Archive of obsolete content
ould have used prlibrary *lib; library->load(&lib); //but we can't use that in os x. instead, we use nsaddimage. nsaddimage(path.get(), nsaddimage_option_return_on_error | nsaddimage_option_with_searching | nsaddimage_option_match_filename_by_installname); // 1) we don't care if this failed! if you update your dependencies in your component, // but forget to
remove a dependant library in the stubloader, then we don't want to // fail loading the component since the dependant library isn't required. // // 2) we are going to leak this library. we don't care about that either. // nsaddimage adds the image to the process. when the process terminates, the library // will be properly unloaded. } library->setnativeleafname(ns_literal_cst...
...real component and “pass the buck”. nsgetmoduleproc getmoduleproc = (nsgetmoduleproc)lookupsymbol(componentlib, "_nsgetmodule"); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } // convienience method grabbed from // http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/standalone/nsgluelinkingosx.cpp . // deprecated api calls have been
removed. static void* lookupsymbol(const mach_header* alib, const char* asymbolname) { nssymbol sym = nsnull; if (alib) { sym = nslookupsymbolinimage(alib, asymbolname, nslookupsymbolinimage_option_bind | nslookupsymbolinimage_option_return_on_error); } if (!sym) return nsnull; return nsaddressofsymbol(sym); } notes code samples are licensed under the mit license. this co...
Adding preferences to an extension - Archive of obsolete content
to call the window.setinterval() dom method to set up a callback that will automatically run our refreshinformation() method every 10 minutes. the interval time is specified in milliseconds. shutdown() the stockwatcher.shutdown() method deactivates the observer on the preferences. this is also where we would add any other shutdown tasks we need to perform. shutdown: function() { this.prefs.
removeobserver("", this); }, observe() the stockwatcher.observe() function is called whenever an event occurs on the preference branch we're watching. for details on how observers work, read up on the nsiobserver interface. observe: function(subject, topic, data) { if (topic != "nspref:changed") { return; } switch(data) { case "symbol": this.ticker...
...ight object, so we need to reference // it by its full name var symbol = stockwatcher.tickersymbol; var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher2'); var output = httprequest.responsetext; if (output.length) { //
remove any whitespace from the end of the string output = output.replace(/\w*$/, ""); // build the tooltip string var fieldarray = output.split(","); samplepanel.label = symbol + ": " + fieldarray[1]; samplepanel.tooltiptext = "chg: " + fieldarray[4] + " | " + "open: " + fieldarray[5] + " | " + "low: " + fieldarray[6] + " | " + ...
MozOrientation - Archive of obsolete content
you should use that api instead. an event that is repeatedly fired on the window as accelerator data is provided to the browser. note: this below describes how these values worked for the now obsolete mozorientation. the x axis represents the amount of right-to-left tilt. this value is 0 if the device is level along the x axis, and approaches 1 as the device is tilted toward the left, and -1 as the device is tilted toward the right. the y axis represents the amount of front-to-back tilt. ...
...away from you) and -1 as you tilt the device frontward (toward you). the z axis represents acceleration vertically. the value is -1 when the device is undergoing standard earth gravity (9.8m/sec2) but not moving. moving the device upward causes the value to increase. the value is 0 if the device is being thrust upward. in free fall (weightless or falling as a result of a drop), the value
remains -1. in weightlessness, all values would be zero when the device is not moving, regardless of orientation, and would only change when being accelerated. in firefox versions 3.6, 4, and 5 gecko utilized mozorientation which was also built to support orientation data but with different apis from the specified deviceorientationevent. to normalize between the two you can do...
Structure of an installable bundle - Archive of obsolete content
nd greater /dictionaries/*.{aff|dic} myspell dictionaries firefox 2 and greater of course, an extension need not (and normally won't) have all of these directories. themes are limited for security reasons, and can normally only provide a chrome.manifest which registers the theme and a jar file. platform-specific files gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)
removed support for platform-specific subdirectories, described below. instead, you need to use manifest flags, such as the os and abi flags, in your chrome manifest to specify components that should be loaded for specific platforms. for example: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-component components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-compon...
...components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-component components/mac/mycomponent64.dylib abi=darwin_x86_64-gcc3 binary-component components/linux/mycomponent.so abi=linux_x86-gcc3 this also means you can no longer have platform-specific preference files in your bundle. platform-specific subdirectories: gecko 1.9.2.x and earlier note: platform-specific subdirectory support was
removed in gecko 2.0. see the section platform-specific files to learn how to use platform-specific files. in some cases a single extension or application may wish to include binary component or plugins for multiple platforms, or theme authors might want to include multiple platform-specific jar files. to facilitate the first case, the extension/app loader has special sub-directories specifically f...
Drag and Drop - Archive of obsolete content
n the mouse pointer first moves over the element while something is being dragged. this might be used to change the appearance of the element to indicate to the user that the object can be dropped on it. ondragexit called for an element when the mouse pointer moves out of an element while something is being dragged. the is also called after a drop is complete so that an element has a chance to
remove any highlighting or other indication. ondragdrop this event handler is called for an element when something is dropped on the element. at this point, the user has already released the mouse button. the element can simply ignore the event or can handle it some way, such as pasting the dragged object into itself. ondragend called when the drag operation is finished. there are two ways t...
... found in a file named toolkit/content/nsdraganddrop.js nsdraganddrop.js which is contained in the widget-toolkit (or global) package. xpcom drag and drop interfaces two interfaces are used to support drag and drop. the first is a drag service, nsidragservice and the second is the drag session, nsidragsession. the nsidragservice is responsible for creating drag sessions when a drag starts, and
removing the drag session when the drag is complete. the function invokedragsession should be called to start a drag inside an ondraggesture event handler. once this function is called, a drag has started. the function invokedragsession takes four parameters, as described below: invokedragsession(element, transferablearray, region, actions) element a reference to the element that is being dragg...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
xulrunner ships with the javaxpcom component, which allows java code to interact with xpcom objects. as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++. ...
... xulrunner ships with the javaxpcom component, which allows java code to interact with xpcom objects. as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++. ...
Exception logging in JavaScript - Archive of obsolete content
as a result, if, for example, c++ code called a javascript component, which threw an exception, that exception would be logged to the console before control was returned to the c++ caller. this had the unintended consequence of logging "expected" errors at length into the console. javascript code is sometimes designed to throw exceptions to report a result condition back to the c++ caller. these might be perfectly normal circumstances, but the exceptions were dutifully logged nonetheless. ...
...ipt in frame 4 throws an exception, the exception is returned as an error code to the c++ in frame 3. no exception will be logged to the error console in this case. that c++ may handle the error, generate a different error, or simply pass it straight back to the js in frame 2. if the javascript in frame 2 either receives an exception from frame 3 or generates its own exception, and that exception
remains unandled, then the exception will always be logged to the error console before control returns to the c++ in frame 1. in other words, all unhandled javascript exceptions (except those in rules 3 and 4 above) will be logged before control returns to the outermost c++ caller. forcing logging of exceptions in inner js frames sometimes you might actually want to see all exceptions from inner java...
Block and Line Layout Cheat Sheet - Archive of obsolete content
dsize as its available height in the nshtmlreflowstate. if set, ns_unconstrainedsize is passed to nslinelayout as the available height. brs_shrinkwrapwidth brs_needresizereflow related to brs_shrinkwrapwidth. set if we need to force a resize reflow when computing the final size. e.g., because...why? brs_isinlineincrreflow this flag is set in nsblockframe::reflow() if we detect that we're inc
rementally reflowing a linebox that contains inline frames. in this case, we can avoid some of the work that occurs during reflow. brs_nowrap this flag is set in the nsblockreflowstate constructor when the "white-space" style of the block frame is pre or nowrap. it is cleared, otherwise. brs_istopmarginroot this flag is set in the nsblockreflowstate constructor when reflowing a "block margin root...
...rent frame?). brs_computemaxwidth this flag is set if reflow should recompute a frame's maximum width; for example, during first-pass table reflow. when this is set, nsblockframe::reflowline will flow the first line and each unwrapped line in the block twice. nsblockreflowcontext encapsulates the transient reflow state for a nslinebox that contains a block frame. mnextrcframe during an inc
remental reflow, this member holds current frame in the reflow chain. nslinelayout encapsulates the transient reflow state for a nslinebox that contains inline frames. a new nslinelayout object is created for each inline linebox that is flowed. mflags ll_endsinwhitespace set to true by default when starting line layout. ll_understandsnwhitespace ll_textstartswithnbsp ll_firstletterstyleo...
Repackaging Firefox - Archive of obsolete content
working on 3.x repackaging. firefox can be customized for the needs of a particular group of users (for example, your organization's employees or clients). because firefox is designed from the ground up for extensibility and customization, this process is simple and easy to maintain. important legal considerations before you get started, it is very important to know and abide by the legal requi
rements for distributing firefox. you must have written authorization from mozilla to distribute a modified version of firefox. to do this, please contact trademarks@mozilla.com. getting started now, on to the technical details. the following diagram represents an overview of the process and the pieces involved: you will need the following to get started: a macintosh computer (even for repack...
... to each one you want to generate. make sure you have the standard firefox install package in the source directory for each of these. the names of the source installer packages for each platform that are included in your source directory will appear next to each checkbox. the repackager tool will do its work, placing the customized installers into the destination directory you specified. please
remember to obtain permission as described above before distributing your new firefox installer. ...
Introducing the Audio API extension - Archive of obsolete content
ication of the <audio> and <video> media elements by exposing audio metadata and raw audio data. this enables users to visualize audio data, to process this audio data and to create new audio data. obsolete since gecko 28 (firefox 28 / thunderbird 28 / seamonkey 2.25 / firefox os 1.3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. deprecated since gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19)this feature has been
removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aw...
... support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. please note that this document describes a non-standard experimental api. this api has been deprecated since gecko 22, disabled since gecko 28, and
removed from gecko 31. you should use the web audio api instead. reading audio streams the loadedmetadata event when the metadata of the media element is available, it triggers a loadedmetadata event. this event has the following attributes: mozchannels: number of channels mozsamplerate: sample rate per second mozframebufferlength: number of samples collected in all channels this informatio...
Monitoring downloads - Archive of obsolete content
try to avoid using it.this interface is deprecated as of firefox 26. please use downloads.jsm instead. firefox 3 makes it easier than ever to monitor the status of downloads. although it was possible to do so in previous versions of firefox, it was previously only possible for one observer to do so at a time. firefox 3 introduces new api that allows any number of listeners to observe downloads. this article demonstrates how to monitor downloads in firefox 3, using the download manager. ...
...ponents.interfaces.nsidownloadmanager.download_downloading, the file has begun to download. the adownload object is an nsidownload object. in that case, we create a new row in our database for the new file by opening the database and building a replace into sqlite command. the first three rows are set to the values of the source uri, file size, and start time fields from the download object. the
remaining rows are set to zeroes since that's not information we have at the moment. if the download's state indicates that the download is finished, canceled, or failed, we call our logtransfercompleted routine to update the log to indicate that state change. that code looks like this: logtransfercompleted: function(adownload) { var endtime = new date(); // current time is the...
How to Write and Land Nanojit Patches - Archive of obsolete content
adobe and mozilla share a copy of nanojit. this means that landing nanojit patches is a bit complicated, but experience has taught us that this is much better than having separate versions of nanojit. ...
...adobe and mozilla share a copy of nanojit. this means that landing nanojit patches is a bit complicated, but experience has taught us that this is much better than having separate versions of nanojit. ...
Extensions - Archive of obsolete content
as any mozilla-based extension. since prism is a totally separate host application, there are some prism-specific issues that you need to handle when creating your extension. most notably, the prism application id and the differences in the user interface (ui). extensions typically overlay the host application's ui to add toolbar buttons, menus and other features. one of prism's features is an ext
reme lack of ui elements, which means that trying to use the same overlays in firefox and prism is really not possible. the basics in order to install an extension in prism, you need to follow the guidelines for building a mozilla-based extension. to support prism specifically, you'll need to add prism to the list of target applications in the extension's install.rdf file. the code snippet will look ...
...he xpi. installing prism supports a basic add-on user interface which allows a user to manage extensions. using this dialog, a user just launches a webapp and opens the add-ons dialog. then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the “install…” button, navigating to the extension and selecting it for installation. extensions can be
removed using the same dialog. ...
Prism - Archive of obsolete content
prism is no longer developed by mozilla labs. there are now no alternatives. prism is a simple xulrunner-based browser that hosts web applications without the normal web browser user interface. prism is based on a concept called site-specific browsers (ssb). an ssb is designed to work exclusively with a single web application. it doesn’t have the menus, toolbars and other accout
rements of a traditional web browser. an ssb also offers tighter integration with the operating system and desktop than a typical web application running through a web browser. applications running in an ssb are therefore able to benefit from many of the advantages of the desktop and of the web at the same time. benefits separate process: web apps can hog memory or processor cycles or even bring down t...
...owser. an ssb also offers tighter integration with the operating system and desktop than a typical web application running through a web browser. applications running in an ssb are therefore able to benefit from many of the advantages of the desktop and of the web at the same time. benefits separate process: web apps can hog memory or processor cycles or even bring down the whole browser in ext
reme cases. by running each app in its own process, we minimize the impact of any mishaps. we can also benefit from operating system tools that lets us view the memory/cpu consumption of a specific application. minimal user interface: a general-purpose browser ui is not necessary or appropriate for most web apps. it is more efficient to provide a ui that is specific to the application. this also cu...
RDF Datasource How-To - Archive of obsolete content
graph back to the original file format. for examples of an implementation like this, look at the rdf/xml datasource or the bookmarks datasource. you may want to choose this implementation if your primary goal is to "wrap" a legacy data store. this implementation may cause problems if your data store can be modified "on the fly" by other agents. aggregate the in-memory datasource. this is an ext
reme case of delegation, where you use xpcom aggregation to implement the nsirdfdatasource interface. see aggregating the in-memory datasource for technical details. if you take this approach, you won't be able to selectively implement methods of the nsirdfdatasource interface; instead, all of the methods will be "forwarded" to the in-memory datasource. this can be useful if your datasource is "read-...
... <treecell>name</treecell> <treecell>url</treecell> </treeitem> </treehead> <!-- treechildren built _here_ --> </tree> </window> the important "magic attributes" have been called out in bold, above: datasources="rdf:my-datasource". this is a space-separated list that may include internal xpcom datasource "identifiers" (as described above) and uris for local or
remote rdf/xml documents. each datasource that is listed will be loaded, and the assertions contained in the datasource will be made available to the tree control for display. ref="http://foo.bar.com/". this roots the graph in your content model. the tree tag will be treated as if it has the id attribute with a value http://foo.bar.com/. <template>...</template>. the xul template that is used to ...
Frequently Asked Questions - Archive of obsolete content
what is the status of the svg implementation? we currently maintain two documents to help answer this question: a status page for svg in firefox 1.5+ and a status page for svg in the development trunk. why does mozilla show source code/gibberish instead of svg? there are two possible reasons for this: a simple mistake in the svg file, or a misconfigured server. if there's a grey area at the top of the source with the text "this xml file does not appear to have any style information associated with it" then the problem is with the svg file. to be valid the root <svg> tag in svg files must have at least the following two "namespace bindings". ...
...ng on what? other than reviewing patches and fixing the occassional bug, alex is currently taking a break from active svg development to concentrate on 'real work' and cool stuff like xtf and jssh. tim is working on implementing <filter> and working on items that need to be done before turning on svg by default. after recently implementing gradients, scooter is working on fixing some issues that
remain outstanding and fixing <switch>. jonathan is working on various bugs, especially those that need to be fixed before svg can be enabled in the official builds. david continues to create svg enabled nightlies and answer build related questions as he has done for some time. finally, occasional fixes are provided by other mozilla hackers. how can i get in contact with you? the best way to get in...
File object - Archive of obsolete content
tation defined format. use of standard "file:" urls is encouraged. if no argument is supplied to the constructor, the current working directory is the file object that is returned. examples of possible prefix strings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file url. when a file is constructed, leading and trailing spaces are
removed from the filename, so new file(" abc.txt ") just creates a file called abc.txt. filenames starting and ending with the pipe symbol (|) are interpreted as pipes. readable pipelines (i.e. pipe to programs generating output on stdout) begin with the pipe symbol; writeable pipelines end with the pipe symbol. bi-directional pipelines are not supported. properties static properties file.i...
...m access. file.hasautoflush force a flush on each line break? (readonly) file.position the file position. writing to the property moves the file pointer. file.isnative true if the file is backed by a native stdio file stream. (i.e. file.input, file.output, file.error or a pipeline) methods file.open() opens the file, specifying file mode and type. file.close() closes the file. file.
remove()
removes the file, provided it is not open. file.copyto() creates a verbatim copy of the file at a new location. file.renameto()
removes the file. file.flush() flushes the operating system's write buffers for the file and blocks until any pending data has been committed to disk. file.seek() moves the file position pointer forward or backwards. file.read() read a fixed number of byt...
Supporting private browsing mode - Archive of obsolete content
firefox 3.5 introduced private browsing mode, in which potentially private information is not recorded. this includes cookies, history information, download information, and so forth. when private browsing mode is enabled, temporary, databases are created to be used for cookies and local storage; these databases are thrown away when private browsing mode is turned off, and the regular databases are re-activated. the temporary cookie and local storage databases start out empty. ...
... "onenterprivatebrowsing" in this._watcher) { this.watcher.onenterprivatebrowsing(); } } else if (adata == "exit") { this._inprivatebrowsing = false; if (this.watcher && "onexitprivatebrowsing" in this._watcher) { this.watcher.onexitprivatebrowsing(); } } } else if (atopic == "quit-application") { this._os.
removeobserver(this, "quit-application"); this._os.
removeobserver(this, "private-browsing"); } }, get inprivatebrowsing() { return this._inprivatebrowsing; }, get watcher() { return this._watcher; }, set watcher(val) { this._watcher = val; } }; of special note is the fact that this helper object is designed to not break on versions of firefox without private br...
Table Layout Regression Tests - Archive of obsolete content
_tests should not be defined (so ac_add_options --enable-tests), patience and time. test runs go to the %moz_src%/layout/html/tests/block directory. avoid the nasty assertions to pop up by set xpcom_debug_break=warn, the world would be a much better place if we could first fix those assertions. as you will probably run your normal mozilla in parallel with the testing issue then: set moz_no_
remote=1 at the command prompt. start the layout debugger via mozilla -layoutdebug - p foo where foo is just another profile than your main profile. select from the regression-test menu the add new list...entry. select %moz_src%/layout/html/tests/block/rtest.lst. execute the baseline test shutdown the layoutdebugger execute mozilla -layoutdebug - p foo >selftest.txt execute the verify test ma...
...tests have failed at the same place as the previous diagnosed false positives => ignore try to figure out what the other regressions are: are they improving the picture or are they regressions? note the difficult to explain test failures. change the source if necessary until the regression tests indicate that your patch does not fork the block and table layout submit your patch and lists the
remaining differences in the bug be prepared to cycle. how the layout regression tests work first the url's to test are red from rtest.lst files in various directories. layout/html/tests/block/rtest.lst points to them. snippet from rtest.lst in the table/marvin directory: body_col.html body_tbody.html body_tfoot.html body_thead.html col_span.html the regression tests compare the frame tree dump...
Table Layout Strategy - Archive of obsolete content
ting to numeffcols is that we don't poke the cellmap for nonexisting cells. overspeficied percent columns <col width="30%"><col width="60%"><tbody></tbody>foobar <col width="33%"><col><tbody></tbody>foobar <table border width="200px"> <col width="30%"><col width="60%"> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> the columns reach here only 90 % percent of the width so the
remaining 20px need to be redistributed between the cols. the second table has <col width="33%"><col> lets return to the first case but now but with more than 100%: <col width="40%"><col width="80%"><tbody></tbody>foobar <col width="40%"><col><tbody></tbody>foobar <table border width="200px"> <col width="40%"><col width="80%"> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> the alg...
...ted between the cols. the second table has <col width="33%"><col> lets return to the first case but now but with more than 100%: <col width="40%"><col width="80%"><tbody></tbody>foobar <col width="40%"><col><tbody></tbody>foobar <table border width="200px"> <col width="40%"><col width="80%"> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> the algorithm tries to satisfy the requi
rements on a first come first serve base. the second table has <col width="40%"><col>. ie and opera handle this pretty much the same as mozilla. original document information author(s): bernd mielke last updated date: september 27, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license |...
Tamarin Build System Documentation - Archive of obsolete content
scription. ...
...ing a sandbox build view the build status page or the queue (if buildbot is busy) how do i view and change the queue? if buildbot is busy the queue is displayed http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm the submitter of a sandbox build may
remove a build request by clicking on the cancel button tamarin-redux builds are higher priority than sandbox builds, they cannot be
removed but the most checkin including all new checkins are built how can i run buildbot scripts locally? the buildbot scripts are located in the tamarin repository, get a current copy in your test repository cd into the build/buildbot/slaves directory: cd build/buildbot/slaves copy the your platform scripts directory into the scripts directory and cd into the new scripts directory: cp -r mac-in...
Elements - Archive of obsolete content
urn out of date information. in firefox 3 and later, the constructor is called when reflow can take place, which results in up-to-date information being returned. see bug 398404 for details. note: all properties of the binding are "imported" as local variables in a constructor's scope. see bug 407314 for more details. destructor the code inside the destructor is called when a binding is being
removed from an element. you can use this to unload resources to free memory. however the destructor is often not called when it should, see bug 230086. the destructor tag must be placed inside the implementation tag. id - the id attribute is a document-unique identifier. method <!entity % method-content "(parameter*,body?)"> <!element method %method-content;> <!attlist method id ...
...operty tag. id - the id attribute is a document-unique identifier. handlers <!entity % handlers-content "handler*"> <!element handlers %handlers-content;> <!attlist handlers id id #implied > the handlers element contains event handlers that can be attached to elements within the bound document. these handlers are installed when the binding is attached and
removed when the binding is detached. the handlers tag must be inside the binding tag. id - the id attribute is a document-unique identifier. handler <!entity % handler-content "pcdata"> <!element handler %handler-content;> <!attlist handler id id #implied event nmref #required action cdat...
Methods - Archive of obsolete content
recated and as of gecko 1.9 no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. methods dircreate creates a new directory. dirgetparent returns an object representing the parent directory. dir
remove
removes a directory. dirrename renames the specified directory. copy makes a copy of the specified file. diskspaceavailable returns the amount of disk space available in bytes. exists returns a boolean value indicating whether the specified file exists or not. execute queues a file for executing as part of the installation process. isdirectory returns a boolean value indicating wh...
...ion process. isdirectory returns a boolean value indicating whether an object is a directory. isfile returns a boolean value indicating whether an object is a file. moddate returns a number representing the last modified date of the given file. moddatechanged specifies whether the last modification on a file is older than a specified date move moves a file from one location to another.
remove
removes a file. rename renames a file in place. size returns the size of the file in bytes. windowsshortcut creates a windows shortcut for a file. macalias creates a macintosh alias for a file. windowsgetshortname returns the windows shortname of the path. windowsregisterserver registers dlls with the registry. ...
deleteRegisteredFile - Archive of obsolete content
deleteregisteredfile (netscape 6 and mozilla do not currently support this method.) deletes the specified file and
removes its entry from the client version registry. method of install object syntax int deleteregisteredfile (string registryname); parameters the deleteregisteredfile method has the following parameter: registryname the pathname in the client version registry for the file that is to be deleted. returns an integer error code. for a list of possible values, see return codes. description the deleteregisteredfile method deletes the specified file and
removes the file's entry from the client version registry. if the file is currently being used, the name of the file that is to be deleted is saved and netscape 6 attempts to delete it each time it star...
...alues, see return codes. description the deleteregisteredfile method deletes the specified file and
removes the file's entry from the client version registry. if the file is currently being used, the name of the file that is to be deleted is saved and netscape 6 attempts to delete it each time it starts up until the file is successfully deleted. this method is used to delete files that cannot be
removed by the uninstall method or to
remove files that are no longer necessary or whose names have changed. ...
deleteValue - Archive of obsolete content
returns 0 if it succeeded; a nonzero number if it failed to schedule the deletion. ...
... returns 0 if it succeeded; a nonzero number if it failed to schedule the deletion. ...
newlines - Archive of obsolete content
below how the text box handles pastes with newlines in them. ...
...ct paste newlines unchanged pastetofirst paste text up to the first newline, dropping the rest of the text replacewithcommas pastes the text with the newlines replaced with commas replacewithspaces pastes the text with newlines replaced with spaces strip pastes the text with the newlines
removed stripsurroundingwhitespace pastes the text with newlines and adjacent whitespace
removed ...
persistence - Archive of obsolete content
this may be used to close a set of notifications as a group without affecting other notifications. ...
...this may be used to close a set of notifications as a group without affecting other notifications. ...
Attribute (XUL) - Archive of obsolete content
ents expr firstdayofweek firstpage first-tab fixed flags flex focused forcecomplete grippyhidden grippytooltiptext group handlectrltab height helpuri hidden hidechrome hidecolumnpicker hideheader hideseconds hidespinbuttons highlightnonmatches homepage href icon id ignoreblurwhilesearching ignorecase ignoreincolumnpicker ignorekeys image inactivetitlebarcolor inc
rement index inputtooltiptext insertafter insertbefore instantapply inverted iscontainer isempty key keycode keytext label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines ...
...nerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizardcancel onwizardfinish onwizardnext open ordinal orient pack pageid pageinc
rement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel
removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex seltype setfocus showcaret showcommentcolumn...
Building accessible custom components in XUL - Archive of obsolete content
ne the grid, then define the headers for each row (numbered 1 through 7), then define the column header and cells for each column. the label for each header and cell is defined in the value attribute. the flex attributes are simply for layout. note: the row and column headers are denoted by description elements, and individual cells are denoted by label elements. this is not an accessibility requi
rement; as we'll see in the next section, the actual xul elements are irrelevant because we will define the role of each element in a separate attribute. <code> <grid class="spreadsheet" id="accjaxspreadsheet" flex="1"> <rows flex="1"></rows> <columns flex="1"> <column> <description value="entry #"/> <description value="1"/> <description value="2"/> <description value=...
...f in the tab order. the individual cells, row headers, and column headers are not in the tab order, but we can still set focus to them programmatically using javascript whenever the user clicks a specific cell. but since the individual cells are not in the tab order, clicking on a spreadsheet cell and tabbing off will move to the spreadsheet's next sibling control, which is what we want. the only
remaining issue is that when the spreadsheet regains focus (by pressing shift-tab, or cycling all the way around the tab order and coming back into the spreadsheet), we need to programmatically reset the focus to the previously focused cell. this is handled in the spreadsheet_focus function, which is registered as a handler for the focus event. <code> var gfocuscell = null; function install_handlers...
How to implement a custom XUL query processor component - Archive of obsolete content
of the name var name = avar.tostring().slice(1); return this._data[name]; }, // return an object instead of a string for convenient comparison purposes // or null to say just use string value getbindingobjectfor: function(avar) { return null; }, // called when a rule matches this item. ...
...ata[name]; }, // return an object instead of a string for convenient comparison purposes // or null to say just use string value getbindingobjectfor: function(avar) { return null; }, // called when a rule matches this item. ...
Methods - Archive of obsolete content
idepopup increase increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwithflags
removeallitems
removeallnotifications
removealltabsbut
removecurrentnotification
removecurrenttab
removeitemat
removeitemfromselection
removenotification
removeprogresslistener
removesession
removetab
removetabsprogresslistener
removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selec...
...mentsbytagnamens dom:element.getfeature fixme: brokenlink dom:element.getuserdata dom:element.hasattribute dom:element.hasattributens dom:element.hasattributes dom:element.haschildnodes dom:element.insertbefore dom:element.isequalnode dom:element.issamenode dom:element.issupported dom:element.lookupnamespaceuri dom:element.lookupprefix dom:element.normalize dom:element.
removeattribute dom:element.
removeattributenode dom:element.
removeattributens dom:element.
removechild dom:element.
removeeventlistener dom:element.replacechild dom:element.setattribute dom:element.setattributenode dom:element.setattributenodens dom:element.setattributens dom:element.setuserdata ...
Property - Archive of obsolete content
row editingsession editor editortype emptytext deprecated since gecko 2 enablecolumndrag eventnode firstordinalcolumn firstpermanentchild flex focused focuseditem forcecomplete group handlectrlpageupdown handlectrltab hasuservalue height hidden hideseconds highlightnonmatches homepage hour hourleadingzero id ignoreblurwhilesearching image inc
rement inputfield inverted is24hourclock ispm issearching iswaiting itemcount label labelelement lastpermanentchild lastselected left linkedpanel listboxobject locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month m...
...istboxobject locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageinc
rement pageindex pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollinc
rement scrollheight scrollwidth searchbutton searchcount sea...
Sorting and filtering a custom tree view - Archive of obsolete content
this is useful if this is an editable table //to prevent the user from losing the row they edited var topvisiblerow = null; if (table) { topvisiblerow = gettopvisiblerow(); } if (data == null) { //put object loading code here. for our purposes, we'll hard code it. data = []; //the property names match the column ids in the xul. this way, we don't have to deal wi...
...for strings, lowercases them function prepareforcomparison(o) { if (typeof o == "string") { return o.tolowercase(); } return o; } function gettopvisiblerow() { return tree.treeboxobject.get...
Bindings - Archive of obsolete content
al.jpg, ?title = 'canal') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?title = 'obelisk') the second triple will add a ?description for the first photo, adding a fourth variable-value pair to the existing data. for the second photo, the datasource doesn't have any matches for the description, so that potential result will be
removed. the same happens for the third photo. in the end, only one photo
remains. (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above', ?description = 'view from the top of the tower looking east of the doges palace') thus, only one match exists, so only one set of content is generated. sometimes, it would be...
...ulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above', ?description = 'view from the top of the tower looking east of the doges palace') thus, only one match exists, so only one set of content is generated. sometimes, it would be useful to have triples that match conditionally; that is, a triple that doesn't cause a result to be
removed as a possible match. this is done with a binding element. this tag doesn't go in the query block but instead inside a rule element. the syntax is as follows: <template> <query> ... </query> <rule> <binding subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> <action> ... </action> </rule> </tem...
Building Hierarchical Trees - Archive of obsolete content
emplate may be used to generate hierarchical trees. this works just like with recursive generation using the content builder. each level of the tree is created using a successive iteration of the template build process. if the items are containers, the tree builder will mark the right rows as containers, so that they can be opened and closed with the small icon twisties on the left of the column.
remember to make the left column the primary column for these to appear. to be able to do this, the tree builder must know that an item is a container. with an rdf datasource, this would usually be an rdf container such as a seq and the tree would display its children. for an xml datasource, the tree might display a node's children as the children in the tree, making the tree display a hierarchy simi...
...e rows are not containers, the tree builder does not recurse to find additional data. the tree builder creates rows lazily, so a closed container will not have any data generated inside in it until the row is opened. when the user opens the tree row, the next level of rows are generated from the template and displayed in the tree. similarly, when the user closes a tree row, the rows inside it are
removed, such that they will have to be generated again the next time the row is opened. if you want to put rows inside the photo rows, you will either need to make each photo resource a container (for this rdf datasource, this will usually be an rdf seq), or use the containment attribute to specify additional properties that indicate containership. if a particular photo had a value for one of the pr...
Building Trees - Archive of obsolete content
plate> </tree> note: the tree columns (treecols) are declared outside the template as static content, since they only need to be declared once. this template uses the simple rule syntax. the extended syntax could also be used. when using the tree builder, the uri attribute must be declared on the treeitem element. here, the simple rdf query syntax is used, so the member variable is rdf:*. the
remaining tags have a similar syntax to a tree, but have only a single row. this row is used as the template data by the tree builder. instead of generating content, the builder uses the cell attributes to determine what to display. the tree builder implements the nsitreeview interface, so it becomes the tree’s view—in other words, the tree’s view and the tree’s builder are the same object. w...
... have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). using tree properties since we need to use special css for trees, the properties attribute on a cell becomes ext
remely useful. it can be used to define extra properties for reference later in a stylesheet. for example, if the properties attribute was set to the value "?creator", you could style the photos created by different people differently. alternatively, you could also use static values (in addition to variables) in the properties attribute. for instance, consider the following css: treechildren::-moz-t...
Introduction - Archive of obsolete content
et, no results will be available, so the builder ends up building nothing. once some data starts arriving, the template builder scans its information to see if some results can be created. if so, some content can be generated. if not, nothing gets generated again. an interesting thing to note is that due to the nature of the rdf parsing process, the builder generates results and builds content inc
rementally while the data arrives. of course, since the data arrives so quickly from the network, you really don't notice this. if the datasource is already loaded, the builder can construct content all in one step, although even this isn't completely true as we'll see later. for xml datasources, use a querytype of xml. the datasources attribute should be the url of an xml file, which can be either t...
...e all combined into a single datasource as if they were all in one datasource to begin with. only the built-in rdf type supports this mechanism; the xml and sqlite types do not. when multiple datasources are used, an nsirdfcompositedatasource is created to hold all of the datasources. you can get this composite datasource in a script by using an element's 'database' property if you want to add or
remove datasources from it. when multiple datasources are used, the rdf is combined as if it were one large datasource. that means that a template query can grab data from anywhere in all of the datasources. this combining of datasources is often termed 'aggregation'. this can be quite a useful feature and works regardless of the datasource. for instance, you might use the built-in bookmarks datasour...
Multiple Queries - Archive of obsolete content
ndeakin/images/t/obelisk.jpg) so four possible results are available, one from the first query and three from the second. however, the example shows that only content for three results are generated. what happened to the fourth result? this is where the useful aspect of multiple queries comes in. note that two of the results above are actually for the same photo (canal.jpg). the template builder
removes any duplicate items before generating content. it does this by only allowing the match for the earliest query. that is, the canal.jpg generated by the second query is
removed, since an earlier query (the first query) already generated a match for that result. one important distinction is that the determination of duplicates is only based on the member variable, in this case the ?photo variabl...
...children six times. you probably won't notice any difference for small amounts of data such as the photos example we've been using, but you might for large datasets. thus, you will want to use the simple query syntax when possible. if you are only going to be using one query, it doesn't matter, of course. speaking of using a single query, the simple query syntax allows a slight shorthand. you can
remove the <rule> element and place the rule's conditions directly on the <template>. there's no performance benefit, but it does save some typing. <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template dc:title="canal"> <button uri="rdf:*" image="rdf:*" label="view" orient=...
Special Condition Tests - Archive of obsolete content
since the iscontainer attribute is set to true, the rule will match as long as the member value or child of the starting node is an rdf container. we could also have left the rules in the original order and set the iscontainer on the first rule to false. the only thing we need to make sure is that the rules are in the proper order, so that the rig...
... added. since the iscontainer attribute is set to true, the rule will match as long as the member value or child of the starting node is an rdf container. we could also have left the rules in the original order and set the iscontainer on the first rule to false. the only thing we need to make sure is that the rules are in the proper order, so that the right data will be matched by the right rule.
remember, the more specific rules should go before less specific rules. note that leaving out the iscontainer attribute is not the same as setting it to either true or false. if you don't use the iscontainer attribute, the rule will match regardless of whether the node is a container or not. the iscontainer attribute will also match containers appropriately if you have used the containment attribute ...
Adding HTML Elements - Archive of obsolete content
lable, you can also add html elements directly within a xul file. you can actually use any html element in a xul file, meaning that java applets and tables can be placed in a window. you should avoid using html elements in xul files if you can. (there are some reasons, and the main one concerns the control of the layout described later). however, this section will describe how to use them anyway.
remember that xml is case-sensitive though, so you'll have to enter the tags and attributes in lowercase. xhtml namespace in order to use html elements in a xul file, you must declare that you are doing so using the xhtml namespace. this way, mozilla can distinguish the html tags from the xul ones. the attribute below should be added to the window tag of the xul file, or to the outermost html element...
...splayed, unless the xul element the text is inside allows this (the description element, for example). the examples below may help. examples of html elements what follows are some examples of adding html elements to windows. in each case, the window and other common information has been left out for simplicity. a dialog with a check box example 2 : source view <html:p> click the box below to
remember this decision. <html:p> <html:input id="rtd" type="checkbox"/> <html:label for="rtd">
remember this decision</html:label> </html:p> </html:p> in this case, one p tag was used to place the text in and another was used to break apart the text into multiple lines. text outside of html blocks example 3 : source view <html:div> would you like to save the following documents? ...
Adding Methods to XBL-defined Elements - Archive of obsolete content
the description element and the second the stack element. constructors and destructors xbl supports two special methods created with separate tags, constructor and destructor. a constructor is called whenever the binding is attached to an element. it is used to initialize the content such as loading preferences or setting the default values of fields. the destructor is called when a binding is
removed from an element. this might be used to save information. there are two points when a binding is attached to an element. the first occurs when a window is displayed. all elements that have xbl-bound content will have their constructors invoked. the order that they are called in should not be relied upon, as they are loaded from various files. the window's onload handler is not called until af...
...ent will have their constructors invoked. the order that they are called in should not be relied upon, as they are loaded from various files. the window's onload handler is not called until after all the bindings have been attached and their constructors finished. the second point is when a binding is attached by changing the -moz-binding style property of an element. the existing binding will be
removed, after its destructor is called. then, the new binding will be added in its place and its constructor invoked. the script for a constructor or destructor should be placed directly inside the appropriate tag. there should only be at most one of each per binding and they take no arguments. here are some examples: <constructor> if (this.childnodes[0].getattribute("open") == "true"){ this...
Commands - Archive of obsolete content
when the disable button is pressed, the command is disabled by setting its disabled attribute, and both buttons will be disabled as well. it is normal to put a group of commands inside a commandset element, together near the top of the xul file, as in the following: <commandset> <command id="cmd_open" oncommand=...
...the supportscommand m...
Creating Dialogs - Archive of obsolete content
window to the original window in one of two ways. first, you could use the window.opener property which holds the window that opened the dialog. second, you could pass a function or object as one of the arguments when creating the dialog, then call that function or modify the object in the opened dialog. note: opendialog() requires universalbrowserwrite privilege. this means it will not work on
remote sites; for those, use window.open() instead. the dialog element the dialog element should be used in place of the window element when creating a dialog. it provides the useful ability to construct up to four buttons along the bottom of the dialog forok,cancel, and so on. you do not need to include the xul for each button; however, you do need to supply code to perform the appropriate tasks ...
...d be returned instead. this would be used, for example, if an invalid value was entered in a field in the dialog. amongst other useful attributes are buttonlabelaccept - label to appear on the accept button egsave buttonaccesskeyaccept - access key to use for the accept button egs defaultbutton - button is activated when the enter key is pressed note: the label attributes are required by
remote sites and are probably missing in the above examples due to bug 224996. example dialog with more features <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel"...
Creating an Installer - Archive of obsolete content
is complete, the new package has been installed. if multiple packages are being installed, their scripts will run in sequence. install triggers as indicated above, the install process is started by an install trigger. this involves the use of the special global object installtrigger. it contains a number of methods which can be used to start an installation. you can use this object in local or
remote content, meaning that it is suitable for a download from a web site. let's create an example install trigger. this involves the use of the function installtrigger.install(). this function takes two arguments, the first is a list of packages to install, and the second is a callback function which will be called when the installation is complete. here is an example: function donefn ( name , re...
...lt) alert("an error occured: " + result); } var xpi = new object(); xpi["find files"] = "findfile.xpi"; installtrigger.install(xpi,donefn); the xpi archive note: if you want to create a new xulrunner application, extension, or theme, see bundles. the installer xpi file is required to contain one file called install.js which is a javascript file which is executed during the installation. the
remaining files are the files to be installed. these files will typically be placed inside a directory in the archive but they do not have to be. for chrome files, they might be structured like the chrome directory. often, the only files placed in an xpi archive will be the install script (install.js) and a jar file. this jar file contains all of the files used by your application. the components pr...
Element Positioning - Archive of obsolete content
ight. you will still be able to resize the window beyond that point but the button will stop growing in size. the box the button is inside will also continue to grow, unless you set a maximum height on the box also. if two buttons are equally flexible, normally both will share the amount of extra space. if one button has a maximum width, the second will still continue to grow and take all of the
remaining space. if a box has a maximum width or height, the children cannot grow larger than that maximum size. if a box has a minimum width or height, the children cannot shrink smaller than that minimum size. examples of setting widths and heights <button label="1" style="width: 100px;"/> <button label="2" style="width: 100em; height: 10px;"/> <button label="3" flex="1" style="min-width: 50px;"...
...ill be ignored. example 2 the second button will be displayed with a height of ten pixels and a width of 100 ems (an em is the size of a character in the current font). example 3 the third button is flexible so it will grow based on the size of the box the button is in. however, the button will never shrink to be less than 50 pixels. other flexible components such as spacers will absorb the
remaining space, breaking the flex ratio. example 4 the fourth button is flexible and will never have a height that is smaller than 2 ex (an ex is usually the height of the letter x in the current font) or wider than 100 pixels. example 5 the text input is flexible but will never grow to be larger than 10 ems. you will often want to use ems when specifying sizes with text in them. this unit is ...
Introduction - Archive of obsolete content
as they have their own executable file. xul package in between the other two are applications which are created in the same way as an extension, but they act like a separate application in a separate window. this is used when you don't want to have the larger size of a complete xulrunner application, but don't mind requiring a mozilla browser to be installed to be able to run the application. ...
... the first three types all require an installation to be performed on the user's machine. ...
More Event Handlers - Archive of obsolete content
addeventlistener('command',buttonpressed,true); var outerbox = document.getelementbyid("outerbox"); outerbox.addeventlistener('command',boxpressed,true); </script> here, an event listener has been added to the button and another event listener has been added to the box. the stoppropagation method has been called in the box's listener, so the button's listener never gets called. if this call was
removed, both listeners would be called and both alerts would appear. prevent default action if no event handlers have been registered for an event, then after completing the capturing and bubbling phases, the element will handle the event in a default way. what will happen depends on the event and the type of element. for example, the 'popupshowing' event is sent to a popup just before it is display...
... event. you might, however, want to display some help text on a status bar. mousemove called when the mouse pointer is moved while over an element. the event may be called many times as the user moves the mouse so you should avoid performing lengthy tasks from this handler. mouseout called when the mouse pointer is moved off of an element. you might then unhighlight the element or
remove status text. there are also a set of drag related events, which occur when the user holds down a mouse button and drags the mouse around. those events are described in drag and drop. mouse button event properties when a mouse button event occurs, a number of additional properties are available to determine which mouse buttons were pressed and the location of the mouse pointer. the event's but...
More Tree Features - Archive of obsolete content
ld rows. by clicking the row, the user can open and close the list. the child rows are indented. notice how the guys row only needs one column as it is a placeholder item for its children. the outer treeitem element contains a single treerow element and a treechildren element. the former creates the data for the parent row and the latter contains the child items. you can nest rows deeper as well.
remember that you must use the container attribute on rows which contain child rows. the simple presence of child rows isn't sufficient to indicate this, as you may have a container that has no children but should still be treated like a container. for example, a directory with no files in it should still be treated like a container whereas a file should not. more about tree columns one additional at...
...column. you can use the style class tree-splitter to hide the notch, although the column may still be resized. you can set a minimum or maximum width of a column using the minwidth or maxwidth attributes. you can set the hidden attribute on a column to true to have the column hidden by default. the user can choose to show the column by selecting it from the drop-down on the end of the header row.
remembering state of columns as with all elements, the persist attribute can be used to save the state of the columns in-between sessions. (that feature will see in the later section). thus, once the user has decided on a column layout they like, it will automatically be saved for next time. you will need to save a number of attributes as indicated in the example below: example 2 : source vie...
More Wizards - Archive of obsolete content
identifier for each page. then, to navigate to a page, use one of two methods: set the next attribute on each page to the page id of the next page to go to. you can change these attributes as needed to navigate to different pages. call the wizard's goto() method. it takes one argument, the page id of a page to go to. you might call this method in the onpageadvanced or onwizardnext handlers.
remember to return false in this case, because you have already changed the page yourself. note that the goto() method, because it causes a page change, will fire the events again, so you'll have to make sure you handle that case. for example, here are a set of wizard pages (the inner content has been omitted): <wizardpage pageid="type" next="font"> <wizardpage pageid="font" next="done"> <wizardpag...
...ast page. a script will adjust the next attributes as necessary to go to the page with the page id color when needed. wizard functions the wizard works much like a tabbed panel, except that the tabs are not displayed and the user navigates between pages by using the buttons along the bottom. because all of the pages are part of the same file, all of the values of the fields on all pages will be
remembered. thus, you do not have to load and save information between pages. however, you may want to do some validation of each field on each page. for this, use the handlers described in the previous section. if a field is invalid, you might display an alert. in some cases, it would be more convenient to disable the next button until valid input has been entered. the wizard has a property canadvan...
Skinning XUL Files by Hand - Archive of obsolete content
d element.class { attribute: value; } element#id { attribute: value; } menu.baseline { border: 0px; font-size: 9pt; } menu#edit { color: red; } other style subgroups contextualsubgroups -- elements appearing within other elements, such as italicized text anywhere within a <p> element or a <div> -- can be grouped in css, but this is an ext
remely inefficient way to style xul, and is frowned upon in the mozilla development community (again, refer to the skinning guidelines in writing skinnable xul and css for more info); css2 also provides some new ways to group elements for styling, which we summarize briefly here, because they appear in mozilla with some frequency, but reserve for another article: pseudo-class parent-chil...
... attribute: value; } parent > child { attribute: value; } button:hover { border: 1px; } menu#file > menuitem { font-weight: bold; } pseudo-classes reflect states of the element: when the mouse moves over a button, for example, the appropriate pseudo-class stylesheet rules are applied. the parent-child relationship is more economical than the afo
rementioned contextual subgrouping, which searches the entire subtree of an element for the subelement. finally, mozilla provides some special extensions to the cascading style sheets specification that allow even more control over the way that xul is skinned within the browser. on to the actual global.css file: after some comments, the css file contains basic style information for the <windo...
Splitters - Archive of obsolete content
<iframe id="content-3" width="60" height="20" src="w3.html"/> <iframe id="content-4" width="60" height="20" src="w4.html"/> </hbox> here, four iframes have been created and a splitter has been placed in-between the first and second one. the collapse has been set to a value of before, meaning that if the splitter grippy is clicked on, the first frame would disappear and the splitter and the
remaining frames would shuffle to the left. the splitter grippy is drawn centered inside the splitter. the splitter has been given a resizeafter value of farthest. this means that when the splitter is dragged, the farthest element after it will change size. in this case, frame 4 will change size. a value has not been specified for resizebefore so it will default to a value of closest. in this case,...
...ll add an area in-between the search criteria and the buttons along the bottom. a splitter will allow you to collapse, or hide, the search results. </tabbox> <iframe src="results.html"/> <splitter collapse="before" resizeafter="grow"> <grippy/> </splitter> <hbox> here, a splitter and an iframe have been added to the dialog. we don't need the spacer after the tabbox any more so we can
remove it. the content of the frame is contained in a file called 'results.html'. create this file and put whatever you want in it for now. the iframe will be replaced later with a results list when we know how to create it. for now, it serves to demonstrate the splitter. the splitter has been set to a collapse value of before meaning that the element just before the splitter will collapse. here, it...
XPCOM Examples - Archive of obsolete content
of cookies that have been saved in the browser. the cookie service can be used for such a purpose. it implements the nsicookiemanager interface which can be used to enumerate over all of the cookies. here is an example which populates a menu list with the names of all of the cookies set from mozillazine. ...
...nsicookie){ if (cookie.host == "www.mozillazine.org") menu.appenditem(cookie.name,cookie.value); } } } </script> <hbox> <menulist id="cookiemenu" onpopupshowing="getcookies();"/> </hbox> the getcookies() function will be called whenever the menu is opened, as indicated by the onpopupshowing attribute on the menulist. the first two lines of getcookies() get the menulist and
remove all of the existing items in the menu. this is done because getcookies() is called every time the menu is opened and we don't want to leave the old items there each time. next, the cookie manager is retrieved. the cookie manager has an enumerator method which returns an object which implements nsisimpleenumerator. this can be used to iterate over all of the cookies. an enumerator has a hasmore...
XUL Changes for Firefox 1.5 - Archive of obsolete content
one - in which case no button is set to be the default. button: icon property the icon property on a button may be used to set stock icons on a button, used on some platforms. for instance <button icon="help"> will create a button with a help icon. ...
...this has been fixed in firefox 1.5 and all code depending on this non zero-based behaviour should be changed. <stringbundle> the <stringbundle> element has a strings property which may be used to retrieve an enumeration of all of the strings in the bundle. ...
action - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidt...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
assign - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
bbox - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
binding - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to match. this must be a uri of the property. subject type...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
bindings - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to match. this must be a uri of the property. subject type: stri...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
box - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements vbox, hbox ...
broadcaster - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
broadcasterset - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
button - Archive of obsolete content
e the buttons, the others in the group are unchecked. icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons. some platforms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add,
remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribute to indicate this. see the appearance of the different icons on some available platforms. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the po...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulbuttonelement ...
column - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, rows, row ...
conditions - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
content - Archive of obsolete content
if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag. for example, by using a value of treechildren, the condition will o...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata relacionados tbd ...
deck - Archive of obsolete content
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 ...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related stack ...
dropmarker - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, cont...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
grippy - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
groupbox - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, cont...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
hbox - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, vbox ...
keyset - Archive of obsolete content
if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it ca...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
listcol - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcols, listhead, listheader, listitem ...
listcols - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listhead, listheader, listitem ...
listhead - Archive of obsolete content
disabled type: boolean gets and sets the value of the disabled attribute. inherited properties...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listheader, listitem ...
listheader - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, cont...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listhead, listitem ...
member - Archive of obsolete content
container type: ? a variable reference to a node that is expected to be a conta...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
observes - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
page - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
popupset - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements popup, menupopup ...
preferences - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes ...
progressmeter - Archive of obsolete content
max type: integer gets and sets the value of the max attribute. mode type: string gets and set...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
query - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
queryset - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
resizer - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
script - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollbox - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollcorner - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
spacer - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements separator, splitter ...
spinbuttons - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
stack - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related deck ...
statusbar - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, contro...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements statusbarpanel interfaces nsiaccessibleprovider ...
stringbundle - Archive of obsolete content
this is an object which implements nsilocale. src type: url gets and sets the value of ...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related xul property files ...
stringbundleset - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
template - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
textnode - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
titlebar - Archive of obsolete content
properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , f...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
toolbargrippy - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database,...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarpalette - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarseparator - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, control...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarset - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarspacer, toolbox ...
toolbarspacer - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, cont...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarspring - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, contro...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbox interfaces nsiaccessiblep...
treechildren - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata example <tree flex="1"> <treecols> <treecol id="sender" label="sender" flex="1"/> <treecol id="subject" label="subject" flex="2"/> </treecols> <treechildren> <treeitem> ...
triple - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
vbox - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, hbox ...
where - Archive of obsolete content
lement align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref,
removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwid...
... getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
xulrunner 1.8.0.1 is the first stable developer preview release of xulrunner. it provides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications. xulrunner 1.8.0.4 is now available as a security/stability update; all users should install this new version. system requi
rements before installing, make sure your computer meets the system requi
rements. the system requi
rements for xulrunner are the same as the system requi
rements for firefox. installing xulrunner mozilla provides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using a archive ...
...er/1.8.0.1 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). uninstalling xulrunner windows/linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to
remove all installed versions of xulrunner,
remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the ex...
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
but very powerful mozilla build system. and all that furniture you smash in the meantime makes great kindling to get you through those cold winter nights. let's face it, it was probably time for you to get some new furniture anyway. everything you ever wanted to know about building mozilla (and thus xulrunner) can be found in the build documentation. follow the instructions for meeting build requi
rements and getting the source, then come back here since the build process itself will be slightly different. got source? now you need to set up a special .mozconfig file to tell mozilla to build both xulrunner and your application. here's a sample .mozconfig for building xulrunner and mccoy: # options for client.mk. mk_add_options moz_build_projects="xulrunner mccoy" mk_add_options moz_objdir=@tops...
...options mccoy --enable-application=mccoy ac_add_app_options mccoy --with-libxul-sdk=../xulrunner/dist the first section tells mozilla what to build and where to put the resulting object files. in this case, we are building both xulrunner and mccoy and placing the build in the directory mccoybase, located at the same level as the current (i.e. source) directory. to build just one of the projects,
remove the name of the other from moz_build_projects. for example, you might want to set it to "xulrunner" now and run make to ensure that everything is set up correctly so far. the second section contains general options for your build. in this case we're creating a debug build, so you'd have to change the relevant options if you want a release build instead. you can find out more about which option...
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - november 24, 2006 - december 1, 2006 announcements none this week. discussions firefox 2.0 should re-implement modal window.open to support web 2.0 a plea to re-implement the option to show modal windows, using window.open(), from inside an untrusted script. this implementation was
removed in 2002 to fight against popups. xml in firefox is a major problem a major debate surrounding the use of xml for customizing rss feeds. devs say this is the way its supposed to be, others say its a bug! the debate continues. discussion of support for modal windows within firefox 2.0 a lengthy post regarding the re-implementation of modal windows into firefox. basic feature that i think is a must in any web broswer a discussion revolving around...
...irefox automatically convert mistaken non-english characters to english so that web addresses will be completed. mozstorage documentation up a revisted discussion surround the mozstorage documentation. rich results for searches a proposal to implement "rich results", a set of registered sites that would provide information as it relates to a user's search. windows dde shell integration
removal a call for responses or concerns regarding the
removal of the dde shell integration. how do allow an internal web site to have universalbrowserwrite? a question regarding having an internal website use universalbrowserwrite on a local intranet. developping microsummary generator questions and discussion surrounding microsummaries in ff 2.0. applying extensions question regarding ...
Monitoring plugins - Archive of obsolete content
bserver service. ...
...his, "experimental-notify-plugin-call", false); this.registered = true; } }, //unregisters from the observer services unregister: function() { if (this.registered == true) { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.
removeobserver(this, "experimental-notify-plugin-call"); this.registered = false; } } } additional resources more information on the observer service: nsiobserverservice nsiobserver ...
NPP_Write - Archive of obsolete content
stream pointer to the current stream. offset offset in bytes of buf from the beginning of the data in the stream. can be used to check stream progress or by range requests from npn_requestread. ...
...at contains len bytes of data offset bytes from the start of the stream. the buffer is allocated by the browser and is deleted after returning from the function, so the plug-in should make a copy of the data it needs to keep. returns the plug-in should return the number of bytes written (consumed by the instance). if the return value is smaller than the size of the buffer, the browser sends the
remaining data to the plug-in through subsequent calls to npp_writeready and npp_write. if unsuccessful, the function signals an error by returning a negative value. the browser will destroy the stream by calling npp_destroystream. description the browser calls the npp_write function to deliver the data specified in a previous npp_writeready call to the plug-in. a plug-in must consume at least as man...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
tems into a single xpi bundle. in the xpi you can use the following structure: platform/ linux_x86-gcc3/ plugins/ libplugin.so darwin_ppc-gcc3/ plugins/ libplugin.dylib more specific information can be found in the platform-specific subdirectories documentation. gecko 2.0 (firefox 4) and later gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)
removed support for platform-specific subdirectories. instead, you need to place the different plugin libraries into the plugins directory. for example: plugins/ libplugin.so libplugin.dylib install manifest the install manifest describes the plugin to the user. for a plugin the manifest only needs to be very simple: <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://w...
...and maximum version of the application that the plugin works with. there can be multiple targetapplication blocks listed. the unpack property is necessary to tell applications using newer versions of gecko to unpack the plugin because dlls can't be loaded from xpi files. providing updates when plugins are packaged in this way they can make use of the built in add-on update system. this allows a
remote update file to be read periodically and an updated version of the plugin offered to the user or to mark the plugin as compatible with a wider range of applications. this is performed by including an updateurl in the install manifest. this should point to an update.rdf file on the internet which will include the updated versions and version information for the plugin. ...
RSS - Archive of obsolete content
getting started a guided tutorial that will help you get started with rss. really simple syndication (rss) is a popular html-like xml-based data format used for syndication. rss has a sordid history and a multitude of different incompatible rss versions. (some being based on rdf, but most only being based on xml.) nonetheless, rss is an ext
remely popular format that is used for syndicating news, blog posts, ipradio, and iptv, with an amazing amount of momentum. documentation why rss slash is popular - counting your comments charles iliya k
rempeaux talks about the rss slash module, why it is popular among some, and how it is used to give a count for your comments. why well-formed web rss module is popular - syndicating your comments charles ili...
... blog posts, ipradio, and iptv, with an amazing amount of momentum. documentation why rss slash is popular - counting your comments charles iliya k
rempeaux talks about the rss slash module, why it is popular among some, and how it is used to give a count for your comments. why well-formed web rss module is popular - syndicating your comments charles iliya k
rempeaux talks about the rss well-formed web module, why it is popular among some, and how it is used to link to your comments. atomic rss tim bray talks about using atom 1.0 as a micro format and extension module for rss 2.0; keeping rss 2.0 as your sydication format but bringing in and using selected atom 1.0 elements. view all... community view mozilla xm...
Threats - Archive of obsolete content
rsely impact data or systems via unauthorized access, destruction, disclosure, or modification of information, and/or denial of service. threats may involve intentional actors (e.g., attacker who wants to access information on a server) or unintentional actors (e.g., administrator who forgets to disable user accounts of a former employee.) threats can be local, such as a disgruntled employee, or
remote, such as an attacker in another geographical area. a threat source is the cause of a threat, such as a hostile cyber or physical attack, a human error of omission or commission, a failure of organization-controlled hardware or software, or other failure beyond the control of the organization. a threat event is an event or situation initiated or caused by a threat source that has the potential...
... and applications that create exploitable vulnerabilities, or errors made by end users and administrators. network traffic typically passes through intermediate computers, such as routers, or is carried over unsecured networks, such as wireless hotspots. because of this, it can be intercepted by a third party. threats against network traffic include the following: eavesdropping. information
remains intact, but its privacy is compromised. for example, someone could learn your credit card number, record a sensitive conversation, or intercept classified information. tampering. information in transit is changed or replaced and then sent on to the recipient. for example, someone could alter an order for goods or change a person's resume. impersonation. information passes to a person who po...
Create Your Own Firefox Background Theme - Archive of obsolete content
kins the default firefox ui background. finished your design? you can submit it right now! creating a theme header image the header image is displayed as the background of the top of the browser window, nestling in behind the toolbars, address bar, search bar and the tab strip. it will be anchored to the top-right corner of the browser window. view a sample theme header here. image requi
rements dimensions should be 3000px wide × 200px high png or jpg file format image must be no larger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser ui. firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window. the upper right-...
...online photo editor. creating a theme footer image in older versions of firefox, or newer versions with certain add-ons installed, the footer image is displayed as the background of the bottom of the browser window, behind the add-on and find bars. it will be anchored to the bottom-left corner of the browser window. footer images are optional. view a sample theme footer here. image requi
rements dimensions should be 3000px wide × 100px high png or jpg file format image must be no larger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser ui. firefox may reveal more of the upper portion of the image if the find bar is open or if an extension adds more height to the bottom of the window. t...
Theme changes in Firefox 3 - Archive of obsolete content
browser.css the width of the drag and drop indicator is no longer calculated during the drag (tabbrowser.xml). instead a '-moz-margin-start' property must be added to .tab-drop-indicator-bar, with a value that is half of the width of the indicator image. also, the visibility of the indicator is now controlled by setting collapsed in tabbrowser.xml. as a result, the 'display' property should be
removed from .tab-drop-indicator-bar (including for dragging="true"). mac os x file description of change browser/themes/pinstripe/browser/tabbrowser/tabdragindicator.png
removed superfluous blank pixels from the edges, so that the image is smaller. may or may not affect other mac themes that use it. browser/themes/pinstripe/browser/browser.css .tabbrowser-...
...on bar icons is: #urlbar[pageproxystate="invalid"] > #urlbar-icons > :not(#go-button) , #urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button { visibility: collapse; } images to add add the following images: chrome://global/skin/icons/information-16.png used when presenting information notices. chrome://global/skin/icons/warning-16.png used when displaying warnings. images to
remove the following images were
removed: chrome://mozapps/skin/extensions/question.png no longer used. mac os x mac os x themes for firefox 3 should add these two rules to the end of chrome://global/skin/wizard.css: .wizard-buttons-btm { padding:xpx; } .wizard-label-box { display: none; } the numeric value ofx, the number of pixels of padding in .wizard-buttons-btm, should be the sam...
Using the W3C DOM - Archive of obsolete content
n element's text using the dom the text of an element is available as the textcontent or innertext property (some browsers support both). the textcontent property was introduced in the w3c dom 3 core, innertext has been an ie method since ie 4 and has been standardised in html5. both properties can be read or set. reading the property returns the text of an element with all the element content
removed. setting the property replaces all the element's content with a single text node with the assigned text. the following examples show how to modify the text of a span element that already exists in the html file. <body> <p>papa's got <span id="dynatext">a lot of nerve</span>!</p> <script type="text/javascript"> // get a reference to the span element var spanel = document.getelementbyid(...
...it then tests for support for textcontent, then innertext and uses which ever is supported. if neither is supported, it assumes support for basic dom 1 methods and uses those. it should be clear that translating scripts to...
-ms-filter - Archive of obsolete content
the -ms-filter css property is a microsoft extension that sets or retrieves the filter or collection of filters applied to an object. warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was
removed and should no longer be used. syntax the -ms-filter property is specified as a string that contains a list of one or more items, separated by spaces, of the following types: filters transitions procedural surfaces formal syntax filter: <-ms-filter-function>+ -ms-filter: [ "'" <-ms-filter-function># "'" ] | [ '"' <-ms-filter-function># '"' ] where <-ms-filter-function> = <-ms-filter-function-progi...
... .gradient.vertical { -ms-filter: 'progid:dximagetransform.microsoft.gradient(startcolorstr="#ffffff", endcolorstr="#000000", gradienttype=0)'; background-image: linear-gradient(to bottom, #ffffff 0%, #000000 100%); } result specifications not part of any specification. ...
-ms-scrollbar-base-color - Archive of obsolete content
</div> </body> the following image shows the result. note that scro...
...e-color: aqua; scrollbar-arrow-color: blue; border-color: blue; } .bisquescroll { scrollbar-base-color: bisque; scrollbar-arrow-color: red; border-color: red; } <body> <div class="aquascroll"> lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="bisquescroll"> lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> the following image shows the result. note that scrollbar-base-color sets the scroll bar face color and highlight color to different shades of the same base color. specifications not part of any specification. ...
-ms-scrollbar-highlight-color - Archive of obsolete content
</div> </body> this image shows the result: specifications not part...
...blue; border-color: blue; } .redscroll { -ms-scrollbar-highlight-color: bisque; -ms-scrollbar-face-color: red; -ms-scrollbar-arrow-color: red; border-color: red; } <body> <div class="bluescroll"> lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="redscroll"> lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> this image shows the result: specifications not part of any specification. ...
-ms-scrollbar-track-color - Archive of obsolete content
</div> </body> the following image shows the result. ...
...lue; border-color: blue; } .redscroll { -ms-scrollbar-highlight-color: bisque; -ms-scrollbar-face-color: red; -ms-scrollbar-arrow-color: red; border-color: red; } <body> <div class="bluescroll"> lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> <div class="redscroll"> lo
rem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </body> the following image shows the result. ...
Processing XML with E4X - Archive of obsolete content
use domparser/domserializer or a non-native jxon algorithm instead. first introduced in javascript 1.6, e4x introduces a native xml object to the javascript language, and adds syntax for embedding literal xml documents in javascript code. a full definition of e4x can be found in the ecma-357 specification. this chapter provides a practical overview of the language; it is not a complete reference. ...
...ecification. this chapter provides a practical overview of the language; it is not a complete reference. compatibility issues prior to widespread browser support for the <script> element, it was common for javascript embedded in a page to be surrounded by html comment tags to prevent <script> unaware browsers from displaying javascript code to the user. this practice is no longer necessary, but
remains in some legacy code. for backwards compatibility, e4x defaults to ignoring comments and cdata sections. you can add an e4x=1 argument to your <script> tag to disable this restriction: <script type="text/javascript;e4x=1"> ... </script> creating an xml object e4x offers two principal ways of creating an xml object. the first is to pass a string to the xml constructor: var languages = new...
E4X - Archive of obsolete content
use domparser/domserializer or a non-native jxon algorithm instead. ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. ...
...use domparser/domserializer or a non-native jxon algorithm instead. ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. ...
Accessing XML children - Archive of obsolete content
use domparser/domserializer or a non-native jxon algorithm instead. normal javascript objects use the . operator or [] notation to set properties. var a = {}; a.foo = 1; a["bar"] = 2; in e4x, the . and [] operators provide access to the child nodes of an e4x element. ...
... note, however, that assigning a non-xml value to a child element that doesn't exist will create that element. var element1 = <foo/> element1.bar = 1; produces <foo> <bar>1</bar> </foo> if the child node already exists, the . operator allows you to change its value. var elem = <foo> <bar>1</bar> </foo> elem.bar = 2; will replace the previous value of 1 with 2. you can
remove a child node by using the delete command: var elem = <foo> <bar/> <baz/> </foo> delete elem.bar; leaves just <foo> <baz/> </foo> the . operator can also be used to replace particular child nodes var elem1 = <foo> <bar/> </foo>; var elem2 = <red> <blue/> </red>; elem1.bar = elem2; replaces the <...
New in JavaScript 1.8.5 - Archive of obsolete content
object as the arguments list, instead of only true arrays. strict mode support array.tostring() now works even on non-arrays by either returning the result of calling its join() method if one is available or by calling its tostring() method. other standardization work various non-standard syntaxes for defining getters and setters have been
removed; ecmascript 5 defined syntax has not been changed. these were all pretty esoteric and rarely used; if this affects you, see this blog post for details. new objects object description old proxy api offers support for creating object and function proxies tha...
... in date: the date object's parse() method now supports simple iso 8601 format date strings. global objects made read only: the nan, infinity, and undefined global objects have been made read only, per the ecmascript 5 specification. obj.__parent__ and obj.__count__ become obsolete. some information about why: spidermonkey change du jour: the special __parent__ property has been
removed bug 551529 & bug 552560. trailing commas no longer accepted in json.parse(). ...
Object.unobserve() - Archive of obsolete content
the object.unobserve() method was used to
remove observers set by object.observe(), but has been deprecated and
removed from browsers. you can use the more general proxy object instead. syntax object.unobserve(obj, callback) parameters obj the object to stop observing. callback the reference to the observer to stop calling each time changes are made on the object obj. return value the specified object. description object.unobserve() should be called after object.observe() in order to
remove an observer from an object. the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer. ...
... return value the specified object. description object.unobserve() should be called after object.observe() in order to
remove an observer from an object. the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer. it's useless to call object.unobserve() with an anonymous function as callback, it will not
remove any observer. examples unobserving an object var obj = { foo: 0, bar: 1 }; var observer = function(changes) { console.log(changes); } object.observe(obj, observer); obj.newproperty = 2; // [{name: 'newproperty', object: <obj>, type: 'add'}] object.unobserve(obj, observer); obj.foo = 1; // the callback wasn't called using an anonymous function var person = { name: 'ahmed', ...
Object.prototype.unwatch() - Archive of obsolete content
syntax obj.unwatch(prop) parameters prop the name of a property of the object to stop watching. return value undefined. ...
... syntax obj.unwatch(prop) parameters prop the name of a property of the object to stop watching. return value undefined. ...
Object.prototype.watch() - Archive of obsolete content
in addition, using watchpoints has a serious negative impact on performance, which is especially true when used on global objects, such as window. you can usually use setters and getters or proxies instead. the watch() method watches for a property to be assigned a value and runs a function when that occurs. syntax obj.watch(prop, handler) parameters prop the name of a property of the object on which you wish to monitor changes. ...
...ct, calling handler(prop, oldval, newval) whenever prop is set and storing the return value in that property. a watchpoint can filter (or nullify) the value assignment, by returning a modified newval (or by returning oldval). if you delete a property for which a watchpoint has been set, that watchpoint does not disappear. if you later recreate the property, the watchpoint is still in effect. to
remove a watchpoint, use the unwatch() method. by default, the watch method is inherited by every object descended from object. the javascript debugger has functionality similar to that provided by this method, as well as other debugging options. for information on the debugger, see venkman. in firefox, handler is only called from assignments in script, not from native code. for example, window.wat...
arguments.caller - Archive of obsolete content
description this property is not available anymore, but you can still use function.caller. function whocalled() { if (whocalled.caller == null) console.log('i was called from the global scope.'); else console.log(whocalled.caller + ' called me!'); } examples the following code was used to check the value of arguments.caller in a function, but doesn't work anymore. ...
... ...
JSObject - Archive of obsolete content
.javascript.jsobject class has the following methods: call calls a javascript method. equals determines if two jsobject objects refer to the same instance. (what's the problem with == ?) eval evaluates a javascript expression. getmember retrieves the value of a property of a javascript object. getslot retrieves the value of an array element of a javascript object.
removemember
removes a property of a javascript object. setmember sets the value of a property of a javascript object. setslot sets the value of an array element of a javascript object. tostring converts a jsobject to a string. the netscape.javascript.jsobject class has the following static method: getwindow gets a jsobject for the window containing the given applet. call...
...mber(string name) getslot method. retrieves the value of an array element of a javascript object. equivalent to "this[index]" in javascript. declaration public object getslot(int index) getwindow static method. returns a jsobject for the window containing the given applet. this method is useful in client-side javascript only. declaration public static jsobject getwindow(applet applet)
removemember method.
removes a property of a javascript object. declaration public void
removemember(string name) setmember method. sets the value of a property of a javascript object. equivalent to "this.name = value" in javascript. declaration public void setmember(string name, object value) setslot method. sets the value of an array element of a javascript object. equivalent to "this...
LiveConnect - Archive of obsolete content
uded special support for the java<->javascript bridge (such as the java and packages global objects), but as of mozilla 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) liveconnect functionality is provided solely by the oracle's java plugin. documentation java plugin - liveconnect documentation this is likely the most up-to-date documentation of liveconnect.
removal of java and packages global objects in mozilla 16 see bug 748343 for the rationale and workarounds. you can still embed java applets and access their api from javascript. liveconnect overview an overview for liveconnect. liveconnect reference the java classes used for liveconnect, along with their constructors and methods. java in firefox extensions ...
... for liveconnect. liveconnect reference the java classes used for liveconnect, along with their constructors and methods. java in firefox extensions community view mozilla.dev.tech.java forums... mailing list newsgroup rss feed related topics javascript, plugins older notes (please update or
remove as needed.) while the bloated liveconnect code in the mozilla source was
removed in version 1.9.2 of the platform (see bug 442399), its former api has been restored (see also the specification and this thread) (building on npapi?), and as of java 6 update 12, extensions as well as applets can make use of this restored api. the reimplementation also restores the ability to use try-catch except...
Packages - Archive of obsolete content
created by the packages object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method. ...
... created by the packages object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method. ...
StopIteration - Archive of obsolete content
examples stopiteration is thrown by iterator. ...
... examples stopiteration is thrown by iterator. var a = { x: 10, y: 20 }; var iter = iterator(a); console.log(iter.next()); // ["x", 10] console.log(iter.next()); // ["y", 20] console.log(iter.next()); // throws stopiteration throwing stopiteration. ...
background-size - Archive of obsolete content
vides details on which browsers are encompassed by each. i'm going to post on dev-mdc momentarily with a proposal on this. (sheppy 07 december 2009) we should encourage web developers to ask for layout engines, not for browsers. [that said, the popularity of chrome let me think of a table row like safari, chrome (webkit) | 4.0, 2.0 (528). but i'm not able and willing spending time for this.
remember you have to test yourself, don't trust online references, don't trust webkit | apple | google homepage, they are wrong. don't trust the internet at alll! ] listing konqueror below the table is a compromise for consistency. feel free to put it inside, nothing is set in stone. konqueror's global market share is 0.05%, (< 5% of linux users). given the fact that this reference has serious short...
... en/css_reference/property_template and all css property pages ; ) start with -webkit-background-size and investigate support of contain and cover keywords and "omitted second value" behavior. [i assume it's the same as safari, since they just backported a webkit patch into khtml. but we need facts, rather than assumptions.] btw, some time ago i'v listed opera in the property template table and
removed netscape because netscape is gecko based and opera has a global market share of > 2% (> 40% in some european countries). user:jürgen jeka 2009-08-04 <hr> is there anyway to have the -moz-border-image only apply if -moz-background-size is not supported? i'm guessing not, just asking because having both rules in for 3.6 creates a strange effect: -moz-border-image gets inherited by every eleme...
Requests For Enhancement - Archive of obsolete content
applications by using xforms. if previously you was forced to use ajax for this then now xforms makes this for you automatically. custom controls interfaces this section contains rfe to the custom control interfaces. if you find that you can't create a custom control due to limitations in our interfaces or the functionality of our controls, then this is the right place to pass along your requi
rements. custom controls if you have a custom control that you believe will help fulfill the needs of form authors or other custom controls authors, please file it here. this section could be of particular interest to people using custom controls in xul documents for the following reasons: xul, in many cases, is much better suited for application development than xhtml. therefore the control set...
...e will help fulfill the needs of form authors or other custom controls authors, please file it here. this section could be of particular interest to people using custom controls in xul documents for the following reasons: xul, in many cases, is much better suited for application development than xhtml. therefore the control set may need to be more extensive to address the wider spectrum of requi
rements that a xul application will have on its controls. xul is a feature of mozilla only and custom control authors should be aware their controls won't work on other browser platforms. enhancements of xforms elements if you find that none of the elements proposed by the xforms spec address your requi
rements, please post your usecase here. xforms extension ui this section should be for used ...
XForms Secret Element - Archive of obsolete content
the default value is false. ...
...ng simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xforms secret element is represented by a password field. the password field is a text field, the value of which is hidden by asterisks (xhtml/xul). characteristics analogous widgets are <xhtml:input type="password"/> and <xul:textbox type="password"/> if the inc
remental attribute is present and has the value true, then the bound instance node is updated on every user input. please keep in mind that the instance data will hold exactly what the user gave as input. any other xform control bound to that data will show that data 'as is'. ...
XForms - Archive of obsolete content
see the html forms guide for approaches to creating forms in html5. xforms essentials an online book giving you a guided tour of xforms. xforms were envisioned as the future of online forms as envisioned by the w3c. ...
...see the html forms guide for approaches to creating forms in html5. xforms essentials an online book giving you a guided tour of xforms. xforms were envisioned as the future of online forms as envisioned by the w3c. ...
Archived open Web documentation - Archive of obsolete content
ernative to e4x is a non-native jxon algorithm. e4x tutorial this tutorial walks you through the basic syntax of e4x (ecmascript for xml). with e4x, programmers can manipulate an xml document with a syntax more familiar to javascript programming. talk:array.foreach() ok, in the end i didn't
remove the old code as it isn't hosted anywhere (i thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. iterator the iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. liveconne...
...sted anywhere (i thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. iterator the iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. liveconnect (please update or
remove as needed.) msx emulator (jsmsx) old proxy api proxies are objects for which the programmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the programmer define most of the behavior of an object in javasc...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
ndardized across groups. in the development world, there is a need for standards because applications are designed across multiple development groups. many organizations publish internal development standards and practices. for example, an organization may decide that c++, java, and javascript will be the primary coding languages. they may require that each project be comprised of marketing requi
rements documents, product requi
rements documents, functional requi
rements documents, quality assurance test plans, and certification documents. as organizations mature, they discover that they need more processes to give them greater control, which allows them to more easily plan and predict. with processes, organizations can make release schedules, implement marketing plans, analyze resource alloc...
... verify, and certify the tests, and eliminate redundant testing databases to ensure consistency and reliability. like the engineers, standardization also helps the qa engineers become highly proficient and capable of shifting from project to project. summary as organizations expand product development across multiple devices and product families, integration and compatibility must be a key requi
rement. adhering to a set of future-focused international standards will make cross-functional integration possible. adopting standards will not only help an organizations end users enjoy a cross application experience; organizations will help themselves by giving development and quality assurance engineers the tools to become better equipped and flexible. lastly, by following a series of standards, ...
2D collision detection - Game development
his.color = "blue"; } }); var circle1 = {radius: 20, x: 5, y: 5}; var circle2 = {radius: 12, x: 10, y: 5}; var dx = circle1.x - circle2.x; var dy = circle1.y - circle2.y; var distance = math.sqrt(dx * dx + dy * dy); if (distance < circle1.radius + circle2.radius) { // collision detected! } note: here is another example without canvas or external libraries. separating axis theo
rem this is a collision algorithm that can detect a collision between any two *convex* polygons. it's more complicated to implement than the above methods but is more powerful. the complexity of an algorithm like this means we will need to consider performance optimization, covered in the next section. implementing sat is out of scope for this page so see the recommended tutorials below: separat...
...ollision algorithm that can detect a collision between any two *convex* polygons. it's more complicated to implement than the above methods but is more powerful. the complexity of an algorithm like this means we will need to consider performance optimization, covered in the next section. implementing sat is out of scope for this page so see the recommended tutorials below: separating axis theo
rem (sat) explanation collision detection and response collision detection using the separating axis theo
rem sat (separating axis theo
rem) separating axis theo
rem collision performance while some of these algorithms for collision detection are simple enough to calculate, it can be a waste of cycles to test *every* entity with every other entity. usually games will split collision into two phas...
Building up a basic demo with PlayCanvas editor - Game development
sed on the newly created box. click on the plus button in the assets tab, and click on the material option in the dropdown list that appears to create a new material. click on your new material in the assets tab and its entity inspector will appear on the right hand side of the display. now edit the name text field to give it a unique name (we've chosen boxmaterial). a unique name will help us
remember what this material is for — we will add more later! to change its color we'll use the diffuse option in the entity inspector. click diffuse, then select the colored box next to the color label — it will open a color wheel. from here you can click your desired color or enter it in the bottom text field as a hex value. we've chosen a blue color with a hex value of 0095dd — enter this ...
...)), 1); the setlocalscale() method applies the given values to the x, y and z axes of the object. in our case we're modifying the scale of the cylinder on the y axis, giving it as a value the math.sin() of the timer, with math.abs() applied to the result of that to have the values always above zero (0-1; sin values are normally between -1 and 1.) this gives us a nice scaling effect as a result.
remember to add the cylinderanimation.js file to the cylinder object to apply the given animations. the cone time to play with the last object — the cone. create a coneanimation.js file and double click it to open it in the editor. next, add the following line to the initialize() function: this.timer = 0; to move the cone up and down we will use the setposition() method — add the code below ...
GLSL Shaders - Game development
agment shaders compute the renderings of a shape's colors and other attributes. glsl is not as intuitive as javascript. glsl is strongly typed and there is a lot of math involving vectors and matrices. it can get very complicated — very quickly. in this article we will make a simple code example that renders a cube. to speed up the background code we will be using the three.js api. as you may
remember from the basic theory article, a vertex is a point in a 3d coordinate system. vertices may, and usually do, have additional properties. the 3d coordinate system defines space and the vertices help define shapes in that space. shader types a shader is essentially a function required to draw something on the screen. shaders run on a gpu (graphics processing unit), which is optimized for such...
...e purpose of the fragment shader is to set up the gl_fragcolor variable. gl_fragcolor is a built-in glsl variable like gl_position. the calculations result in a variable containing the information about the rgba color. demo let's build a simple demo to explain those shaders in action. be sure to read three.js tutorial first to grasp the concept of the scene, its objects, and materials. note:
remember that you don't have to use three.js or any other library to write your shaders — pure webgl (web graphics library) is more than enough. we've used three.js here to make the background code a lot simpler and clearer to understand, so you can just focus on the shader code. three.js and other 3d libraries abstract a lot of things for you — if you wanted to create such an example in raw webg...
Desktop gamepad controls - Game development
if(gamepadbuttonpressedhandler(2)) { playerx -= 5; } else if(gamepadbuttonpressedhandler(3)) { playerx += 5; } if(gamepadbuttonpressedhandler(11)) { alert('boom!'); } // ... ctx.drawimage(img, playerx, playery); requestanimationframe(draw); } in this case, we are checking the four d-pad buttons (0-3) and the a button (11). note: please
remember that different devices may have different key mappings, i.e. the d-pad right button have an index of 3 on the wireless xbox 360, but may have a different one on another device. you could also create a helper function that would assign proper names to the listed buttons, so for example istead of checking out if gamepadbuttonpressedhandler(3) is pressed, you could do a more descriptive check:...
..., and the axes property stores the array containing the values signifying the amount an axis is pressed in the x and y directions, represented by a float in the (-1, 1) range. ...
Implementing controls using the Gamepad API - Game development
gamepad object there's lots of useful information contained in the gamepad object, with the states of buttons and axes being the most important: id: a string containing information about the controller. index: a unique indentifier for the connected device. connected: a boolean variable, true if the device is connected. mapping: the layout ty...
... string: enum gamepadmappingtype { "", "standard" }; this enum defines the set of known mappings for a gamepad. for now, there's only the standard layout available, but new ones may appear in the future. if the layout is unknown, it is set to an empty string. events there were more events available in the spec than just gamepadconnected and gamepaddisconnected available, but they were
removed from the specification as they were thought to not be very useful. the discussion is still ongoing as to whether they should be put back, and in what form. summary the gamepad api is very easy to develop with. now it's easier than ever to deliver a console-like experience to the browser without the need for any plugins. you can play the full version of the hungry fridge game directly in you...
Bounce off the walls - Game development
unction to this: ctx.arc(x, y, ballradius, 0, math.pi*2); bouncing off the top and bottom there are four walls to bounce the ball off — let's focus on the top one first. we need to check, on every frame, whether the ball is touching the top edge of the canvas — if yes, we'll reverse the ball movement so it will start to move in the opposite direction and stay within the visible boundaries.
remembering that the coordinate system starts from the top left, we can come up with something like this: if(y + dy < 0) { dy = -dy; } if the y value of the ball position is lower than zero, change the direction of the movement on the y axis by setting it equal to itself, reversed. if the ball was moving upwards with a speed of 2 pixels per frame, now it will be moving "up" with a speed of -2 p...
...moving upwards with a speed of 2 pixels per frame, now it will be moving "up" with a speed of -2 pixels, which actually equals to moving down at a speed of 2 pixels per frame. the code above would deal with the ball bouncing off the top edge, so now let's think about the bottom edge: if(y + dy > canvas.height) { dy = -dy; } if the ball's y position is greater than the height of the canvas (
remember that we count the y values from the top left, so the top edge starts at 0 and the bottom edge is at 320 pixels, the canvas' height), then bounce it off the bottom edge by reversing the y axis movement as before. we could merge those two statements into one to save on code verbosity: if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } if either of the two statements is true, reverse...
Collision detection - Game development
rick) { brick.kill(); } and that's it! reload your code and you should see the new collision detection working just as required. thanks to phaser there are two parameters passed to the function — the first one is the ball, which we explicitly defined in the collide method, and the second one is the single brick from the bricks group that the ball is colliding with. inside the function we
remove the brick in question from the screen simply by running the kill() method on it. you would expect to have to write a lot more calculations of your own to implement collision detection when using pure javascript. that's the beauty of using the framework — you can leave a lot of boring code to phaser, and focus on the most fun and interesting parts of making a game. compare your code you ca...
...implement collision detection when using pure javascript. that's the beauty of using the framework — you can leave a lot of boring code to phaser, and focus on the most fun and interesting parts of making a game. compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps we can hit the bricks and
remove them, which is a nice addition to the gameplay already. it would be even better to count the destroyed bricks inc
rement the score as a result. « previousnext » ...
Extra lives - Game development
nger by adding lives. in this article we'll implement a lives system, so that the player can continue playing until they have lost three lives, not just one. new variables add the following new variables below the existing ones in your code: var lives = 3; var livestext; var lifelosttext; these respectively will store the number of lives, the text label that displays the number of lives that
remain, and a text label that will be shown on screen when the player loses one of their lives. defining the new text labels defining the texts look like something we already did in the score lesson. add the following lines below the existing scoretext definition inside your create() function: livestext = game.add.text(game.world.width-5, 5, 'lives: '+lives, { font: '18px arial', fill: '#0095dd' }...
......
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
a polyfill is a piece of code (usually javascript on the web) used to provide modern functionality on older browsers that do not natively support it. for example, a polyfill could be used to mimic the functionality of an html canvas element on microsoft internet explorer 7 using a silverlight plugin or mimic support for css
rem units, or text-shadow, or whatever you want. the reason why polyfills are not used exclusively is for better functionality and better performance. native implementations of apis can do more and are faster than polyfills. for example, the object.create polyfill only contains the functionalities that are possible in a non-native implementation of object.create. other times, polyfills are used to address issues where browsers implement the same features in diff...
...us, the javascript developer had access to only a very tiny handful of javascript apis that worked more-or-less consistently across all browsers. using a polyfill to handle browser-specific implementations is practically non-existent today because modern browsers mostly implement a broad set of apis according to standard semantics. learn more general knowledge what is a polyfill? (article by
remy sharp, the originator of the term) ...
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
or limited-resource devices such as mobile phones. wcag 2.0 which superseded wcag 1.0 was published as a w3c recommendation on 11 december 2008. it consists of 12 guidelines organized under 4 principles (perceivable, operable, understandable, and robust) and each guideline has testable success criteria. ...
... 4 principles (perceivable, operable, understandable, and robust) and each guideline has testable success criteria. wcag uses three levels of conformance: priority 1: web developers must satisfy these requi
rements, otherwise it will be impossible for one or more groups to access the web content. conformance to this level is described as a. priority 2: web developers should satisfy these requi
rements, otherwise some groups will find it difficult to access the web content. conformance to this level is described as aa or double-a. priority 3: web developers may satisfy these requi
rements, in order to make it easier for some groups to access the web content. conformance to this level is described as aaa or triple-a. learn more general knowledge wcag on wikipedia technical knowledge ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
responsenodes = a; } else { // otherwise, the response must be a single well-formed document response responsenodes = [response.documentelement]; // put in array so can be treated the same way as the above } // prepend any node(s) (as xml) then
remove xinclude for (j=0; j < responsenodes.length ; j++) { xincludeparent.insertbefore(responsenodes[j], xinclude); } xincludeparent.
removechild(xinclude); } else if (responsetype === 'responsetext') { if (e...
...arent.replacechild(textnode, xinclude); } // replace xinclude in doc with response now (as plain text or xml) } } } catch (e) { // use xi:fallback if xinclude retrieval above failed var xifallbackchildren = xifallback.childnodes; // prepend any node(s) then
remove xinclude for (j=0; j < xifallbackchildren.length ; j++) { xincludeparent.insertbefore(xifallbackchildren[j], xinclude); } xincludeparent.
removechild(xinclude); } } } return docu; } ...
CSS and JavaScript accessibility best practices - Learn web development
t don't change it so much that it no longer looks or behaves as expected. the following sections summarize the main html features to consider. "standard" text content structure headings, paragraphs, lists — the core text content of your page: <h1>heading</h1> <p>paragraph</p> <ul> <li>my list</li> <li>has two items.</li> </ul> some typical css might look like this: h1 { font-size: 5
rem; } p, li { line-height: 1.5; font-size: 1.6
rem; } you should: select sensible font sizes, line heights, letter spacing, etc. to make your text logical, legible, and comfortable to read. make sure your headings stand out from your body text, typically big and bold like the default styling. your lists should look like lists. your text color should contrast well with your background color...
... form element that has focus, or when such an element is tapped on a touchscreen device. this doesn't work by default however when you allow a non-default-focusable event to have focus using tabindex — in such cases you need to detect specifically when that exact key is pressed (see building keyboard accessibility back in). test your skills! you've reached the end of this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: css and javascript accessibility. summary we hope this article has given you a good amount of detail and understanding about the accessibility issues surrounding css and javascript use on web pages. next up, wai-aria! previous o...
A cool-looking box - Learn web development
fun we can have with css. general tasks apply the css to the html. styling the box we'd like you to style the provided <p>, giving it the following: a reasonable width for a large button, say around 200 pixels. a reasonable height for a large button, centering the text vertically in the process. centered text. a slight increase in font size, to around 17-18 pixel computed style. use
rems. write a comment about how you worked out the value. a base color for the design. give the box this color as its background color. the same color for the text; make it readable using a black text shadow. a fairly subtle border radius. a 1-pixel solid border with a color similar to the base color, but a slightly darker shade. a linear semi-transparent black gradient that goes toward the bott...
...ts background color. the same color for the text; make it readable using a black text shadow. a fairly subtle border radius. a 1-pixel solid border with a color similar to the base color, but a slightly darker shade. a linear semi-transparent black gradient that goes toward the bottom right corner. make it completely transparent at the start, gradiating to around 0.2 opacity by 30% along, and
remaining at the same color until the end. multiple box shadows. give it one standard box shadow to make the box look slightly raised off the page. the other two should be inset box shadows — a semi-transparent white shadow near the top left and a semi-transparent black shadow near the bottom right — to add to the nice raised 3d look of the box. example the following screenshot shows an examp...
Advanced styling effects - Learn web development
iple light sources. other box shadow features unlike text-shadow, box-shadow has an inset keyword available — putting this at the start of a shadow declaration causes it to become an inner shadow, rather than an outer shadow. let's have a look and see what we mean. ...
... help you bring interest to your designs, is the filter property. this property enables photoshop-like filters right from css. in the example below we have used two different values for filter. the first is blur() — this function can be passed a value to indicate how much the image should be blurred. the second is grayscale(); by using a percentage we are setting how much color we want to be
removed. play with the percentage and pixel parameters in the live example to see how the images change. you could also swap the values for some others. try contrast(200%), invert(100%) or hue-rotate(20deg) on the live example below. take a look at the mdn page for filter for many other options you could try. you can apply filters to any element and not just images. some of the filter options ava...
Images, media, and form elements - Learn web development
the overflowing issue? as we learned in our previous lesson, a common technique is to make the max-width of an image 100%. this will enable the image to become smaller in size than the box but not larger. this technique will work with other replaced elements such as <video>s, or <iframe>s. try adding max-width: 100% to the <img> element in the example above. you will see that the smaller image
remains unchanged, but the larger one becomes smaller to fit into the box. you can make other choices about images inside containers. for example, you may want to size an image so it completely covers a box. the object-fit property can help you here. when using object-fit the replaced element can be sized to fit a box in a variety of ways. below we have used the value cover, which sizes the image ...
...nsistent than in the past. however if you want to take a look at one example, check out normalize.css, which is a very popular stylesheet used as a base by many projects. for further information on styling forms, take a look at the two articles in the html section of these guides. styling web forms advanced form styling test your skills! we have covered a lot in this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: images and form elements. summary this lesson has highlighted some of the differences you will encounter when working with images, media, and other unusual elements in css. in the next article we'll look over a few tips you'll find use...
Combinators - Learn web development
. descendent elements further down the hierarchy don't match. for example, to select only <p> elements that are direct children of <article> elements: article > p in this next example, we have an unordered list, nested inside of which is an ordered list. i am using the child combinator to select only the <li> elements which are a direct child of a <ul>, and have given them a top border. if you
remove the > that designates this as a child combinator, you end up with a descendant selector and all <li> elements will get a red border. adjacent sibling combinator the adjacent sibling selector (+) is used to select something if it is right next to another element at the same level of the hierarchy. for example, to select all <img> elements that come right after <p> elements: p + img a comm...
...to the location of that element in the markup. it is often better to create a simple class and apply that to the element in question. that said, your knowledge of combinators will come in very useful if you need to get to something in your document and are unable to access the html, perhaps due to it being generated by a cms. test your skills! we have covered a lot in this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: selectors. moving on this is the last section in our lessons on selectors. next we will move on to another important part of css — the css box model. previous overview: building blocks next in this module cascade and inh...
Test your skills: Selectors - Learn web development
the background green. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. selectors three in this example, try making the following changes without adding to the html. style links, making the link-state orange, visited links green, and
remove the underline on hover. make the first element inside the container font-size: 150% and the first line of that element red. stripe every other row in the table by selecting these rows and giving them a background color of #333 and foreground of white. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting poin...
...ese rows and giving them a background color of #333 and foreground of white. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. selectors four in this task try the following: make any paragraph that directly follows an h2 element red.
remove the bullets and add a 1px grey bottom border only to list items that are a direct child of the ul with a class of list. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. selectors five in this final task add css using attribute select...
Sizing items in CSS - Learn web development
o be a percentage of the element's width. however, this is not the case! when you use margin and padding set in percentages, the value is calculated from the inline size — therefore the width when working in a horizontal language. in our example, all of the margins and padding are 10% of the width. this means you can have equal-sized margins and padding all around the box. this is a fact worth
remembering if you do use percentages in this way. min- and max- sizes in addition to giving things a fixed size, we can ask css to give an element a minimum or a maximum size. if you have a box that might contain a variable amount of content, and you always want it to be at least a certain height, you could set the min-height property on it. the box will always be at least this height, but will th...
... text. sizing things according to the viewport can be useful in your designs. for example, if you want a full-page hero section to show before the rest of your content, making that part of your page 100vh high will push the rest of the content below the viewport, meaning that it will only appear once the document is scrolled. test your skills! we have covered a lot in this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: sizing. summary this lesson has given you a rundown of some key issues that you might run into when sizing things on the web. when you move onto css layout, sizing will become very important in mastering the different layout methods, s...
Normal Flow - Learn web development
objective: to explain how browsers layout web pages by default, before we begin to make changes. as detailed in the last lesson introducing layout, elements on a webpage lay out in the normal flow, if you have not applied any css to change the way they behave. and, as we began to discover, you can change how elements behave either by adjusting their position in that normal flow, or
removing them from it altogether. starting with a solid, well-structured document that is readable in normal flow is the best way to begin any webpage. it ensures that your content is readable, even if the user is using a very limited browser or a device such as a screen reader that reads out the content of the page. in addition, as normal flow is designed to make a readable document, by starting in ...
... new lines; instead, they sit on the same line as one another and any adjacent (or wrapped) text content, as long as there is space for them to do so inside the width of the parent block level element. if there isn't space, then the overflowing text or elements will move down to a new line. if two adjacent elements both have the margin set on them and the two margins touch, the larger of the two
remains, and the smaller one disappears — this is called margin collapsing, and we have met this before too. let's look at a simple example that explains all of this: <h1>basic document flow</h1> <p>i am a basic block level element. my adjacent block level elements sit on new lines below me.</p> <p>by default we span 100% of the width of our parent element, and we are as tall as our child cont...
How CSS is structured - Learn web development
two p { ... } rules to your stylesheet. next, change the first p selector to .special to see how it changes the styling. the rules of specificity and the cascade can seem complicated at first. these rules are easier to understand as you become more familiar with css. the cascade and inheritance section in the next module explains this in detail, including how to calculate specificity. for now,
remember that specificity exists. sometimes, css might not apply as you expected because something else in the stylesheet has more specificity. recognizing that more than one rule could apply to an element, is the first step in fixing these kinds of issues. properties and values at its most basic level, css consists of two components: properties: these are human-readable identifiers that indicat...
...w it works. you can also experiment with different values. warning: one less obvious aspect of using css shorthand is how omitted values reset. a value not specified in css shorthand reverts to its initial value. this means an omission in css shorthand can override previously set values. comments as with any coding work, it is best practice to write comments along with css. this helps you to
remember how the code works as you come back later for fixes or enhancement. it also helps others understand the code. css comments begin with /* and end with */. in the example below, comments mark the start of distinct sections of code. this helps to navigate the codebase as it gets larger. with this kind of commenting in place, searching for comments in your code editor becomes a way to efficient...
CSS FAQ - Learn web development
t my style rules work properly? style rules that are syntactically correct may not apply in certain situations. you can use dom inspector's css style rules view to debug problems of this kind, but the most frequent instances of ignored style rules are listed below. html elements hierarchy the way css styles are applied to html elements depends also on the elements hierarchy. it is important to
remember that a rule applied to a descendent overrides the style of the parent, in spite of any specificity or priority of css rules. .news { color: black; } .corpname { font-weight: bold; color: red; } <!-- news item text is black, but corporate name is red and in bold --> <div class="news"> (reuters) <span class="corpname">general electric</span> (ge.nys) announced on thursday... </div> in c...
...ys: <span class="stocksymbol">ge</span> +1.0 ... </div> to avoid this kind of error, try to define rules only once for a certain selector, and group all rules belonging to that selector. use of a shorthand property using shorthand properties for defining style rules is good because it uses a very compact syntax. using shorthand with only some attributes is possible and correct, but it must be
remembered that undeclared attributes are automatically reset to their default values. this means that a previous rule for a single attribute could be implicitly overridden. #stockticker { font-size: 12px; font-family: verdana; font-weight: bold; } .stocksymbol { font: 14px arial; color: red; } <div id="stockticker"> nys: <span class="stocksymbol">ge</span> +1.0 ... </div> in the previous exam...
Typesetting a community school homepage - Learn web development
word-spacing, as appropriate. give the first paragraph after each heading in the <section> a little bit of text-indentation, say 20px. links: give the link, visited, focus, and hover states some colors that go with the color of the horizontal bars at the top and bottom of the page. make it so that links are underlined by default, but when you hover or focus them, the underline disappears.
remove the default focus outline from all the links on the page. give the active state a noticeably different styling so it stands out nicely, but make it still fit in with the overall page design. make it so that external links have the external link icon inserted next to them. lists: make sure the spacing of your lists and list items works well with the styling of the overall page. each list...
...ustom bullet image or something else. navigation menu: style your navigation menu so that it has an appropriate look for the look and feel for the page. hints and tips you don't need to edit the html in any way for this exercise. you don't necessarily have to make the nav menu look like buttons, but it needs to be a bit taller so that it doesn't look silly on the side of the page; also
remember that you need to make this one a vertical nav menu. example the following screenshot shows an example of what the finished design could look like: assessment or further help if you would like your work assessed, or are stuck and want to ask for help: put your work into an online shareable editor such as codepen, jsfiddle, or glitch. write a post asking for assessment and/or help a...
What do common web layouts contain? - Learn web development
vary between pages. for now, it's best to keep your layout consistent throughout your site. active learning there is no active learning available yet. deeper dive let's study some more concrete examples taken from well-known websites. one-column layout invision application. a typical one-column layout providing all the information linearly on one page. quite straightforward. just
remember, many people will still browse your site from desktops, so make your content usable/readable there as well. two-column layout. abduzeedo, a simple blog layout. blogs usually have two columns, a fat one for the main content and a thin one for stuff on the side (like widgets, secondary navigation levels, and ads). in this example, look at the image (b1) right underneath the header...
...ut it, so you could think of the image either as main content or as side content. it doesn't really matter. what does matter is, if you put something right under the header, it should either be main content or directly related to the main content. it's a trap mica. this is a bit trickier. it looks like a three-column layout... ...but it's not. b1 and b2 float around the main content.
remember that word "float"--it will ring a bell when you start learning about css. why would you think it's a three-column layout? because the image on the top-right is l-shaped, because b1 looks like a column supporting the shifted main content, and because the "m" and "i" of the mica logo create a vertical line of force. this is a good example of a classic layout supporting some design creativity...
What is a web server? - Learn web development
cond, a web server provides support for http (hypertext transfer protocol). as its name implies, http specifies how to transfer hypertext (linked web documents) between two computers. a protocol is a set of rules for communication between two computers. http is a textual, stateless protocol. textual all commands are plain-text and human-readable. stateless neither the server nor the client
remember previous communications. for example, relying on http alone, a server can't
remember a password you typed or
remember your progress on an incomplete transaction. you need an application server for tasks like that. (we'll cover that sort of technology in other articles.) http provides clear rules for how a client and server communicate. we'll cover http itself in a technical article later. ...
...ser. if not, an application server builds the necessary file. if neither process is possible, the web server returns an error message to the browser, most commonly 404 not found. (the 404 error is so common that some web designers devote considerable time and effort to designing 404 error pages.) static vs. dynamic content roughly speaking, a server can serve either static or dynamic content.
remember that the term static means "served as-is". static websites are the easiest to set up, so we suggest you make your first site a static site. the term dynamic means that the server processes the content or even generates it on the fly from a database. this approach provides more flexibility, but the technical stack is more complex, making it dramatically more challenging to build a website. ...
How do you set up a local testing server? - Learn web development
this article explains how to set up a simple local testing server on your machine, and the basics of how to use it. prerequisites: you need to first know how the internet works, and what a web server is. objective: you will learn how to set up a local testing server. local files vs.
remote files throughout most of the learning area, we tell you to just open your examples directly in a browser — this can be done by double clicking the html file, dragging and dropping it into the browser window, or choosing file > open... and navigating to the html file. there are many ways to achieve this. if the web address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used. in contrast, if you view one o...
...ouble clicking the html file, dragging and dropping it into the browser window, or choosing file > open... and navigating to the html file. there are many ways to achieve this. if the web address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used. in contrast, if you view one of our examples hosted on github (or an example on some other
remote server), the web address will start with http:// or https://, to show that the file has been received via http. the problem with testing local files some examples won't run if you open them as local files. this can be due to a variety of reasons, the most likely being: they feature asynchronous requests. some browsers (including chrome) will not run async requests (see fetching data from ...
Basic native form controls - Learn web development
r doesn't support native color pickers). note: you can find examples of all the single line text field types on github at single-line-text-fields.html (see it live also). here is a basic single line text field example: <input type="text" id="comment" name="comment" value="i'm a text field"> single line text fields have only one true constraint: if you type text with line breaks, the browser
removes those line breaks before sending the data to the server. the following screenshot shows default, focused and disabled text input types in firefox 71 and safari on macos and in chrome 79 and edge 18 on windows 10. note: html5 enhanced the basic original single line text field by adding special values for the type attribute that enforce specific validation constraints and other features, f...
...ute must be the id attribute of a <form> element in the same document. this lets you associate a form control with a form it is outside of, even if it is inside a different form element. name the name of the element; this is submitted with the form data. value the element's initial value. test your skills! you've reached the end of this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: basic controls. summary this article has covered the older input types — the original set introduced in the early days of html that is well supported in all browsers. in the next section, we'll take a look at the newer values of the ...
Example 3 - Learn web development
ers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function definitions // // -------------------- // function deactivateselect(select) { if (!select.classlist.contains('active')) return; var optlist = select.queryselector('.optlist'); optlist.classlist.add('hidden'); select.classlist.
remove('active'); } function activeselect(select, selectlist) { if (select.classlist.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.querysel...
...st.contains('active')) return; selectlist.foreach(deactivateselect); select.classlist.add('active'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.
remove('highlight'); }); option.classlist.add('highlight'); }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.
remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); ...
How to structure a web form - Learn web development
o hear about your experiences too. note: you can find this example on github as required-labels.html (see it live also). don't test the example with 2 or 3 of the versions uncommented — screenreaders will definitely get confused if you have multiple labels and multiple inputs with the same id! common html structures used with forms beyond the structures specific to web forms, it's good to
remember that form markup is just html. this means that you can use all the power of html to structure a web form. as you can see in the examples, it's common practice to wrap a label and its widget with a <li> element within a <ul> or <ol> list. <p> and <div> elements are also commonly used. lists are recommended for structuring multiple checkboxes or radio buttons. in addition to the <fieldset> e...
... is a lot simpler, containing only a <button> of type submit, for submitting the form data. add this to the bottom of your form now: <p> <button type="submit">validate the payment</button> </p> you can see the finished form in action below (also find it on github — see our payment-form.html source and running live): test your skills! you've reached the end of this article, but can you
remember the most important information? you can find a further test to verify that you've retained this information before you move on — see test your skills: form structure. summary you now have all the knowledge you'll need to properly structure your web forms. we will cover many of the features introduced here in the next few articles, with the next article looking in more detail at using all...
Other form controls - Learn web development
"75" low="33" high="66" optimum="50">75</meter> the content inside the <meter> element is a fallback for browsers that don't support the element and for assistive technologies to vocalize it. support for <progress> and <meter> is fairly good — there is no support in internet explorer, but other browsers support it well. ...
... now that you have a grasp of the html behind the different available form controls, we'll take a look at styling them. ...
Sending form data - Learn web development
note: it is beyond the scope of this article to teach you any server-side languages or frameworks. the links above will give you some help, should you wish to learn them. a special case: sending files sending files with html forms is a special case. files are binary data — or considered as such — whereas all other data is text data. because http is a text protocol, there are special requi
rements for handling binary data. the enctype attribute this attribute lets you specify the value of the content-type http header included in the request generated when the form is submitted. this header is very important because it tells the server what kind of data is being sent. by default, its value is application/x-www-form-urlencoded. in human terms, this means: "this is form data that has be...
...erent subdomain or even better through a completely different domain. you should avoid many/most problems if you follow these three rules, but it's always a good idea to get a security review performed by a competent third party. don't assume that you've seen all the possible problems. summary as we'd alluded to above, sending form data is easy, but securing an application can be tricky. just
remember that a front-end developer is not the one who should define the security model of the data.it's possible to perform client-side form validation, but the server can't trust this validation because it has no way to truly know what has really happened on the client-side. if you've worked your way through these tutorials in order, you now know how to markup and style a form, do client-side vali...
Test your skills: Advanced styling - Learn web development
ier task than with standard text inputs, even on modern browsers. we've already provided you with a basic reset to build upon. first of all, try giving the search box a consistent width, height, padding, and border color across browsers. you'll find that some browsers will not behave in terms of the form element's height. this is due to native os styling being used in some cases. ...
...even on modern browsers. we've already provided you with a basic reset to build upon. first of all, try giving the search box a consistent width, height, padding, and border color across browsers. you'll find that some browsers will not behave in terms of the form element's height. this is due to native os styling being used in some cases. how can you
remove this native styling? once you've
removed the native styling, you'll need to add back one of the features it was providing, to keep same look and feel we originally had. how do you do this? one thing that is inconsistent across browsers (particularly looking at safari here) is the position of the standard blue focus outline. how can you
remove this? there is a major problem with just getting rid of the blue focus outline. what is i...
Your first form - Learn web development
(form validation), and paired with text labels that describe their purpose to both sighted and blind users. designing your form before starting to code, it's always better to step back and take the time to think about your form. designing a quick mockup will help you to define the right set of data you want to ask your user to enter. from a user experience (ux) point of view, it's important to
remember that the bigger your form, the more you risk frustrating people and losing users. keep it simple and stay focused: ask only for the data you absolutely need. designing forms is an important step when you are building a site or application. it's beyond the scope of this article to cover the user experience of forms, but if you want to dig into that topic you should read the following article...
... label with the form control, enabling mouse, trackpad, and touch device users to click on the label to activate the corresponding control, and it also provides an accessible name for screen readers to read out to their users. you'll find further details of form labels in how to structure a web form. on the <input> element, the most important attribute is the type attribute. this attribute is ext
remely important because it defines the way the <input> element appears and behaves. you'll find more about this in the basic native form controls article later on. in our simple example, we use the value <input/text> for the first input — the default value for this attribute. it represents a basic single-line text field that accepts any kind of text input. for the second input, we use the valu...
HTML basics - Learn web development
an attribute should always have the following: a space between it and the element name (or the previous attribute, if the element already has one or more attributes). the attribute name followed by an equal sign. the attribute value wrapped by opening and closing quotation marks. note: simple attribute values that don't contain ascii whitespace (or any of the characters " ' ` = < > ) can
remain unquoted, but it is recommended that you quote all attribute values, as it makes the code more consistent and understandable. nesting elements you can put elements inside other elements too — this is called nesting. if we wanted to state that our cat is very grumpy, we could wrap the word "very" in a <strong> element, which means that the word is to be strongly emphasized: <p>my cat is <...
... href="https://www.mozilla.org/about/manifesto/">mozilla manifesto</a> you might get unexpected results if you omit the https:// or http:// part, called the protocol, at the beginning of the web address. after making a link, click it to make sure it is sending you where you wanted it to. href might appear like a rather obscure choice for an attribute name at first. if you are having trouble
remembering it,
remember that it stands for hypertext reference. add a link to your page now, if you haven't already done so. conclusion if you have followed all the instructions in this article, you should end up with a page that looks like the one below (you can also view it here): if you get stuck, you can always compare your work with our finished example code on github. here, we have o...
The web and web standards - Learn web development
any different companies, it means that no one company gets to control them, which is a really good thing. you wouldn't want a single company suddenly deciding to put the entire web behind a paywall, or releasing a new version of html that everyone has to buy to continue making web sites, or worse still, just deciding they aren't interested any more and just turning it off. this allows the web to
remain a freely-available public resource. don't break the web another phrase you'll hear around open web standards is "don't break the web" — the idea is that any new web technology that is introduced should be backwards compatible with what went before it (i.e. old web sites will still continue to work), and forwards compatible (future technologies in turn will be compatible with what we curren...
.... testing tools that can be used to run tests to show whether your code is behaving as you intended it to. libraries and frameworks built on top of javascript that allow you to build certain types of web site much more quickly and effectively. so-called "linters", which take a set of rules, look at your code, and highlight places where you haven't followed the rules properly. minifiers, which
remove all the whitespace from your code files to make it so that they are smaller and therefore download from the server more quickly. server-side languages and frameworks html, css, and javascript are front-end (or client-side) languages, which means they are run by the browser to produce a website front-end that your users can use. there are another class of languages called back-end (or serv...
Creating hyperlinks - Learn web development
igation-menu-start directory: index.html projects.html pictures.html social.html you should: add an unordered list in the indicated place on one page that includes the names of the pages to link to. a navigation menu is usually just a list of links, so this is semantically ok. change each page name into a link to that page. copy the navigation menu across to each page. on each page,
remove just the link to that same page — it's confusing and unnecessary for a page to include a link to itself. and, the lack of a link acts a good visual
reminder of which page you are currently on. the finished example should look similar to the following page: note: if you get stuck, or aren't sure if you have got it right, you can check the navigation-menu-marked-up directory to see the c...
...o understand what url query notation is more commonly used for. here are a few other sample mailto urls: mailto: mailto:nowhere@mozilla.org mailto:nowhere@mozilla.org,nobody@mozilla.org mailto:nowhere@mozilla.org?cc=nobody@mozilla.org mailto:nowhere@mozilla.org?cc=nobody@mozilla.org&subject=this%20is%20the%20subject test your skills! you've reached the end of this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: links. summary that's it for links, for now anyway! you'll return to links later on in the course when you start to look at styling them. next up for html, we'll return to text semantics and look at some more advanced/unusual features ...
Adding vector graphics to the Web - Learn web development
ickly starts to get very difficult. for creating svg images, most people use a vector graphics editor like inkscape or illustrator. these packages allow you to create a variety of illustrations using various graphics tools, and create approximations of photos (for example inkscape's trace bitmap feature.) svg has some additional advantages besides those described so far: text in vector images
remains accessible (which also benefits your seo). svgs lend themselves well to styling/scripting, because each component of the image is an element that can be styled via css or scripted via javascript. so why would anyone want to use raster graphics over svg? well, svg does have some disadvantages: svg can get complicated very quickly, meaning that file sizes can grow; complex svgs can also t...
...="55" fill="white" stroke="black" stroke-width="2"> hello! ...
Video and audio content - Learn web development
e above sections for more information about them. restarting media playback at any time, you can reset the media to the beginning—including the process of selecting the best media source, if more than one is specified using <source> elements—by calling the element's load() method: const mediaelem = document.getelementbyid("my-media-element"); mediaelem.load(); detecting track addition and
removal you can monitor the track lists within a media element to detect when tracks are added to or
removed from the element's media. for example, you can watch for the addtrack event being fired on the associated audiotracklist object (retrieved via htmlmediaelement.audiotracks) to be informed when audio tracks are added to the media: const mediaelem = document.queryselector("video"); mediaelem.a...
...ormat they support best and load it. these should include type attributes. give the <video> element a poster that will be displayed before the video starts to be played. have fun creating your own poster graphic. for an added bonus, you could try researching text tracks, and work out how to add some captions to your video. test your skills! you've reached the end of this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: multimedia and embedding. note that the third assessment question in this test assumes knowledge of some of the techniques covered in the next article, so you may want to read that before attempting it. summary and that's a wrap; we ho...
HTML table basics - Learn web development
when done correctly, even blind people can interpret tabular data in an html table — a successful html table should enhance the experience of sighted and visually impaired users alike. table styling you can also have a look at the live example on github! one thing you'll notice is that the table does look a bit more readable there — this is because the table you se...
...ning the days she is teaching. recreate the table by following the steps below. first, make a local copy of our timetable.html file in a new directory on your local machine. the html contains the same table you saw above, minus the column styling information. add a <colgroup> element at the top of the table, just underneath the <table> tag, in which you can add your <col> elements (see the
remaining steps below). the first two columns need to be left unstyled. add a background color to the third column. the value for your style attribute is background-color:#97db9a; set a separate width on the fourth column. the value for your style attribute is width: 42px; add a background color to the fifth column. the value for your style attribute is background-color: #97db9a; add a different...
Test your skills: Arrays - Learn web development
racket notation and assignment. then add a new item to the beginning of the array. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. arrays 2 now let's move on to another task. here you are provided with a string to work with. we'd like you to: convert the string into an array,
removing the + characters in the process. save the result in a variable called myarray. store the length of the array in a variable called arraylength. store the last item in the array in a variable called lastitem. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. arrays 3 for thi...
...e called arraylength. store the last item in the array in a variable called lastitem. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. arrays 3 for this final array task, we provide you with a starting array, and you will work in somewhat the opposite direction. you need to:
remove the last item in the array. add two new names to the end of the array. go over each item in the array and add its index number after the name inside parentheses, for example ryu (0). note that we don't teach how to do this in the arrays article, so you'll have to do some research. finally, join the array items together in a single string called mystring, with a separator of " - ". try upd...
What went wrong? Troubleshooting JavaScript - Learn web development
at you can learn the techniques we are teaching here. then you can go back and try to fix your example. at this point, let's consult the developer console to see if it reports any syntax errors, then try to fix them. you'll learn how below. fixing syntax errors earlier on in the course we got you to type some simple javascript commands into the developer tools javascript console (if you can't
remember how to open this in your browser, follow the previous link to find out how). what's even more useful is that the console gives you error messages whenever a syntax error exists inside the javascript being fed into the browser's javascript engine. now let's go hunting. go to the tab that you've got number-game-errors.html open in, and open your javascript console. you should see an error m...
...rong. if you are not sure of the correct spelling of a piece of syntax, it is often good to look up the feature on mdn. the best way to do this currently is to search for "mdn name-of-feature" with your favorite search engine. here's a shortcut to save you some time in this instance: addeventlistener(). so, looking at this page, the error appears to be that we've spelled the function name wrong!
remember that javascript is case sensitive, so any slight difference in spelling or casing will cause an error. changing addeventlistener to addeventlistener should fix this. do this now. note: see our typeerror: "x" is not a function reference page for more details about this error. syntax errors round two save your page and refresh, and you should see the error has gone. now if you try to ...
Working with JSON - Learn web development
here we first create an <h1> element with createelement(), set its textcontent to equal the squadname property of the object, then append it to the header using appendchild(). we then do a very similar operation with a paragraph: create it, set its text content and append it to the header. the only difference is that its text is set t...
...e to see it in action: let myjson = { "name": "chris", "age": "38" }; myjson let mystring = json.stringify(myjson); mystring here we're creating a javascript object, then checking what it contains, then converting it to a json string using stringify() — saving the return value in a new variable — then checking it again. test your skills! you've reached the end of this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: json. summary in this article, we've given you a simple guide to using json in your programs, including how to create and parse json, and how to access data locked inside it. in the next article, we'll begin looking at object-oriented ...
Object-oriented JavaScript for beginners - Learn web development
} } note that when we are calling our constructor function, we are defining greeting() every time, which isn't ideal. to avoid this, we can define functions on the prototype instead, which we will look at later. creating our finished constructor the example we looked at above was only a simple example to get us started. let's now get on and create our final person() constructor function. ...
...ing(); you'll see that person2 has been created based on person1—it has the same properties and method available to it. one limitation of create() is that ie8 does not support it. so constructors may be more effective if you want to support older browsers. we'll explore the effects of create() in more detail later on. test your skills! you've reached the end of this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: object-oriented javascript. note that this set of tests relies on some of the knowledge taught in the next two articles, so you might want to read them first before you try the tests. summary this article has provided a simplified vie...
Object building practice - Learn web development
h basically states "finish drawing the path we started with beginpath(), and fill the area it takes up with the color we specified earlier in fillstyle." you can start testing your object out already. save the code so far, and load the html file in a browser. open the browser's javascript console, and then refresh the page so that the canvas size changes to the smaller visible viewport that
remains when the console opens. type in the following to create a new ball instance: let testball = new ball(50, 100, 4, 4, 'blue', 10); try calling its members: testball.x testball.size testball.color testball.draw() when you enter the last line, you should see the ball draw itself somewhere on the canvas. updating the ball's data we can draw the ball in position, but to actually move ...
... ...
Object prototypes - Learn web development
n and wish to know more. this section is intentionally simplified to make these concepts a little easier to understand when you first meet them. important: the prototype property is one of the most confusingly-named parts of javascript — you might think that this points to the prototype object of the current object, but it doesn't (that's an internal object that can be accessed by __proto__,
remember?). prototype instead is a property containing an object on which you define members that you want to be inherited. revisiting create() earlier on we showed how the object.create() method can be used to create a new object instance. for example, try this in your previous example's javascript console: let person2 = object.create(person1); what create() actually does is to create a n...
...le: // constructor with property definitions function test(a, b, c, d) { // property definitions } // first method definition test.prototype.x = function() { ... }; // second method definition test.prototype.y = function() { ... }; // etc. this pattern can be seen in action in piotr zalewa's school plan app example. test your skills! you've reached the end of this article, but can you
remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: object-oriented javascript. note that this set of tests relies on some of the knowledge taught in the next article, so you might want to read that first before you try them. summary this article has covered javascript object prototype...
Perceived performance - Learn web development
rtant; even more important that actual download time but difficult to quantify. there are areas of your site that you may not be able to make faster, but you can make it feel faster even if the metrics discussed in the othser sections can't be improved. there is no unicorn metric that can measure what the user feels, but metrics are useful in guaging improvements (and regressions). relevant measu
rements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and speed index. first paint is reported by the browser and provides the time, in ms, of when the page starts changing; but this change can be a simple background color update or something even less noticable. it doesn’t indicate completeness and may report a time...
...nteresting but unobtrusive 200ms animation to that keyup even can reduce another 200ms of the perceived load. you're not saving 400ms of time, but the user doesn't feel like they're waiting for content until, well, until they're waiting for content. conclusion by turning as much of the download, render and wait time into active phases and reducing any passive waiting, even if the objective measu
rements stay the same, the user will feel like the content downloaded, rendered, and responded more quickly. now that we know what we should be speeding up, let's take a look at some metrics and learn how we can measure these events. previous overview: performance next in this module the "why" of web performance what is web performance? how do users perceive performance? measuring per...
Client-Server Overview - Learn web development
ic=js&topic=api&topic=webdev). the target/host website (developer.mozilla.org). the end of the first line also includes a short string identifying the specific protocol version (http/1.1). the final line contains information about the client-side cookies — you can see in this case the cookie includes an id for managing sessions (cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; ...). the
remaining lines contain information about the browser used and the sort of responses it can handle. for example, you can see here that: my browser (user-agent) is mozilla firefox (mozilla/5.0). it can accept gzip compressed information (accept-encoding: gzip). it can accept the specified set of characters (accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7) and languages (accept-language: de,en;q=0.
...ching content-length: 41823 <!doctype html> <html lang="en-us" dir="ltr" class="redesign no-js" data-ffo-opensanslight=false data-ffo-opensans=false > <head prefix="og: http://ogp.me/ns#"> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <script>(function(d) { d.classname = d.classname.replace(/\bno-js/, ''); })(document.documentelement);</script> ... the
remainder of the response header includes information about the response (e.g. when it was generated), the server, and how it expects the browser to handle the page (e.g. the x-frame-options: deny line tells the browser not to allow this page to be embedded in an <iframe> in another site). post request/response example an http post is made when you submit a form containing information to be saved o...
Ember interactivity: Events, classes and state - Learn web development
cript code to control interactive features, and setting up a service to keep track of the data state of our app. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be ext
remely beneficial, as ember makes heavy use of them. objective: to learn how to create component classes and use events to control interactivity, and keep track of app state using a service. adding interactivity now we've got a refactored componentized version of our todo app, lets walk through how we can add the interactivity we need to make the app functional. when beginnin...
... when we press the enter key and have it appear in the todos list. we want to be able to capture the text typed into the input. we do this so that our javascript code knows what we typed in, and we can save our todo and pass that text along to the todo list component to display. we can capture the keydown event via the on modifier, which is just ember syntactic sugar around addeventlistener and
removeeventlistener (see this explanation if needed). add the new line shown below to your header.hbs file: <input class='new-todo' aria-label='what needs to be done?' placeholder='what needs to be done?' autofocus {{on 'keydown' this.onkeydown}} > this new attribute is inside double curly braces, which tells you it is part of ember's dynamic templating syntax. the first argument passed ...
Getting started with React - Learn web development
ework like vue — it is more approachable when you build your entire app with react. in addition, many of the developer-experience benefits of a react app, such as writing interfaces with jsx, require a compilation process. adding a compiler like babel to a website makes the code on it run slowly, so developers often set up such tooling with a build step. react arguably has a heavy tooling requi
rement, but it can be learned. this article is going to focus on the use case of using react to render the entire user interface of an application, using tooling provided by facebook’s own create-react-app tool. how does react use javascript? react utilizes features of modern javascript for many of its patterns. its biggest departure from javascript comes with the use of jsx syntax. jsx extends ...
...on by installing some packages and creating some files for you, handling the tooling described above. it's possible to add react to a website without create-react-app by copying some <script> elements into an html file, but the create-react-app cli is a common starting point for react applications. using it will allow you spend more time building your app, and less time fussing with setup. requi
rements in order to use create-react-app, you need to have node.js installed. it's recommended that you use the long-term support (lts) version. node includes npm (the node package manager), and npx (the node package runner). you may also use the yarn package manager as an alternative, but we'll assume you are using npm in this set of tutorials. see package management basics for more information on...
Rendering a list of Vue components - Learn web development
late, like so: <ul> <li v-for="item in todoitems" :key="item.id"> <to-do-item label="my todo item" :done="true"></to-do-item> </li> </ul> when you make this change, every javascript expression between the <li> tags will have access to the item value in addition to the other component attributes. this means we can pass the fields of our item objects to our todoitem component — just
remember to use the v-bind syntax. this is really useful, as we want our todo items to display their label properties as their label, not a static label of "my todo item". in addition, we want their checked status to reflect their done properties, not always be set to done="false". update the label="my todo item" attribute to :label="item.label", and the :done="false" attribute to :done="item.d...
...e can do here. instead of generating the id for the checkboxes inside your todoitem component, we can turn the id into a prop. while this isn't strictly necessary, it makes it easier for us to manage since we already need to create a unique id for each todo item anyway. add a new prop to your todoitem component — id. make it required, and make its type a string. to prevent name collisions,
remove the id field from your data attribute. you are no longer using uniqueid, so you need to
remove the import uniqueid from 'lodash.uniqueid'; line, otherwise your app will throw an error. the <script> contents in your todoitem component should now look something like this: export default { props: { label: {required: true, type: string}, done: {default: false, type: boolean...
Accessibility information for UI designers and developers
by keyboard (or other specialised input methods), rely on focus styles to see where they are on the page. only one element has focus at a given time, typically revealed by browsers with a dotted outline. css lets authors change what the focus indicator look like, so you can design it to match branding. here's an example of someone tabbing through a footer, the focus moves around: note: don't
remove the focus indicator, as without it, users that can't or don't use a mouse cannot see where they are. it would be like
removing the mouse indicator. see also: understanding sc 2.4.7: focus visible be ready for resizing and custom styles on the web, users can use tools in their browser to make font sizes larger, or even provide custom css to meet their specific needs. ensure your design is fl...
...as they are often too low in contrast. it is more helpful to describe what an input element is for in text just above or underneath the input. error recovery when you detect users provide unexpected input, explain what is wrong and, if possible, how to correct it. this is specifically important in these cases: the user input is about legal commitments or financial transactions it updates or
removes the user's data in a system when recording tests responses in those cases, ensure users can change submissions, automatically check for errors. or provide an opportunity to review the input before submitting it. use default controls controls that are built into browsers come with a lot of accessibility for free. for example, the select element displays an ideal mobile interface on mobile...
CSUN Firefox Materials
rward by web page (alt+left and alt+right) occurs near-instantaneously the download manager provides keyboard access to all of your recent downloads customize your experience! many users are finding the true greatness of firefox lies in support for third party extensions. extensions are small add-ons which can change your browser experience as you see fit. extensions can easily be installed or
removed with the extension manager in the tools menu. here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this information): adblock plus
removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior. in muc...
...ble accessibility in firefox on windows and especially for this new powerful world of "web applications". a web application may be an easier-to-use online tax assistant, a web calendar or a live sports statistics page, which is familiar in that it acts much like a desktop application. whether the current buzzword for this technology is "dhtml", "ajax" or "web 2.0" doesn't really matter. this fact
remains: the web is changing to become more interactive and less like a bunch of plain documents. firefox is currently the only browser to support the new evolving standards for making these web applications accessible. companies such as yahoo! have announced they are already working with the technology their new richer interfaces accessible with this new technology. sun contributes code to improve a...
Embedding API for Accessibility
text selection appearance setcharpref("browser.selection.background_color", colorstring); setcharpref("browser.selection.foreground_color", colorstring); setcharpref("browser.selection.border", cssborderstylestring); /* is a selection border hard to implement? ...
...oing this is to build up the nsiwebbrowseraccessible interface, so that there is a method to force loading each type of content just for the current page in the current session. open issue: accessibility settings per url a powerful possibility is that we design an interface for setting certain preferences based on the url. if we can find a clean way to present it to the user, this would be ext
remely useful. for example, settings per url would allow a user to accept scripts from their known benign web pages, but not others. users may want similarity abilities with applets, background images, style sheets, etc. we have a permissions system for cookies and images based on url's. perhaps it can be extended to store accessibility preferences. this is a ui issue we'll need to settle before we...
Multiprocess on Windows
most code that runs on gecko's main thread is not thread safe. since gecko's main thread uses com, and com requires threads to declare their threading model, the main thread must initialize itself to live inside its own single threaded apartment (sta). this is true for both chrome and content processes. as you should already know from the prerequisite reading, single threaded apartments receive
remote procedure calls (rpcs) from com, via the windows message queue. from a performance standpoint, this is less than ideal. the windows message queue carries a lot of baggage for the purposes of maintaining backward compatibility. on the other hand, com's multithreaded apartment (mta) uses a much faster ipc mechanism that does not suffer from the same problems as the message queue. ideally, we wou...
...processes. if you only register your interfaces in one process, com won't be able to understand the interface in the other process. registering outparams that consist of arrays of interfaces recall that one of the limitations of typelibs is that their metadata isn't as rich as oicf metadata. something typelibs do not include in their metadata, is idl annotations, such as length_is and size_is.
remember, for interceptors to work correctly, they must be able to wrap any outparams that are interfaces with their own interceptors. without the support for length_is and size_is annotations, the interceptor cannot tell the difference between a scalar outparam and an array outparam. if your interface outputs an array of interfaces, the interceptor would only wrap the first element in the array, bec...
Software accessibility: Where are we today?
ntry easier. however, any special features are generally handled in the keyboard itself, so that no special programming is required. speech recognition technology lets people talk to the computer. this technology has come a long way, but still needs to be more integrated into mainstream software. consistent keyboard support and hotkeys many people can't use a mouse. ext
remely consistent keystroke support is a very important consideration. blind testers have knack for finding ways to improve keystroke support in almost any given piece of software. testing with people that have disabilities generally benefits everyone. use the accessible toolkit checklist to make sure your ui controls adhere to standards. a major limitation - the lack of context the solutions develo...
... by large numbers of disabled users. there has been some progress with the support of gnome's atk apis in many of these packages, and the development of gok (gnome onscreen keyboard) and gnopernicus (screenreader and magnifier). however, these solutions are not yet truly usable for real disabled end users. what do i need to do? mozilla developers follow the general front-end accessibility requi
rements: there are a number of potential "gotchas" when developing xul ui. please follow the practical techniques put forth listed in the accessible xul authoring guidelines. these guidelines cover many possible scenarios. if you take a little time to learn them, they will become an unconscious improvement to your design and engineering technique. ensure correct keyboard accessibility whe...
Chrome registration
me packages can decide whether to use the xpcnativewrapper security mechanism to automatically protect their code against malicious content that they might access. see safely accessing content dom from chrome for details. this flag is enabled by default since firefox 1.5. disabling it manually was possible by specifying xpcnativewrappers=no until firefox 4. note: support for this flag has been
removed in gecko 2.0. you can no longer disable xpcnativewrappers. to update your add-on to work without this flag: if your add-on depends upon xbl bindings attached to content objects (that is, it needs to be able to call functions or get and set properties created by the xbl binding), you'll need to use the object's wrappedjsobject property to obtain a wrapped object. if you need to call functi...
...not support the plaintext manifest format yet, so contents.rdf manifests are required for extensions that wish to maintain backwards compatibility with firefox 1.0 or the suite. gecko 1.9.2 note the contents.rdf manifest format is no longer supported at all starting with gecko 1.9.2; add-ons already installed using this format will continue to work but can no longer be installed. be sure to
remove your add-on and reinstall it to ensure that it installs correctly after updating it to use a plaintext manifest. official references for toolkit api official references. do not add to this list without contacting benjamin smedberg. note that this page is included from the pages listed below. so: don't add breadcrumbs! structure of an installable bundle: describes the common structure of i...
Creating a Firefox sidebar
d like to have a deeper integration with the browser to offer more complex features, a traditional overlay extension can be an option. the document might be obsolete, though.obsolete since gecko 57 the social api obsolete since gecko 57 (firefox 57 / thunderbird 57 / seamonkey 2.54)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. this content covers features introduced in firefox 17. the window.sidebar api obsolete since gecko 23 (firefox 23 / thunderbird 23 / seamonkey 2.20)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. as of firefox 23, the addpanel and addpersisten...
...oid using it. this content covers features introduced in firefox 17. the window.sidebar api obsolete since gecko 23 (firefox 23 / thunderbird 23 / seamonkey 2.20)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. as of firefox 23, the addpanel and addpersistentpanel functions have been
removed from the deprecated, netscape-derived window.sidebar object. that means the ability to add a traditional sidebar panel is no longer available from web content. the new social api or an extension can be used instead as described above. see also bootstrap addon demo which adds a sidebar with browser for html content: https://gist.github.com/noitidart/8728393 ...
Creating reftest-based unit tests
running ipc reftests reftests can also be run in a separate process, which can differ from same-process rendering in significant ways. currently, ipc reftests are only being run on linux. to run: moz_layers_force_shmem_surfaces=1 make -c $(objdir) reftest-ipc note: right now, automation currently only runs layout/reftests/reftest-sanity/reftest.list! if you ...
...es three extra steps. first you need to add class="reftest-wait" to the root element in the test to tell the reftest framework not to check the rendering as soon as the test finishes loading and moving on to the next test. next you need to add a listener for the 'mozreftestinvalidate' event, and only make the changes you want to test invalidation for after that event has fired. third, you need to
remove 'reftest-wait' from the root element's 'class' attribute to tell the reftest framework that the test is now ready to have its rendering tested. the reason for using the 'mozreftestinvalidate' event is because a document's initial painting is not typically finished when the 'load' event fires. it would be possible to try and wait for the initial rendering to be done using a settimeout, but tha...
Makefile - variables
mespace directory. extra_components nsdefaultclh.manifest, javascript xpcomm files extra_dso_libs extra_dso_ldopts extra_js_modules extra_pp_components xpcomm files to pre-process before installation. garbage a "clean target" macro containing a list of files to
remove. garbage_dirs a "clean target" macro containing a list of directories to
remove. global_deps a list of common dependencies (makefile.in, autoconf.mk) that will force rebuilding. libobjs have_dtrace sun microsystem's dynamic tracing environment is available. local_includes allow use o...
...s to process makefile 'tool' targets in. moz_ variable description moz_auto_deps moz_build_app moz_build_projects build multiple projects in the same sandbox. ...
How Mozilla's build system works
s reserved for most of the work, like compiling c++ source files. tools is used to install tests and other support tools. when make is invoked, it starts at the export sub-tier of the first tier, and traverses all the directories in that tier. then, it does the same thing for the libs sub-tier and, subsequently, the tools sub-tier. it then moves on to the next tier and continues until no tiers
remain. to view information about the tiers, you can execute the following special make targets: command effect make echo-tiers show the final list of tiers. make echo-dirs show the list of non-static source directories to iterate over, as determined by the tier list. make echo-variable-static_dirs show the list of static source directories to iterate...
...eir parent directories. for example, you could have: dirs = \ public \ resources \ src \ $(null) this example demonstrates another concept called continuation lines. a backslash as the last character on a line allows the variable definition to be continued on the next line. the extra whitespace is compressed. the terminating $(null) is a method for consistency; it allows you to add and
remove lines without worrying about whether the last line has an ending backslash or not. makefile examples standard makefile header installing headers using exports compiling interfaces using xpidlsrcs installing a javascript component building a component dll building a static library building a dynamic library makefiles - best practices and suggestions makefile - targets makefile - va...
Old Thunderbird build
8 gb or more is recommended. while you can build thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less ram. good internet connection for the initial source download. ...
...pported. check for @topsrcdir@ or relative paths in your mozconfig. those have caused several problems historically and tend to be poorly tested when the build system changes. if on windows you get link errors like "lnk1102: out of memory" or "lnk1318: unexpected pdb error; ok (0)", try deleting the largest .pdb files before rushing out the door to buy more ram. clobbering (see below) will also
remove those files. try with a clean obj-dir. you can clean out previous build artefacts using ./mozilla/mach clobber references general build documentation comm-central using the mozilla symbol server ...
Simple Instantbird build
this page covers the basic steps needed to build a bleeding-edge, development version of instantbird. for additional, more detailed information, see the build documentation. this should be kept in sync with simple thunderbird build, you might want to take a look at that page too. build prerequisites hardware requi
rements: while you can build instantbird on older hardware it can take quite a bit of time to compile on slower machines, and having 8gb of ram is recommended (though you can probably still get away with 4gb). good internet connection for the initial source download. setup: depending on your operating system you will need to carry out a different process to prepare your machine. so firstly complete the instructions for your os and then continue following these build ...
...ies, are located under the dist/bin folder under the object directory. to run the executable from your comm-central working directory: windows: obj-.../dist/bin/instantbird.exe linux: obj-.../dist/bin/instantbird os x: obj-.../dist/instantbird.app/contents/macos/instantbird how to update and build again simply re-run the mach command above. this will only recompile files that changed. inc
remental builds when you are working on your own patches, an inc
remental build is often enough, and is very fast indeed. this will only rebuild a particular folder. so, for instantbird, you would run mach build im which has been configured to automatically rebuild /chat as well. upstream changes to fetch the latest upstream changes, in your comm-central directory, run the same command as before:...
Simple SeaMonkey build
you can build a bleeding-edge, development version of seamonkey using the commands below. for complete information, see the build documentation. build prerequisites hardware requi
rements: the seamonkey build process is both i/o- and cpu-intensive, and can take a long time to build even on modern hardware. minimum and recommended hardware requi
rements for mozilla development are: recommended: 8gb of ram (having only 4gb ram and 4gb swap may give memory errors during compile) 35 gb free disk space. this will accomodate visual studio 2013 community edition, the required sdks, the mozillabuild package, the mercurial source repository and enough free disk space to compile. a fast ssd is recommended; the firefox build process is i/o-intensive. high speed internet installing build ...
... references general build documentation comm-central ...
Updating NSPR or NSS in mozilla-central
apply the patches. if merging is required, update the patch file. if a patch is no longe...
...k line) to force a rebuild of nspr: mozilla/nsprpub/config/prdepend.h or nss: mozilla/security/nss/coreconf/coreconf.dep check directory mozilla/nsprpub/patches/ for patches that need to be applied to nspr, and directory mozilla/security/patches/ for patches that need to be applied to nss. apply the patches. if merging is required, update the patch file. if a patch is no longer needed,
remove the patch from the directory and update the readme file. check for new or
removed files $ hg add
remove -n review the output to make sure it looks correct update the minimum required system nss version in old-configure.in. this is for builds with --with-system-nss. for example, in the following, "3.16.1" would be replaced with the new nss version. moz_arg_with_bool(system-nss, [ ...
Interface Compatibility
wsers make it the only option. any changes, including new features, must have super-review. one exception to this rule is apis which are explicitly shipped with mozilla prefixes as a technology preview. this includes css properties that begin with the -moz- prefix (e.g. -moz-box-shadow), or javascript apis that begin with the moz prefix (e.g. canvasrenderingcontext.mozdrawtext). these apis may be
removed or replaced with standard interfaces in future releases of mozilla. jetpack the jetpack sdk and apis are not yet complete. the stable version 1.0 of the jetpack sdk is planned for later in 2010. documented apis which are shipped as part of the jetpack sdk are designed to work in future versions of firefox. achieving this compatibility may require rebuilding the extension with a new version ...
...erfaces traditionally, mozilla has maintained a set of xpcom interfaces and functions with the @status frozen marking. using these interfaces, and using dynamic calls to queryinterface, it has been possible to write binary xpcom components which were compatible with multiple versions of firefox. beginning with mozilla 2 (firefox 4), this will no longer be supported: all @status markings have been
removed, and extensions that use binary components will need to recompile for each major version they wish to support. js-ctypes is the recommended way for extensions to call into os or third-party native code. you should strongly consider migrating existing code to use js-ctypes instead of binary components. if necessary, it is possible for an extension to support multiple versions by shipping mu...
Error codes returned by Mozilla APIs
le exists beforehand. ns_error_file_read_only (0x80520013) an attempt was made to create or write to a file or directory that is read only. this might happen if the file is not writable, the directory containing the file is not writable or the disk is write protected. use nsifile.iswritable() to check if the file can be written to. ns_error_file_dir_not_empty (0x80520014) when calling nsifile.
remove() on a directory and the 'recursive' argument to this method is false, this error will occur if the directory is not empty. ns_error_file_access_denied (0x80520015) an operation was not performed on a file because the file cannot be accessed, typically because the permissions set for the file do not allow the operation. stream errors ns_base_stream_closed (0x80470002) this error occurs...
...example, an http redirect occurred). this error code is used with load groups to notify the load group observer when a request in the load group is redirected to another request. ns_binding_retargeted (0x804b0004) the asynchronous request has been "retargeted" to a different "handler." this error code is used with load groups to notify the load group observer when a request in the load group is
removed from the load group and added to a different load group. ns_error_malformed_uri (0x804b000a) the uri is malformed. ns_error_already_connected (0x804b000b) the connection is already established. xxx currently unused - consider
removing. ns_error_not_connected (0x804b000c) the connection does not exist. xxx currently unused - consider
removing. ns_error_connection_refused (0x804b000d) ...
Experimental features in Firefox
terface for managing media playback, and to obtain media file metadata. see bug 1112032 for more details. release channel version added enabled by default? nightly 71 yes developer edition 71 no beta 71 no release 71 no preference name dom.media.mediasession.enabled asynchronous sourcebuffer add and
remove this adds the promise-based methods appendbufferasync() and
removeasync() for adding and
removing media source buffers to the sourcebuffer interface. see bug 1280613 and bug 778617 for more information. release channel version added enabled by default? nightly 62 no developer edition 62 no beta 62 no release 62 no...
... that the request was upgraded, instead of showing a warning. release channel version added enabled by default? nightly 60 no developer edition 60 no beta 60 no release 60 no preference name security.mixed_content.upgrade_display_content ftp support disabled for security reasons, mozilla intends to
remove support for ftp from firefox in 2020, effective in firefox 82. see bug 1622409 for implementation progress. the network.ftp.enabled preference must be enabled (set to true) to allow ftp to be used. release channel version added enabled by default? nightly 77 yes developer edition 77 no beta 77 no release 77 no ...
Communicating with frame scripts
ue: // frame script addeventlistener("click", function (event) { var results = sendsyncmessage("my-addon@me.org:my-e10s-extension-message", { details : "they clicked", tag : event.target.tagname }); content.console.log(results[0]); // "value from chrome" }, false); like arguments, return values from sendsyncmessage() must be json-serializable, so chrome can't return functions.
removemessagelistener() to stop listening for messages from content, use the message manager's
removemessagelistener() method: // chrome script messagemanager.
removemessagelistener("my-addon@me.org:my-e10s-extension-message", listener); chrome to content to send a message from chrome to content, you need to know what kind of message manager you're using. if it's a browser message manager, you can...
...rverservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); observerservice.addobserver(this, "message-manager-disconnect", false); console.log("listening"); }, unregister: function() { var observerservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); observerservice.
removeobserver(this, "message-manager-disconnect"); } } var observer = new myobserver(); observer.register(); ...
Process scripts
when you need to run code in the content process in order to access web content, then you should use frame scripts. however, a problem with frame scripts is that they can be loaded multiple times in the content process, in multiple scopes that are insulated from each other. for example, if you call the global frame message manager's loadframescript() function, then the script will be loaded separately into all open tabs. this can then cause a problem the frame scripts are interacting with a global service in the content process. ...
...the dump() statement will run once in each content process as well as in the main process. this example also figures out whether it is running in the chrome or in a content process by looking at the process type in services.appinfo. in just about every respect, using process scripts is like using frame scripts: you can pass the allowdelayedload to loadprocessscript(). if you do, you must call
removedelayedprocessscript() when your extension is disabled or
removed the message-passing apis are the same: sendasyncmessage() is available in both directions, while sendsyncmessage() is available from content to chrome only process scripts are system-privileged, and have access to the components object. however, process scripts are subject to the same kinds of limitations as frame scripts (for ...
Security best practices for Firefox front-end engineers
strings that enter the dom through apis such as innerhtml when running system-privileged chrome code, we sanitize all html fragments that are created for chrome-privileged documents. this policy includes all dom apis that take a string and parse it into a dom tree. we use our built-in sanitizer with the following flags: sanitizerallowstyle sanitizerallowcomments sanitizerdropforms sanitizerlog
removals the sanitizer
removes all scripts (script tags, event handlers) and form elements (form, input, keygen, option, optgroup, select, button, datalist). the canonical truth for the list of whitelisted elements is the source code. the last flag ensures that developers will identify and avoid the problems early on in the development cycle and before shipping the code. linter rules against uns...
... innerhtml and similar dom apis. the linter makes an exception for code that uses string literals that are hard coded in the source code, assuming benevolent developers. developers are able to avoid tripping the rule by using escaping functions in combination with template strings, for example: bar.innerhtml = escapehtml`<a href='${url}'>about</a>`; in system-privileged chrome code, any kind of
remaining scripts will still be
removed by our sanitizer. appendix list of disallowed dom apis innerhtml outerhtml insertadjacenthtml() createcontextualfragment() document.write() document.writeln() please take a look at the repository for an updated list ...
Using the Browser API
if you have one. in any case, you should at least download the repo and refer to the code as you read the sections below. the html an <iframe> is turned into a browser iframe by setting the mozbrowser attribute on it: <iframe src="http://mozilla.org" mozbrowser> in addition, the <iframe> can be loaded in its own child process — separate to the page embedding this frame — by including the
remote attribute. <iframe src="http://hostname.tld" mozbrowser
remote> warning: this last attribute is necessary for security reasons if you plan to load content from an untrusted/unknown origin. if you don't use it, you run the risk of your application being compromised by a malicious web site. it is implied for webextensions, which always run in a separate content process from web content. as...
... error message to the console when an error with the browser iframe is encountered. note that this doesn't include simple errors due to incorrect urls being entered. see the mozbrowsererror page for more details. other methods and events we've only covered a fraction of the new methods and events that the browser api adds. there are many others covering a variety of functions and edge case requi
rements: for the full list of methods, check out the htmliframeelement page. for the full list of events, see the browser api landing page events section. ...
mozbrowsermetachange
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowsermetachange event is fired when a <meta> element related to web applications is added,
removed or changed. see below for the applicable types. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read onl...
...t object with the following properties: name a domstring representing the <meta> name attribute value. this can be viewmode, theme-color, theme-group, or application-name. content a domstring representing the <meta> content attribute value, i.e. the content of the meta tag. type a domstring representing the type of meta change that this event object represents. this can be added, changed,
removed, or undefined. lang optional a domstring representing the <meta> name attribute value, if included. if not included, the value returned is undefined. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsermetachange", function(event) { console.log("a meta tag has been " + event.details.type + ". its name is " + event.details.name + ", and its con...
CSS <display-xul> component
see this firefox site compatibility post for more details. ...
...see this firefox site compatibility post for more details. ...
Overview of Mozilla embedding APIs
kreference document for more information. public return codes ns_succeeded ns_error_failure ns_error_not_implemented public functions the following functions are available from the xpcom dll. ns_initembedding this function initializes the gecko embedding support. this must be the first function call made into gecko. ns_termembedding this function shuts down gecko and cleans up any
remaining resources... currently, once gecko has been shutdown, it cannot be restarted in the same process space... this should change in the future. nsmemory nsmemory::alloc nsmemory::realloc nsmemory::free this helper class provides static accessors to the global nsmemory service. ns_getglobalcomponentmanager this function returns an instance of the component ...
...scomtypeinfo template directly. ns_getweakreference this function creates a weak reference to a component which implements the nsiweakreference interface. global services nsservicemanager the service manager is the central repository for accessing instances of the various xpcom services. each service is represented by a singleton object which is instantiated the first time it is requested and
remains alive until the service manager is shut down, or the service is explicitly unloaded. through the service manager, individual services can be loaded, unloaded and accessed. implemented interfaces: nsiservicemanager related interfaces: nsishutdownlistener nsmemory the nsmemory service provides the global memory manager implementation for xpcom. in addition to memory allocation and relea...
Getting from Content to Layout
watch" the content tree. nscssframeconstructor gets notified from the document's presshell (which implements nsidocumentobserver and observes the document) about all nodes in the document. the frame constructor takes these notifications and does the following: dispatches "restyle events" which trigger the reprocessing of relevant css selectors and any restyling that needs to occur. adds and
removes frames to make the frame tree a proper representation of the new content tree. restyling the restyletracker maintains a list of restyles to process. elements that need to be restyled are marked with flags (e.g element_has_pending_restyle) and are stored in the mpendingrestyles hashtable. a list of restyle roots (places in the content tree where all descendants need to be restyled but not...
...ge. these items are then examined in relation to the location in the content tree that is being modified and either the relevant frames are created/destroyed or the logic moves up to the parent frame. to give a trivial example of when this might be necessary, consider: "<span>foo <div></div> bar</span>". separate frames are created for the pre and post-div parts of the <span>. if the <div> is
removed, the frame construction code merges those frames by examining the parent frame, destroying the two frames created for the <span>, and creating one unified frame for the text content. examples of this type of code are in wipecontainingblock. this code tries hard to avoid unnecessary frame tree modifications and is rather complicated as a result. ...
Getting Started with Chat
for our new home. please see https://wiki.mozilla.org/matrix for up-to-date information. general rules and etiquette once you have your client set up (see software below) and are connected, there are some basic rules you should follow to ensure the most enjoyable and productive experience: as with all mozilla forums and events, agreeing to our community participation guidelines is a requi
rement for participation. try to keep messages as concise as possible. if you have something long to post, a code snippet for example, use paste.mozilla.org and paste the generated url in irc instead. when addressing someone directly, try to use name: message format. for example, "ashughes: good morning!" every channel has its own topic. try to keep your messages within that subject matter. for ex...
... web-based clients which allow connecting to irc by clicking on irc:// links. one of the simplest web-based clients is mibbit, another is irccloud. these operate very much in the same way as the previously mentioned desktop clients and chatzilla. mibbit does not require flash or any other plugins. channels here is a list of channels you should be aware of as a member of the mozilla community: (
remember to use irc.mozilla.org and port 6697 or 6667 for your server settings) #qa a channel for qa discussion #developers a channel for mozilla development discussion #sumo a channel for support with firefox for more information about the mozilla irc network and more channels, go here. commands the following is a list of commands you should be familiar...
How to get a stacktrace for a bug report
t a crash you should include a stacktrace (call stack) in your report. a stacktrace will tell mozilla developers what crashed and provide a starting point for investigating its cause. this article describes how to use the mozilla crash reporter (breakpad) to get a crash id, which our engineers can use to get a stacktrace, and alternative ways to get a stacktrace if you can't get a crash id. requi
rements you need a binary build of firefox from mozilla.org. seamonkey and thunderbird also support crash reporting. mozilla's crash report server currently only has debug information for mozilla builds and thus the crash reporter cannot work if you use a build from a linux distribution or if you compile from source code. in these cases you will need to use one of the alternative methods listed bel...
...g like "xulrunner", not "firefox". crash reports files on your computer when breakpad initially catches a crash it first writes crash report files (e.g. .dump and .extra files) into the 'pending' subdirectory of its 'crash reports' directory. if breakpad successfully sends the crash report to the reporting server then, by default, the files added to the 'pending' subdirectory for the crash are
removed, and a .txt file is placed in the 'submitted' directory containing the crash id created by the reporting server. if you want breakpad to leave the .dump and .extra files on your computer so that you can examine them locally, then set the moz_crashreporter_no_delete_dump environment variable to 1. ubuntu: instructions from the ubuntu team opensuse: general instructions from opensuse fe...
Implementing Download Resuming
the first part of the file corresponds to the initial version, while the latter part belongs to a different version, leading to an unusable result. the interface resuming is done using the nsiresumablechannel interface. the expected way to use it is this: for all downloads that happen, get the entityid from the channel, and store it for later use. the entity id is what ensures that the file
remains unchanged. this can also be used to check whether the download is resumable: if it is not (e.g. the server is not using http 1.1), then accessing this attribute will throw an ns_error_not_resumable exception. if the download gets interrupted, necko will call the stream listener's onstoprequest method with a failure status. (todo: document what webbrowserpersist/exthandler do). the front-end ...
... resume a download, you should create a channel as usual (using nsiioservice). then, you can check if it implements nsiresumablechannel. if it does not, the protocol does not support resuming. otherwise, call resumeat with the desired start position, and the previously stored entity id. (it is possible to pass an empty string as the id; however, this means that you have no assurance that the file
remained unchanged) now, you can open the channel as usual (using nsichannel.asyncopen() in the common case) and write to the file in the ondataavailable notifications. you may want to use nsisimplestreamlistener to simplify this task; to get progress notifications, you can implement nsiprogresseventsink and set an interface requester as the notificationcallbacks of the channel that gives out such a...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
process non-ascii characters in such a way to conform to existing host name character restrictions. how mozilla browsers handle non-ascii domain names unicode and nameprep when mozilla receives idn input from the user via the location bar or a request to process non-ascii host name links, it first turns them into unicode, then normalizes the input string to make it conform to general uri requi
rement. the process will convert uppercase characters to lowercase ones (case folding), unify characters with multiple representation, e.g. conversion of half-width kana characters in japanese into full-width ones (normalization), eliminate prohibited characters (e.g. space), eliminate ambiguities in bi-directional text (e.g. arabic and hebrew), and check whether or not unassigned characters in the ...
...ent prefixes. e.g. "bq--" for race, but all except the standard ace prefix "xn--" are now disallowed in idn. as an example, an output string to be sent to a dns server for a japanese domain name, "http://ジェーピーニック.jp", will look like the following in ace form: http://xn--hckqz9bzb1cyrb.jp domain name registration after the technical standards were established by ietf, the last
remaining issue was for domain name registrars to agree on an international guideline on the use of idn characters. this was accomplished by the publication of the icann guideline for idn in june of 2003. (cf. icann = internet corporation for assigned names and numbers.) the guideline allows domain name registrars in each country to limit the use of characters for domain names. since the unicode repe...
DeferredTask.jsm
the deferredtask.jsm javascript code module offers utility routines for a task that will run after a delay. multiple attempts to run the same task before the delay will be coalesced. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/deferredtask.jsm"); use this, for instance, if you write data to a file and you expect that you may have to rewrite data very soon afterwards. ...
... "example service: shutting down", () => savedeferredtask.finalize() ); instead, if you are going to delete the saved data from disk anyways, you might as well prevent any pending write from starting, while still ensuring that any write that is currently in progress terminates, so that the file is not in use any more: savedeferredtask.disarm(); savedeferredtask.finalize().then(() => os.file.
remove(...)) .then(null, components.utils.reporterror); ...
Dict.jsm
the dict.jsm javascript code module offers routines for managing dictionaries of key/value pairs. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/dict.jsm"); creating a dictionary you can create a new, empty dictionary by simply calling the dict() constructor: var newdict = new dict(); if you wish, you may also pass in an object literal of key/value pairs with which to initialize the dictionary: var someobj = {}; var newdict = new dict({key1: "foo", key2: someobj}); note that values may be any javascript object type. ...
...pied. dict copy(); parameters none. return value a new dictionary object containing the same top-level items as the original dictionary on which the copy() method was called. del() deletes a key/value pair from the dictionary, given a key. boolean del( string akey ); parameters akey the key for the item to delete from the dictionary. return value true if an entry was found and
removed; false if no match was found. get() returns the value corresponding to the specified key. object get( string akey, [optional] object adefault ); parameters akey the key whose value should be returned. adefault optional the value to return if the specified key isn't found. if you don't specify a default value, undefined is returned for keys that aren't found. return value the...
DownloadSummary
provides an aggregated view on the contents of a downloadlist. a reference to a downloadsummary object can be obtained using the downloads.getsummary() function. method overview promise bindtolist(downloadlist alist); promise addview(object aview); promise
removeview(object aview); properties attribute type description allhavestopped read only boolean indicates whether all the downloads are currently stopped. progresstotalbytes read only number indicates the total number of bytes to be transferred before completing all the downloads that are currently in progress. for downloads that do not have a known final size, the number of b...
...l receive an initial onsummarychanged notification. promise addview( object aview ); parameters aview the view object to add. the following methods may be defined: onsummarychanged: optional called after any property of the summary has changed. promise resolves to undefined when the view has been registered and the onsummarychanged notification has been sent.
removeview()
removes a view that was previously added using addview(). promise
removeview( object aview ); parameters aview the view object to
remove. promise resolves to undefined when the view has been
removed. at this point, the
removed view will not receive any more notifications. ...
Following the Android Toasts Tutorial from a JNI Perspective
guides - toasts tutorial. it will use the jni.jsm module that is available in firefox for android since version 17. this article teaches developers how to port java code to jni by reading the java and android documentation. toast description a toast provides simple feedback about an operation in a small popup. it only fills the amount of space required for the message, and the current activity
remains visible and interactive. for example, navigating away from an email before you send it triggers a "draft saved" toast to let you know that you can continue editing later. toasts automatically disappear after a timeout. toasts do not have to be created with jni; they are exposed by the nativewindow feature on firefox for android, see toast documentation. java code let's start with the follo...
...ion); var toast = toast.maketext(context, text, duration); // toast.show(); toast.show(); notice that the charsequence was not created with a constructor. this is special: because a charsequence is an array of byte characters, we can pass simple javascript strings to jni.jsm wherever a charsequence is needed. this tells us we don't even need the sig for charsequence in our sig object, so let's
remove it. final jni ported code here's converted code. var my_jenv = null; try { my_jenv = jni.getforthread(); // we declare the classes, methods, etc we will be using: this part is not seen in the native example var sig = { context: 'landroid/content/context;', geckoappshell: 'lorg/mozilla/gecko/geckoappshell;', int: 'i', toast: 'landroid/widget/toast...
Log.jsm
new log.basicformatter())); // a dump appender logs to stdout. log.addappender(new log.dumpappender(new log.basicformatter())); // log some messages log.error("oh noes!! something bad happened!"); log.debug("details about bad thing only useful during debugging", {someinfo: "nothing"}); log.warn("here is an error", new error("ouch")); logger levels fatal severe errors that cause p
remature termination. expect these to be immediately visible on a status console. error other runtime errors or unexpected conditions. expect these to be immediately visible on a status console. warn use of deprecated apis, poor use of api, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong". expect these to be immediately ...
... format(); logmessage(); length: 4 keys of prototype: leveldesc logger(); length: 2 keys of prototype: addappender(); level logstructured(); name parent
removeappender(); updateappenders(); and the methods mentioned below: logger methods loggerrepository(); length: 0 keys of prototype: getlogger(); rootlogger storagestreamappender(); length: 1 keys of prototype: doappend(); ...
OSFile.jsm
f nsiioservice, etc.) by javascript code. what are the relationships with the html5 file api? none, really. the file api is designed for high-level, highly-restricted manipulation of files by web applications. os.file is designed for efficient, unrestricted, manipulation of files by firefox itself and by add-ons. why is off main thread file i/o important? one thing that all developers need to
remember is that the duration of a file i/o operation is unbounded. depending on the current load of the kernel, the current disk activity, the current load of the bus, the current rotation speed of the disk, the amount of battery power, etc. operations can take an arbitrary amount of time. we are talking about several seconds to execute operations that look trivial, such as closing a file, or checki...
...s to execute operations that look trivial, such as closing a file, or checking when it was last modified. if the operation is called on the main thread, this means that the whole user experience is stuck for several seconds, which is quite bad. why is i/o efficiency important? i/o efficiency is all about minimizing the number of actual i/o calls. this is critical because some platforms have ext
remely slow storage (e.g. smartphones, tablets) and because, regardless of the platforms, doing too much i/o penalizes not just your application but potentially all the applications running on the system, which is quite bad for the user experience. finally, i/o is often expensive in terms of energy, so wasting i/o is wasting battery. consequently, one of the key design choices of os.file is to provi...
Using JavaScript code modules
in it, you can put the code module in your content folder and reference it like your other content files via chrome://<yourextension>/content/<yourmodule>.jsm. if your extension or application needs to support mozilla 1.9.x (firefox 3.x), you should register a new resource url. details on doing this are in the "extending resource: urls" section below. sharing objects using code modules an ext
remely important behavior of components.utils.import() is that modules are cached when loaded and subsequent imports do not reload a new version of the module, but instead use the previously cached version. this means that a given module will be shared when imported multiple times. any modifications to data, objects, or functions will be available in any scope that has imported the module. for exampl...
...ith your own resource url at the top level in a component source. a possible solution is moving the call to components.utils.import() into the xpcom component constructor (discussion). packaging notes it's important to note that you should not typically put your javascript code modules in a jar file in your add-on. firefox 3.6 doesn't support them at all, and there's only one case in which it's
remotely useful: a firefox 4-only add-on which must be installed unpacked. otherwise placing code modules in a jar file breaks compatibility unnecessarily. importing commonjs modules the javascript code modules described here are not the same thing as commonjs modules, but you can import commonjs modules into any scope where you can use components.utils.import. just call the following: const { req...
WebRequest.jsm
it takes one mandatory argument and two optional arguments, as detailed below. name type description callback function the callback argument is a function to be called when the event is triggered. it's passed an object whose structure will vary depending o...
...ific documentation for details. in particular, "blocking" may be passed to several event types, and will make the event dispatch synchronous, so the browser will wait for the event listener to return before continuing with the request. this then enables the event listener to modify or cancel the request. see modifying & canceling requests. some examples of using addlistener(). to
remove a listener for an event, call
removelistener on the event in question, passing it the listener to
remove. filtering the filter argument is the second argument to addlistener(). if you don't pass filter, then the listener is invoked for every web request the browser makes that triggers that particular event. filter is an object that may contain up to two properties: urls and types. ...
XPCOMUtils.jsm
method is invoked on that object, it checks to see if the specified iid is listed in the array specified by the interfaces parameter; if it is, this (that is, the object itself) is returned. otherwise, null is returned. function generateqi( interfaces ); parameters interfaces an array of interfaces implemented by the component. return value a queryinterface() function implementation.
remarks when you implement an interface that inherits from another one, you should generally list all the base interfaces explicitly, except for nsisupports. for example, if your component implements nsistreamconverter: mycomponent.prototype = { queryinterface: xpcomutils.generateqi([ components.interfaces.nsirequestobserver, components.interfaces.nsistreamlistener, components.interfa...
...another without having to hard-code full paths. void importrelative( that, path, scope ); parameters that the javascript object of the calling javascript code module's global scope. you should simply pass this. path the relative path of the javascript code module to import. scope an optional object to import into; if omitted, the object passed in for the that parameter is used.
remarks this lets an extension bundle its own javascript code modules within itself and have them load one another. for example, if an extension named "myextension" bundles foo.jsm and bar.jsm, and foo.jsm needs to load bar.jsm, it can do so like this: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.importrelative(this, "bar.jsm"); in other words: importrelative will ...
Bootstrapping a new locale
ers to let them know that you are interested in starting a localization. the l10n-drivers will help set up an experimental hg repository in bit bucket. you will need to create an account so you can access the service. once you have that account, send the l10n-drivers the details to be added as a "writer". with that level of authority, you will be able to push and pull and manage the repository
remotely. it will be just like working on hg with mozilla, yet you will use the bit bucket platform to start. after your new bit bucket repository is created by the l10n-drivers, please visit the url for your repo. you can do this by entering the following url into your browser: $ https://bitbucket.org/mozillal10n/ab-cd/overview/ (where ab-cd will be replaced by your locale code) at that main ...
...ranslated browser/" $ hg push http://bitbucket.org/mozillal10n/ab-cd/ note that due to the distributed nature of hg, hg commit saves the changes locally, i.e. in the hg repository on your computer. you can see the history of commits with hg log. after doing hg commit, you still need to send the changes to bitbucket. this is why you need to do hg push, which sends the already made commits to the
remote repository (http://bitbucket.org/mozillal10n/ab-cd/ in the example above). after you have committed and pushed your initial translation, email the l10n-drivers team to let us know it's ready. set up for building the next step is to create a .mozconfig file with the compile options for the localized build of firefox, and to set up the object directory for the localized build. cd mozilla-1.9...
Localization content best practices
ink}}. privacy-link = privacy terms and then replace {{link}} at run-time with the link. don't hardcode characters typically white spaces, commas, or other separators (":", "|"). if you need a trailing white space in a string, use the unicode character \u0020 (that's usually a bad sign, you're concatenating it to another string). at some point, someone will accidentally trim that whitespace.
remove unused strings if you're
removing features, don't leave around unused strings in the .properties file. tooltips if a string is used as a tooltip, it should not end in a period (in english). tooltips are never written in imperative mood but infinitive mood instead. hence the proper absence of periods to indicate this isn't just a matter of consistency for en-us, as it is also vital info for ...
...osebookmark.accesskey" to match it. string freeze some repositories are considered to be string-frozen. this means that string changes are not allowed to land, and each case must be evaluated before landing. as a general rule, it's recommended to fix strings on the trunk/master repository, and create ad-hoc patches for string frozen repositories that don't involve string changes. note that even
removing strings is considered a breakage. in the case of firefox and thunderbird, string frozen repositories are: mozilla-aurora, mozilla-beta, mozilla-release. bugzilla and l10n do i need l10n feedback? feedback from l10n-drivers is not necessary for each landing involving strings, as long as you're following the basic rules described in this document. if you have doubts about the localizabilit...
MathML In Action
you already have a mathml-enabled build but what you see on the screenshot is not what you get? in that case you are probably missing some crucial mathml fonts. now that you are well-equipped, you should be able to see this inline equation with varying accents: x ^ + xy ^ + xyz ^ . ...
... addeventlistener("click", zoomtoggle, false); } window.addeventlistener("load", load, false); consider an interesting markup like this { u t + f ( u ) x = 0 u ( 0 , x ) = { u ...
Using the viewport meta tag to control layout on mobile browsers
mber of device pixels that best approximates the reference pixel. it is recommended that the reference pixel be the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. for web developers, this means that the size of a page is much smaller than the actual pixel count and browsers may size their layouts and images accordingly. but
remember that not all mobile devices are the same width; you should make sure that your pages work well in a large variation of screen sizes and orientations. the default pixel ratio depends on the display density. on a display with density less than 200dpi, the ratio is 1.0. on displays with density between 200 and 300dpi, the ratio is 1.5. for displays with density over 300dpi, the ratio is the in...
...user-scalable. these properties affect the initial scale and width, as well as limiting changes in zoom level. not all mobile browsers handle orientation changes in the same way. for example, mobile safari often just zooms the page when changing from portrait to landscape, instead of laying out the page as it would if originally loaded in landscape. if web developers want their scale settings to
remain consistent when switching orientations on the iphone, they must add a maximum-scale value to prevent this zooming, which has the sometimes-unwanted side effect of preventing users from zooming in: <meta name="viewport" content="initial-scale=1, maximum-scale=1"> suppress the small zoom applied by many smartphones by setting the initial scale and minimum-scale values to 0.86. the result is ho...
Mozilla Web Developer FAQ
w, bug-inducing, difficult and complicated. the usual counter argument is that there is no need to guess—mozilla should do whatever browser x does (where x is the favorite non-mozilla browser of whoever is presenting the counter argument). however, doing whatever browser x does in every conceivable case isn’t simple at all, even though it might appear to be simple when presented as a passing
remark. different people have different ideas about what x should be. the second problem is that web authors are very creative in coming up with different ways of deviating from the standards. in fact, since the input to the browser can be of arbitrary length, there is no upper bound for the number of distinct ways of deviating from the standards. therefore, it is impossible to test whether mozilla ...
...ot explicitly present. cdata sections are supported. xml empty element notation (<foo/>) is supported. white space characters in attribute values are normalized to spaces at parse time, so the original white space never makes it to the dom. this affects data round tripping using hidden form inputs. in versions prior to gecko 1.9/firefox 3, the document is not loaded and rendered inc
rementally. the layout mode is the (full) standards mode regardless of doctype. css works according to the xml+css rules. html-specific css exceptions do not apply. for example, the body element gets no special treatment. css selectors are case-sensitive. the dom is in the xml mode. namespace-aware variants of methods need to be used when working with elements (eg. createelemen...
Mozilla Development Strategies
e to file a "fix it" bug and fix stuff you know about later -- chances are the reviewer will make you do the work anyway. if it takes you five extra minutes to do something the "right" way rather than twenty minutes debating it with the reviewer, you've just saved yourself and the reviewer valuable time. obviously, when doing it the "right" way means re-engineering large amounts of code, then inc
remental work is better; it's a fine line. don't drag out reviews by fighting the reviewer in bugzilla (or email) when getting a review, try not to belabor a point that a reviewer is debating you on. if the debate is involved, solve it in person, on irc or over aim. a five minute discussion is worth an hour of e-mails. do thorough code reviews when you review someone else's code, review thoroughl...
...wing skills on your own patch before you seek reviews and a super review. better that you catch something, than the reviewers or super reviewers. you might find a problem, or find that you left in some dump() or printf() statements, or have messed up the whitespace. if you're working on something massive, start a branch if you are working on something big, and you want to be able to check in inc
rementally without getting reviews, create a branch. but having a branch means dealing with conflicts when you land, and waiting a long time for reviews. here's how to create a branch: from your linux or mac os x box: # start from your trunk tree on your local disk cd mozilla find . -type d \! -name cvs | xargs -l -p10 cvs tag -l my_base_tag > & ../taglog1.txt find . -type d \! -name cvs | xargs -...
Investigating leaks using DMD heap scan mode
wn checks. first, in toolkit/components/terminator/nsterminator.cpp, delete everything in runwatchdog but the call to ns_setcurrentthreadname. this will keep the watch dog from killing the browser when shut down takes multiple minutes. secondly, you may need to comment out the call to moz_crash("nss_shutdown failed"); in xpcom/build/xpcominit.cpp, as this also seems to trigger when shutdown is ext
remely slow. you need the cycle collector analysis script find_roots.py, which can be downloaded as part of this repo on github. generating logs the next step is to generate a number of log files. you need to get a shutdown cc log and a dmd log, for a single run. definitions i'll write $objdir for the object directory for your firefox dmd build, $srcdir for the top level of the firefox source di...
... the -sfl 10000 tells it to not truncate stack frames, and -a tells it to not display generic frames related to the allocator. caveat: i think block_analyzer.py does not attempt to clamp the address you pass into it, so if it is an offset from the start of the block, it won’t find it. block_analyzer.py will return a series of entries that look like this (with the [...] indicating where i have
removed things): 0x7f089306b000 size = 4096 bytes at byte offset 2168 nsattrandchildarray::growby[...] nsattrandchildarray::insertchildat[...] [...] 0x7f089306b000 is the address of the block that contains $leakaddr. 144 bytes is the size of that block. that can be useful for confirming your guess about what class the block actually is. the byte offset tells you were in the block the pointer ...
Profiling with Xperf
that you don't get dropped events. also, when recording the stack, i've found that a heap trace is often missing module information (i believe this is a bug in xperf). it's possible to get around that by doing a simultaneous capture of non-heap data. to start a trace session, launching a new firefox instance: xperf -on base xperf -start heapsession -heap -pidnewprocess "./firefox.exe -p test -no-
remote" -stackwalk heapalloc+heaprealloc -buffersize 512 -minbuffers 128 -maxbuffers 512 to stop a session and merge the resulting files: xperf -stop heapsession -d heap.etl xperf -d main.etl xperf -merge main.etl heap.etl result.etl "result.etl" will contain your merged data; you can delete main.etl and heap.etl. note that it's possible to capture even more data for the non-heap profile; for examp...
...t to change the grouping -- for example, drag it to the left of the module column to have grouping happen only by process (stuff that's to the left), so that you get symbols in order of weight, regardless of what module they're in. dragging the columns around will change grouping in various ways; experiment to get the data that you're looking for. also experiment with turning columns on and off;
removing a column will allow data to be aggregated without considering that column's contributions. disabling all but one core will make the numbers add up to 100%. this can be done by running 'msconfig' and going to advance options from the "boot" tab. building firefox to get good data from a firefox build, it is important to build with the following options in your mozconfig: export cflags="-oy-"...
Refcount tracing and balancing
the leakers first you have to figure out which objects leaked. the script tools/rb/find_leakers.py does this. it grovels through the log file, and figures out which objects got allocated (it knows because they were just allocated because they got addref()-ed and their refcount became 1). it adds them to a list. when it finds an object that got freed (it knows because its refcount goes to 0), it
removes it from the list. anything left over is leaked. the scripts output looks like the following. 0x00253ab0 (1) 0x00253ae0 (2) 0x00253bd0 (4) the number in parentheses indicates the order in which it was allocated, if you care. pick one of these pointers for use with step 2. post-processing step 2: filtering the log once you've picked an object that leaked, you can use tools/rb/filter-log.
...s from smart pointers. if the leak comes from a smart pointer that is logged in the xpcom_mem_comptr_log, then find-comptr-leakers.pl will find the exact stack for you, and you don't have to look at trees. ignore balanced trees. the make-tree.pl script accepts an option --ignore-balanced, which tells it not to bother printing out the children of a node whose balance factor is zero. this can help
remove some of the clutter from an otherwise noisy tree. ignore matched releases from smart pointers. if you've checked (see above) that the leak wasn't from a smart pointer, you can ignore the references that came from smart pointers (where we can use the pointer identity of the smart pointer to match the addref and the release). this requires using an xpcom_mem_refcnt_log and an xpcom_mem_comptr_l...
TraceMalloc
this documentation is only relevant to older versions of the codebase that still contain it. tracemalloc captures stack traces of all malloc, calloc , realloc, and free calls (this currently covers all operator new and delete calls in mozilla, too). to enable tracemalloc in your build, configure with --enable-trace-malloc. the built mozilla application will support the following additional command-line options: --trace-malloc filename the application will log allocation and deallocation events with stack traces in a binary format to the given file. ...
...leak.log # note 2: it appears that the shutdown log is not recorded if --trace-malloc is given the - argument. build/dist/minefield.app/contents/macos/firefox --trace-malloc /dev/null --shutdown-leaks=sdleak.log # convert raw log to text representation of call trees perl source/tools/trace-malloc/diffbloatdump.pl --depth=15 --use-address /dev/null sdleak.log > sdleak.tree.raw # frobulate trees to
remove extraneous junk perl source/tools/rb/fix-macosx-stack.pl sdleak.tree.raw > sdleak.tree you can also use the leakstats program to analyze a log for shutdown leaks. it will produce a report like the following. leaks: 382739 bytes, 3465 allocations maximum heap size: 7751799 bytes 62095212 bytes were allocated in 391091 allocations. detecting memory usage growth in a running process to do this, d...
perf
f this document easier to understand. energy estimates perf can access the intel rapl energy estimates. the following example shows how to invoke it for this purpose. sudo perf stat -a -r 1 \ -e "power/energy-pkg/" \ -e "power/energy-cores/" \ -e "power/energy-gpu/" \ -e "power/energy-ram/" \ <command> the -a is necessary; it means "all cores", and without it all the measu
rements will be zero. the -r 1 means <command> is executed once; higher values can be used to get variations. the output will look like the following. performance counter stats for 'system wide': 51.58 joules power/energy-pkg/ [100.00%] 14.80 joules power/energy-cores/ [100.00%] 9.93 joules power/energy-gpu/ [100.00%] 27.38 joules power/energy-ram/ [100.00%] 5.003049064...
...ing. performance counter stats for 'system wide': 51.58 joules power/energy-pkg/ [100.00%] 14.80 joules power/energy-cores/ [100.00%] 9.93 joules power/energy-gpu/ [100.00%] 27.38 joules power/energy-ram/ [100.00%] 5.003049064 seconds time elapsed it's not clear from the output, but the following relationship holds. energy-pkg >= energy-cores + energy-gpu the measu
rement is in joules, which is usually less useful than watts. for these reasons rapl is usually a better tool for measuring power consumption on linux. wakeups perf can also be used to do high-context profiling of wakeups. ...
A brief guide to Mozilla preferences
rivilege to his or her profile directory, he or she can change the default values if he or she knows how. another disadvantage is that existing profiles will not be affected. this method is considered user-hostile. any use of this technique by software such as firefox extension to override normal user preference will result in being added to the firefox blocklist or the preferences being forcibly
removed. note: because of abuse of user.js preferences, support for user.js may be
removed in a future version of firefox. see bug 1543752. sticky preferences sticky preferences were introduced in firefox 40 via bug 1098343. sticky preferences are created when they are defined using sticky_pref(). these preferences act as default preferences but whenever a value is created for the preferenc...
...e defined using sticky_pref(). these preferences act as default preferences but whenever a value is created for the preference, that value is always written even when it matches the default. sticky preferences are generally used for preferences that have a different default value in different channels with the intent being that once the user sets the preference in one channel, the preference will
remain with that value when using a different channel with different defaults. for example, let's assume that nightly has a preference "some.preference" which defaults to true while developeredition defaults the same preference to false and the user desires the preference to have the value true in both channels. if the preference is not a sticky preference and the user runs developeredition and flips...
Profile Manager
), so a new standalone profile manager application has been created, which works with any xulrunner application, and has many features not found in firefox's built-in version. downloading binaries you can download profile manager builds from https://ftp.mozilla.org/pub/mozilla.org/utilities/profilemanager/1.0/ note: there is no installer; just extract the files from the archive. system requi
rements: mac: an intel processor, i386 or x86_64 linux: any version capable of running firefox 4.0 windows: xp or later source code you can download the source as well: hg clone http://hg.mozilla.org/automation/profilemanager/ instructions for building can be found in build.txt. reporting bugs profile manager bugs should be reported in bugzilla, under testing -> profilemanager. starting ...
...launch options available for firefox. these cause firefox to be launched with various command-line arguments. see command line options for a description of these. launch option command line argument run firefox in offline mode -offline run firefox in safe mode -safe-mode start firefox with a console -console start new instance -no-
remote note: it isn't possible to start a second instance of firefox without passing it the -no-
remote command line argument. for this reason, if you attempt to launch firefox using profile manager, and it detects that another instance of firefox is already running, it will automatically add the -no-
remote argument for you, regardless of whether this launch option was checked. locked profi...
A guide to searching crash reports
ure facet" tab -- the results will be spread across multiple pages, which you can visit by clicking the links at the top right of the tab. the links within the results do the following things. the link in each "crash id" column cell links to an individual crash report. the links in each "signature" column cell have the same effect that they did in the "signature facet" tab. the links in the
remaining column cells also let you perform a narrower subsequent search with that link's value added to the search criteria. a narrower search you can add criteria to perform a narrower search. for example, to perform a search for all mac crash reports that occurred while javascript garbage collection was running, do the following. add "mac os x" to the "platform" field. select "new line", an...
...ple of less useful grouping the usefulness of grouping varies from field to field. in particular, fields that can have many possible values (such as numeric fields) often don't group well. for example, if we do a default search grouped by uptime we get results like those in the following screenshot. in this example the top 10 groups account for less than 12% of all crashes, and there is an ext
remely long tail. these results would be improved by using numeric ranges instead of individual values, but unfortunately that isn't supported. advanced usage the combination of searching and grouping is powerful. searches find crash reports that match particular criteria, and grouping organizes those crash reports into interesting groups. when a search is performed, the page's url is updated to i...
Leak And Bloat Tests
08/04/2008: prefs.js created via tb with the above settings, the first section is for preferences included in tinderbox, the second section is ones which don't currently get set. user_pref("mail.account.account1.server", "server1"); user_pref("mail.account.account2.id...
...entities", "id1"); user_pref("mail.account.account2.server", "server2"); user_pref("mail.accountmanager.accounts", "account1,account2"); user_pref("mail.accountmanager.defaultaccount", "account2"); user_pref("mail.accountmanager.localfoldersserver", "server1"); user_pref("mail.identity.id1.fullname", "tinderbox"); user_pref("mail.identity.id1.smtpserver", "smtp1"); user_pref("mail.identity.id1.use
remail", "tinderbox@invalid.com"); user_pref("mail.identity.id1.valid", true); user_pref("mail.root.none-rel", "[profd]mail"); user_pref("mail.root.pop3-rel", "[profd]mail"); user_pref("mail.server.server1.directory-rel", "[profd]mail/local folders"); user_pref("mail.server.server1.hostname", "local folders"); user_pref("mail.server.server1.name", "local folders"); user_pref("mail.server.server1.type...
McCoy
n order to verify the update manifests applications need to already have information from you for how to verify it. this is in the form of the public part of a cryptographic key included in the original add-on you release. the first step is to create a cryptographic key. simply click the "create" toolbar button or select "create key" from the "keys" menu. you should give the key a name that will
remind you what you are using it for. it is up to you how you use your keys, either using one key for all add-ons or one key per add-on would seem sensible choices. once you have a key you need to add its public part to your add-on's install.rdf file. the simplest way to do this is to select the key then click the install toolbar button. you must then locate your install.rdf for mccoy and the public...
... ...
Midas editor module security preferences
please do not try to modify this page. to protect users' private information, unprivileged scripts cannot invoke the cut, copy, and paste commands in midas, which is mozilla's rich text editor component. ...
... ...
Atomic Operations
rmance. on systems that do not provide direct access to atomic operators, nspr emulates the capabilities by using its own locking mechanisms. ...
...hat do not provide direct access to atomic operators, nspr emulates the capabilities by using its own locking mechanisms. ...
Monitors
tor type monitor functions with a mutex of type prlock, a single thread may enter the monitor only once before it exits, and the mutex can have multiple associated condition variables. with a mutex of type prmonitor, a single thread may re-enter a monitor as many times as it sees fit. the first time the thread enters a monitor, it acquires the monitor's lock and the thread's entry count is inc
remented to 1. each subsequent time the thread successfully enters the same monitor, the thread's entry count is inc
remented again, and each time the thread exits the monitor, the thread's entry count is dec
remented. when the entry count for a thread reaches zero, the thread releases the monitor's lock, and other threads that were blocked while trying to enter the monitor will be rescheduled. a call...
..., all monitor functions require a pointer to an opaque object of type prmonitor. monitor functions all monitor functions are thread-safe. however, this safety does not extend to protecting the monitor object from deletion. pr_newmonitor creates a new monitor. pr_destroymonitor destroys a monitor object. pr_entermonitor enters the lock associated with a specified monitor. pr_exitmonitor dec
rements the entry count associated with a specified monitor. pr_wait waits for a notify on a specified monitor's condition variable. pr_notify notifies a thread waiting on a specified monitor's condition variable. pr_notifyall notifies all threads waiting on a specified monitor's condition variable. ...
Named Shared Memory
ol using named shared memory functions pr_opensharedmemory creates the shared memory segment, if it does not already exist, or opens a connection with the existing shared memory segment if it already exists. pr_attachsharedmemory should be called following pr_opensharedmemory to map the memory segment to an address in the application's address space. pr_attachsharedmemory may also be called to
remap a shared memory segment after detaching the same prsharedmemory object. be sure to detach it when you're finished. pr_detachsharedmemory should be called to unmap the shared memory segment from the application's address space. pr_closesharedmemory should be called when no further use of the prsharedmemory object is required within a process. following a call to pr_closesharedmemory, the prsha...
...l names provided to pr_opensharedmemory should be valid filename syntax or name syntax for shared memory for the target platform. referenced directories should have permissions appropriate for writing. limits on shared memory resources different platforms have limits on both the number and size of shared memory resources. the default system limits on some platforms may be smaller than your requi
rements. these limits may be adjusted on some platforms either via boot-time options or by setting the size of the system paging space to accommodate more and/or larger shared memory segment(s). security considerations on unix platforms, depending on implementation, contents of the backing store for the shared memory can be exposed via the file system. set permissions and or access controls at crea...
PLHashEnumerator
syntax #include <plhash.h> typedef printn (pr_callback *plhashenumerator)(plhashentry *he, printn index, void *arg); /* return value */ #define ht_enumerate_next 0 /* continue enumerating entries */ #define ht_enumerate_stop 1 /* stop enumerating entries */ #define ht_enumerate_
remove 2 /*
remove and free the current entry */ #define ht_enumerate_unhash 4 /* just unhash the current entry */ description plhashenumerator is a function type used in the enumerating a hash table. when all the table entries are enumerated, each entry is passed to a user-specified function of type plhashenumerator with the hash table entry, an integer index, and an arbitrary piece of user data as argument.
remark the meaning of ht_enumerate_unhash is not clear. in the current implementat...
...ype plhashenumerator with the hash table entry, an integer index, and an arbitrary piece of user data as argument.
remark the meaning of ht_enumerate_unhash is not clear. in the current implementation, it will leave the hash table in an inconsistent state. the entries are unlinked from the table, they are not freed, but the entry count (the nentries field of the plhashtable structure) is not dec
remented. see also pl_hashtableenumerateentries ...
PR_CEnterMonitor
enters the lock associated with a cached monitor. syntax #include <prcmon.h> prmonitor* pr_centermonitor(void *address); parameter the function has the following parameter: address a reference to the data that is to be protected by the monitor. this reference must
remain valid as long as there are monitoring operations being performed. returns the function returns one of the following values: if successful, the function returns a pointer to the prmonitor associated with the value specified in the address parameter. if unsuccessful (the monitor cache needs to be expanded and the system is out of memory), the function returns null. description pr_centermonitor uses the value specified in the address parameter to find a monitor in the monitor cache, then enters the lock asso...
... if unsuccessful (the monitor cache needs to be expanded and the system is out of memory), the function returns null. description pr_centermonitor uses the value specified 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 inc
remented (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 inc
remented 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 ...
PR_ExitMonitor
threads that were blocked trying to enter the monitor will be rescheduled. ...
... the function has the following parameter: mon a reference to an existing structure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful (the calling thread has not entered the monitor), pr_failure. description if the dec
remented entry count is zero, pr_exitmonitor releases the monitor's lock. threads that were blocked trying to enter the monitor will be rescheduled. ...
PR_PopIOLayer
removes a layer from the stack. syntax #include <prio.h> prfiledesc *pr_popiolayer( prfiledesc *stack, prdescidentity id); parameters the function has the following parameters: stack a pointer to a prfiledesc object representing the stack from which the specified layer is to be
removed. id identity of the layer to be
removed from the stack. returns the function returns one of the following values: if the layer is successfully
removed from the stack, a pointer to the
removed layer. if the layer is not found in the stack or cannot be popped (for example, the bottommost layer), the function returns null with the error code pr_invalid_argument_error. description pr_popiolayer pops the specified layer from the stack. ...
... the function returns one of the following values: if the layer is successfully
removed from the stack, a pointer to the
removed layer. if the layer is not found in the stack or cannot be popped (for example, the bottommost layer), the function returns null with the error code pr_invalid_argument_error. description pr_popiolayer pops the specified layer from the stack. if the object to be
removed is found, pr_popiolayer returns a pointer to the
removed object the object then becomes the responsibility of the caller. even if the identity indicates the top layer of the stack, the reference returned is not the file descriptor for the stack and that file descriptor
remains valid. in other words, stack continues to point to the top of the stack after the function returns. ...
NSPR API Reference
hat operate on pathnames functions that act on file descriptors directory i/o functions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers network addresses network address types and constants network address functions atomic operations pr_atomicinc
rement pr_atomicdec
rement pr_atomicset interval timing interval time type and constants interval functions date and time types and constants time parameter callback functions functions memory management operations memory allocation functions memory allocation macros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion ...
...ros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted printing linked lists linked list types prclist linked list macros pr_init_clist pr_init_static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_
remove_link pr_
remove_and_init_link pr_insert_before pr_insert_after dynamic library linking library linking types prlibrary prstaticlinktable library linking functions pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in...
NSPR release process
set the nspr version number. five files need to be updated: configure.in, configure, repackage.sh, prinit.h, and vercheck.c. look at their cvs histories for examples. make a dummy change (add or
remove a blank line) to mozilla/nsprpub/config/prdepend.h. make sure the nss tinderboxes (which also build and test nspr) are all green. the build+test cycles of the nss tinderboxes are very long, so you usually need to wait half a day for them to cycle through. create a beta cvs tag. the naming convention is nspr_x_y_z_betan for nspr x.y.z beta n. push the beta tag to mozilla-central for testing in firefox trunk builds. ideally you should test it for a week.
remove "beta" from the nspr version number for the final release. usually you just need to update prinit.h. make a dummy change (add o...
...sually need to wait half a day for them to cycle through. create a beta cvs tag. the naming convention is nspr_x_y_z_betan for nspr x.y.z beta n. push the beta tag to mozilla-central for testing in firefox trunk builds. ideally you should test it for a week.
remove "beta" from the nspr version number for the final release. usually you just need to update prinit.h. make a dummy change (add or
remove a blank line) to mozilla/nsprpub/config/prdepend.h. create a rtm cvs tag. the naming convention is nspr_x_y_z_rtm for nspr x.y.z. upload a source tar file to https://ftp.mozilla.org/pub/mozilla....nspr/releases/ write the release notes. announce the release in the mozilla nspr newsgroup. ...
An overview of NSS Internals
roperties, as well as providing a handle for the programmer to use. once the application is done with a handle, it should be released, allowing nss to free the associated resources. when working with handles to private keys it's usually difficult (and undesired) that an application gets access to the raw key data; therefore it may be difficult to extract such data from nss. the usual minimum requi
rement is that private keys must be wrapped using a protective layer (such as password-based encryption). the intention is to make it easier to review code for security. the less code that has access to raw secret keys, the less code that must be reviewed. nss has only limited functionality to look up raw keys. the preferred approach is to use certificates, and to look up certificates by propertie...
...uites. if a programmer wants to influence how nss verifies certificates or how nss verifies the data presented in a ssl connection handshake, it is possible to register application-defined callback functions which will be called by nss at the appropriate point of time, and which can be used to override the decisions made by nss. if you would like to use nss as a toolkit that implements ssl,
remember that you must init nss first. but if you don't care about modifying the default trust permanently (recorded on disk), you can use the no-database init calls. when creating the network socket for data exchange, note that you must use the operating system independent apis provided by nspr and nss. it might be interesting to mention a property of the nspr file descriptors, which are stacked in ...
Certificate functions
later cert_filtercertlistbycanames mxr 3.4 and later cert_filtercertlistbyusage mxr 3.4 and later cert_filtercertlistforusercerts mxr 3.6 and later cert_findcertbydercert mxr 3.2 and later cert_findcertbyissuerandsn mxr 3.2 and later cert_findcertbynickname mxr 3.2 and later cert_findcertbynicknameo
remailaddr mxr 3.2 and later cert_findcertbysubjectkeyid mxr 3.7 and later cert_findcertextension mxr 3.4 and later cert_findcertissuer mxr 3.3 and later cert_findkeyusageextension mxr 3.4 and later cert_findsmimeprofile mxr 3.2 and later cert_findsubjectkeyidextension mxr 3.7 and later cert_findu...
... cert_nametoascii mxr 3.2 and later cert_newcertlist mxr 3.2 and later cert_newtempcertificate mxr 3.12 and later cert_nicknamestringsfromcertlist mxr 3.4 and later cert_opencertdbfilename mxr 3.2 and later cert_ocspcachesettings mxr 3.11.7 and later cert_pkixverifycert mxr 3.12 and later cert_
removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsloptime mxr 3.2 and later cert_setocspfailu
remode mxr 3.11.7 and later cert_setocsptimeout mxr 3.12 and later cert_setusepkixforvalidation mxr 3.12 and later cert_sta...
FIPS Mode - an explanation
fips regulations, so their applicability is somewhat wider than just the us government's personnel. what is "fips mode"? one of the fips regulations, fips 140, governs the use of encryption and cryptographic services. it requires that all cryptography done by us government personnel must be done in "devices" that have been independently tested, and certified by nist, to meet the extensive requi
rements of that document. these devices may be hardware or software, but either way, they must function and behave as prescribed. so, in order for mozilla firefox and thunderbird to be usable by people who are subject to the fips regulations, mozilla's cryptographic software must be able to operate in a mode that is fully compliant with fips 140. to that end, mozilla products can function in a "fi...
...nternally. except for "public keys", it must not allow any keys to leave it (to get outside of it) unless they are encrypted ("wrapped") in a special way. this makes it difficult to move keys from one device to another, and consequently, all crypto engines and key storage must be in a single device rather than being split up into several devices. how does this affect firefox users? these requi
rements have several implications for users. in fips mode, every user must have a good strong "master password", and must enter it each time he starts or restarts firefox before he can visit any web sites that use cryptography (https). firefox can only use the latest version of ssl, known as "tls", and not the older ssl 2 or ssl 3.0 protocols, and firefox can only talk to those servers that use fip...
HTTP delegation
ts from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the implementation in mozilla client applications. specifying an ocsp proxy the
remainder of this document is a short howto. one might expect the api defines a simple function that accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to b...
...t 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to
remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application be unable to keep a physical connection alive all the time, the application is expected to create new connections automatically. nss may choose to repeatedly call a "network connection keep alive" function (sec_httpserver_keepalivesessionfcn) on the server session object, giving application code a chance t...
HTTP delegation
ts from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the implementation in mozilla client applications. specifying an ocsp proxy the
remainder of this document is a short howto. one might expect the api defines a simple function that accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to b...
...t 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to
remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application be unable to keep a physical connection alive all the time, the application is expected to create new connections automatically. nss may choose to repeatedly call a "network connection keep alive" function (sec_httpserver_keepalivesessionfcn) on the server session object, giving application code a chance t...
NSS Key Log Format
) and are ignored. secrets follow the format <label> <space> <clientrandom> <space> <secret> where: <label> describes the following secret. <clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters. <secret> depends on the label (see below). ...
...pace> <clientrandom> <space> <secret> where: <label> describes the following secret. <clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters. <secret> depends on the label (see below). ...
NSS 3.14.1 release notes
ing. new functions in ocspt.h cert_createocspsingleresponsegood cert_createocspsingleresponseunknown cert_createocspsingleresponserevoked cert_createencodedocspsuccessresponse cert_createencodedocsperrorresponse new types in ocspt.h certocspresponderidtype notable changes in nss 3.14.1 windows ce support has been
removed from the code base. bug 812399 - in nss 3.14, a regression caused bug 641052 / cve-2011-3640 to be re-introduced under certain situations. this regression only affected applications that initialize nss via the nss_nodb_init function. nss 3.14.1 includes the complete fix for this issue. bug 357025 - nss 3.14 added support for tokens that make use of cka_always_authenticate. however, when a...
...us=verified;target_milestone=3.14.1;product=nss compatability nss 3.14.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered in this release should be reported by filing a bug report at https://bugzilla.mozilla.org with the product of nss. ...
NSS 3.15.1 release notes
ecmod_closeuserdb/secmod_openuserdb fails to reset the token delay, leading to spurious failures. bug 884072 - fix a typo in the header include guard macro of secmod.h. bug 876352 - certutil now warns if importing a pem file that contains a private key. bug 565296 - fix the bug that shlibsign exited with status 0 even though it failed. the nss_survive_double_bypass_failure build option is
removed. bugs fixed in nss 3.15.1 https://bugzilla.mozilla.org/buglist.cgi?list_id=5689256;resolution=fixed;classification=components;query_format=advanced;target_milestone=3.15.1;product=nss compatibility nss 3.15.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.1 shared libraries wit...
...t=advanced;target_milestone=3.15.1;product=nss compatibility nss 3.15.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.16.3 release notes
s an issue with a recently added utility function. new functions in cert.h cert_getgeneralnametypefromstring - an utlity function to lookup a value of type certgeneralnametype given a human readable string. this function was already added in nss 3.16.2, however, it wasn't declared in a public header file. ...
...b:98:43:dc:ab:8c:e8:6a:81:10:9f:e4:8e ou = valicert class 2 policy validation authority sha1 fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6 ou = valicert class 3 policy validation authority sha1 fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35:fb additionally, the following ca certificate was
removed as requested by the ca ou = tdc internet root ca sha1 fingerprint: 21:fc:bd:8e:7f:6c:af:05:1b:d1:b3:43:ec:a8:e7:61:47:f2:0f:8a the following ca certificates were added cn = certification authority of wosign sha1 fingerprint: b9:42:94:bf:91:ea:8f:b6:4b:e6:10:97:c7:fb:00:13:59:b6:76:cb cn = ca 沃通根证书 sha1 fingerprint:...
NSS 3.16.4 release notes
alls: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_4_rtm/src/ new in nss 3.16.4 this release consists primarily of ca certificate changes as listed below, and includes a small number of bug fixes. notable changes in nss 3.16.4 the following 1024-bit root ca certificate was restored to allow more time to develop a better transition strategy for affected sites. it was
removed in nss 3.16.3, but discussion in the mozilla.dev.security.policy forum led to the decision to keep this root included longer in order to give website administrators more time to update their web servers. cn = gte cybertrust global root sha1 fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74 in nss 3.16.3, the 1024-bit "entrust.net secure se...
...rder to give website administrators more time to update their web servers. cn = gte cybertrust global root sha1 fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74 in nss 3.16.3, the 1024-bit "entrust.net secure server certification authority" root ca certificate (sha1 fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39) was
removed. in nss 3.16.4, a 2048-bit intermediate ca certificate has been included, without explicit trust. the intention is to mitigate the effects of the previous
removal of the 1024-bit entrust.net root certificate, because many public internet sites still use the "usertrust legacy secure server ca" intermediate certificate that is signed by the 1024-bit entrust.net root certificate. the inclusion o...
NSS 3.18.1 release notes
s a huge spike in the number of certificate verification errors attributed to this change. so, to give website administrators more time to update their web servers, we reverted the trust bits back to being enabled. ou = equifax secure certificate authority sha1 fingerprint: d2:32:09:ad:23:d3:14:23:21:74:e4:0d:7f:9d:62:13:97:86:63:3a the following ca certificate was
removed after discussion about 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 ...
...dvanced&product=nss&target_milestone=3.18.1 compatibility nss 3.18.1 shared libraries are backward compatible with all older nss 3.18 shared libraries. a program linked with older nss 3.18 shared libraries will work with nss 3.18.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.19.2.1 release notes
ly. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain
remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handling of large allocations would allow exceptionally large allocations to be reported as successfu...
...ch release to fix security-relevant bugs. compatibility nss 3.19.2.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.2.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.19.3 release notes
19.3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_3_rtm/src/ new in nss 3.19.3 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. ...
...dvanced&product=nss&target_milestone=3.19.3 compatibility nss 3.19.3 shared libraries are backward compatible with all older nss 3.19 shared libraries. a program linked with older nss 3.19 shared libraries will work with nss 3.19.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.19.4 release notes
ly. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain
remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handling of large allocations would allow exceptionally large allocations to be reported as successfu...
... patch release to fix security-relevant bugs. compatibility nss 3.19.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.4 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.20.1 release notes
ly. bug 1192028 (cve-2015-7181) and bug 1202868 (cve-2015-7182): several issues existed within the asn.1 decoder used by nss for handling streaming ber data. while the majority of nss uses a separate, unaffected der decoder, several public routines also accept ber data, and thus are affected. an attacker that successfully exploited these issues can overflow the heap and may be able to obtain
remote code execution. the following security-relevant bugs have been resolved in nspr 4.10.10, which affect nss. because nss includes portions of the affected nspr code at build time, it is necessary to use nspr 4.10.10 when building nss. bug 1205157 (nspr, cve-2015-7183): a logic bug in the handling of large allocations would allow exceptionally large allocations to be reported as successfu...
... patch release to fix security-relevant bugs. compatibility nss 3.20.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.20.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.23 release notes
handshake has been reordered to increase compatibility of the extended master secret with servers (bug 1243641) the build time environment variable nss_enable_zlib has been renamed to nss_ssl_enable_zlib (bug 1243872). the build time environment variable nss_disable_chachapoly was added, which can be used to prevent compilation of the chacha20/poly1305 code. ...
... responsibly disclosing the issue in bug 1245528. compatibility nss 3.23 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.23 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.24 release notes
ht be used for signing rather than key exchange. update sslauthtype to define a larger number of authentication key types. deprecate the member attribute authalgorithm of type sslciphersuiteinfo. instead, applications should use the newly added attribute authtype. rename ssl_auth_rsa to ssl_auth_rsa_decrypt. add a shared library (libfreeblpriv3) on linux platforms that define freebl_lowhash.
remove most code related to ssl v2, including the ability to actively send a sslv2-compatible client hello. however, the server-side implementation of the ssl/tls protocol still supports processing of received v2-compatible client hello messages. disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable is set. to ena...
...ck by providing advance copies of their research. compatibility nss 3.24 shared libraries are backward-compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.24 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.27.1 release notes
ced with nss 3.27. notable changes in nss 3.27.1 availability of the tls 1.3 (draft) implementation has been re-disabled in the default build. previous versions of nss made tls 1.3 (draft) available only when compiled with nss_enable_tls_1_3. nss 3.27 set this value on by default, allowing tls 1.3 (draft) to be disabled using nss_disable_tls_1_3, although the maximum version used by default
remained tls 1.2. however, some applications query the list of protocol versions that are supported by the nss library, enabling all supported tls protocol versions. because nss 3.27 enabled compilation of tls 1.3 (draft) by default, it caused those applications to enable tls 1.3 (draft). this resulted in connectivity failures, as some tls servers are version 1.3 intolerant, and failed to negotiate ...
... been fixed in nss 3.27.1: re-disable tls 1.3 by default compatibility nss 3.27.1 shared libraries are backwards compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.27.1 shared libraries without recompiling or relinking. applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.27 release notes
ns. for those applications, updating to nss 3.27 may result in tls 1.3 (draft) to be enabled. the tls 1.3 (draft) protocol can be disabled, by defining symbol nss_disable_tls_1_3 when building nss. npn can not be enabled anymore. hard limits on the maximum number of tls records encrypted with the same key are enforced. disabled renegotiation in dtls. ...
...nents&query_format=advanced&product=nss&target_milestone=3.27 compatibility nss 3.27 shared libraries are backwards compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.27 shared libraries without recompiling or relinking. applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS release notes template
or network security services (nss) 3.xx.y is a patch release for nss 3.xx. the bug fixes in nss 3.xx.y are described in the "bugs fixed" section below. distribution information the hg tag is nss_3_xx_rtm. nss 3.xx requires nspr 4.xx or newer. nss 3.xx source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_xx_rtm/src/ (make a link) new in nss 3.xx new functionality either: no new functionality is introduced in this release. this is a patch release to fix ... or: ... ...
... by providing advance copies of their research. compatibility nss 3.xx.y shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.xx.y shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will
remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
PKCS11 FAQ
the temporary database with no special trust bits associated with them. nss is perfectly capable of using token certificates in place. which function does nss use to get login state information? nss calls c_getsessioninfo to get the login/logout state. nss never attempts to cache this information, because login state can change instantly without nss knowing about it (for example, when the user
removes the card). you must update all sessions correctly when the state changes. not doing so is a common source of problems. i have noticed that nss sometimes use a session handle value of 0. is this an invalid session handle? a session handle of 0 is indeed invalid. in the past, nss uses the invalid session handle to mark problems with acquiring or using a session. there have been cases where ns...
... noticed that nss sometimes use a session handle value of 0. is this an invalid session handle? a session handle of 0 is indeed invalid. in the past, nss uses the invalid session handle to mark problems with acquiring or using a session. there have been cases where nss would then use this handle to try to do some operation. pkcs #11 modules should fail with ckr_invalid_session. we are working to
remove these cases as we find them. what are "generic crypto svcs" (the first item listed when you click the view/edit button for the nss internal pkcs #11 module under security devices under options/security in firefox)? generic crypto svcs are the services that nss uses to do its basic cryptography (rsa encryption with public keys, hashing, aes, des, rc4, rc2, and so on).other pkcs #11 modules ca...
NSS tools : crlutil
ion to every cert entries within the range. * add certificate entries(s) to crl: addcert range date range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. date: revocation date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). *
remove certificate entry(s) from crl rmcert range where: range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. * change range of certificate entry(s) in crl range new-range where: new-range: two integer values separated by dash: range of certificates that will ...
... identifies the reason for the certificate revocation. reasoncode non-critical code where: reasoncode: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension code: the following codes are available: unspecified (0), keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6),
removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date where: crlnumber: identifies the name of an extension non-critical:...
NSS Tools crlutil
d certificate entries(s) to crl: addcert range date where: range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. date: revocation date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz).
remove certificate entry(s) from crl rmcert range where: range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. change range of certificate entry(s) in crl range new-range where: new-range: two i...
... invaliditydate non-critical date where: ...
NSS tools : crlutil
entries within the range. * add certificate entries(s) to crl: addcert range date range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. date: revocation date of a cert. date should be represented in generalizedtime format (yyyymmddhhmmssz). *
remove certificate entry(s) from crl rmcert range where: range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. only one cert will be added if there is no delimiter. * change range of certificate entry(s) in crl range new-range where: new-range: two integer values separated by dash: range of...
...son for the certificate revocation. reasoncode non-critical code where: reasoncode: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension code: the following codes are available: unspecified (0), keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6),
removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date where: crlnumber: identifies the name of an exte...
Necko walkthrough
is created now and may be called later otherwise, the callback would be called directly, when the socket is readable et voila, the transaction has been posted to the socket thread, and the main thread continues on, unblocked from network io. so, on the socket thread... the event queue works around to nshttpconnectionmgr::onmsgnewtransaction (with the nshttptransaction passed as a param -
remember the event was posted earlier by initiatetransaction from the main thread). nshttpconnectionmgr::onmsgnewtransaction nshttpconnectionmgr::processnewtransaction (notice the check that we're on gsocketthread) gets conn info (i.e. hostname and port) from the transaction, and then gets or creates a connection entry from the connection table, an nsclasshashtable<nscstringhashkey, nscon...
...es to read nspipeevents::notifyinputready puts the callback object into an nspipeevents object. once this object goes out of scope, mcallback->oninputstreamready is called. note: this callback may be a proxy object, nsinputstreamreadyevent: it is a runnable that dispatches itself to a previously set target thread, and calls its internal mcallback->oninputstreamready function.
remember that nspipeinputstream::asyncwait was called earlier, after the transaction was initially created and posted to the connection manager on the socket thread. and in that function it created a proxy callback because it wished to have oninputstreamready called on the main thread. back on the main thread: nsinputstreampump::oninputstreamready this function in turn calls nsinputstreampump...
Rhino scopes and contexts
read that will be executing javascript. to associate the current thread with a context, simply call the enter method of context: context cx = context.enter(); once you are done with execution, simply exit the context: context.exit(); these calls will work properly even if there is already a context associated with the current thread. that context will be returned and an internal counter inc
remented. only when the counter reaches zero will it be disassociated from the thread.
remember to put the exit() call in a finally block if you're executing code that could throw an exception. scopes a scope is a set of javascript objects. execution of scripts requires a scope for top-level script variable storage as well as a place to find standard objects like function and object. it's importa...
...itable with shared scopes since if a script by mistake adds a property to a library object from the shared scope, that object would not be garbage collected until there are no active references to the shared scope potentially leading to memory leaks. in addition if a script alters some of the standard objects, the library may not work properly for other scripts. such bugs are hard to debug and to
remove a possibility for them to occur one can seal the shared scope and all its objects. a notion of a sealed object is a javascript extension supported by rhino and it means that properties can not be added/deleted to the object and the existing object properties can not be changed. any attempt to modify sealed object throws an exception. to seal all objects in the standard library passtrue for th...
Creating JavaScript jstest reftests
ong in the jit-test suite, read more here. performance tests or stress tests tests of spidermonkey's comformance to the ecmascript standard a brief history: in 2017, spidermonkey started comsuming test262, a comprehensive tests suite for ecmascript implementations. before using test262, spidermonkey had a fair number of internal tests of conformance to ecmascript, and many of those tests
remain in the js/src/non262 directory as regressions. test262 tests test262 is the implementation conformance test suite for the latest drafts of ecmascript language specification, as well as internationalization api specification and the json data interchange format. it is maintained by tc39, the ecmascript standard's technical committee. mozilla manually imports these tests into the js/src/tests/...
...ing directly to test262, you must submit the tests in the test262 format, which you can see in the test262 git repository and read about here. an update script exists in the js/src/tests directories to fetch and reformat the test262 suite, see test262-update.py. writing a new test file please read the high level advice for test writing in the parent article here. jstests has a special requi
rement: the call to reportcompare in every jstest is required by the test harness. except in old tests or super strange new tests, it should be the last line of the test. comparison functions and shared test functionality the jstest runner loads the code in js/src/tests/shell.js for every test. additionally, it loads every shell.js and broswer.js file in the subdirectories on the path from js/s...
GC Rooting Guide
js::handle<t> all gc thing pointers that are parameters to a function must be wrapped in js::handle<t>. a js::handle<t> is a reference to a js::rooted<t>, and is created implicit...
...ass, but don't do this unless it's really necessary. js::heap<t> pointers must also continue to be traced in the normal way, which is covered below. js::heap<t> doesn't require a jscontext*, and can be constructed with or without an initial value parameter. like the other template classes, it functions as if it were the gc thing pointer itself. one consequence of having different rooting requi
rements for heap and stack data is that a single structure containing gc thing pointers cannot be used on both the stack and the heap. in this case, separate structures must be created for the stack and the heap. there are currently no convenience typedefs for js::heap<t>. for example, instead of this: struct heapstruct { jsobject* msomeobject; js::value msomevalue; }; you should write...
64-bit Compatibility
dereference the pointer. for more information and platform specific details on virtual address widths, see this article on wikipedia. builtins and calls when passing arguments to lirwriter::inscall(), there are four types: argsize_f - floating point value argsize_i - 32-bit integer argsize_q - 64-bit integer argsize_p - 32-bit integer on 32-bit platforms, 64-bit integer on 64-bit platforms. ...
...s when passing arguments to lirwriter::inscall(), there are four types: argsize_f - floating point value argsize_i - 32-bit integer argsize_q - 64-bit integer argsize_p - 32-bit integer on 32-bit platforms, 64-bit integer on 64-bit platforms.
remember to use argsize_p where appropriate - on pointers or natively sized integers (including jsvals). similarly, when adding types to jsbuiltins.h,
remember to use _js_ptr for pointer-width values. lir safety it is not immediately clear from reading lir which opcodes should be used for 64-bit safety. if you make a mistake, there's an ext
remely good chance the sanityfilter in nanojit will catch it while generating code. if this happens you will get an assert that points directly to the ill-typed lir. not all pointer-width values are actually poin...
Statistics API
of wall time that this gc consumed. note: this is the sum of all the slice durations, not end time - start time. compartments_collected: integer - the number of compartments that were collected by the gc. compartment_count: integer - the number of compartments that were present in the system at the end of the gc. max_pause: number (milliseconds) - longest duration pause during the gc. noninc
remental_reason: string - a string representing the reason that an inc
remental gc was aborted or forced to finish in a single slice. if the inc
remental gc completed normally, this will be "none". allocated: integer (mb) - size of the javascript heap in mib at the start of the gc. slices: array of objects - a list of objects describing each slice in detail. times: object - a map from phase names to...
...e a bit of elaboration. gc work can be divided into phases, such as marking or sweeping. the division into phases is hierarchical, so a phase can be split into subphases. for example, the sweep phase includes the time for the sweep_atoms, sweep_tables, sweep_compartments phases and so on. the times object gives how much time was spent in each phase of the gc, in milliseconds. additionally, an inc
remental gc is divided into a series of slices (the division into slices is completely separate from the division into phases; neither one is a refinment of the other). a little bit of gc work is done in each slice. in between slices, other browser code is allowed to run. the slices array describes how long each slice took and what work was done during the slice. each element of the slices array is a...
Invariants
(the jsval encoding depends on this.) the jsstackframe::down chain never forms a cycle. (it's a stack. ...
...a nameexpression that refers to a variable in an enclosing scope which the function can outlive (i.e. ...
Self-hosted builtins in SpiderMonkey
.prototype.call, this syntax makes it impossible for other code to interfere and gets compiled to bytecode that doesn't have any overhead compared to a normal function invocation. otoh, normal method calls are forbidden in self-hosted code. so instead of receiver.fun(arg1, ..., argn) you have to use callfunction(fun, receiver, arg1, ... argn). this restriction was added because otherwise it's ext
remely easy to accidentally call methods that have been changed by content, changing the behavior from what was expected. if the fun can potentially be a content-provided function, callcontentfunction has to be used. this is to prevent accidentally calling content functions when assuming that content can't interfere with behavior. e.g., if receiver is an object that content has access to, then callf...
...erfere with behavior. e.g., if receiver is an object that content has access to, then callfunction(receiver.fun, receiver) wouldn't be guaranteed to work, because content might have changed the value of receiver.fun, so callcontentfunction(receiver.fun, receiver) has to be used. self-hosted functions by default are not constructors and do not have a prototype property, so that they meet the requi
rements for standard built-in functions as described in the ecmascript language specification 5.1, clause 15. to make a self-hosted function a constructor, call makeconstructible(functionname) after the function declaration. a prototype property can be added from the self-hosted code itself. all self-hosted functions have direct access to each other and can rely on references being stable, i.e. not ...
Introduction to the JavaScript shell
d name. if value is specified, it must be convertable to a positive uint32; gcparam() sets gc parameter name to value. for more information, see the c/c++ functions js_getgcparameter and js_setgcparameter. gczeal(level) added in spidermonkey 1.8 debug only. set the level of gc zeal, a debugging feature. this can be 0 for normal periodic garbage collection, 1 for very frequent gc, or 2 for ext
remely frequent gc. anything other than 0 will make javascript run ext
remely slow but may help reveal or reproduce gc-related bugs. for more information, see the c/c++ version of this function, js_setgczeal. getpda(object) returns the property descriptors for the specified object. getslx(object) returns the script line extent, which is the number of lines of code comprising the specified object. ...
...his is a powerful debugging mechanism when used in concert with line2pc(). for example, if you want to display a message when line 6 of a function, dosomething() is executed, you can enter the following: trap(dosomething, line2pc(dosomething, 6), "print('line 6!\n')"); note: when a trap is set, the corresponding bytecode in the program is replaced with a trap bytecode until you use untrap() to
remove the trap. untrap(function [, pc])
removes a trap from the specified function at the offset pc. if pc isn't specified, the trap is
removed from the function's entry point. this function has no effect if there is no trap at the specified location. version([number]) the version() function lets you get or set the javascript version number. this may be useful for gaining access to syntax only ...
JIT Optimization Outcomes
ype of the object is not known. this can happen if the operation sees many different types of objects, and so the type of the input to the operation cannot be resolved to a single type. unknownproperties optimization failed because the object containing the property was marked as having unknown properties. this can happen if too many properties are defined on the object, or if delete is used to
remove one of the object's properties. singleton one of the types present in the typeset was a singleton type, preventing the optimization from being enabled. notsingleton optimization failed because the object containing the property did not have a 'singleton' type. singleton types are assigned to objects that are "one of a kind", such as global objects, literal objects declared in the global sc...
...timization strategy fails for this condition. arrayrange could not accurately calculate the range attributes of an inline array creation. arrayseennegativeindex arrays at this element access location have seen negative indexes. typedobjectneutered the typed object being accessed at this location may have been neutered (a neutered typed object is one where the underlying byte buffer has been
removed or transferred to a worker). typedobjectarrayrange failed to do range check of element access on a typed object. accessnotdense accessnotsimdobject the observed type of the target of the property access doesn't guarantee that it is an simd object. accessnottypedobject the observed type of the target of the property access doesn't guarantee that it is a typedobject. accessnottypedarray...
BOOLEAN_TO_JSVAL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. cast a c integer to a boolean js::value without any type checking or error handling. please use js::booleanvalue/js::truevalue/js::falsevalue instead in spidermonkey 45 or later. syntax jsval boolean_to_jsval(bool b); name type description b bool c integer value to be converted to a boolean jsval. description boolean_to_jsval converts a bool argument, b, to a boolean jsval. if b is false, the result is jsval_false. ...
...x jsval boolean_to_jsval(bool b); name type description b bool c integer value to be converted to a boolean jsval. description boolean_to_jsval converts a bool argument, b, to a boolean jsval. if b is false, the result is jsval_false. if b is true, the result is jsval_true. see also mxr id search for boolean_to_jsval js::booleanvalue bug 1177892 --
removed ...
DOUBLE_TO_JSVAL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. casts a pointer to a gc-allocated jsdouble to type jsval. please use js::doublevalue instead in spidermonkey 45 or later. syntax jsval double_to_jsval(double d); name type description d double c double to convert to a jsval. description double_to_jsval is the inverse of js::tonumber. to convert a c float, double to type js::value, use js_numbervalue instead. ...
...later. ...
INT_TO_JSVAL
try to avoid using it. converts a specified integer value to a js integer value. please use js::int32value instead in spidermonkey 45 or later. syntax jsval int_to_jsval(int32_t i); name type description i any integer type c integer to convert to a jsval. description int_to_jsval converts a c integer, i, to a jsval. before spidermonkey 1.8.5, not all integers can be stored in a jsval; use int_fits_in_jsval to test. ...
...k isn't needed any longer for 32-bit integers.") }} if i does not fit into a jsval (see int_fits_in_jsval), the behavior is undefined. to convert any number to a jsval, regardless of whether it fits in an int jsval, use js_newnumbervalue instead. to convert an integer jsval to a c integer, use js::toint32. see also mxr id search for int_to_jsval js::toint32 js::int32value bug 1177892 --
removed ...
JSClass
tub, js_propertystub, js_enumeratestub, js_resolvestub, js_convertstub, null, jsclass_no_optional_members }; to expose this class to scripts, and to attach methods and properties to it, use js_initclass. private data custom classes very often need to store private c/c++ data that should not be visible to scripts. to do this, use the jsclass_has_private (jsclass_construct_prototype wad
removed) flags. implement a jsnative constructor function that allocates this private data and stores it in the new object using js_setprivate. implement a jsclass.finalize callback that frees the private data. each native getter, setter, or method can access the private data using js_getinstanceprivate. when initializing the class, pass the jsnative constructor function to js_initclass. (this exam...
...dermonkey 31 or older * js_set_rval(cx, vp, object_to_jsval(obj)); */ return true; } { js_initclass(cx, global, js::null(), &printer_class, printer_construct, 1, null, null, null, null); } see also mxr id search for jsclass jsclass.flags js_getclass js_initclass js_newobject js_newobjectforconstructor js_instanceof bug 638291 - added trace bug 702507 -
removed jsclass_construct_prototype bug 726944 -
removed xdrobject, reserved0 and reserved1 bug 886829 - made finalize optional bug 957688 -
removed checkaccess bug 1103368 - made most of members optional bug 1097267 -
removed jsclass_new_enumerate bug 1054756 -
removed convert bug 1261723 - class ops are moved to a sub-structure jsclassops ...
JSNewResolveOp
try to avoid using it. jsnewresolveop is the type of the jsclass.resolve callback when the jsclass_new_resolve bit is set in the jsclass.flags field. syntax typedef bool (* jsnewresolveop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandleobject objp); name type description cx jscontext * pointer to the js context in which the property access is taking place. ...
...efined mechanism.) jsresolve_declaring obsolete since jsapi 15 the property is being declared in a var, const, or function declaration. jsresolve_classname obsolete since javascript 1.8.8 class name used when constructing. jsresolve_with obsolete since javascript 1.8.8 the lookup is occurring for a name evaluated inside a with statement. see also jsclass bug 547140 -
removed flags bug 993026 - obsoleted ...
JSPRINCIPALS_HOLD
syntax jsprincipals_hold(cx, principals) jsprincipals_drop(cx, principals) name type description cx jscontext * a context. principals jsprincipals * pointer to the jsprincipals object to hold or drop. this argument must not be null. description jsprincipals_hold and jsprincipals_drop are used to manage memory for jsprincipals objects. ...
...emory for jsprincipals objects. principals are used by the spidermonkey security system. jsprincipals objects are not jsobjects. they are reference counted, not garbage collected. application code that stores a pointer to a jsprincipals object must call jsprincipals_hold(cx, principals) before storing it and jsprincipals_drop(cx, principals) when done with it. jsprincipals_hold(cx, principals) inc
rements the reference count of principals by 1. jsprincipals_drop(cx, principals) dec
rements the reference count of principals by 1. if the reference count drops to 0, indicating that no one is using the object anymore, jsprincipals_drop also deallocates principals by calling its destroy method. see also bug 728250 ...
JSVAL_NULL
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript value null. syntax jsval_null description jsval_null is a jsval constant that represents the javascript value null. it is equivalent to object_to_jsval(null). ...
...discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript value null. syntax jsval_null description jsval_null is a jsval constant that represents the javascript value null. it is equivalent to object_to_jsval(null). ...
JSVAL_ONE
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript number 1. syntax jsval_one description jsval_one is equivalent to int_to_jsval(1). ...
...it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript number 1. syntax jsval_one description jsval_one is equivalent to int_to_jsval(1). ...
JSVAL_TRUE
try to avoid using it. jsval constants that represent the javascript values true and false. syntax jsval_true jsval_false description jsval_true and jsval_false are jsval constants that represent the javascript boolean values, true and false. they are equivalent to boolean_to_jsval(true) and boolean_to_jsval(false), respectively. take care not to confuse the jsval constants jsval_true and jsval_false with the bool constants true and false. ...
...tively. ...
JSVAL_UNLOCK
jsval_unlock unlocks a previously locked js value, v, so it can be garbage collected. v is a js object, string, or double value. ...
...jsval_unlock unlocks a previously locked js value, v, so it can be garbage collected. v is a js object, string, or double value. jsval_unlock determines if v is an object, string, or double value, and if it is, it unlocks the value. ...
JSVAL_VOID
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript value undefined. syntax jsval_void description jsval_void is a jsval constant that represents the javascript value undefined. ...
...ork in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript value undefined. syntax jsval_void description jsval_void is a jsval constant that represents the javascript value undefined. ...
JSVAL_ZERO
obsolete since jsapi 42this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript number 0. syntax jsval_zero description jsval_zero is equivalent to int_to_jsval(0). ...
... may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the jsval that represents the javascript number 0. syntax jsval_zero description jsval_zero is equivalent to int_to_jsval(0). ...
JS_AddArgumentFormatter
obsolete since jsapi 18this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. add or
remove a format string handler for js_convertarguments, js_pusharguments, js_convertargumentsva, and js_pushargumentsva. syntax jsbool js_addargumentformatter(jscontext *cx, const char *format, jsargumentformatter formatter); void js_
removeargumentformatter(jscontext *cx, const char *format); name type description cx jscontext * the context in which to install the formatter. format const char * the format string prefix that should be handled by formatter, or whose handler should be
removed. formatter jsargumentformatter ...
...cx. on success, it returns js_true. otherwise it returns js_false. (at the moment, js_addargumentformatter fails only if there is no memory available to record the registration.) js_addargumentformatter does not copy format, it points at the string storage allocated by the caller, which is typically a string constant. if format is in dynamic storage, the caller must keep the string alive until js_
removeargumentformatter is called. js_
removeargumentformatter
removes any conversion functions associated with format. callback syntax jsbool (*jsargumentformatter)(jscontext *cx, const char *format, jsbool fromjs, jsval **vpp, va_list *app); name type description cx jscontext * the context in which the conversion is being performed. form...
JS_AliasProperty
try to avoid using it. create an alias for a native property. syntax jsbool js_aliasproperty(jscontext *cx, jsobject *obj, const char *name, const char *alias); name type 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. obj jsobject * object for which to create the alias. ...
...y for which to create an alias. alias const char * alias name to assign to the property. description js_aliasproperty assigns an alternate name for a property associated with a native object. obj is the object to which the property belongs. name is the property's current name in the object, and alias is the alternate name to assign to the property. notes this feature has been
removed. an alias does not replace a property's name; it supplements it, providing a second way to reference a property. if the alias is successfully created and associated with the property, js_aliasproperty returns js_true. creating an alias does not change the length of the property array. if the property name you specify does not exist, js_aliasproperty reports an error, and returns js_false. if ...
JS_ClearContextThread
try to avoid using it. transfer a jscontext from one thread to another. syntax jsword js_clearcontextthread(jscontext *cx); jsword js_setcontextthread(jscontext *cx); name type description cx jscontext * the context to transfer from one thread to another. there must not be any active or suspended requests using this context. ...
...ead other than the one where it was created looks like this: void mythread(jscontext *cx) { js_setcontextthread(cx); /* note: outside the request */ js_beginrequest(cx); ... js_endrequest(cx); js_clearcontextthread(cx); /* note: outside the request */ } js_setcontextthread ties cx to the current thread for exclusive use. no other thread may use cx until the current thread
removes this association by calling js_clearcontextthread. js_setcontextthread returns the thread id of the thread previously associated with this context. when the function is used properly, the return value is always zero, indicating that no thread was previously associated with the context. js_clearcontextthread relinquishes the calling thread's right to use cx. it returns the thread id of the la...
Gecko Roles
ress bar, dynamically showing the user the percent complete of an operation in progress. role_dial represents a dial or knob whose purpose is to allow a user to set a value. role_hotkeyfield represents a hot-key field that allows the user to enter a combination or sequence of keystrokes. role_slider represents a slider, which allows the user to adjust a setting in given inc
rements between minimum and maximum values. role_spinbutton represents a spin box, which is a control that allows the user to inc
rement or dec
rement the value displayed in a separate "buddy" control associated with the spin box. role_diagram represents a graphical image used to diagram data. role_animation represents an animation control, which contains content that changes ov...
... offer the user a list of choices, and then hides when the user selects one of those choices. role_radio_menu_item a radio button that is a menu item. role_root_pane a root pane. a specialized pane that has a glass pane and a layered pane as its children. its children can include scroll bars and a viewport. role_scroll_pane a scroll pane. an object that allows a user to inc
rementally view a large amount of information. role_split_pane a split pane. a specialized panel that presents two other panels at the same time. between the two panels is a divider the user can manipulate to make one panel larger and the other panel smaller. role_table_column_header the header for a column of a table. role_table_row_header the header for a row of a table. ...
Places utilities for JavaScript
eparator. boolean nodeisvisit(anode) determines whether or not a resultnode is a visit item or not boolean nodeisuri(anode) determines whether or not a resultnode is a url item or not boolean nodeisquery(anode) determines whether or not a resultnode is a query item or not boolean nodeisreadonly(anode) determines if a node is read only (children cannot be inserted, sometimes they cannot be
removed depending on the circumstance) boolean nodeishost(anode) determines whether or not a resultnode is a host folder or not boolean nodeiscontainer(anode) determines whether or not a resultnode is a container item or not boolean nodeisdynamiccontainer(anode) determines whether or not a result-node is a dynamic-container item. the dynamic container result node type is for dynamically created...
...ether or not a resultnode is a container item or not boolean nodeisdynamiccontainer(anode) determines whether or not a result-node is a dynamic-container item. the dynamic container result node type is for dynamically created containers (e.g. for the file browser service where you get your folders in bookmark menus). boolean nodeislivemarkcontainer(anode) determines whether a result node is a
remote container registered by the livemark service. boolean nodeislivemarkitem(anode) determines whether a result node is a live-bookmark item parameters anode the node to check. return type returns a boolean. isreadonlyfolder() determines whether or not a node is a readonly folder. boolean isreadonlyfolder(anode) parameters anode the node to check. return type return true if...
How to build an XPCOM component in JavaScript
the object's contractid (unless 'service' is specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' is not // specified, the concatenation of the string "service," and the object's contractid // is passed as avalue parameter of addcategoryentry. service: true }], // queryinterface implementation, e.g. ...
... xpti.dat from the components directory. delete compreg.dat and xpti.dat from your profile directory. restart application. using your component using wrappedjsobject if you only intend to access your component from javascript, i.e. ...
Setting up the Gecko SDK
longer available. you may want to check for newer versions at gecko versions prior to 1.7: http://ftp.mozilla.org/pub/mozi...illa/releases/ gecko versions after 1.8: http://ftp.mozilla.org/pub/mozi...nner/releases/ once you download the sdk, you can expand it into any convenient location. in this appendix, we set up the windows gecko sdk in c:\gecko-sdk\. if you choose some other location,
remember to adjust the settings described here (e.g., in the building a microsoft visual cpp project section below) to point to this new location. when you extract the sdk, it should have the layout seen below: layout of the extracted sdk the directories represent different modules in the sdk. for example, the headers for networking are all located in the necko directory, and the headers that xp...
...ko_sdk_path)/bin/xpidl cxx ?= c++ xpidlsrcs = \ interfacea.idl \ interfaceb.idl \ $(null) cppsrcs = \ sourcea.cpp \ sourceb.cpp \ $(null) cppflags += -fno-rtti \ -fno-exceptions \ -fshort-wchar \ -fpic \ $(null) # gcc only define which allows us to not have to #include mozilla-config # in every .cpp file. if your not using gcc
remove this line and add # #include "mozilla-config.h" to each of your .cpp files. gecko_config_include = -include mozilla-config.h gecko_defines = -dmozilla_strict_api gecko_includes = -i$(gecko_sdk_path) \ -i$(gecko_sdk_path)/idl \ -i$(gecko_sdk_path)/include \ -i$(gecko_sdk_path)/xpcom/include \...
How to build a binary XPCOM component using Visual Studio
he implementation is where the methods actually do the work. component factory module, also in c++. the factory is in charge of creating instances of the implementations. let’s specify a simple interface: #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(in long a, in long b); };
remember to generate your own guid. the next step is to compile the idl into a type-library (*.xpt) and a c++ header file (*.h), which we can use to define our implementation object. the blank vc++ project has a bat file that will create the xpt and the h files. the command executes xpidl.exe twice, like this: {path_to_geckosdk}\bin\xpidl.exe -m header -i..\gecko-sdk\idl {your_idl_file} {path_to_gec...
...ponent. test component in a xulrunner application in order to test your component in a xulrunner application, you need to “install” the component, “clear” the component registry, and use the component from javascript. install component: copy your xpt and dll files to the {app}/components folder. you should not put your component in the xulrunner/components folder. clear registry: inc
rement the buildid in your {app}/application.ini. use in javascript: function doxpcom() { try { const cid = "@starkravingfinkle.org/specialthing;1"; var obj = components.classes[cid].createinstance(); obj = obj.queryinterface(components.interfaces.ispecialthing); } catch (err) { alert(err); return; } var res = obj.add(3, 4); alert('3+4 = ' + res); var name = obj.
NS_ConvertASCIItoUTF16
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
NS_ConvertUTF16toUTF8
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
NS_ConvertUTF8toUTF16
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
NS_LossyConvertUTF16toASCII
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer. void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. astring [in] a nsacstring to append to this string. void replace( index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. adata [in] a raw character arra...
... adata [in] a raw character array to append to this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void replace( index_type acutstart, index_type acutlength, char_type achar ); parameters acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. achar [in] a character to append to this string.
remarks if insufficient memory is available to perform the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer. void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. astring [in] a nsastring to append to this string. void replace( index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. adata [in] a raw character array...
.... adata [in] a raw character array to append to this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void replace( index_type acutstart, index_type acutlength, char_type achar ); parameter acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. achar [in] a character to append to this string.
remarks if insufficient memory is available to perform the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
nsAdoptingCString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsAdoptingString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsAutoString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsCAutoString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar ch...
...e to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsCString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsDependentCString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsDependentCSubstring
class declaration nstdependentsubstring_chart a string class which wraps an external array of string characters. it is the client code's responsibility to ensure that the external buffer
remains valid for a long as the string is alive. names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(cons...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsDependentString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsDependentSubstring
class declaration nstdependentsubstring_chart a string class which wraps an external array of string characters. it is the client code's responsibility to ensure that the external buffer
remains valid for a long as the string is alive. names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(cons...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsFixedCString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsFixedString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsPromiseFlatCString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsPromiseFlatString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsXPIDLCString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence of 1 string for another parameters char aoldchar char anewchar void rep...
...characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsXPIDLString
@param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps occurence of 1 string for another parameters prunichar aoldchar prunichar ...
... or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to
remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
IAccessible2
sed. s_ok. states() returns the bit strip containing any iaccessible2 states. the iaccessible2 states are in addition to the msaa states and are defined in the ia2states enum. [propget] hresult states( [out] accessiblestates states ); parameters states return value s_ok. uniqueid() returns the unique id. the uniqueid is an identifier for this object, is unique within the current window, and
remains the same for the lifetime of the accessible object. the uniqueid is not related to: the msaa objectid which is used by the server to disambiguate between iaccessibles per hwnd or the msaa childid which is used to disambiguate between children being managed by an iaccessible. this value is provided so the at can have access to a unique runtime persistent identifier even when not handling an e...
...ty of windowhandle, the at would have to get the window handle by using windowfromaccessibleobject on each iaccessible, which is slow because it's implemented by oleacc.dll as a loop which crawls up the ancestor chain and looks for a role_window object, mapping that back to a window handle. [propget] hresult windowhandle( [out] hwnd windowhandle ); parameters windowhandle return value s_ok.
remarks when you have a reference to an iaccessible and require a reference to an iaccessible2 use queryservice as follows: // pacc is a reference to the accessible object's iaccessible interface. iserviceprovider *pservice = null; hr = pacc->queryinterface(iid_iserviceprovider, (void **)&pservice); if(succeeded(hr)) { iaccessible2 *pia2 = null; hr = pservice->queryservice(iid_iaccessible, iid_ia...
imgICache
or channel, null may be passed, but this will cause any image cache requests to use the permanent storage cache (ie. any images from windows in private browsing mode will not be present in the cache returned from a call with a null parameter). method overview void clearcache(in boolean chrome); nsiproperties findentryproperties(in nsiuri uri); void
removeentry(in nsiuri uri); methods clearcache() evict images from the cache. void clearcache( in boolean chrome ); parameters chrome if true, evict only chrome images. if false, evict everything except chrome images. findentryproperties() find properties used to get properties such as 'type' and 'content-disposition' 'type' is a nsisupportscstring containing the images' m...
...ortscstring containing the images' mime type such as 'image/png' 'content-disposition' will be a nsisupportscstring containing the header if you call this before any data has been loaded from a uri, it will succeed, but come back empty. nsiproperties findentryproperties( in nsiuri uri ); parameters uri the uri to look up. return value null if the url was not found in the cache.
removeentry() evict images from the cache. void
removeentry( in nsiuri uri ); parameters uri the uri to
remove. exceptions thrown ns_ok if a uri was
removed from the cache. ns_error_not_available if a uri was unable to be
removed from the cache. ...
mozIRegistry
interface, thereby enabling alternative registry implementations to be substituted at run/link time. there will be two registry interface implementations: one based solely on libreg (for "compatibility") and a fancier rdf-based one. open issues we have identified two open issues, neither of which appear to be so hard that it we won't be able to solve them in a timely fashion: if and when we
remove what is currently a static binding of clsids, there will be the risk that required clsids won't be present. a corollary is that the build/install process will require updates to user "registry" to enable new class implementations to be accessible. our current build/install process doesn't quite step up to these problems as of yet. there are some bootstrapping issues related to using the servi...
...pping, including functions that create instances of a given clsid. the nsrepository functions are declared in nsrepository.h. much more information about nsrepository can be found below. the second way you access other components is via the service manager. that thing isn't yet covered in this document. see the note above. in this section, i'll discuss a number of different components, their requi
rements for dynamically binding to other components, and how they might utilize the core xpcom components to satisfy those requi
rements. i18n xul/xptoolkit app shell clsid binding protocols this is a placeholder for potential encapsulations of particular idioms for storing clsid information in the registry and using that information, along with nsrepository, to implement some instance creation...
mozISpellCheckingEngine
ne has contract id "@mozilla.org/spellchecker/engine;1". extensions can use this interface to check spelling or provide its own spell checker to editors. method overview void adddirectory(in nsifile dir); boolean check(in wstring word); void getdictionarylist([array, size_is(count)] out wstring dictionaries, out pruint32 count); void
removedirectory(in nsifile dir); void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out pruint32 count); attributes attribute type description copyright wstring a string indicating the copyright of the engine. not currently used. read only. dictionary wstring ...
...list() gets the list of dictionaries. void getdictionarylist( [array, size_is(count)] out wstring dictionaries, out pruint32 count ); parameters dictionaries a list of dictionaries supported by this spell checker. the dictionary attribute can be set to one of these. each dictionary name is typically but not always a locale code. count the length of dictionaries.
removedirectory()
removes all the dictionaries in the specified directory from the spell checker. void
removedirectory( nsifile dir ); parameters dir an nsifile object indicating the directory whose spell checkers are to be
removed from the spell checker. suggest() gets a list of suggestions for a misspelled word. when this changes, the spell checker sends a "spellcheck-dictionary-...
nsIAccessibleEvent
ult action has changed. event_action_change 0x0010 0x000d an object's action has changed. event_accelerator_change 0x0011 0x000e an object's keyboard shortcut has changed. event_selection 0x8006 0x0012 0x000f the selection within a container object has changed. event_selection_add 0x8007 0x0013 0x0010 an item within a container object has been added to the selection. event_selection_
remove 0x8008 0x0014 0x0011 an item within a container object has been
removed from the selection. event_selection_within 0x8009 0x0015 0x0012 numerous selection changes have occurred within a container object. event_alert 0x0002 0x0016 0x0013 an alert has been generated. server applications send this event when a user needs to know that a user interface element has changed. event_foreground 0x...
...attributes changed. also see event_object_attribute_changed. event_text_caret_moved 0x0033 0x002f the caret has moved to a new position. event_text_changed 0x0034 0x0030 this event indicates general text changes. that is, changes to text that is exposed through the iaccessibletext and iaccessibleeditabletext interfaces. event_text_inserted 0x0035 0x0031 text was inserted. event_text_
removed 0x0036 0x0032 text was
removed. event_text_updated 0x0037 0x0033 text was updated. event_text_selection_changed 0x0038 0x0034 the text selection changed. event_visible_data_changed 0x0039 0x0035 a visible data event indicates the change of the visual appearance of an accessible object. this includes for example most of the attributes available via the iaccessiblecomponent interf...
nsIAccessibleRole
rcent complete of an operation in progress. it is used for xul:progressmeter, role="progressbar". role_dial 49 represents a dial or knob whose purpose is to allow a user to set a value. role_hotkeyfield 50 represents a hot-key field that allows the user to enter a combination or sequence of keystrokes. role_slider 51 represents a slider, which allows the user to adjust a setting in given inc
rements between minimum and maximum values. it is used by xul:scale, role="slider", xforms:range. role_spinbutton 52 represents a spin box, which is a control that allows the user to inc
rement or dec
rement the value displayed in a separate "buddy" control associated with the spin box. it is used for xul:spinbuttons. role_diagram 53 represents a graphical image used to diagram data. it is used for...
...y used to offer the user a list of choices, and then hides when the user selects one of those choices. role_radio_menu_item 84 a radio button that is a menu item. role_root_pane 85 a root pane. a specialized pane that has a glass pane and a layered pane as its children. also refer to role_glass_pane and role_layered_pane. role_scroll_pane 86 a scroll pane. an object that allows a user to inc
rementally view a large amount of information. its children can include scroll bars and a viewport. also refer to role_view_port. role_split_pane 87 a split pane. a specialized panel that presents two other panels at the same time. between the two panels is a divider the user can manipulate to make one panel larger and the other panel smaller. role_table_column_header 88 the header for a column o...
nsIAccessibleTreeCache
try to avoid using it. a private interface to operate with tree accessible. accessible/public/nsiaccessibletreecache.idlnot scriptable please add a summary to this article. ...
...r atk only. return value the nsiaccessible corresponding to the specified tree cell. invalidatecache() invalidates the number of cached treeitem accessibles. void invalidatecache( in long arow, in long acount ); parameters arow row index the invalidation starts from. acount the number of treeitem accessibles to invalidate, the number sign specifies whether rows have been inserted (plus) or
removed (minus) treeviewchanged() invalidates children created for the previous tree view. void treeviewchanged(); parameters none. treeviewinvalidated() fires name change events for invalidated area of tree. void treeviewinvalidated( in long astartrow, in long aendrow, in long astartcol, in long aendcol ); parameters astartrow row index invalidation starts from. aendrow row index invalid...
nsIApplicationUpdateService
provides utilities for selecting and downloading update patches. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void adddownloadlistener(in nsirequestobserver listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void
removedownloadlistener(in nsirequestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker nsiupdatechecker the update checker being used for background update checking. read only. canapplyupdates boolean true if the update service can download and install updates...
..."downloading" the update is being downloaded. "pending" the update is ready to be applied. "applying" the update is in the process of being applied. "succeeded" the update has been installed successfully. "download-failed" the update failed to be downloaded. "failed" installing the update failed. pausedownload() pauses the currently active update download. void pausedownload(); parameters none.
removedownloadlistener()
removes a listener that is receiving progress and state information about the update that is currently being downloaded. void
removedownloadlistener( in nsirequestobserver listener ); parameters listener the listener object to
remove. selectupdate() selects the best update to install from a provided list of available updates. nsiupdate selectupdate( [array, size_is(upd...
nsIBoxObject
last changed in gecko 1.9 (firefox 3) to get an instance, use the boxobject property. where possible, element.getclientrects and element.getboundingclientrect should be used instead. method overview wstring getlookandfeelmetric(in wstring propertyname); obsolete since gecko 1.9 wstring getproperty(in wstring propertyname); nsisupports getpropertyassupports(in wstring propertyname); void
removeproperty(in wstring propertyname); void setproperty(in wstring propertyname, in wstring propertyvalue); void setpropertyassupports(in wstring propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only. firstchild nsidomelement the first child of the box, in box-ordinal-group order. read only. height long the height of the box, in c...
...metric() obsolete since gecko 1.9 (firefox 3) wstring getlookandfeelmetric( in wstring propertyname ); parameters propertyname return value getproperty() wstring getproperty( in wstring propertyname ); parameters propertyname return value getpropertyassupports() nsisupports getpropertyassupports( in wstring propertyname ); parameters propertyname return value
removeproperty() void
removeproperty( in wstring propertyname ); parameters propertyname setproperty() void setproperty( in wstring propertyname, in wstring propertyvalue ); parameters propertyname propertyvalue setpropertyassupports() void setpropertyassupports( in wstring propertyname, in nsisupports value ); parameters propertyname value ...
nsIBrowserSearchService
may be null if there are no visible search engines. defaultengine nsisearchengine the default search engine. returns the...
...ascript, this observer can be a regular function. moveengine() moves a visible search engine. void moveengine( in nsisearchengine engine, in long newindex ); parameters engine the engine to move. newindex the engine's new index in the set of visible engines. exceptions thrown ns_error_failure if newindex is out of bounds, or if engine is hidden.
removeengine()
removes the search engine. if the search engine is installed in a global location, this will just hide the engine. if the engine is in the user's profile directory, it will be
removed from disk. void
removeengine( in nsisearchengine engine ); parameters engine the engine to
remove. restoredefaultengines() un-hides all engines installed in the directory corresponding ...
nsICacheService
blic/nsicacheservice.idlscriptable handles visiting and evicting entries operations along with the creating of cache sessions and creation of temporary client ids operations for offline caching. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is no longer supported and planned to be
removed soon: use nsicachestorageservice instead. at the time of writing there is no documentation for nsicachestorageservice but comments are available in the source. note: starting in gecko 2.0, cache i/o is handled asynchronously. method overview nsicachesession createsession(in string clientid, in nscachestoragepolicy storagepolicy, in boolean streambased); acstring create...
...be consistent with the value of this field. for example, a non-stream-based cache entry can only have a storage policy of store_in_memory. return value returns a new cache session. createtemporaryclientid() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. this method creates and returns a unique, temporary cache client id. this is used by the offline cache. the offline cache lets clients accumulate entries in a temporary client and merge them in as a group using nsiofflinecachesession.mergetemporaryclient(). acstring createtemporaryclientid( in nscachestoragepolicy storagepolicy ); parameters stora...
nsICachingChannel
n 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 entry identified by the cache token. depending on the value of nsireque...
...ng 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 it. the cache token can be queryinterface'd to a nsicacheentryinfo...
nsIChromeFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable handles loading of content in a
remote chrome frame. 1.0 66 introduced gecko 2.0 inherits from: nsiframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void loadframescript(in astring aurl, in boolean aallowdelayedload); void
removedelayedframescript(in astring aurl); methods loadframescript() loads a script into the
remote frame. void loadframescript( in astring aurl, in boolean aallowdelayedload ); parameters aurl the url of the script to load into the frame; this must be an absolute url, but data: urls are supported. aallowdelayedload if true, the script will be loaded when the...
...delayedframescript(in astring aurl); methods loadframescript() loads a script into the
remote frame. void loadframescript( in astring aurl, in boolean aallowdelayedload ); parameters aurl the url of the script to load into the frame; this must be an absolute url, but data: urls are supported. aallowdelayedload if true, the script will be loaded when the
remote frame becomes available; otherwise, the script will only be loaded if the frame is already available.
removedelayedframescript()
removes a script from the list of scripts supporting delayed load. void
removedelayedframescript( in astring aurl ); parameters aurl the url of the script to
remove from the list of scripts supporting delayed load. see also content process even...
nsIClipboardDragDropHooks
widget/public/nsiclipboarddragdrophooks.idlscriptable interfaces for overriding the built-in drag, drop, copy, and paste implementations in the content area and editors. use this to do things such as prevent a drag from starting, adding or
removing data and flavors, or preventing the drop. ...
...p. inherits from: nsisupports last changed in gecko 1.7 embedders who want to have these hooks made available should implement nsiclipboarddragdrophooks and use the command manager to send the appropriate commands with these parameters/settings: command: cmd_clipboarddragdrophook params value type possible values "addhook" isupports nsiclipboarddragdrophooks as nsisupports "
removehook" isupports nsiclipboarddragdrophooks as nsisupports note: overrides/hooks need to be added to each window (as appropriate). adding them to the first window does not enable them for every window. if more than one implementation is set for a window, the hooks will be called in the order they are added. adding the same hook to the same window will not add a second call. each hook can on...
nsIConsoleService
isterlistener(in nsiconsolelistener listener); void reset(); void unregisterlistener(in nsiconsolelistener listener); methods getmessagearray() to obtain an array of all logged messages. obsolete since gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. void getmessagearray( [array, size_is(count)] out nsiconsolemessage messages, out pruint32 count ); parameters messages an array of logged messages. count the number of messages in the array. if no messages are logged, this function will return a count of 0, but allocating a placeholder word for messages, showing as a 0-length array when called...
...for example, for privacy reasons): void reset(); parameters none. note: console listeners expect you to log an empty string message before calling reset, so they too can clear their message buffers. (this also works before gecko 19.) unregisterlistener() deregisters a listener. void unregisterlistener( in nsiconsolelistener listener ); parameters listener the nsiconsolelistener to
remove. examples retrieving the message array to retrieve the message array in gecko prior to version 19: function getconsolemessagearray() { var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); var array = {}; consoleservice.getmessagearray(array, {}); return array.value; } to re...
nsIContentPrefObserver
dom/interfaces/base/nsicontentprefservice.idlscriptable this interface allows code to easily watch for changes to the values of content preferences. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void oncontentpref
removed(in astring agroup, in astring aname); void oncontentprefset(in astring agroup, in astring aname, in nsivariant avalue); methods oncontentpref
removed() called when a content preference is
removed. void oncontentpref
removed( in astring agroup, in astring aname ); parameters agroup the group to which the
removed preference belonged; this may be the uri of a web site. this value is null if the preference was global, applying to all web sites. a...
... oncontentprefset() called when the value of a preference is set (either by changing its current value or by creating the preference). void oncontentprefset( in astring agroup, in astring aname, in nsivariant avalue ); parameters agroup the group to which the preference belongs; this may be the uri of a web site. ...
nsIDBChangeListener
d to filter out events that you yourself started. ainstigator may also be null. onhdrdeleted() called when a header is deleted from the database. void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); parameters ahdrchanged the nsimsgdbhdr of the message that was
removed. aparentkey the key of the parent folder for deleted header. the typedef of nsmsgkey is given in mailnewstypes2.idl. aflags the flags on the message. flags are defined in nsmsgmessageflags. ainstigator the caller who deleted the header. this can be used to filter out events that you yourself started. ainstigator may also be null. onhdradded() called when a header is added to the data...
... typedef of nsmsgkey is given in mailnewstypes2.idl. ainstigator the caller who changed the parent. this can be used to filter out events that you yourself started. ainstigator may also be null. onannouncergoingaway() called when an announcer is being deleted. void onannouncergoingaway(in nsidbchangeannouncer ainstigator); parameters ainstigator the nsidbchangeannouncer that is being
removed. onreadchanged() called when the read state of news messages changes. only used by nsinewsdatabase databases. others use the onhdrflagschanged() method. void onreadchanged(in nsidbchangelistener ainstigator); parameters ainstigator the caller who changed the read state. this can be used to filter out events that you yourself started. ainstigator may also be null. onjunkscorechang...
nsIDOMEvent
out voidptr aiter ); parameters amsg aiter return value native code only!duplicateprivatedata void duplicateprivatedata(); parameters none. violates the xpcom interface guidelines getinternalnsevent() nseventptr getinternalnsevent(); parameters none. return value getpreventdefault() note: use the defaultprevented attribute instead. this method will be
removed in future releases, see bug 691151. boolean getpreventdefault(); parameters none. return value initevent() this method is used to initialize the value of an event created through the documentevent interface. this method may only be called before the event has been dispatched via the dispatchevent method, though it may be called multiple times during that phase if necessary. if called...
...hat the event is to be canceled, meaning any default action normally taken by the implementation as a result of the event will not occur. if, during any stage of event flow, the preventdefault method is called the event is canceled. any default action associated with the event will not occur. calling this method for a non-cancelable event has no effect. once preventdefault has been called it will
remain in effect throughout the
remainder of the event's propagation. this method may be used during any stage of event flow. void preventdefault(); parameters none. violates the xpcom interface guidelines serialize() void serialize( in ipcmessageptr amsg, in boolean aserializeinterfacetype ); parameters amsg aserializeinterfacetype native code only!settarget void s...
nsIDOMNSHTMLDocument
is not implemented in gecko. value some commands require an argument. you can pass null for those commands that do not need an argument. return value true if the command was recognized, false otherwise. execcommandshowhelp() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) this method never did anything but throw an exception, and was
removed entirely in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11). boolean execcommandshowhelp( in domstring commandid ); parameters commandid the name of the command. return value this method is not supported and always throws an exception. getselection() domstring getselection(); parameters none. return value the text of the current selection, the same as window.getsel...
...lean querycommandsupported( in domstring commandid ); parameters commandid the name of the command to query. return value returns true if the command is supported on the current range, false otherwise. querycommandtext() obsolete since gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) this method never did anything but throw an exception, and was
removed entirely in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11). domstring querycommandtext( in domstring commandid ); parameters commandid the name of the command to query. return value this method is not supported and always throws an exception. querycommandvalue() domstring querycommandvalue( in domstring commandid ); parameters commandid the name of the ...
nsIDOMStorage2
cal storage object can be retrieved from the window's localstorage attribute. dom/public/idl/storage/nsidomstorage2.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void
removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this
removes all values bound to the domain or origin. void clear(); parameters none. getitem() returns from local storage the data correspond...
...to the specified key, or null if no data exists for the given key. key() returns the key for the item stored at the specified index in the data store. domstring key( in unsigned long index ); parameters index the index for which the corresponding key should be returned. return value a string containing the requested key. exceptions thrown index_size_errthere is no key at the specified index.
removeitem() given a key,
removes the corresponding entry from local storage. void
removeitem( in domstring key ); parameters key the key for which data should be
removed from storage. setitem() sets the value corresponding to a given key. if the key does not already exist, a new key is added, associated with the specified value. if the key already exists, the existing value is replaced with th...
nsIDOMXULSelectControlElement
selectedindex long selecteditem nsidomxulselectcontrolitemelement value domstring methods appenditem() nsidomxulselectcontrolitemelement appenditem( in domstring label, in domstring value ); parameters label value return value getindexofitem() long getindexofitem( ...
...) long getindexofitem( in nsidomxulselectcontrolitemelement item ); parameters item return value getitematindex() nsidomxulselectcontrolitemelement getitematindex( in long index ); parameters index return value insertitemat() nsidomxulselectcontrolitemelement insertitemat( in long index, in domstring label, in domstring value ); parameters index label value return value
removeitemat() nsidomxulselectcontrolitemelement
removeitemat( in long index ); parameters index return value ...
nsIDictionary
extensions/xml-rpc/idl/nsidictionary.idlscriptable a simple mutable table of objects, maintained as key/value pairs. objects can be located and managed by referencing them by key. 66 introduced gecko 1.0 obsolete gecko 1.9.1 inherits from: nsisummary last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface was
removed in firefox 3.5; use dict.jsm instead. see bug 668424 for further information. method overview boolean haskey(in string key); void getkeys(out pruint32 count, [retval, array, size_is(count)] out string keys); nsisupports getvalue(in string key); void setvalue(in string key, in nsisupports value); nsisupports deletevalue(in string key); void cl...
... the key is already present, the new value replaces the old one. void setvalue( in string key, in nsisupports value ); parameters key the key by which the value can be accessed. value the value to store. deletevalue() find the value indicated by the key. nsisupports deletevalue( in string key ); parameters key the key indicating the pair to be
removed. return value the
removed value. if the key doesn't exist, ns_error_failure will be returned. clear() delete all key-value pairs from the dictionary. void clear(); parameters none. ...
nsIDocShell
ng unloaded as well. void firepagehidenotification( in boolean isunload ); parameters isunload if true, fire the unload event in addition to the pagehide event. native code only!fireunloadnotification obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. notify the associated content viewer and all child docshells that they are about to be unloaded. void fireunloadnotification(); parameters none. getdocshellenumerator() get an enumerator over this docshell and its children. nsisimpleenumerator getdocshellenumerator( in long aitemtype, in long adirection ); parameters aitemtype only include do...
...rageforuri( in nsiuri uri, in domstring documenturi ); parameters uri the domain of the storage object to retrieve. documenturi if a new storage object needs to be created, it will be created with a reference to this document.documenturi in its storageevent. return value the session storage object for the supplied domain. historypurged() notification that entries have been
removed from the beginning of a nsshistory which has this as its rootdocshell. void historypurged( in long numentries ); parameters numentries the number of entries
removed. native code only!internalload loads the given uri. this method is identical to loaduri() except that its parameter list is broken out instead of being packaged inside of an nsidocshellloadinfo object. void internallo...
nsIEffectiveTLDService
ception originates in the normalize() method in nsiidnservice and is thrown when ahost contains characters disallowed in uris. ns_error_insufficient_domain_levels this exception is thrown if there were insufficient subdomain levels in the hostname to satisfy the requested aadditionalparts value. ns_error_host_is_ip_address this exception is thrown if ahost is a numeric ipv4 or ipv6 address.
remarks note: prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this method worked if you passed host strings starting with a period ("."). that is no longer the case, since these are not valid host names. you should strip leading periods off host names before passing them to this method. getpublicsuffix() returns the public suffix of a uri. a public suffix is the highest-level d...
...eturn value an acstring containing the public suffix. exceptions thrown ns_error_invalid_arg this exception is thrown if ahost is empty. ns_error_unexpected this exception originates in the normalize() method in nsiidnservice and is thrown when ahost contains characters disallowed in uris. ns_error_host_is_ip_address this exception is thrown if ahost is a numeric ipv4 or ipv6 address.
remarks all returned strings are encoded in ascii/ace and normalized according to rfc 3454. ...
nsIHttpActivityDistributor
void addobserver( in nsihttpactivityobserver aobserver ); parameters aobserver the nsihttpactivityobserver that should receive notifications of http transport activity; this object's nsihttpactivityobserver.observeactivity() method will be called each time ac...
...sihttpactivityobserver aobserver); methods addobserver() begins delivery of notifications of http transport activity. void addobserver( in nsihttpactivityobserver aobserver ); parameters aobserver the nsihttpactivityobserver that should receive notifications of http transport activity; this object's nsihttpactivityobserver.observeactivity() method will be called each time activity occurs.
removeobserver() stops delivery of notifications of http transport activity. void
removeobserver( in nsihttpactivityobserver aobserver ); parameters aobserver the nsihttpactivityobserver that should no longer receive notifications of http transport activity. see also monitoring http activity nsihttpactivityobserver ...
nsILocalFileMac
eturns the target of the alias. if followlinks is false, returns the unresolved alias file. fsspec getfsspec(); parameters none. return value the fsspec of the file object. native code only!inittoappwithcreatorcode obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. init this object to point to an application having the given creator code. if this app is missing, this will fail. it will first look for running application with the given creator. void inittoappwithcreatorcode( in ostype aappcreator ); parameters aappcreator the signature of the app. native code only!initwithcfurl init this object with a cfurlref. no...
...code only!initwithfsref init this object with an fsref. note: supported only for xp_macosx. void initwithfsref( [const] in fsrefptr afsref ); parameters afsref the native fsref. native code only!initwithfsspec obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. init this object with an fsspec legacy method - leaving in place for now. void initwithfsspec( [const] in fsspecptr afilespec ); parameters afilespec the native file spec. ispackage() boolean ispackage(); parameters none. return value true if a directory is determined to be a package under mac os 9/x. launchwithdoc() launch the application that this f...
nsIMicrosummaryGenerator
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides access to a microsummary that has been installed in firefox. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was
removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a
remote resource) been loaded. read only. localuri nsiuri for generators installed by ...
... only. uri nsiuri the canonical location and unique identifier of the generator. it tells us where the generator comes from and where to go for updates. read only. for generators referenced by web pages via <link> tags, this uri is the url specified by the tag. for generators installed via nsisidebar.addmicrosummarygenerator(), this uri is a urn of the form urn:source:<url>, where <url> is the
remote location from which we installed the generator. for generators installed via some other mechanism (for example an extension that dynamically creates generators), this uri is a urn in a form of the extension's own choosing, with the only restriction being that the uri be globally unique. to ensure this, we recommend that such extensions incorporate uuids created by nsiuuidgenerator into the urn...
nsIMicrosummarySet
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides access to sets of microsummaries returned from the nsimicrosummaryservice. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) warning: microsummary support was
removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosummaryobserver observer); nsisimpleenumerator enumerate(); void
removeobserver(in nsimicrosummaryobserver observer); methods addobserver() add a microsummary observer to this microsummary set. adding an observer to a set is the equiv...
...ing an observer to a set is the equivalent of adding it to each constituent microsummary. void addobserver( in nsimicrosummaryobserver observer ); parameters observer the microsummary observer to add. enumerate() retrieve an nsisimpleenumerator of microsummaries in the set. nsisimpleenumerator enumerate(); parameters none. return value an enumerator of nsimicrosummary objects.
removeobserver()
remove a microsummary observer from this microsummary. void
removeobserver( in nsimicrosummaryobserver observer ); parameters observer the microsummary observer to
remove. see also nsimicrosummaryservice microsummary topics creating a microsummary ...
nsIMsgAccount
nsimsgaccount mailnews/base/public/nsimsgaccount.idlscriptable an account consists of an incoming server and one or more outgoing identities. inherits from: nsisupports last changed in gecko 1.7 method overview void addidentity(in nsimsgidentity identity); void clearallvalues(); void init(); void
removeidentity(in nsimsgidentity identity); astring tostring(); attributes attribute type description defaultidentity nsimsgidentity identities nsisupportsarray read only. outgoing identity list (array of nsimsgidentity's) incomingserver nsimsgincomingserver incoming server stuff key acstring internal key identifying itself methods addidentity() adds a new identity to this account. void addidentity( in nsimsgidentity identity ); parameters identity th...
... addidentity() adds a new identity to this account. void addidentity( in nsimsgidentity identity ); parameters identity the identity to add. clearallvalues() clear all user preferences associated with an account. void clearallvalues(); parameters none. init() initializes an account. void init(); parameters none. exceptions thrown ns_error_already_opened if it is called more then once
removeidentity()
removes an identity from this account. void
removeidentity( in nsimsgidentity identity ); parameters identity the identity to
remove. ...
nsIMsgSendLater
messaging account. inherits from: nsistreamlistener implemented by: @mozilla.org/messengercompose/sendlater;1. to create an instance, use var msgsendlater = components.classes["@mozilla.org/messengercompose/sendlater;1"] .getservice(components.interfaces.nsimsgsendlater); method overview void sendunsentmessages(in nsimsgidentity identity); void
removelistener(in nsimsgsendlaterlistener listener); void addlistener(in nsimsgsendlaterlistener listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messages for an identity. void sendunsentmessages(in ...
...listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messages for an identity. void sendunsentmessages(in nsimsgidentity identity) parameters identity the nsimsgidentity to send unsent messages for
removelistener()
remove an event listener from this nsisendmsglater instance void
removelistener(in nsimsgsendlaterlistener listener); parameters listener the nsimsgsendlaterlistener to
remove. addlistener() add an event listener to this nsisendmsglater instance. void addlistener(in nsimsgsendlaterlistener listener); parameters listener the nsimsgsendlaterlistener to add. ge...
nsIMsgThread
iew void addchild(in nsimsgdbhdr child, in nsimsgdbhdr inreplyto, in boolean threadinthread, in nsidbchangeannouncer announcer); nsimsgdbhdr getchildat(in long index); nsmsgkey getchildkeyat(in long index); nsimsgdbhdr getchild(in nsmsgkey msgkey); nsimsgdbhdr getchildhdrat(in long index); nsimsgdbhdr getroothdr(out long index); void
removechildat(in long index); void
removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); void markchildread(in boolean bread); nsimsgdbhdr getfirstunreadchild(); nsisimpleenumerator enumeratemessages(in nsmsgkey parent); attributes attribute type description threadkey nsmsgkey unsigned long key designating th...
...x); parameters index the index to get the key from getchild() nsimsgdbhdr getchild(in nsmsgkey msgkey); parameters msgkey the index to get the key from getchildhdrat() nsimsgdbhdr getchildhdrat(in long index); parameters index the index to get the message from. getroothdr() nsimsgdbhdr getroothdr(out long index); return index changed to the index of the root.
removechildat() void
removechildat(in long index); parameters index the index to
remove the message from
removechildhdr() void
removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); parameters child the message to
remove announcer an nsidbchangeannouncer to receive notification when the change is made. markchildread() void markchildread(in boolean bread); p...
nsIMsgWindow
ke bad cert exceptions. promptdialog nsiprompt readonly: this is the equivalent of calling getinterface on the rootdocshell object. mailcharacterset acstring this is used to track the character set of the currently displayed message. if set to an alias, the actual character set is returned. charsetoverride boolean
remember the message's charset was overridden, so it can be inherited (e.g for quoting). stopped boolean check if a running url been stopped. if you are checking this flag, you need to clear it before you start your operation since there's no convenient place to clear it. domwindow nsidomwindow the message window's global chrome window object. s...
...indow is being unloaded from the content window, this notification can be used to force a flush on anything the message window hangs on. for some reason xpconnect is still hanging onto the message window even though all of our objects have let go of it. this forces a release. it clears out the content listener, the windowcommands, the statusfeedback and the docshell objects. void closewindow();
remarks see also ...
nsIMutableArray
rray.queryelementat() will never return a null value. any of these methods may throw ns_error_out_of_memory when the array must grow to complete the call, but the allocation fails. method overview void appendelement(in nsisupports element, in boolean weak); void clear(); void insertelementat(in nsisupports element, in unsigned long index, in boolean weak); void
removeelementat(in unsigned long index); void replaceelementat(in nsisupports element, in unsigned long index, in boolean weak); methods appendelement() append an element at the end of the array. void appendelement( in nsisupports element, in boolean weak ); parameters element the element to append. weak whether or not to store the element using a weak reference.
...p. if the position is equal to the current length of the array, the new element is appended. an index lower than 0 or higher than the current length of the array is invalid and will be ignored. weak whether or not to store the element using a weak reference. exceptions thrown ns_error_failure when a weak reference is requested, but the element does not support nsiweakreference.
removeelementat()
remove an element at a specific position, moving all elements stored at a higher position down one. to
remove a specific element, use nsiarray.indexof() to find the index first, then call
removeelementat. void
removeelementat( in unsigned long index ); parameters index the position of the item. replaceelementat() replace the element at the given position. void replaceel...
nsINavHistoryResult
ckaged interaction with a nsitreeboxobject. if you need a different view, you'll need to create your own viewer interface. the viewer provides notifications to the controller when view events occur; this is done using the nsinavhistoryresultviewobserver interface. method overview void addobserver(in nsinavhistoryresultobserver aobserver, in boolean aownsweak); void
removeobserver(in nsinavhistoryresultobserver aobserver); attributes attribute type description root nsinavhistorycontainerresultnode the root of the results. this container gives you access to all the results in the tree. note: keep in mind that you need to open containers for their results to be valid. when ...
...er for changes that occur on the result. void addobserver( in nsinavhistoryresultobserver aobserver, in boolean aownsweak ); parameters aobserver an object that implements the nsinavhistoryresultobserver interface, which will receive notifications of changes on the result. aownsweak if false, the result will keep an owning reference to the observer, which must be
removed by calling
removeobserver(). if true, the result will keep a weak reference to the observer, which must implement the nsisupportsweakreference interface.
removeobserver()
removes an observer that was added by a previous call to addobserver(). void
removeobserver( in nsinavhistoryresultobserver aobserver ); parameters aobserver the observer to
remove. see also nsinavhist...
nsIPlacesView
slating its own selection format into one the controller can understand. views do this, and other things, by implementing the nsiplacesview interface. note: nsiplacesview does not exist in idl at the moment. it's currently implemented directly on each of the built-in places views. method overview nsinavhistoryresultnode[] getdragableselection(); nsinavhistoryresultnode[][] get
removableselectionranges(); nsinavhistoryresult getresult(); nsinavhistorycontainerresultnode getresultnode(); nsinavhistoryresultnode[] getselectionnodes(); void selectall(); attributes attribute type description hasselection boolean whether or not there are selected items. read only. insertionpoint insertionpoint ...
...node nsinavhistoryresultnode the selected node in the view. if there are multiple selected nodes, this is null. read only. methods getdragableselection() returns an array of selected nsinavhistoryresultnode objects that can be dragged from the view. nsinavhistoryresultnode[] getdragableselection(); parameters none. return value an array of nsinavhistoryresultnode objects. get
removableselectionranges() returns an array whose elements are themselves arrays of nsinavhistoryresultnode objects that can be
removed from the view. each inner array represents a contiguous range of nodes that can be
removed. nsinavhistoryresultnode[][] get
removableselectionranges(); parameters none. return value an array of arrays of nsinavhistoryresultnode objects. getresult() returns th...
nsIProtocolProxyService
or a lengthy period of time. by passing this flag to resolve, one can failover to asyncresolve to avoid locking up the calling thread if a pac query is required. when this flag is passed to resolve, resolve may throw the exception ns_base_stream_would_block to indicate that it failed due to this flag being present. methods resolve() deprecated since gecko 18 this method has been
removed in firefox 18. use resolveasync instead previous doc this method returns a nsiproxyinfo instance that identifies a proxy to be used for loading the given uri. otherwise, this method returns null indicating that a direct connection should be used. if this proxy is unavailable, getfailoverforproxy() may be called to determine the correct secondary proxy to be used. if the protocol handler...
...proxies for the given uri, and then it applies the proxy filters. the filters have the opportunity to modify the list of proxies. if two filters register for the same position, then the filters will be visited in the order in which they were registered. if the filter is already registered, then its position will be updated. after filters have been run, any disabled or disallowed proxies will be
removed from the list. a proxy is disabled if it had previously failed-over to another proxy (see getfailoverforproxy()). a proxy is disallowed, for example, if it is a http proxy and the nsiprotocolhandler for the queried uri does not permit proxying via http. if a nsiprotocolhandler disallows all proxying, then filters will never have a chance to intercept proxy requests for such urls. note: it i...
nsISessionStore
ated. atab the tab to duplicate (can come from a different window). return value an nsidomnode representing the new tab, the content of which is a duplicate of atab. forgetclosedtab() nsidomnode forgetclosedtab( in nsidomwindow awindow, in unsigned long aindex ); parameters awindow is the browser window associated with the closed tab. aindex is the index of the closed tab to be
removed (fifo ordered). return value forgetclosedwindow() nsidomnode forgetclosedwindow( in unsigned long aindex ); parameters aindex is the index of the closed window to be
removed (fifo ordered). return value exceptions thrown ns_error_invalid_arg when aindex does not map to a closed window. getbrowserstate() returns the current state of all of windows and all of their tab...
.... setwindowstate() sets the state of a single window to a given stored state. void setwindowstate( in nsidomwindow awindow, in astring astate, in boolean aoverwrite ); parameters awindow the nsidomwindow whose state is to be set to the state indicated by astate. astate the saved state to apply to the specified window. aoverwrite if this parameter is true, all existing tabs are
removed and replaced with the tabs in the state astate. if it's false, the tabs in astate are added to the tabs already in the window. setwindowvalue() sets the value corresponding to a given key for a specified window. void setwindowvalue( in nsidomwindow awindow, in astring akey, in astring astringvalue ); parameters awindow the browser window for which the value is to be set. akey...
nsISupportsArray
aelement, in unsigned long aindex); violates the xpcom interface guidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long aindex); violates the xpcom interface guidelines long lastindexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines boolean moveelement(in long afrom, in long ato); violates the xpcom interface guidelines boolean
removeelementat(in unsigned long aindex); violates the xpcom interface guidelines boolean
removeelementsat(in unsigned long aindex, in unsigned long acount); violates the xpcom interface guidelines boolean
removelastelement([const] in nsisupports aelement); violates the xpcom interface guidelines boolean replaceelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom inte...
...aother aindex return value violates the xpcom interface guidelines lastindexof() long lastindexof( [const] in nsisupports apossibleelement ); parameters apossibleelement return value violates the xpcom interface guidelines moveelement() boolean moveelement( in long afrom, in long ato ); parameters afrom ato return value violates the xpcom interface guidelines
removeelementat() boolean
removeelementat( in unsigned long aindex ); parameters aindex return value violates the xpcom interface guidelines
removeelementsat() boolean
removeelementsat( in unsigned long aindex, in unsigned long acount ); parameters aindex acount return value violates the xpcom interface guidelines
removelastelement() boolean
removelastelement( [const] ...
nsISupports proxies
obsolete since gecko 12 (firefox 12 / thunderbird 12 / seamonkey 2.9)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. xpcom proxies were a technology which allowed code to make asynchronous or synchronous xpcom calls to a different thread on arbitrary xpcom interfaces. this technology has been
removed in firefox 12 because it was very complex and often lead to strange deadlock conditions. it is no longer needed because javascript code can no longer run on arbitrary threads, and compiled code can use compiled runnable to achieve the same effect in a much simpler manner. for more information about alternatives, see making cross-thread calls using runnables. the following inter...
...orts *aouter, const nsiid & iid, print32 proxytype, void * *result); the two apis are essentially the same. the only difference is that the first accepts a created object object, and the latter will create an object for you. this creation will happen off the destination's event queue. for instance, if you need to not only use an object
remotely, but also have it created
remotely, use the second api. the iid that you are requesting must be in the typelib. these means that you should have had to create and idl for it and have generated a typelib. if you haven't, or you've never heard of these things, see http://www.mozilla.org/scriptable/ . the proxytype parameter can be either two flags: proxy_sync or proxy_async. these two flags ...
nsITimer
not guaranteed: the timer can fire at any time. this is the preferable repeating type for most situations. type_repeating_precise 2 type_repeating_precise is just a synonym for type_repeating_precise_can_skip. they used to be distinct, but the old type_repeating_precise kind was similar to type_repeating_precise_can_skip while also being less useful. so the distinction was
removed. type_repeating_precise_can_skip 3 this repeating timer aims to have constant period between firings. the processing time for each timer callback should not influence the timer period. however this timer type guarantees that it will not queue up new events to fire the callback until the previous callback event finishes firing. if the callback takes a long time, then the ...
... unsigned long adelay, in unsigned long atype ); parameters acallback a nstimercallbackfunc interface compatible function to call when timer fires. aclosure an opaque pointer to pass to that function. adelay timeout delay in milliseconds. atype defines the timer type: one shot, repeating slack or repeating precise. must be one of the constants defined under constants on this page.
remarks type_repeating_slack timer is the preferable repeating timer type for most situations example using initwithcallback: // we need an nsitimercallback compatible... // ... interface for the callbacks. var event = { notify: function(timer) { alert("fire!"); } } // now it is time to create the timer... var timer = components.classes["@mozilla.org/timer;1"].createinstance(components.i...
nsIToolkitProfile
public/nsitoolkitprofile.idlscriptable represents a user profile. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) you should not create these objects yourself; to obtain them, use the nsitoolkitprofileservice interface to create and obtain them. method overview nsiprofilelock lock(out nsiprofileunlocker aunlocker); void
remove(in boolean
removefiles); attributes attribute type description localdir nsilocalfile the location of the profile local directory, which may be the same as the root directory. see nsiprofilelock.localdirectory(). read only. name autf8string the profile's name. rootdir nsilocalfile the location of the profile directory. read only...
...nnot be returned to javascript as the error causes an exception to be thrown. the unlocker object is only available in gecko 34 or later when running on windows vista or later. return value an nsiprofilelock object which holds a profile lock as long as you hold a reference to it. example: var profile = profilelist.getnext().queryinterface(ci.nsitoolkitprofile); var locker = profile.lock({});
remove()
removes the profile from the registry of profiles. void
remove( in boolean
removefiles ); parameters
removefiles indicates whether or not the profile directory should be
removed when the profile is
removed from the profile list. see also profile management nsitoolkitprofileservice nsiprofilelock nsiprofileunlocker ...
nsITransactionManager
this is commonly referred to as the number of levels of undo. a value of -1 means no limit. a value of zero means the transaction manager will execute each ...
...some implementations if there is a batch at the top of the undo stack. nsitransaction peekundostack(); parameters none. return value an addref'd pointer to the nsitransaction at the top of the undo stack. redotransaction() pops the topmost transaction on the redo stack, calls it's nsitransaction.redotransaction() method, then pushes it on the undo stack. void redotransaction(); parameters none.
removelistener()
removes a listener from the transaction manager's notification list. the listener's nsitransactionlistener.release() method is called. void
removelistener( in nsitransactionlistener alistener ); parameters alistener the nsitransactionlistener to
remove. undotransaction() pops the topmost transaction on the undo stack, calls it's nsitransaction.undotransaction() method, then push...
nsITreeBoxObject
height the height of the element iscellcropped() determine if the text of a cell is being cropped or not. boolean iscellcropped(in long row, in nsitreecolumn col); parameters row the index of the row col the nsitreecolumn rowcountchanged() notify the tree that the number of rows changed. the view is responsible for calling this notification method when rows are added or
removed. for non-contiguous additions/
removals, this method should be called multiple times. void rowcountchanged(in long index, in long count); parameters index the position at which the new rows were added or at which rows were
removed. count the number of rows added or
removed. use negative values for
removed rows. example you deleted the row with index rowindex. inform the tre...
...this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync. void beginupdatebatch(); endupdatebatch() notify the tree that the view has completed a batch update. ...
nsIURLParser
rectorypos directorylen basenamepos basenamelen extensionpos extensionlen parsepath() breaks the path string up into its 4 major components: a file path, a param string, a query string, and a reference string. ...
...melen extensionpos extensionlen parsepath() breaks the path string up into its 4 major components: a file path, a param string, a query string, and a reference string. ...
nsIWebBrowserPersist
inherits from: nsicancelable last changed in gecko 36.0 (firefox 36.0 / thunderbird 36.0 / seamonkey 2.33) implemented by: @mozilla.org/embedding/browser/nswebbrowser;1 and @mozilla.org/embedding/browser/nswebbrowserpersist;1. ...
...ent) persist_flags_dont_change_filenames 2048 don't make any adjustments to filenames. persist_flags_fail_on_broken_links 4096 fail on broken in-line links. persist_flags_cleanup_on_failure 8192 automatically cleanup after a failed or cancelled operation, deleting all created files and directories. this flag does nothing for failed upload operations to
remote servers. persist_flags_autodetect_apply_conversion 16384 let the webbrowserpersist decide whether the incoming data is encoded and whether it needs to go through a content converter, for example to decompress it. persist_flags_append_to_file 32768 append the downloaded data to the target file. this can only be used when persisting to a local file. persi...
nsIXMLHttpRequest
try to avoid using it. nsixmlhttprequest along with nsijsxmlhttprequest and nsixmlhttprequesteventtarget are mozilla's implementation details of the dom xmlhttprequest object. note: if you're a web developer or a mozilla add-on developer, please refer to the xmlhttprequest documentation instead. this page contains documentation, specific to mozilla application and add-on developers. ...
... req.open('post', "http://www.foo.bar:8080/nietzsche.do", true); req.send('your=data&and=more&stuff=here'); example 2 var {cu: utils, cc: classes, ci: instances} = components; cu.import('resource://gre/modules/services.jsm'); function xhr(url, cb) { let xhr = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); let handler = ev => { evf(m => xhr.
removeeventlistener(m, handler, !1)); switch (ev.type) { case 'load': if (xhr.status == 200) { cb(xhr.response); break; } default: services.prompt.alert(null, 'xhr error', 'error fetching package: ' + xhr.statustext + ' [' + ev.type + ':' + xhr.status + ']'); break; ...
nsIXULTemplateQueryProcessor
methods, except for translateref(). the builder will then call compilequery() for each query in the template to compile the queries. when results need to be generated, the builder will call generateresults(). the initializeforbuilding(), compilequery() and addbinding() methods may not be called after generateresults() has been called until the builder indicates that the generated output is being
removed by calling the done() method. currently, the datasource supplied to the methods will always be an nsirdfdatasource or a dom node, and will always be the same one in between calls to initializeforbuilding() and done(). method overview void addbinding(in nsidomnode arulenode, in nsiatom avar, in nsiatom aref, in astring aexpr); print32 compareresults(in nsixultemplateresult aleft, in nsixu...
...mnode aquery, in nsiatom arefvariable, in nsiatom amembervariable ); parameters abuilder the template builder. aquery <query> node to compile. arefvariable the reference variable. amembervariable the member variable. return value a compiled query object. done() called when the template builder is being destroyed so that the query processor can clean up any state. the query processor should
remove as much state as possible, such as results or references to the builder. this method will also be called when the template is going to be rebuilt. void done(); parameters none. generateresults() generate the results of a query and return them in an enumerator. the enumerator must contain nsixultemplateresult objects. if there are no results, an empty enumerator must be returned. the datasourc...
nsIXULTemplateResult
ord. a result is expected to only be created by a query processor. each result also contains a set of variable bindings. the value for a particular variable may be retrieved using the getbindingfor() and getbindingobjectfor() methods. method overview astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeen
removed(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id astring id of the result. the dom element created for this result, if any, will have its id attribute set to this value. the id must be unique for a query. iscontainer boolean t...
...le such as ?name for this result. this method may return null for a variable, even if getbindingfor() returns a non-null value for the same variable. this method is provided as a convenience when sorting results. nsisupports getbindingobjectfor( in nsiatom avar ); parameters avar the variable to look up. return value the value for the variable or null if it has no value. hasbeen
removed() indicate that the output for a result has been
removed and that the result is no longer being used by the builder. void hasbeen
removed(); parameters none. rulematched() indicate that a particular rule of a query has matched and that output will be generated for it. both the query as compiled by the query processor's nsixultemplatequeryprocessor.compilequery() method and the xul <rule> elem...
nsIXULWindow
contextflags pruint32 contextflags are from nsiwindowcreator2. docshell nsidocshell the docshell owning the xul for this window. read only. intrinsicallys...
..., or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content shell, which is the same as the "type" attribute on the containing frame element. return value the tree item corresponding to the given id, if any.
removechildwindow() tell this window that it has lost a child xul window. note that xul windows do not currently track child xul windows. void
removechildwindow( in nsixulwindow achild ); parameters achild the child window being
removed. showmodal() shows the window as a modal window. that is, ensures that it is visible and runs a local event loop, exiting only once the window has been c...
nsIZipReader
ith the character represented by 'a' having a lower ascii value than the character represented by 'z'. [^az] matches any character except a or z. if ] is to appear inside the brackets as a character to not match, it must be escaped. pat~pat2 returns matches to the pattern 'pat' which do not also match the pattern 'pat2'. this may be used to perform filtering upon the results of one pattern to
remove all matches which also match another pattern. for example, because '*' matches any string and '*z*' matches any string containing a 'z', '*~*z*' will match all strings except those containing a 'z'. note that a pattern may not use '~' multiple times, so a string such as '*~*z*~*y*' is not a valid pattern. (foo|bar) will match either the pattern foo or the pattern bar. neither of the patterns...
...; //services.ww.activewindow.alert(pathtoxpitoread); try { zr.open(nsifilexpi); //if file dne it throws here var entries = zr.findentries('*'); //we use asterik because we want everything listed out while (entries.hasmore()) { var entrypointer = entries.getnext(); //just a string of "zip path" (this means path to file in zip, and it uses forward slashes
remember) var entry = zr.getentry(entrypointer); // should return true on `entry instanceof ci.nsizipentry` console.log('entrypointer', entrypointer); /* console output * "entrypointer" "bootstrap.js" scratchpad/1:18 */ console.info('entry', entry); /* console output * "entry" xpcwrappednative_nohelper { queryinterface: queryinterface...
NS_CStringCutData
« xpcom api reference summary the ns_cstringcutdata function
removes a section of the string's internal buffer. this is a low-level api. #include "nsstringapi.h" nsresult ns_cstringcutdata( nsacstring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsacstring instance to be modified. acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. pass pr_uint32_max to specify the length from acutstart to the end of the string. return values the ns_cstringcutdata function returns ns_ok if successful. otherwise, it returns an error code.
remarks this function is defined inline as a wrapper around ns_cstringsetdatarange . exa...
...pass pr_uint32_max to specify the length from acutstart to the end of the string. return values the ns_cstringcutdata function returns ns_ok if successful. otherwise, it returns an error code.
remarks this function is defined inline as a wrapper around ns_cstringsetdatarange . example code nscstringcontainer str; ns_cstringcontainerinit(str); ns_cstringsetdata(str, "hello world"); //
remove " world" portion of string ns_cstringcutdata(str, 5, pr_uint32_max); const char* data; ns_cstringgetdata(str, &data); printf("%s\n", data); // prints out "hello" ns_cstringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_cstringsetdatarange , nsacstring ...
NS_StringCopy
the implementation may employ reference counting techniques to optimize this operation. ...
... this is a low-level api. #include "nsstringapi.h" nsresult ns_stringcopy( nsastring& adeststring, const nsastring& asrcstring ); parameters adeststring [in] a nsastring instance to be modified. asrcstring [in] a nsastring instance containing the new string value. return values the ns_stringcopy function returns ns_ok if successful. otherwise, it returns an error code.
remarks this function is designed to allow the implementation to efficiently assign the same value to two string objects. the implementation may employ reference counting techniques to optimize this operation. example code /* attribute acstring value; */ ns_imethodimp mycomponent::getvalue(nsastring& avalue) { return ns_stringcopy(avalue, mvalue); } ns_imethodimp mycomponent::setval...
NS_StringCutData
« xpcom api reference summary the ns_stringcutdata function
removes a section of the string's internal buffer. this is a low-level api. #include "nsstringapi.h" nsresult ns_stringcutdata( nsastring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsastring instance to be modified. acutstart [in] the starting index of the section to
remove, measured in storage units. acutlength [in] the length of the section to
remove, measured in storage units. pass pr_uint32_max to specify the length from acutstart to the end of the string. return values the ns_stringcutdata function returns ns_ok if successful. otherwise, it returns an error code.
remarks this function is defined inline as a wrapper around ns_stringsetdatarange. note: gcc...
...see bug 239123 for details. ...
XPCOM string functions
ns_cstringcontainerinit function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcontainerinit2the ns_cstringcontainerinit2 function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcopythe ns_cstringcopy function copies the value from one nsacstring instance to another. this is a low-level api.ns_cstringcutdatathe ns_cstringcutdata function
removes a section of the string's internal buffer. this is a low-level api.ns_cstringgetdatathe ns_cstringgetdata function gives the caller read access to the string's internal buffer.ns_cstringgetmutabledatathe ns_cstringgetmutabledata function gives the caller write access to the string's internal buffer.ns_cstringinsertdatathe ns_cstringinsertdata function appends data to the existing value of a n...
...eleases any memory allocated by a nsstringcontainer instance. this is a low-level api.ns_stringcontainerinitthe ns_stringcontainerinit function initializes a nsstringcontainer instance for use as a nsastring. this is a low-level api.ns_stringcopythe ns_stringcopy function copies the value from one nsastring instance to another. this is a low-level api.ns_stringcutdatathe ns_stringcutdata function
removes a section of the string's internal buffer. this is a low-level api.ns_stringgetdatathe ns_stringgetdata function gives the caller access to the string's internal buffer. this is a low-level api.ns_stringinsertdatathe ns_stringinsertdata function appends data to the existing value of a nsacstring instance. this is a low-level api.ns_stringsetdatathe ns_stringsetdata function copies data into t...
nsIAbCard/Thunderbird3
numbertype jobtitle, department, company _aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularityindex prefermailformat (see nsiabprefermailformat) boolean properties: allow
remotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pruint32 getpropertyasuint32(in string name); [noscript] boolean getpropertyasbool(in st...
...etproperty and setproperty. lastname astring shorthand for getproperty and setproperty. displayname astring shorthand for getproperty and setproperty. primaryemail astring shorthand for getproperty and setproperty. ismaillist boolean if ismaillist is true then maillisturi will contain the uri of the associated mail list. this will be
removed from the interface at a later date. maillisturi string if ismaillist is true then maillisturi will contain the uri of the associated mail list. this will be
removed from the interface at a later date. methods getproperty() returns a property for the given name. nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); parameters name ...
Using the Gecko SDK
this guide explains how to build xpcom components in c++ using the gecko sdk. introduction it is assumed that you already know something about xpcom component development. (more information on xpcom is available at the xpcom project page.) the intent of this guide is to help you build your components "the right way" such that they will
remain compatible with future versions of mozilla. for information on how to retrieve and install the gecko sdk, see here. an xpcom component will be compatible with future versions of mozilla if it only makes use of frozen gecko apis. a frozen gecko api is one that is included in the gecko and marked frozen with the text <tt>@status frozen</tt> (with nspr as the exception to the rule). the frozen gecko api consists of a set of component interfaces (c...
...ed from the xpcom library and the nspr libraries. the abi of the component interfaces depends on the c++ abi of the host compiler (i.e., the vtable format and calling conventions of the virtual methods may vary from compiler to compiler). the gecko abi is therefore compiler sensitive. (<tt>about:buildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the
remainder of this guide, we'll assume you are developing components under linux. (ports of this guide are welcome.) a "frozen" interface or function is guaranteed to be supported by future versions of same major version of the platform. the sdk contains headers for all of the frozen interfaces and functions, and it also contains headers for classes and functions defined in the glue libraries. when th...
Weak reference
it's key to note that an nsweakptr has exactly the same interface as an nscomptr. in fact, nsweakptr is defined like this typedef nscomptr<nsiweakreference> nsweakptr; well this sucks! by now you've probably noticed that this particular weak reference implementation doesn't give you exactly the interface you were ...
...lly 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 requi
rements to allow com to work. among these requi
rements is that every call to queryinterface against the same (aggragate) object for the same interface must yield the same result, no matter what interface pointer you call it through, and no matter when you call it. this is impossible in our situation, since we explicitly rely on the the fact that part of the `aggregate' can be destroyed. subsequent at...
XPCOM category image-sniffing-services
...
...to allow "third-party" xpcom components to identify images based on their content. if mozilla's built-in image code cannot identify an image, then any xpcom components implementing the nsicontentsniffer interface may register under the "image-sniffing-services" category, and will be queried to determine the mime type of the image being downloaded. note: this category was
removed. see bug 813787 -
remove support for image-sniffing-services. ...
Address Book examples
ection (see above), you can search for cards with particular properties within that collection using getcardfromproperty. this function will return the first match that it finds in the collection or null. let collection = ... let card = collection.getcardfromproperty("jobtitle", "software engineer", false); if you are searching for a card with a particular email address, you can use the cardfo
remailaddress function that will match against multiple email addresses stored in one card. again, this function returns the first match that it finds in the collection, or null. let collection = ... let card = collection.cardfo
remailaddress("foo@bar.invalid.com"); note: both of these functions may raise an ns_error_not_implemented exception if the collection has not implemented that function. thi...
.... assuming you wish to search across multiple directories: let abmanager = components.classes["@mozilla.org/abmanager;1"] .getservice(components.interfaces.nsiabmanager); let alladdressbooks = abmanager.directories; while (alladdressbooks.hasmoreelements()) { let ab = alladdressbooks.getnext(); if (ab instanceof components.interfaces.nsiabdirectory && !ab.is
remote) { let searchresult = abmanager.getdirectory(ab.uri + "?" + searchquery).childcards; // ... use searchresult as required. } } note: this method doesn't work with
remote address books (e.g. ldap). hence the additional !ab.is
remote check how do i add/edit/delete contacts? note: not all address books can be written to. use the nsiabcollection.readonly attribute to determine the rea...
Spam filtering
is does not work for news, but it would be possible to add support for this. (there is a bug on it.). ...
... unknown (user can't see this, looks like "not junk") mark as junk add tokens to bad unknown (user can't see this, looks like "not junk") mark as not junk add tokens to good not junk mark as junk
remove tokens from good, add tokens to bad not junk mark as not junk no op junk mark as junk no op junk mark as not junk
remove tokens from bad, add tokens to good ...
Building a Thunderbird extension 5: XUL
: <statusbar id="status-bar" ...> ... <statusbarpanel>s ... </statusbar> <statusbar id="status-bar"> is a "merge point" for a xul overlay. xul overlays are a way of attaching other ui widgets to a xul document at run time. a xul overlay is a .xul file that specifies xul fragments to insert at specific merge points within a "master" document. these fragments can specify widgets to be inserted,
removed or modified. in this example you are adding a line to the indented statusbar. therefore it becomes an item owned by the id called "status-bar". this shows how the thunderbird architecture allows extensions to modify the user experience without modifying the installation files. this also enables version independence between thunderbird and thunderbird extensions. example xul overlay document...
...nderbird's statusbar and display "date". we have also added a <script> tag that contains a reference to the javascript file overlay.js. in the next section you will learn how to use javascript to modify your label so that it shows the current date. the overlay.js file will be created in a later section and your add-on will still work if the file is missing. for now you can ignore this line, but
remember that this is how you reference a javascript file. « previousnext » ...
Finding the code for a feature
d to follow my usual path and document what i do: hello i would like to add colours and tags to specific emails...by using nsimsgtagservice, can this be done? here is my (edited) response: nsimsgtagservice is used to store the list of valid tags, so it is not the correct way to tag messages. tags are applied using the message database property "keyword". i know the underlying code, but i don't
remember the user interface level function to do it. but here is how i find out. there are two key tools that you need. the first is the dom inspector extension which i have routinely installed in all of my thunderbird installations. (for debug builds, you can make it appear by default using "ac_add_options --enable-extensions=default,venkman,inspector" which is part of my standard configuration). t...
... action involved. oops, i guess i need to get the submenu instead. repeating this process, i see that the submenu items all call a function togglemessagetagmenu. looking that up in mxr, its underlying function uses a very strange call prevhdrfolder[toggler](messages, key) to change the key. trying to figure that out from the code, i see that is just a clever way to do the addkeywordstomessages or
removekeywordsfrommessages method call. (please don't do that guys, it really makes code search difficult!) so the answer the your question is, use the nsimsgfolder method "addkeywordstomessages" (and now i
remember that i knew that!). if you want examples, scan mxr for addkeywordstomessages. you'll find that the only decent examples are in unit tests, my test_bug428427.js or asuth's messagemodifie...
Activity Manager examples
null); // note that we don't define a custom icon, default process icon // will be used process.contexttype = "account"; // group this activity by account process.contextobj = folder.server; // account in question gactivitymanager.addactivity(process); // step 2: showing some progress let percent = 50; process.setprogress(percent, "junk processing 25 of 50 messages", 25, 50); // step 3:
removing the process and adding an event using process' attributes process.state = components.interfaces.nsiactivityprocess.state_completed; gactivitymanager.
removeactivity(process.id); let event = components.classes["@mozilla.org/activity-event;1"].createinstance(nsiae); // localization is omitted, initiator is omitted event.init(folder.prettiestname + " is processed", null, ...
...cel: function(aactivity) { let initiator = aactivity.initiator; if (initiator) { let folder = aactivity.getsubjects({})[0]; .... // assuming that the initiator has some way to cancel // the junk processing for given folder if (initiator.cancelfolderop(folder)) { aactivity.state = components.interfaces.nsiactivityprocess.state_canceled; gactivitymanager.
removeactivity(aactivity.id); return cr.ns_success; } } return cr.ns_failure; } } // step 2: modify the previous sample to add initiator, subject // and associate a nsiactivitycancelhandler component ... // assuming that gjunkprocessor is the entity initiating the junk processing // activity, and it has cancelfolderop method that cancels the operations on folders process.init("proc...
Using popup notifications
of your secondary actions from the drop-down menu, the corresponding callback is invoked. choosing the "not now" option dismisses the notification; it can be brought back by clicking on the notification icon again. implementing a timeout function for the popup notification you can use a timeout to make your notification automatically disappear after some amount of time, by calling notification.
remove() as shown below. components.utils.import('resource://gre/modules/popupnotifications.jsm'); var notify = new popupnotifications(gbrowser, document.getelementbyid("notification-popup"), document.getelementbyid("notification-popup-box")); var notification = notify.show( // browser gbrowser.selectedbrowser, // popup id "pdes-popup", // message "hi, ther...
... ...
Add to iPhoto
roduced in that build. cfmutablearray one thing about core foundation types that is interesting is the use of regular and mutable versions of the same data types. for example, the cfarray type describes an array, but cfarray objects can't be changed once they've been created. however, obviously there are cases in which you'll want to be able to manipulate the contents of an array by adding and
removing items, sorting them, and so forth. that's where the cfmutablearray type comes into play. all cfarray functions accept cfmutablearray objects, so you can use cfmutablearray with any routine that accepts a cfarray as input, but cfmutablearray supports additional functions that let you change the contents of the array. there's nothing particularly interesting about how we declare this api, but...
...e. it gets the filename of the file being download by slicing it off the end of the specified image url, then obtains the path to the temporary items folder and appends the image file's name to that path. then we call createunique() to create a unique file by that name (or a derivative thereof if the name is already in use), and download the contents of the image file to that local file. closing
remarks this is a fairly simple example of how to use js-ctypes, but it actually does something useful, and should be a helpful demonstration not just for how to use js-ctypes, but also more specifically for developers that want to interface with mac os x system frameworks. ...
Flash Activation: Browser Comparison - Plugins
nce. the firefox flash roadmap includes links to roadmaps and posts from other vendors. ui comparison mozilla firefox in-page ui is displayed when the site attempts to use flash. an icon also appears on the left side of the location bar. the user can click on the flash object or the location bar icon to activate flash: users have the choice to allow flash just for the current session, or to
remember their choice: google chrome in-page ui is displayed when the site attempts to use flash without fallback content: a user can click the plugin element to show a prompt for allowing flash: if the site provides fallback content for an object element, chrome will display that content and will not prompt the user to enable flash. if a flash element is not visible to the user, the user w...
...mation icon on the left side of the location bar on any site to open the site information and allow flash on that site: microsoft edge in-page ui is displayed when the site attempts to use flash. an icon also appears on the right side of the location bar. the user can click the flash object to show activation options: users have the choice to allow flash just for the current session, or to
remember their choice: site authoring tips if a flash element is very small, hidden, or covered by other content, users will probably not notice that flash is required and will become confused. even if the plugin element will eventually be hidden, pages should create the plugin element so that it's visible on the page, and should resize or hide it only after the user has activated the plugin. thi...
URLs - Plugins
ethod as the http server method post, which transmits data to the server. you can use npn_posturl to post data to a url from a memory buffer or file. the result from the server can also be sent to a particular browser window or frame for display, or delivered to the plug-in instance in a new stream. plug-ins can use this capability to post form data to cgi scripts using http or upload files to a
remote server using ftp. the browser resolves this method as the http server method post, which transmits data to the server. the data to post can be contained either in a local temporary file or a new memory buffer. to post a file, set the flag file to true, the buffer buf to the path name string for a file, and len to the length of the path string. the file-type url prefix "file://" is optional. ...
... displayed in a new window. char* ppostdata = "content-type:\tapplication/x-www-form-urlencoded\ncontent-length:\t17\n\nname=aaashun@gmail.com\n"; uint32 npostdatalen = (uint32)strlen(ppostdata); npn_posturl(npinstance, "http://www.baidu.com","_blank", npostdatalen, ppostdata, false); uploading files to an ftp server plug-ins can use npn_posturl or npn_posturlnotify to upload files to a
remote server using ftp. this example uploads a file from the root of the local file system to an ftp server and displays the response in a frame named response: char* mydata = "file:///c\/mydirectory/myfilename"; uint32 mylength = strlen(mydata) + 1; err = npn_posturl(instance, "ftp://fred@ftp.example.com/pub/", "response", mylength, mydata, true); sending mail a plug-in ca...
Browser Console - Firefox Developer Tools
tails. but while the web console executes code in the scope of the content window it's attached to, the browser console executes code in the scope of the chrome window of the browser. ...
...ng, closing tabs and windows and changing the content that they host, and modify the browser's ui by creating, changing and
removing xul elements. controlling the browser the command line interpreter gets access to the tabbrowser object, through the gbrowser global, and that enables you to control the browser through the command line. ...
Browser Toolbox - Firefox Developer Tools
whole browser rather than just single page on a single tab. note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger. use the browser toolbox for add-ons that are neither. enabling the browser toolbox the browser toolbox is not enabled by default. to enable it you need to check the settings "enable chrome and addon debugging" and "enable
remote debugging". to do this, open the developer tools settings, go to the section "advanced settings", and check the settings "enable browser chrome and add-on debugging toolboxes" and "enable
remote debugging". opening the browser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift ...
...the settings "enable browser chrome and add-on debugging toolboxes" and "enable
remote debugging". opening the browser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift + i key combination ( cmd + opt +shift + i on a mac). you will be presented with a dialog like this (it can be
removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser toolbox will open in its own window: you'll be able to inspect the browser's chrome windows and see, and be able to debug, all the javascript files loaded by the browser itself and by any add-ons that are running. altogether you will have access to the following developer tools: debugger (no...
Using the Debugger map scopes feature - Firefox Developer Tools
copes (e.g., a bundle file with all concatenated module files). let's take a look at how this works. if you want to follow along, use this example. open the example page and then open the debugger using tools > web developer > debugger (or press ctrl + i and then select the debugger). select the "bundle.js" file in the sources panel on the left and then set a breakpoint at line 102 in the inc
rement function. when you click the inc
rement button on the page and hit the breakpoint, an additional section is added to the right-hand panel below the call stack to display variables mapped from the original scope, like this: as useful as this is, it would be even nicer if you could view the original code (before it was packages into the "bundle.js" file. right-click on the source code and...
...ck to display variables mapped from the original scope, like this: as useful as this is, it would be even nicer if you could view the original code (before it was packages into the "bundle.js" file. right-click on the source code and the context menu now includes an option to jump to original location as shown below. click jump to original location. the debugger opens the file "inc
rement.js" so you can view the original code. notice that your breakpoint is set here in the original code as it was in the corresponding line in the "bundle.js" file. and, since map has been checked in the scopes panel, you also see variable symbols from the original code. using this feature is expensive in terms of resources, but it certainly makes your life easier when you have to debug so...
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
ee(w.wrappedjsobject); // enable allocation tracking in dbg's debuggees. dbg.memory.trackingallocationsites = true; } window.demoplotallocations = function() { // grab the allocation log. var log = dbg.memory.drainallocationslog(); // neutralize the debugger, and drop it on the floor // for the gc to collect. console.log("stopping allocation tracking."); dbg.
removealldebuggees(); dbg = undefined; // analyze and display the allocation log. plot(log); } function handleuncaughtexception(ex) { console.log('debugger hook threw:'); console.log(ex.tostring()); console.log('stack:'); console.log(ex.stack); }; function plot(log) { // given the log, compute a map from allocation sites to // allocation counts. note tha...
...stand that they // are safe for chrome code to use, so we must tell it // so explicitly. site = components.utils.waivexrays(site.frame); if (!counts.has(site)) counts.set(site, 0); counts.set(site, counts.get(site) + 1); } // walk from each site that allocated something up to the // root, computing allocation totals that include // children.
remember that 'null' is a valid site, // representing the root. var totals = new map; for (let [site, count] of counts) { for(;;) { if (!totals.has(site)) totals.set(site, 0); totals.set(site, totals.get(site) + count); if (!site) break; site = site.parent; } } // compute parent-to-child links, since saved stack fram...
Dominators view - Firefox Developer Tools
he 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. ...
... example let's see how some simple code is reflected in the dominators view. ...
Work with animations - Firefox Developer Tools
on-inspector-compositing.html and click the red rectangle, a simple opacity animation will start. if you look at this in the animation inspector in firefox 49+, you'll see that: the white lightning bolt icon now indicates whether all the animation properties have been optimized by running them through the compositor, where possible. the bar tooltip also includes this information, as a further
reminder. you'll get a message of "all animation properties are optimized." the expanded animation information now includes a lightning bolt icon next to the properties whose animation has been optimized via the compositor. let's now look at animation-inspector-compositing-silly.html — this is the same example, except that now once the red rectangle is clicked we animate both the left and tran...
...perty is deliberately not handed over to the compositor to handle. the animation inspector will tell you this — look at it now and you'll see that: the white lightning bolt icon in the bar has been replaced with a grey lightning bolt icon, to indicate that only some of the relevant properties are being optimized by the compositor. the bar tooltip also includes this information, as a further
reminder. you'll get a message of "some animation properties are optimized." properties whose animation is not being optimized, but could be if you improved your code, are now given a dotted underline — see transform in the screenshot below. hovering over this gives you a tooltip that explains why. in this case, the message is "animations of 'transform' cannot be run on the compositor when geometr...
Page inspector keyboard shortcuts - Firefox Developer Tools
return or space enter or space cycle up and down through auto-complete suggestions (rules view only, when a property or value is being edited) up arrow , down arrow up arrow , down arrow up arrow , down arrow choose current auto-complete suggestion (rules view only, when a property or value is being edited) enter or tab return or tab enter or tab inc
rement selected value by 1 up arrow up arrow up arrow dec
rement selected value by 1 down arrow down arrow down arrow inc
rement selected value by 100 shift + page up shift + page up shift + page up dec
rement selected value by 100 shift + page down shift + page down shift + page down inc
rement selected value by 10 shift + up arr...
...rrow dec
rement selected value by 1 down arrow down arrow down arrow inc
rement selected value by 100 shift + page up shift + page up shift + page up dec
rement selected value by 100 shift + page down shift + page down shift + page down inc
rement selected value by 10 shift + up arrow shift + up arrow shift + up arrow dec
rement selected value by 10 shift + down arrow shift + down arrow shift + down arrow inc
rement selected value by 0.1 alt + up arrow (ctrl + up arrow from firefox 60 onwards.) alt + up arrow alt + up arrow (ctrl + up arrow from firefox 60 onwards.) dec
rement selected value by 0.1 alt + down arrow (ctrl + down arrow from firefox 60 onwards). alt + down arrow ...
Page Inspector - Firefox Developer Tools
user interface tour to find your way around the inspector, here's a quick tour of the ui. you can split the rules view out into its own pane, separate from the other tabs on the css pane — this is called 3-pane mode. ...
... user interface tour to find your way around the inspector, here's a quick tour of the ui. you can split the rules view out into its own pane, separate from the other tabs on the css pane — this is called 3-pane mode. ...
Settings - Firefox Developer Tools
but not enabled by default. available toolbox buttons this group of checkboxes determines which tools get an icon in the toolbox's toolbar. as of firefox 62, if the option to "select an iframe as the currently targeted document" is checked, the icon will appear in the toolbar while the settings tab is displayed, even if the current page doesn't include any iframes. note that in firefox 52 we
removed the checkbox to toggle the "select element" button. the "select element" button is now always shown. themes this enables you to choose one of two themes. there's a light theme, which is the default: a dark theme: common preferences settings that apply to more than one tool. there's just one of these: enable persistent logs a setting to control whether or not the...
...hat this affects the http cache, and not service workers/the cache api. disable javascript reload the current tab with javascript disabled. enable service workers over http enable service worker registrations from insecure websites. enable browser chrome and add-on debugging toolboxes enable you to use developer tools in the context of the browser itself, and not only web content. enable
remote debugging enable the developer tools to debug
remote firefox instances. enable worker debugging enable a panel within the debugger to debug workers. note: this option got
removed from the ui in firefox 56, because this version ships with a new debugger ui, but it can still be enabled for the old ui by setting the preference devtools.debugger.workers to true. ...
Web Console Helpers - Firefox Developer Tools
e different ways of identifying the frame to switch to. you can supply any of the following: a selector string to be passed to document.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes. clear() clears the console output area. clearhistory() just like a normal command line, the console command line
remembers the commands you've typed. use this function to clear the console's command history. copy() copies the argument to the clipboard. if the argument is a string, it's copied as-is. if the argument is a dom node, its outerhtml is copied. otherwise, json.stringify will be called on the argument, and the result will be copied to the clipboard. help()deprecated since gecko 62 :help displays h...
...the webpage which are outside the current bounds of the window will be included in the screenshot. when used, "-fullpage" will be appended to the file name. --selector string the css query selector for a single element on the page. when supplied, only this element will be included in the screenshot. :unblock (starting in firefox 80) followed by an unquoted string,
removes blocking for urls containing that string. in the network monitor, the string is
removed from the request blocking sidebar. no error is given if the string was not previously blocked. values() given an object, returns a list of the values on that object; serves as a companion to keys(). please refer to the console api for more information about logging from content. variables tempn th...
The JavaScript input interpreter - Firefox Developer Tools
mode and still use your function. syntax highlighting the text you enter has syntax highlighting as soon as you have typed enough for the highlighter to parse it and infer the meanings of the "words". the output is highlighted as well where appropriate. note: syntax highlighting is not visible in your browser if accessibility features have been enabled. execution history the interpreter
remembers expressions you've typed. to move back and forward through your history: in single-line mode, use the up and down arrows. in multi-line mode, use the ⋀ and ⋁ icons in the editing panel's toolbar. the expression history is persisted across sessions. to clear the history, use the clearhistory() helper function. you can initiate a reverse search through the expression history, muc...
... see working with iframes. copy() new in firefox 38. copy the argument to the clipboard. if the argument is a string, it's copied as-is. if the argument is a dom node, its outerhtml is copied. otherwise, json.stringify will be called on the argument, and the result will be copied to the clipboard. clearhistory() new in firefox 39. just like a normal command line, the console command line
remembers the commands you've typed. use this function to clear the console's command history. :screenshot new in firefox 62. create a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named: screen shot yyy-mm-dd at hh.mm.ss.png the command has the following optional parameters: command type description ...
AnimationEvent.initAnimationEvent() - Web APIs
do not use this method; instead, use the standard constructor, animationevent(), to create a synthetic animationevent. ...
...do not use this method; instead, use the standard constructor, animationevent(), to create a synthetic animationevent. ...
AudioParam.setValueAtTime() - Web APIs
pen. a typeerror is thrown if this value is negative. returns a reference to this audioparam object. in some browsers older implementations of this interface return void. examples this simple example features a media element source with two control buttons (see our webaudio-examples repo for the source code, or view the example live). ...
...rror is thrown if this value is negative. returns a reference to this audioparam object. in some browsers older implementations of this interface return void. examples this simple example features a media element source with two control buttons (see our webaudio-examples repo for the source code, or view the example live). ...
AuthenticatorAttestationResponse.getTransports() - Web APIs
note: an authenticatorattestationresponse instance is available on publickeycredential.response after calling navigator.credentials.create(). ...
...attestationresponse.gettransports() parameters none. return value an array containing the different transports supported by the authenticator or nothing if this information is not available.of the processing of the different extensions by the client. the elements of this array are supposed to be in lexicographical order. their values may be : "usb": the authenticator can be contacted via a
removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be
removed). examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { ...
BatteryManager - Web APIs
e system's battery charge level. the navigator.getbattery() method returns a battery promise that is resolved in a batterymanager interface which you can use to interact with the battery status api. properties batterymanager.charging read only a boolean value indicating whether or not the battery is currently being charged. batterymanager.chargingtime read only a number representing the
remaining time in seconds until the battery is fully charged, or 0 if the battery is already fully charged. batterymanager.dischargingtime read only a number representing the
remaining time in seconds until the battery is completely discharged and the system will suspend. batterymanager.level read only a number representing the system's battery charge level scaled to a value between 0.0 and 1.0...
...hange a handler for the dischargingtimechange event; this event is sent when the battery discharging time is updated. batterymanager.onlevelchange a handler for the levelchange event; this event is sent when the battery level is updated. methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget. eventtarget.
removeeventlistener()
removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. void seteventhandler(domstring type, eventhandler handler) eventha...
CSSStyleDeclaration - Web APIs
t". cssstyledeclaration.getpropertyvalue() returns the property value given a property name. cssstyledeclaration.item() returns a css property name by its index, or the empty string if the index is out-of-bounds. an alternative to accessing nodelist[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implementations. cssstyledeclaration.
removeproperty()
removes a property from the css declaration block. cssstyledeclaration.setproperty() modifies an existing css property or creates a new css property in the declaration block. cssstyledeclaration.getpropertycssvalue() only supported via getcomputedstyle in firefox. returns the property value as a cssprimitivevalue or null for shorthand properties. example var styleobj = docu...
... css property in the declaration block. cssstyledeclaration.getpropertycssvalue() only supported via getcomputedstyle in firefox. returns the property value as a cssprimitivevalue or null for shorthand properties. example var styleobj = document.stylesheets[0].cssrules[0].style; console.log(styleobj.csstext); for (var i = styleobj.length; i--;) { var namestring = styleobj[i]; styleobj.
removeproperty(namestring); } console.log(styleobj.csstext); specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration' in that specification. working draft merged the dom level 2 style css2properties interface into cssstyledeclaration. document object model (dom) level 2 style specificationthe definition o...
Managing screen orientation - Web APIs
on changes is when you want to revise the layout of your content based on the orientation of the device. for example, perhaps you want a button bar to stretch along the longest dimension of the device's display. by using a media query, you can do this easily and automatically. let's have an example with the following html code <ul id="toolbar"> <li>a</li> <li>b</li> <li>c</li> </ul> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. duis lacinia nisi nec sem viverra vitae fringilla nulla ultricies. in ac est dolor, quis tincidunt leo. cras commodo quam non tortor consectetur eget rutrum dolor ultricies. ut interdum tristique dapibus. nullam quis malesuada est.</p> css relies on the orientation media query to handle specific styles based on the screen orientation /* first ...
... ...
Drawing text - Web APIs
measuretext() returns a textmetrics object containing the width, in pixels, that the specified text will be when drawn in the current text style. the following code snippet shows how you can measure a text and get its width. function draw() { var ctx = document.getelementbyid('...
...width. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); var text = ctx.measuretext('foo'); // textmetrics object text.width; // 16; } gecko-specific notes in gecko (the rendering engine of firefox, firefox os and other mozilla based applications), some prefixed apis were implemented in earlier versions to draw text on a canvas. these are now deprecated and
removed, and are no longer guaranteed to work. « previousnext » ...
Optimizing canvas - Web APIs
to round all co-ordinates used in calls to drawimage() using math.floor(), for example. don’t scale images in drawimage cache various sizes of your images on an offscreen canvas when loading as opposed to constantly scaling them in drawimage(). use multiple layered canvases for complex scenes in your application, you may find that some objects need to move or change frequently, while others
remain relatively static. a possible optimization in this situation is to layer your items using multiple <canvas> elements. for example, let's say you have a game with a ui on top, the gameplay action in the middle, and a static background on the bottom. in this case, you could split your game into three <canvas> layers. the ui would change only upon user input, the gameplay layer would change with...
...ion in this situation is to layer your items using multiple <canvas> elements. for example, let's say you have a game with a ui on top, the gameplay action in the middle, and a static background on the bottom. in this case, you could split your game into three <canvas> layers. the ui would change only upon user input, the gameplay layer would change with every new frame, and the background would
remain generally unchanged. <div id="stage"> <canvas id="ui-layer" width="480" height="320"></canvas> <canvas id="game-layer" width="480" height="320"></canvas> <canvas id="background-layer" width="480" height="320"></canvas> </div> <style> #stage { width: 480px; height: 320px; position: relative; border: 2px solid black; } canvas { position: absolute; } #ui-layer { z...
Transformations - Web APIs
e with the default settings. next we save this state and make changes to the fill color. we then draw the second and smaller blue rectangle and save the state. again we change some drawing settings and draw the third semi-transparent white rectangle. so far this is pretty similar to what we've done in previous sections. however once we call the first restore() statement, the top drawing state is
removed from the stack, and settings are restored. if we hadn't saved the state using save(), we would need to change the fill color and transparency manually in order to return to the previous state. this would be easy for two properties, but if we have more than that, our code would become very long, very fast. when the second restore() statement is called, the original state (the one we set up be...
... the current origin by the angle number of radians. the rotation center point is always the canvas origin. to change the center point, we will need to move the canvas by using the translate() method. a rotate example in this example, we'll use the rotate() method to first rotate a rectangle from the canvas origin and then from the center of the rectangle itself with the help of translate().
reminder: angles are in radians, not degrees. to convert, we are using: radians = (math.pi/180)*degrees. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); // left rectangles, rotate from canvas origin ctx.save(); // blue rect ctx.fillstyle = '#0095dd'; ctx.fillrect(30, 30, 100, 100); ctx.rotate((math.pi / 180) * 25); // grey rect ctx.fillstyle = '#4d...
Canvas API - Web APIs
'); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 150, 100); result reference htmlcanvaselement canvasrenderingcontext2d canvasgradient canvasimagesource canvaspattern imagebitmap imagedata renderingcontext textmetrics offscreencanvas path2d imagebitmaprenderingcontext note: the interfaces related to the webglrenderingcontext are referenced under webgl. canvascaptu
remediastream is a related interface. guides and tutorials canvas tutorial a comprehensive tutorial covering both the basic usage of the canvas api and its advanced features. html5 canvas deep dive a hands-on, book-length introduction to the canvas api and webgl. canvas handbook a handy reference for the canvas api. demo: a basic ray-caster a demo of ray-tracing animation using canvas. ma...
...the canvas api and its advanced features. html5 canvas deep dive a hands-on, book-length introduction to the canvas api and webgl. canvas handbook a handy reference for the canvas api. demo: a basic ray-caster a demo of ray-tracing animation using canvas. manipulating video using canvas combining <video> and <canvas> to manipulate video data in real time. libraries the canvas api is ext
remely powerful, but not always simple to use. the libraries listed below can make the creation of canvas-based projects faster and easier. easeljs is an open-source canvas library that makes creating games, generative art, and other highly graphical experiences easy. fabric.js is an open-source canvas library with svg parsing capabilities. heatmap.js is an open-source library for creating canva...
ChildNode - Web APIs
the childnode mixin contains methods and properties that are common to all types of node objects that can have a parent. it's implemented by element, documenttype, and characterdata objects. properties there are neither inherited, nor specific properties. methods there are no inherited methods. childnode.
remove()
removes this childnode from the children list of its parent. childnode.before() inserts a set of node or domstring objects in the children list of this childnode's parent, just before this childnode. domstring objects are inserted as equivalent text nodes. childnode.after() inserts a set of node or domstring objects in the children list of this childnode's parent, just after this childnode. domstring objects are inserted as equivalent text nodes. childnode.replace...
... as equivalent text nodes. specifications specification status comment domthe definition of 'childnode' in that specification. living standard split the elementtraversal interface in parentnode and childnode. previouselementsibling and nextelementsibling are now defined on the latter. the characterdata and documenttype implemented the new interfaces. added the
remove(), before(), after() and replacewith() methods. element traversal specificationthe definition of 'elementtraversal' in that specification. obsolete added the initial definition of its properties to the elementtraversal pure interface and use it on element. polyfill external on github: childnode.js ...
Constraint validation API - Web APIs
trols, such as <input>, <select> and <textarea>, can restrict the format of allowable values, using attributes like required and pattern to set basic constraints. however, you may want to impose more complex constraints, or to provide clearer reporting of validation failures than the defaults. this can be done using the constraint validation api. note: client-side constraint validation doesn't
remove the need for validation on the server side. even though client-side validation can prevent many common kinds of invalid values, invalid ones can still be sent by older browsers or by attackers trying to trick your web application. therefore, you need to also validate input values on the server side, in a way that is consistent with what is done on the client side. client side validation is a t...
...lue. we therefore do this every time the input event is raised. if you don't do this, and a custom validity was previously set, the input will register as invalid, even if it current contains a valid value on submission. note: firefox supported a proprietary error attribute — x-moz-errormessage — for many versions, which allowed you set custom error messages in a similar way. this has been
removed as of version 66 (see bug 1513890). specifications specification status comment html living standardthe definition of 'constraint validation api' in that specification. living standard html 5.1the definition of 'constraint validation api' in that specification. recommendation no change from the previous snapshot html5. html5the definit...
ContentIndexEvent() - Web APIs
xevent = new contentindexevent(type, contentindexeventinit); parameters type a domstring indicating the event which occurred. for contentindexevent, this is always delete. eventinitdict optional an options object containing any initialization data you want to populate the contentindexevent object with. ...
... eventinitdict optional an options object containing any initialization data you want to populate the contentindexevent object with. the options are: id: the id of the indexed content you want the contentindexevent to
remove. return value a contentindexevent object configured using the given inputs. examples this examples constructs a new contentindexevent with the relevant id. var
removedata = { id : 'unique-content-id' } var cievent = new contentindexevent('contentdelete',
removedata); cievent.id; // should return 'unique-content-id' specifications specification status comment unknownthe definition of 'contentindexevent' in that specification. unknown initial definition. ...
ContentIndexEvent - Web APIs
the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface. it is not fired when the contentindex.delete method is called. ...
...terface inherits the properties of its parent interface, extendableevent. id read only a string which identifies the deleted content index via it's id. methods while contentindexevent offers no methods of its own, it inherits any specified by its parent interface, extendableevent. examples this example shows the sevice worker script listening for the contentdelete event and logs the
removed content index id. self.addeventlistener('contentdelete', (event) => { console.log(event.id); // logs content index id, which can then be used to determine what content to delete from your cache }); specifications specification status comment unknownthe definition of 'contentindexevent' in that specification. unknown initial definition. ...
CustomElementRegistry.define() - Web APIs
} var img = document.createelement('img'); img.src = imgurl; icon.appendchild(img); // create some css to apply to the shadow dom var style = document.createelement('style'); style.textcontent = '.wrapper {' + 'position: relative;' + '}' + '.info {' + 'font-size: 0.8
rem;' + 'width: 200px;' + 'display: inline-block;' + 'border: 1px solid black;' + 'padding: 10px;' + 'background: white;' + 'border-radius: 10px;' + 'opacity: 0;' + 'transition: 0...
...0px;' + 'opacity: 0;' + 'transition: 0.6s all;' + 'position: absolute;' + 'bottom: 20px;' + 'left: 10px;' + 'z-index: 3;' + '}' + 'img {' + 'width: 1.2
rem' + '}' + '.icon:hover + .info, .icon:focus + .info {' + 'opacity: 1;' + '}'; // attach the created elements to the shadow dom shadow.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); } } // define the new element c...
DOMTokenList - Web APIs
eturns the value of the list as a domstring. methods domtokenlist.item(index) returns the item in the list by its index, or undefined if index is greater than or equal to the list's length. domtokenlist.contains(token) returns true if the list contains the given token, otherwise false. domtokenlist.add(token1[, token2[, ...tokenn]]) adds the specified token(s) to the list. domtokenlist.
remove(token1[, token2[, ...tokenn]])
removes the specified token(s) from the list. domtokenlist.replace(oldtoken, newtoken) replaces token with newtoken. domtokenlist.supports(token) returns true if a given token is in the associated attribute's supported tokens. domtokenlist.toggle(token [, force])
removes token from the list if it exists, or adds token to the list if it doesn't. returns a b...
....classlist, add a class using domtokenlist.add(), and then update the node.textcontent of the <p> to equal the domtokenlist. first, the html: <p class="a b c"></p> now the javascript: let para = document.queryselector("p"); let classes = para.classlist; para.classlist.add("d"); para.textcontent = `paragraph classlist is "${classes}"`; the output looks like this: trimming of whitespace and
removal of duplicates methods that modify the domtokenlist (such as domtokenlist.add()) automatically trim any excess whitespace and
remove duplicate values from the list. for example: <span class=" d d e f"></span> let span = document.queryselector("span"); let classes = span.classlist; span.classlist.add("x"); span.textcontent = `span classlist is "${classes}"`; the output looks like this:...
DataTransferItemList.clear() - Web APIs
the drag data store in which this list is kept is only writable while handling the dragstart event. while handling drop, the drag data store is in read-only mode, and this method silently does nothing. no exception is thrown. syntax datatransferitemlist.clear(); parameters none. return value undefined example this example shows the use of the clear() method. ...
...string(function (s){ console.log("... drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.
remove(i); } // clear any
remaining drag data datalist.clear(); } result result link specifications specification status comment html living standardthe definition of 'clear()' in that specification. living standard html 5.1the definition of 'clear()' in that specification. recommendation not included in w3c html5 recommendation ...
Document.caretRangeFromPoint() - Web APIs
ment.caretrangefrompoint(float x, float y); parameters x a horizontal position within the current viewport. y a vertical position within the current viewport. returns one of the following: a range. null, if x or y are negative, outside viewport, or there is no text entry node. ...
...e is no text entry node. example basic demo: when clicking in a paragraph insert a line break at the caret position: html <p>lo
rem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. ...
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
with the caret and caret's character offset within that node. syntax var caretposition = document.caretpositionfrompoint(float x, float y); parameters x the horizontal coordinate of a point. y the vertical coordinate of a point. returns a caretposition object. example this example inserts line breaks wherever you click. the code for it is below the demo. ...
...ject. example this example inserts line breaks wherever you click. the code for it is below the demo. demo html content <p>lo
rem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. ...
Element.requestFullscreen() - Web APIs
ent active document. the element is not contained by a document. the element is not permitted to use the "fullscreen" feature, either because of feature policy configuration or other access control features. the element and its document are the same node. usage notes compatible elements an element that you wish to place into full-screen mode has to meet a small number of simple requi
rements: it must be one of the standard html elements or <svg> or <math>. it is not a <dialog> element. it must either be located within the top-level document or in an <iframe> which has the allowfullscreen attribute applied to it. additionally, of course, the feature policy "fullscreen" permission must be granted. detecting full-screen activation you can determine whether or not your attem...
...ent has a value—we call the video's requestfullscreen() method. we don't need to do anything special if successful, but if the request fails, our promise's catch() handler presents an alert with an appropriate error message. if, on the other hand, full-screen mode is already in effect, we call document.exitfullscreen() to disable full-screen mode. you can see this example in action or view or
remix the code on glitch. specifications specification status comment fullscreen apithe definition of 'element.requestfullscreen()' in that specification. living standard initial definition ...
Element.scrollTop - Web APIs
when an element's content does not generate a vertical scrollbar, then its scrolltop value is 0. when scrolltop is used on the root element (the <html> element), the scrolly of the window is returned. this is a special case of scrolltop. on systems using display scaling, scrolltop may give you a decimal value. syntax // get the number of pixels scrolled. ...
...ats: if the element can't be scrolled (e.g. it has no overflow or if the element has a property of "non-scrollable"), scrolltop is 0. scrolltop doesn't respond to negative values; instead, it sets itself back to 0. if set to a value greater than the maximum available for the element, scrolltop settles itself to the maximum value. example padding-top if you can see this, scrolltop = 0 lo
rem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. if you can see this, scrolltop is > 0 duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupida...
EventSource() - Web APIs
configuration optional provides options to configure the new connection. the possible entries are: withcredentials, defaulting to false, indicating if cors should be set to include credentials. ...
... configuration optional provides options to configure the new connection. the possible entries are: withcredentials, defaulting to false, indicating if cors should be set to include credentials. ...
EventTarget - Web APIs
solas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor eventtarget() creates a new eventtarget object instance. methods eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget. eventtarget.
removeeventlistener()
removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. void seteventhandler(domstring type, eventhandler handler) eventha...
... eventhandler geteventhandler(domstring type) example simple implementation of eventtarget var eventtarget = function() { this.listeners = {}; }; eventtarget.prototype.listeners = null; eventtarget.prototype.addeventlistener = function(type, callback) { if (!(type in this.listeners)) { this.listeners[type] = []; } this.listeners[type].push(callback); }; eventtarget.prototype.
removeeventlistener = function(type, callback) { if (!(type in this.listeners)) { return; } var stack = this.listeners[type]; for (var i = 0, l = stack.length; i < l; i++) { if (stack[i] === callback){ stack.splice(i, 1); return; } } }; eventtarget.prototype.dispatchevent = function(event) { if (!(event.type in this.listeners)) { return true; } var stack =...
Using files from web applications - Web APIs
= this; this.xhr.upload.addeventlistener("progress", function(e) { if (e.lengthcomputable) { const percentage = math.round((e.loaded * 100) / e.total); self.ctrl.update(percentage); } }, false); xhr.upload.addeventlistener("load", function(e){ self.ctrl.update(100); const canvas = self.ctrl.ctx.canvas; canvas.parentnode.
removechild(canvas); }, false); xhr.open("post", "http://demos.hacks.mozilla.org/paul/demos/resources/webservices/devnull.php"); xhr.overridemimetype('text/plain; charset=x-user-defined-binary'); reader.onload = function(evt) { xhr.send(evt.target.result); }; reader.readasbinarystring(file); } the fileupload() function shown above creates a throbber, which is used to display pro...
...ad progress listener is set to update the throbber with new percentage information so that as the upload progresses the throbber will be updated based on the latest information. the xmlhttprequest's upload load event handler is set to update the throbber progress information to 100% to ensure the progress indicator actually reaches 100% (in case of granularity quirks during the process). it then
removes the throbber since it's no longer needed. this causes the throbber to disappear once the upload is complete. the request to upload the image file is opened by calling xmlhttprequest's open() method to start generating a post request. the mime type for the upload is set by calling the xmlhttprequest function overridemimetype(). in this case, we're using a generic mime type; you may or may no...
Using the Gamepad API - Web APIs
to allow you to find a mapping for the controls on the device as well as display useful feedback to the user. index: an integer that is unique for each gamepad currently connected to the system. this can be used to distinguish multiple controllers. note that disconnecting a device and then connecting a new device may reuse the previous index. mapping: a string indicating whether the browser has
remapped the controls on the device to a known layout. currently there is only one supported known layout — the standard gamepad. if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard. connected: a boolean indicating whether the gamepad is still connected to the system. if this is so the value is true; if not, it is false. butt...
...bute("max", "2"); p.setattribute("value", "1"); p.innerhtml = i; a.appendchild(p); } d.appendchild(a); // see https://github.com/luser/gamepadtest/blob/master/index.html var start = document.getelementbyid("start"); if (start) { start.style.display = "none"; } document.body.appendchild(d); requestanimationframe(updatestatus); } function disconnecthandler(e) {
removegamepad(e.gamepad); } function
removegamepad(gamepad) { var d = document.getelementbyid("controller" + gamepad.index); document.body.
removechild(d); delete controllers[gamepad.index]; } function updatestatus() { if (!haveevents) { scangamepads(); } var i = 0; var j; for (j in controllers) { var controller = controllers[j]; var d = document.getelementbyid("control...
HTMLCanvasElement.toDataURL() - Web APIs
= canvas.todataurl('image/jpeg', 0.5); var lowquality = canvas.todataurl('image/jpeg', 0.1); example: dynamically change images you can use this technique in coordination with mouse events in order to dynamically change images (gray-scale vs. ...
...ale vs. ...
HTMLDetailsElement: toggle event - Web APIs
the toggle event fires when the open/closed state of a <details> element is toggled. bubbles no cancelable no interface event event handler property none default action toggles the open state of the <details> element. examples this example logs chapters that are open. chapters are
removed from the log when they are closed. html <aside id="log"> <b>open chapters:</b> <div data-id="ch1" hidden>i</div> <div data-id="ch2" hidden>ii</div> <div data-id="ch3" hidden>iii</div> </aside> <section id="summaries"> <b>chapter summaries:</b> <details id="ch1"> <summary>chapter i</summary> philosophy reproves boethius for the foolishness of his complaints against fortune. her very nature is caprice. </details> <d...
...complaints against fortune. her very nature is caprice. </details> <details id="ch2"> <summary>chapter ii</summary> philosophy in fortune's name replies to boethius' reproaches, and proves that the gifts of fortune are hers to give and to take away. </details> <details id="ch3"> <summary>chapter iii</summary> boethius falls back upon his present sense of misery. philosophy
reminds him of the brilliancy of his former fortunes. </details> </section> css body { display: flex; flex-direction: row-reverse; } #log { flex-shrink: 0; padding-left: 3em; } #summaries { flex-grow: 1; } javascript function logitem(e) { const item = document.queryselector(`[data-id=${e.target.id}]`); item.toggleattribute('hidden'); } const chapters = document.queryselectorall...
HTMLElement: animationiteration event - Web APIs
{ iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3
rem; } .event-log { width: 25
rem; height: 2
rem; border: 1px solid black; margin: 0.2
rem; padding: 0.2
rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselecto...
...ntlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.
remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.clas...
HTMLElement: animationstart event - Web APIs
nimated'); animated.onanimationstart = () => { console.log('animation started'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3
rem; } .event-log { width: 25
rem; height: 2
rem; border: 1px solid black; margin: 0.2
rem; padding: 0.2
rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselecto...
...ntlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.
remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.clas...
HTMLElement.offsetHeight - Web APIs
floated elements extending below other linear content are ignored. ...
...floated elements extending below other linear content are ignored. ...
HTMLImageElement.alt - Web APIs
y string (""). this is shown in the example below. html in the html for this example, shown below, the <img> element includes the alt property, which will prevent the image from having any alternate text, since it's simply a decorational detail. <div class="container"> <div class="left-margin"> <img src="/files/16861/margin-flourish.svg" alt=""> </div> <div class="contents"> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. quisque quis orci ligula. lo
rem ipsum dolor sit amet, consectetur adipiscing elit. in ac neque libero. vivamus consectetur rhoncus elit eget porta. etiam pulvinar ex id sapien laoreet, quis aliquet odio lobortis. nam ac mauris at risus laoreet cursus vitae et sapien. etiam molestie auctor eros, ac porta risus scelerisq...
... screen readers. html the html below creates a snippet of content from a site using the described icon. note the use of the alt attribute on the <img>, providing a good substitution string to use in case the image doesn't load. <div class="container"> <img src="https://udn.realityripple.com/samples/87/eace6b7d6a.svg" alt="new page!" class="pageinfo-badge"> <p class="contents"> lo
rem ipsum dolor sit amet, consectetur adipiscing elit. quisque quis orci ligula. lo
rem ipsum dolor sit amet, consectetur adipiscing elit. in ac neque libero. vivamus consectetur rhoncus elit eget porta. etiam pulvinar ex id sapien laoreet, quis aliquet odio lobortis. nam ac mauris at risus laoreet cursus vitae et sapien. etiam molestie auctor eros, ac porta risus scelerisq...
HTMLIsIndexElement - Web APIs
this latest specification requires that this element implements htmlunknownelement rather than htmlisindexelement. properties inherits properties from its parent, htmlelement. htmlisindexelement.form read only is a htmlformelement representing the <form> element it belongs too. ...
... too. it can have the null value, if <isindex> isn't part of any form. htmlisindexelement.prompt is a domstring representing a text to be prompted for the field. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html5the definition of 'htmlisindexelement' in that specification. recommendation
removed. <isindex> must now implement htmlunknownelement. document object model (dom) level 2 html specificationthe definition of 'htmlisindexelement' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'htmlisindexelement' in that specification. obsolete initi...
HTMLMediaElement.textTracks - Web APIs
the read-only texttracks property on htmlmediaelement objects returns a texttracklist object listing all of the texttrack objects representing the media element's text tracks, in the same order as in the list of text tracks. you can detect when tracks are added to and
removed from an <audio> or <video> element using the addtrack and
removetrack events. however, these events aren't sent directly to the media element itself. instead, they're sent to the track list object of the htmlmediaelement that corresponds to the type of track that was added to the element the returned list is live; that is, as tracks are added to and
removed from the media element, the list's contents change dynamically. once you have a reference to the list, you can monitor it for changes to detect when new ...
... see event handlers in texttracklist to learn more about watching for changes to a media element's track list. ...
HTMLElement.blur() - Web APIs
living standard html 5.1the definition of 'blur' in that specification. ...
... living standard html 5.1the definition of 'blur' in that specification. ...
HTMLOrForeignElement.dataset - Web APIs
of the same html attribute, but in camelcase and with no dashes, dots, etc. in addition to the information below, you'll find a how-to guide for using html data attributes in our article using data attributes. name conversion dash-style to camelcase conversion a custom data attribute name is transformed to a key for the domstringmap entry with the following rules the prefix data- is
removed (including the dash); for any dash (u+002d) followed by an ascii lowercase letter a to z, the dash is
removed, and the letter is transformed into its uppercase counterpart; other characters (including other dashes) are left unchanged. camelcase to dash-style conversion the opposite transformation, which maps a key to an attribute name, uses the following rules: restriction: b...
...ct property of the dataset, as in element.dataset.keyname attributes can also be set and read using the bracket syntax, as in element.dataset[keyname] the in operator can be used to check whether a given attribute exists. setting values when an attribute is set, its value is always converted into a string. for example: null is converted into the string "null". to
remove an attribute, you can use the delete operator. syntax const dataattrmap = element.dataset value a domstringmap. examples <div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>john doe</div> const el = document.queryselector('#user'); // el.id === 'user' // el.dataset.id === '1234567890' // el.dataset.user === 'johndoe' // el.dataset.dateofbirth === '' // set the...
HTMLSelectElement - Web APIs
nt.willvalidateread only a boolean that indicates whether the button is a candidate for constraint validation. it is false if any conditions bar it from constraint validation. methods this interface inherits the methods of htmlelement, and of element and node. htmlselectelement.add() adds an element to the collection of option elements for this select element. htmlselectelement.blur()
removes input focus from this element. this method is now implemented on htmlelement. htmlselectelement.checkvalidity() checks whether the element has any constraints and whether it satisfies them. if the element fails its constraints, the browser fires a cancelable invalid event at the element (and returns false). htmlselectelement.focus() gives input focus to this element. this method is now i...
...-style brackets or parentheses, without calling this method explicitly. htmlselectelement.nameditem() gets the item in the options collection with the specified name. the name string can match either the id or the name attribute of an option node. you can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly. htmlselectelement.
remove()
removes the element at the specified index from the options collection for this select element. htmlselectelement.reportvalidity() this method reports the problems with the constraints on the element, if any, to the user. if there are problems, it fires a cancelable invalid event at the element, and returns false; if there are no problems, it returns true. htmlselectelement.setcustomvali...
HTMLTableRowElement - Web APIs
the surrounding context. the possible values are "left", "right", and "center". htmltablerowelement.bgcolor is a domstring containing the background color of the cells. it reflects the obsolete bgcolor attribute. htmltablerowelement.cells read only returns a live htmlcollection containing the cells in the row. the htmlcollection is live and is automatically updated when cells are added or
removed. htmltablerowelement.ch is a domstring containing one single character. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablerowelement.choff is a domstring containing a integer ind...
...row is not part of a section, returns -1. htmltablerowelement.valign is a domstring representing an enumerated value indicating how the content of the cell must be vertically aligned. it reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. htmltablerowelement.deletecell()
removes the cell at the given position in the row. if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than 0, it raises a domexception with the indexsizeerror value. htmltablerowelement.insertcell() inserts a new cell just before the given position in the row. if the given position is not given or is -1, it appends the cell to the row...
HTMLTableSectionElement - Web APIs
containing an enumerated value reflecting the align attribute. it indicates the alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", and "center". htmltablesectionelement.rows read only returns a live htmlcollection containing the rows in the section. the htmlcollection is live and is automatically updated when rows are added or
removed. htmltablesectionelement.ch is a domstring containing one single chararcter. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablesectionelement.choff is a domstring containing a in...
...l and was not very well supported. htmltablesectionelement.valign is a domstring representing an enumerated value indicating how the content of the cell must be vertically aligned. it reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". methods inherits methods from its parent, htmlelement. htmltablesectionelement.deleterow()
removes the cell at the given position in the section. if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than 0, it raises a domexception with the indexsizeerror value. htmltablesectionelement.insertrow() inserts a new row just before the given position in the section. if the given position is not given or is -1, it appends the ro...
HTML Drag and Drop API - Web APIs
t, datatransfer, datatransferitem and datatransferitemlist. the dragevent interface has a constructor and one datatransfer property, which is a datatransfer object. datatransfer objects include the drag event's state, such as the type of drag being done (like copy or move), the drag's data (one or more items), and the mime type of each drag item. datatransfer objects also have methods to add or
remove items to the drag's data. the dragevent and datatransfer interfaces should be the only ones needed to add html drag and drop capabilities to an application. (firefox supports some gecko-specific extensions to the datatransfer object, but those extensions will only work on firefox.) each datatransfer object contains an items property, which is a list of datatransferitem objects. a datatransfe...
...a list of datatransferitem objects. a datatransferitem object represents a single drag item, each with a kind property (either string or file) and a type property for the data item's mime type. the datatransferitem object also has methods to get the drag item's data. the datatransferitemlist object is a list of datatransferitem objects. the list object has methods to add a drag item to the list,
remove a drag item from the list, and clear the list of all drag items. a key difference between the datatransfer and datatransferitem interfaces is that the former uses the synchronous getdata() method to access a drag item's data, but the latter instead uses the asynchronous getasstring() method. note: dragevent and datatransfer are broadly supported on desktop browsers. however, the datatransfer...
IDBObjectStore.put() - Web APIs
ted, instead of a new record being inserted. note: this feature is available in web workers. syntax let request = objectstore.put(item); let request = objectstore.put(item, key); parameters item the item you wish to update (or insert). key optional the primary key of the record you want to update (e.g. from idbcursor.primarykey). this is only needed for object stores that have an autoinc
rement primary key, therefore the key is not in a field on the record object. in such cases, calling put(item) will always insert a new record, because it doesn't know what existing record you might want to modify. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: ...
... parameter was provided. the object store uses out-of-line keys and has no key generator, and no key parameter was provided. the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or
removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. parameters value the value to be stored. key the key to use to identify the record. if unspecified, it results to null. if the object store has a key generator (e.g. autoinc
rement) the key of the object must be passed in to update the object. example the fo...
IDBObjectStore - Web APIs
f the names of indexes on objects in this object store. idbobjectstore.keypath read only the key path of this object store. if this attribute is null, the application must provide a key for each modification operation. idbobjectstore.name the name of this object store. idbobjectstore.transaction read only the idbtransaction object to which this object store belongs. idbobjectstore.autoinc
rement read only the value of the auto inc
rement flag for this object store. methods idbobjectstore.add() returns an idbrequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store. this is for adding new records to an object store. idbobjectstore.clear() creates and immediately returns an idbrequest object, and clears t...
...droid full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitautoinc
rementchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support...
IdleDeadline - Web APIs
the idledeadline interface is used as the data type of the input parameter to idle callbacks established by calling window.requestidlecallback(). it offers a method, time
remaining(), which lets you determine how much longer the user agent estimates it will
remain idle and a property, didtimeout, which lets you determine if your callback is executing because its timeout duration expired. to learn more about how request callbacks work, see collaborative scheduling of background tasks. ...
...ermine if your callback is executing because its timeout duration expired. to learn more about how request callbacks work, see collaborative scheduling of background tasks. properties idledeadline.didtimeout read only a boolean whose value is true if the callback is being executed because the timeout specified when the idle callback was installed has expired. methods idledeadline.time
remaining() returns a domhighrestimestamp, which is a floating-point value providing an estimate of the number of milliseconds
remaining in the current idle period. if the idle period is over, the value is 0. your callback can call this repeatedly to see if there's enough time left to do more work before returning. example see our complete example in the article cooperative scheduling of backg...
Keyboard API - Web APIs
provides several capabilities. keyboard mapping provides an interface for retrieving the string generated by particular physical key on a keyboard to correctly identify that key to a user. keyboard locking enables a web page to capture keys that are normally reserved by the user agent or the underlying operating system. the intended use of the keyboard api is by web applications such as games or
remote access apps that provide a full-screen immersive experience. keyboard api concepts and usage keyboard mapping on physical keyboards, the code attribute contains the physical location of the key that was pressed, and the key attribute contains the string generated by pressing the key at that physical location on the keyboard. the key value takes into account the keyboard's locale (for examp...
...ific string associated with the key labeled w on an english qwerty keyboard. if (navigator.keyboard) { var keyboard = navigator.keyboard; keyboard.getlayoutmap() .then(keyboardlayoutmap => { var upkey = keyboardlayoutmap.get('keyw'); window.alert('press ' + upkey + ' to move up.'); }); } else { // do something else. } keyboard locking richly interactive web pages, games, and
remote-streaming experiences often require access to special keys and keyboard shortcuts while in full-screen mode. examples of such key/key combinations include escape, alt+tab, and ctrl+n. those keys and key combinations are typically captured by the user agent or the underlying operating system, as illustrated in the following example. to capture the "w", "a", "s", and "d" keys, call lock() with ...
LocalFileSystem - Web APIs
ts) to speed up performance, while creating persistent storage for unique data—such as drafts of emails that were composed while offline—that should not be lost before they are backed up into the cloud. using persistent storage the requestfilesystem() method lets you ask for persistent or temporary storage. persistent storage is storage that stays in the browser unless the app or the user
removes it, but the user must grant you permission before you can use it. in contrast, temporary storage is automatically granted without any user permission, but it can be expunged by the browser at any time. to use persistent storage with the file system api, chrome exposes a requestquota api. so to request storage, you need to do something like the following: var requestedbytes = 1024*1024*10; ...
... persistent 1 storage that stays in the browser unless the user or the app expunges it. the user must grant permission before the app can use this type of storage. methods requestfilesystem() requests a file system where data should be stored. you access a sandboxed file system by requesting a localfilesystem object using this globa...
LocalMediaStream - Web APIs
warning: this interface is no longer available in any mainstream browser. do not use localmediastream; you need to update any code that does use it as soon as possible or your content or application will stop working. ...
... ...
MediaDevices - Web APIs
the mediadevices interface provides access to connected media input devices like cameras and microphones, as well as screen sharing. in essence, it lets you obtain access to any hardware source of media data. properties inherits properties from its parent interface, eventtarget. events devicechange fired when a media input or output device is attached to or
removed from the user's computer. also available via the ondevicechange property. methods inherits methods from its parent interface, eventtarget. enumeratedevices() obtains an array of information about the media input and output devices available on the system. getsupportedconstraints() returns an object conforming to mediatracksupportedconstraints indicating which constrainable properties are supported on the mediastre...
...lector('video'); var constraints = window.constraints = { audio: false, video: true }; var errorelement = document.queryselector('#errormsg'); navigator.mediadevices.getusermedia(constraints) .then(function(stream) { var videotracks = stream.getvideotracks(); console.log('got stream with constraints:', constraints); console.log('using video device: ' + videotracks[0].label); stream.on
removetrack = function() { console.log('stream ended'); }; window.stream = stream; // make variable available to browser console video.srcobject = stream; }) .catch(function(error) { if (error.name === 'constraintnotsatisfiederror') { errormsg('the resolution ' + constraints.video.width.exact + 'x' + constraints.video.height.exact + ' px is not supported by your device.'); }...
MediaRecorder.onerror - Web APIs
using the mediastream recording api; to determine which occurred, check the value of mediarecordererrorevent.error.name. invalidstateerror an attempt was made to stop or pause or an inactive recorder, start or resume an active recorder, or otherwise manipulate the mediarecorder while in the wrong state. this exception can also occur when a request is made on a source that has been deleted or
removed. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. notsupportederror an attempt was made to instanti...
...mediarecorder using a mime type that isn't supported on the user's device; one or more of the requested container, codecs, or profiles as well as other information may be invalid. unknownerror an non-security related error occurred that cannot otherwise be categorized. recording stops, the mediarecorder's state becomes inactive, one last dataavailable event is sent to the mediarecorder with the
remaining received data, and finally a stop event is sent. these errors may occur either directly because of a call to a mediarecorder method, or indirectly due to a problem arising during the recording process. example this example creates a new mediarecorder instance and starts recording using the user agent's default media format. it returns either the mediarecorder or the name of the error th...
MediaRecorder - Web APIs
type read only returns the mime type that was selected as the recording container for the mediarecorder object when it was created. mediarecorder.state read only returns the current state of the mediarecorder object (inactive, recording, or paused.) mediarecorder.stream read only returns the stream that was passed into the constructor when the mediarecorder was created. mediarecorder.igno
remutedmedia indicates whether the mediarecorder instance will record input when the input mediastreamtrack is muted. if this attribute is false, mediarecorder will record silence for audio and black frames for video. the default is false. mediarecorder.videobitspersecond read only returns the video encoding bit rate in use. this may differ from the bit rate specified in the constructor (if it wa...
...some lines have been omitted for brevity; refer to the source for the complete code. specifications specif...
MediaStreamTrackEvent - Web APIs
these events are sent to the stream when these changes occur. ...
... track read only a mediastreamtrack object representing the track which was added to the stream. constructor mediastreamtrackevent() constructs a new mediastreamtrackevent with the specified configuration. methods also inherits methods from its parent event. specifications specification stat...
Transcoding assets for Media Source Extensions - Web APIs
getting started the first and most important step is to ensure that your files are comprised of a container and codec that users' browsers support. depending on the codec, you might need to fragment the file to comply with the iso bmff spec. ...
...nd ├── stream.mpd └── video ├── 1 ├── 2 ├── 3 ├── 4 └── 5 8 directories, 1 file note: mp4-dash-encode.py does not display ffmpeg error messages. you can see it by specifying the -d option. note: if "invalid duration specification for force_key_frames: 'expr:eq(mod(n" is displayed as an error message, modify mp4-dash-encode.py and
remove two "'" from "-force_key_frames 'expr:eq(mod(n,%d),0)'". summary with your video properly encoded and adaptive bitrate media generated, you're now ready to begin adaptive bitrate streaming on the web using dash and mse. ...
Media Capture and Streams API (Media Stream) - Web APIs
the output of the mediastream object is linked to a consumer. it can be a media elements, like <audio> or <video>, the webrtc rtcpeerconnection api or a web audio api mediastreamaudiosourcenode. interfaces in these reference articles, you'll find the fundamental information you'll need to know about each of the interfaces that make up the media capture and streams api. ...
... overconstrainederror url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types. these no longer exist, and you should update any existing code to instead use mediastreamtrack directly. events addtrack ended muted overconstrained
removetrack started unmuted guides and tutorials the articles below provide additional guidance and how-to information that will help you learn to use the api, and how to perform specific tasks that you may wish to handle. capabilities, constraints, and settingsthe twin concepts of constraints and capabilities let the browser and web site or app exchange information about what constr...
Metadata.modificationTime - Web APIs
dificationtime; value a date timestamp indicating when the file system entry was last changed. example this example tries to get a particular working file at tmp/workfile.json. once that file has been found, its metadata is obtained and the file's modification timestamp year is compared to the current year. ...
...mestamp year is compared to the current year. if it was last modified in a year at least five prior to the current year, the file is
removed and a new one is created. workingdirectory.getfile("tmp/workfile.json", { create: true }, function(fileentry) { fileentry.getmetadata(function(metadata) { if ((new date().getfullyear() - metadata.modificationtime.getfullyear()) >= 5) { fileentry.
remove(function() { workingdirectory.getfile("tmp/workfile.json", { create: true }, function(newentry) { fileentry = newentry; }); }); } }); }, handleerror); this api has no official w3c or whatwg specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check o...
Microdata DOM API - Web APIs
you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. the document.getitems(typenames) method provides access to the top-level microdata items. it returns a nodelist containing the items with the specified types, or all types if no argument is specified. ...
...rted property indices are as defined for htmlcollection objects. the supported property names consist of the property names of all the elements represented by the collection, in tree order, ignoring later duplicates. the names attribute must return a live read only array object giving the property names of all the elements represented by the collection, listed in tree order, but with duplicates
removed, leaving only the first occurrence of each name. the same object must be returned each time. the nameditem(name) method must return a propertynodelist object representing a live view of the htmlpropertiescollection object, further filtered so that the only nodes in the propertynodelist object are those that have a property name equal to name. the nodes in the propertynodelist object must be ...
MutationEvent - Web APIs
roposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. the practical reasons to avoid the mutation events are performance issues and cross-browser support. performance adding dom mutation listeners to a document profoundly degrades the performance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover,
removing the listeners does not reverse the damage. the performance effect is limited to the documents that have the mutation event listeners. cross-browser support these events are not implemented consistently across different browsers, for example: ie prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, domnodein...
... in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. mutation events list the following is a list of all mutation events, as defined in dom level 3 events specification: domattrmodified domattributenamechanged domcharacterdatamodified domelementnamechanged domnodeinserted domnodeinsertedintodocument domnode
removed domnode
removedfromdocument domsubtreemodified usage you can register a listener for mutation events using eventtarget.addeventlistener() as follows: element.addeventlistener("domnodeinserted", function (event) { // ... }, false); the event object is passed to the listener in a mutationevent (see its definition in the specification) for most events, and mutationnameevent for domattri...
MutationObserver - Web APIs
nobserver which will invoke a specified callback function when dom changes occur. methods disconnect() stops the mutationobserver instance from receiving further notifications until and unless observe() is called again. observe() configures the mutationobserver to begin receiving notifications through its callback function when dom changes matching the given options occur. takerecords()
removes all pending notifications from the mutationobserver's notification queue and returns them in a new array of mutationrecord objects. mutation observer & customize resize event listener & demo https://codepen.io/webgeeker/full/yjrzgg/ example the following example was adapted from this blog post. // select the node that will be observed for mutations const targetnode = document.getelement...
... (which mutations to observe) const config = { attributes: true, childlist: true, subtree: true }; // callback function to execute when mutations are observed const callback = function(mutationslist, observer) { // use traditional 'for loops' for ie 11 for(let mutation of mutationslist) { if (mutation.type === 'childlist') { console.log('a child node has been added or
removed.'); } else if (mutation.type === 'attributes') { console.log('the ' + mutation.attributename + ' attribute was modified.'); } } }; // create an observer instance linked to the callback function const observer = new mutationobserver(callback); // start observing the target node for configured mutations observer.observe(targetnode, config); // later, y...
MutationObserverInit.childList - Web APIs
the mutationobserverinit dictionary's optional childlist property indicates whether or not to monitor the specified node or nodes for the addition or
removal of new child nodes. if childlist is false (the default), adding or
removing new nodes does not trigger mutation callbacks. by setting childlist to true, your callback will be invoked any time nodes are added to or
removed from the dom node or nodes being watched. syntax var options = { childlist: true | false } value a boolean value indicating whether or not to invoke the callback function when new nodes are added to or
removed from the section of the dom being monitored.. ...
...e dom node or nodes being watched. syntax var options = { childlist: true | false } value a boolean value indicating whether or not to invoke the callback function when new nodes are added to or
removed from the section of the dom being monitored.. if subtree is false, only the node indicated by the observer's target node is monitored for changes. setting subtree to true causes addition or
removal of nodes anywhere within the subtree rooted at target to be reported. example specifications specification status comment domthe definition of 'mutationobserverinit.childlist' in that specification. living standard ...
NameList - Web APIs
items can be accessed by a 0-based index. ...
...items can be accessed by a 0-based index. ...
Navigator - Web APIs
n this function to return a significant value. navigatorplugins.plugins read only returns a pluginarray listing the plugins installed in the browser. navigatorid.product read only always returns 'gecko', on any browser. this property is kept only for compatibility purpose. navigator.serviceworker read only returns a serviceworkercontainer object, which provides access to registration,
removal, upgrade, and communication with the serviceworker objects for the associated document. navigatorstorage.storage read only returns the singleton storagemanager object used for managing persistence permissions and estimating available storage on a site-by-site/app-by-app basis. navigatorid.useragent read only returns the user agent string for the current browser. navigator.xr read only ...
...returns a promise for a mediakeysystemaccess object. navigator.sendbeacon() used to asynchronously transfer a small amount of data using http from the user agent to a web server. navigator.share() invokes the native sharing mechanism of the current platform. navigatorid.taintenabled() deprecated since gecko 1.7.8 obsolete since gecko 9.0 returns false. javascript taint/untaint functions
removed in javascript 1.2. navigator.vibrate() causes vibration on devices with support for it. does nothing if vibration support isn't available. non-standard navigator.mozislocallyavailable() lets code check to see if the document at a given uri is available without using the network. specifications specification status comment html living standardthe defin...
Online and offline events - Web APIs
some browsers implement online/offline events from the whatwg web applications 1.0 specification. overview in order to build a good offline-capable web application, you need to know when your application is actually offline. you also need to know when your application has returned to an 'online' status again. effectively, the requi
rements break down as such: you need to know when the user comes back online, so that you can re-synchronize with the server. you need to know when the user is offline, so that you can queue your server requests for a later time. it is this process that online/offline events help to simplify. api navigator.online navigator.online is a property that maintains a true/false value (true for online, false for offline). this property is updated whenever...
...tches into "offline mode" by selecting the corresponding menu item (file -> work offline in firefox). additionally, this property should update whenever a browser is no longer capable of connecting to the network. according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a
remote page (or knows that such an attempt would fail)... firefox 2 updates this property when switching to/from the browser's offline mode. firefox 41 updates this property when the os reports a change in network connectivity on windows, linux, and os x. this property existed in older versions of firefox and internet explorer (the specification based itself off of these prior implementations), so ...
Node.setUserData() - Web APIs
note that such data will not be preserved when imported via node.importnode, as with node.clonenode() and node.renamenode() operations (though node.adoptnode does preserve the information), and equality tests in node.isequalnode() do not consider user data in making the assessment. this method offers the convenience of associating data with specific nodes without needing to alter the structure of a document and in a standard fashion, but it also means that extra steps may need to be taken if one wishes to serialize the information or include the information upon clone, import, or rename operations. ...
...eger (e.g., 1 to indicate a clone operation), the user key, the data on the node, the source node (null if being deleted), the destination node (the newly created node or null if none).if no handler is desired, one must specify null. userdata is the object to associate to userkey on somenode. if null, any previously registered object and userdatahandler associated to userkey on this node will be
removed. example var d = document.implementation.createdocument('', 'test', null); d.documentelement.setuserdata('key', 15, {handle:function (o, k, d, s, ds) {console.log(o+'::'+k+'::'+d+'::'+s+'::'+ds)}}); // 2::key::15::[object element]::[object element] console.log(d.documentelement.getuserdata('key')); // 15 var e = document.importnode(d.documentelement, true); // causes handler to be called c...
Node.textContent - Web APIs
tcontent. if the node is a cdata section, comment, processing instruction, or text node, textcontent returns the text inside the node, i.e., the node.nodevalue. for other node types, textcontent returns the concatenation of the textcontent of every child node, excluding comments and processing instructions. (this is an empty string if the node has no children.) setting textcontent on a node
removes all of the node's children and replaces them with a single text node with the given string value. differences from innertext don't get confused by the differences between node.textcontent and htmlelement.innertext. although the names seem similar, there are important differences: textcontent gets the content of all elements, including <script> and <style> elements. in contrast, innertext...
... is aware of styling and won’t return the text of “hidden” elements. moreover, since innertext takes css styles into account, reading the value of innertext triggers a reflow to ensure up-to-date computed styles. (reflows can be computationally expensive, and thus should be avoided when possible.) unlike textcontent, altering innertext in internet explorer (version 11 and below)
removes child nodes from the element and permanently destroys all descendant text nodes. it is impossible to insert the nodes again into any other element or into the same element after doing so. differences from innerhtml element.innerhtml returns html, as its name indicates. sometimes people use innerhtml to retrieve or write text inside an element, but textcontent has better performance because...
PaymentResponse - Web APIs
he object depend on the payment method being used; for example, if the basic card payment method is used, this object must conform to the structure defined in the basiccardresponse dictionary. paymentresponse.methodname read only secure context returns the payment method identifier for the payment method that the user selected, for example, visa, mastercard, paypal, etc.. paymentresponse.paye
remail read only secure context returns the email address supplied by the user. this option is only present when the requestpaye
remail option is set to true in the options parameter of the paymentrequest() constructor. paymentresponse.payername read only secure context returns the name supplied by the user. this option is only present when the requestpayername option is set to true in the option...
...'s data (and there is a recoverable error), this method allows a merchant to request that the user retry the payment. the method takes an object as argument, which is used to signal to the user exactly what is wrong with the payment response so they can try to correct any issues. paymentresponse.complete() secure context notifies the user agent that the user interaction is over. this causes any
remaining user interface to be closed. this method should only be called after the promise returned by the paymentrequest.show() method. events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. payerdetailchange secure context fired during a retry when the user makes changes to their personal information while filli...
Performance - Web APIs
cetiming object containing latency-related performance information. not available in workers. performance.memory read only a non-standard extension added in chrome, this property provides an object with basic memory usage information. you should not use this non-standard api. ...
...nce.memory read only a non-standard extension added in chrome, this property provides an object with basic memory usage information. you should not use this non-standard api. performance.timeorigin read only returns the high resolution timestamp of the start time of the performance measu
rement. methods the performance interface doesn't inherit any methods. performance.clearmarks()
removes the given mark from the browser's performance entry buffer. performance.clearmeasures()
removes the given measure from the browser's performance entry buffer. performance.clearresourcetimings()
removes all performance entries with a entrytype of "resource" from the browser's performance data buffer. performance.getentries() returns a list of performanceentry objects based on the given f...
Performance API - Web APIs
the performance interfaces are considered high resolution because they are accurate to a thousandth of a millisecond (subject to hardware or software constraints). the interfaces support a number of use cases including calculating frame-rates (potentially important in animations) and benchmarking (such as the time to load a resource). since a platform's system clock is subject to various skews (such as ntp adjustments), the interfaces support a monotonic clock i.e. a clock that is always increasing. ...
... by calling performance.measure() to add a nameddomhighrestimestamp (the measure) between two marks to the browser's performance timeline. performancenavigationtiming provides methods and properties to store and retrieve high resolution timestamps or metrics regarding the browser's document navigation events. performanceobserver provides methods and properties used to observe performance measu
rement events and be notified of new performance entries as they are recorded in the browser's performance timeline. performanceresourcetiming provides methods and properties for retrieving and analyzing detailed network timing data regarding the loading of an application's resources. specifications specification status comment high resolution time recommendation in...
Using the Permissions API - Web APIs
notification, with firefox also recognizing push and webmidi. more features will be added as time progresses. a simple example for this article, we have put together a simple demo called location finder. it uses geolocation to query the user's current location and plot it out on a google map: you can run the example live, or view the source code on github. most of the code is simple and un
remarkable — below we'll just be walking through the permissions api-related code, so check the code yourself if you want to study any of the other parts. accessing the permissions api the navigator.permissions property has been added to the browser to allow access to the global permissions object. this object will eventually include methods for querying, requesting, and revoking permissions, alt...
... get back to the permission prompt without using the browser menu options: firefox: tools > page info > permissions > access your location. select always ask. chrome: hamburger menu > settings > show advanced settings. in the privacy section, click content settings. in the resulting dialog, find the location section and select ask when a site tries to... . finally, click manage exceptions and
remove the permissions you granted to the sites you are interested in. however, future additions to browser functionality should provide the request() method, which will allow us to programatically request permissions, any time we like. these should hopefully be available soon. ...
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
to filter out the authenticators to be used for the creation operation. syntax authenticatorselection = publickeycredentialcreationoptions.authenticatorselection value an object with the following properties: authenticatorattachmentoptional a string which is either "platform" or "cross-platform". the former describes an authenticator which is bound to the client and which is generally not
removable. the latter describes a device which may be used across different platform (such as a usb or nfc device). requireresidentkeyoptional a boolean which indicated that the credential private key must be stored in the authenticator, the client or in a client device. the default value is false. userverificationoptional a string qualifying how the user verification should be part of the authen...
...ll not fail if the response does not have the uv flag (as part of the authenticatordata property of authenticatorattestationresponse.attestationobject) "discouraged": user verification should not be employed as to minimize the user interaction during the process. the default value is "preferred". the authenticator used for the creation of the public key credential must comply with the requi
rements. note: see publickeycredential.isuserverifyingplatformauthenticatoravailable() which resolves to true when a user-verifiying platform authenticator is available. examples var publickey = { authenticatorselection:{ authenticatorattachment: "cross-platform", requireresidentkey: true, userverification: "required" }, challenge: new uint8array(26) /* this actually is given f...
RTCConfiguration.certificates - Web APIs
providing the security certificates available for use when authenticating duing the connection process. syntax let rtcconfiguration = { certificates: certificatelist }; let rtcconfiguration.certificates = [ cert1... ]; let certificates = rtcconfiguration.certificates; value an array of rtccertificate objects, each specifying one security certificate available for use when connecting to a
remote peer. if this property isn't specified, the browser will automatically generate and use a certificate to secure the connection. see using certificates below for more information on why you might want to—or not to—explicitly provide certificates. description if this property isn't included in the configuration, a set of certificates is automatically generated for each instance of rtcpeer...
...tion passed into a call to a connection's setconfiguration(), it is ignored. this attribute supports providing multiple certificates because even though a given dtls connection uses only one certificate, providing multiple certificates allows support for multiple encryption algorithms. the implementation of rtcpeerconnection will choose which certificate to use based on the algorithms it and the
remote peer support, as determined during dtls handshake. if you don't provide certificates, new ones are generated automatically. one obvious benefit to providing your own is identity key continuity—if you use the same certificate for subsequent calls, the
remote peer can tell you're the same caller. this also avoids the cost of generating new keys. <<<--- add link to information about identity ...
RTCDataChannel.negotiated - Web APIs
in using webrtc data channels for further information about this property. syntax var negotiated = adatachannel.negotiated; value true if the rtcdatachannel's connection was negotiated by the web app itself; false if the negotiation was handled by the webrtc layer. the default is false. ...
...ed; value true if the rtcdatachannel's connection was negotiated by the web app itself; false if the negotiation was handled by the webrtc layer. the default is false. example the code snippet below checks the value of negotiated; if it's true, a function called shutdown
remotechannel() is called with the channel's id; presumably this would be implemented to transmit a shutdown signal to the
remote peer prior to terminating the connection. if (datachannel.negotiated) { shutdown
remotechannel(datachannel.id); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.negotiated' in that specification. candidate recommendation initial specification. ...
RTCDataChannel.send() - Web APIs
this can be done any time except during the initial process of creating the underlying transport channel. data sent before connecting is buffered if possible (or an error occurs if it's not possible), and is also buffered if sent while the connection is closing or closed. different browsers have different limitations on the size of the message you can send. specifications exist to define how to automatically fragment large messages, but not all browsers implement them, and those that do have various additional restrictions. ...
...odern browser that supports using the eor (end of record) flag to indicate when a received message is the last piece of a multi-part object sent using send(). for more information about message size restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is created; it accepts an object as input and sends to the
remote peer, over the rtcdatachannel, a json string with the specified object and a time stamp. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("backchannel"); function sendmessage(msg) { let obj = { "message": msg, "timestamp": new date() } dc.send(json.stringify(obj)); } specifications specification status comment webrtc 1.0: real-time ...
RTCDtlsTransport.state - Web APIs
which describes a datagram transport layer security (dtls) transport state. syntax let mystate = dtlstransport.state; value a string whose value is taken from the rtcdtlstransportstate enumerated type. its value is one of the following: new the initial state when dtls has not started negotiating yet. ...
...stransport.state; value a string whose value is taken from the rtcdtlstransportstate enumerated type. its value is one of the following: new the initial state when dtls has not started negotiating yet. connecting dtls is in the process of negotiating a secure connection and verifying the
remote fingerprint. connected dtls has completed negotiation of a secure connection and verified the
remote fingerprint. closed the transport has been closed intentionally as the result of receipt of a close_notify alert, or calling rtcpeerconnection.close(). failed the transport has failed as the result of an error (such as receipt of an error alert or failure to validate the
remote fingerprint). examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnect...
RTCIceCandidate.relatedAddress - Web APIs
the relatedaddress field's value is set when the rtcicecandidate() constructor is used. ...
... observing the relationships between the various types of candidates and their addresses and related addresses. relatedaddress can also be used by quality-of-service (qos) mechanisms. here's an sdp attribute line (a-line) describing an ice candidate discovered by the stun server: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 6502 typ srflx raddr 192.168.2.77 rport 32768 generation 0 the
remote address, relatedaddress, is the dotted quad (for ipv4) or colon-delineated 64-bit address (for ipv6) immediately following the text "raddr", or "192.168.2.77". example in this example, the candidate's type is checked, and then debugging output is presented, based on the candidate type, including the candidate's ip and relatedaddress. switch(candidate.type) { case "host": console.log("...
RTCIceCandidate.relatedPort - Web APIs
the relatedport field's value is set when the rtcicecandidate() constructor is used. you can't specify the value of relatedport in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly, being taken from its rel-port field. ...
...ic and quality-of-service purposes. they may in fact be omitted for security reasons, but if present can be a useful tool during debugging. see the example, which shows a bit of this. here's an sdp attribute line (a-line) describing an ice candidate discovered by the stun server: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 6502 typ srflx raddr 192.168.2.77 rport 32768 generation 0 the
remote port, relatedport, is the number immediately following the "rport" label on the a-line, or 32768. example in this example, the candidate's type is checked, and then debugging output is presented, based on the candidate type, including the candidate's type, address (ip and port), and related address (relatedaddress and relatedport). var ip = candidate.ip; var port = candidate.port; var relip...
RTCIceCandidate.type - Web APIs
ax var type = rtcicecandidate.type; value a domstring whose value is one of those defined by the rtcicecandidatetype enumerated type. these candidate types are listed in order of priority; the higher in the list they are, the more efficient they are. host the candidate is a host candidate, whose ip address as specified in the rtcicecandidate.ip property is in fact the true address of the
remote peer. srflx the candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the stun server to represent the candidate's peer anonymously. prflx the candidate is a peer reflexive candidate; the ip is an intermediary address assigned by the stun server to represent the candidate's peer anonymously. relay the candidate is a relay candidate, obtained from...
...n address the turn server uses to forward the media between the two peers. if type is null, that information was missing from the candidate's a-line, which will cause rtcpeerconnection.addicecandidate() to throw an operationerror exception. example in this example, the candidate's type is used to present a modified user interface for host candidates (those where the ip refers directly to the
remote peer, rather than an intermediary). if (candidate.type == "host") { showhostcontrols(); } else { hidehostcontrols(); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.type' in that specification. candidate recommendation initial definition. ...
RTCIceCandidateStats.deleted - Web APIs
testats object is no longer under consideration. dthe exact meaning varies depending on the type of candidate: local candidate a value of true means the candidate has been deleted as described by rfc 5245: 8.3. host candidate a value of true indicates that the candidate's network resources have been released. this generally mean sthat any associated socket(s) have been closed and released.
remote (turn) candidate a value of true means the candidate's turn allocation is no longer active. the net result is the same; the candidate is no longer under consideration if this value is true. example in this example, setinterval() is used to set up a function that runs periodically to display the latest statistics for candidates. only candidates which have not been deleted are included in t...
... example, setinterval() is used to set up a function that runs periodically to display the latest statistics for candidates. only candidates which have not been deleted are included in the output. ...
RTCIceServer.url - Web APIs
you should instead use the newer urls property, which allows you to optionally specify multiple urls for the server. try to update any existing code to use that property instead. ...
...you should instead use the newer urls property, which allows you to optionally specify multiple urls for the server. try to update any existing code to use that property instead. ...
RTCIceTransport.ongatheringstatechange - Web APIs
e agent has begun gathering candidates, and if so, whether or not gathering has finished. its possible values are: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates. "gathering" the transport is in the process of gathering candidates. ...
...ent the end-of-candidates indicator to the
remote device. the transport won't gather any further candidates unless an ice restart occurs, at which point the gathering process starts over from scratch. example this snippet establishes a handler for the gatheringstatechange event that checks to see if the state has changed to "complete", indicating that all ice candidates from both the local and
remote peers have been received and processed. var icetransport = pc.getsenders()[0].transport.transport; icetransport.ongatheringstatechange = function(event) { if (icetransport.gatheringstate == "complete") { allcandidatesreceived(pc); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcic...
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
the fecpacketsreceived property of the rtcinboundrtpstreamstats dictionary indicates how many forward error correction (fec) packets have been received by this rtp receiver from the
remote peer. an fec packet provides parity information which can be used to attempt to reconstruct rtp data packets which have been corrupted in transit. syntax var fecpacketsreceived = rtcinboundrtpstreamstats.fecpacketsreceived; value an unsigned integer value which indicates the total number of fec packets which have been recieved from the
remote peer during this rtp session. forward error correction uses an exclusive-or method to perform parity checks on the received data. by using the fec parity information to attempt to reconstruct damaged packets, it is possible to avoid the need to retransmit damaged...
... usage notes it's possible that a subset of the fec packets which have been received were discarded instead of being used. ...
RTCInboundRtpStreamStats.qpSum - Web APIs
dividual codec specifications for details. example calculating average quantization the calculateaverageqp() function shown below computes the average qp for the given rtcstats object that contains rtp stream statistics, returning 0 if the object doesn't describe an rtp stream. ...
...() function shown below computes the average qp for the given rtcstats object that contains rtp stream statistics, returning 0 if the object doesn't describe an rtp stream. function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "
remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "
remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.qpsum' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats - Web APIs
tes that have been received so far for this media source. fecpacketsdiscarded an integer value indicating the number of rtp forward error correction (fec) packets which have been received for this source, for which the error correction payload was discarded. fecpacketsreceived an integer value indicating the total number of rtp fec packets received for this source. this counter may also be inc
remented when fec packets arrive in-band along with media content; this can happen with opus, for example. fircount an integer value which indicates the total number of full intra request (fir) packets which this receiver has sent to the sender. this is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. this value is only available for video stream...
... containing the sum of the qp values for every frame decoded by this rtp receiver. you can determine the average qp per frame by dividing this value by framesdecoded. valid only for video streams. receiverid a string indicating which identifies the rtcaudioreceiverstats or rtcvideoreceiverstats object associated with the stream's receiver. this id is stable across multiple calls to getstats().
remoteid a string which identifies the rtc
remoteoutboundrtpstreamstats object that provides statistics for the
remote peer for this same ssrc. this id is stable across multiple calls to getstats(). slicount an integer indicating the number of times the receiver sent a slice loss indication (sli) frame to the sender to tell it that one or more consecutive (in terms of scan order) video macroblocks ...
RTCOutboundRtpStreamStats.qpSum - Web APIs
dividual codec specifications for details. example calculating average quantization the calculateaverageqp() function shown below computes the average qp for the given rtcstats object that contains rtp stream statistics, returning 0 if the object doesn't describe an rtp stream. ...
...() function shown below computes the average qp for the given rtcstats object that contains rtp stream statistics, returning 0 if the object doesn't describe an rtp stream. function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "
remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "
remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.qpsum' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.createAnswer() - Web APIs
the answer contains information about any media already attached to the session, codecs and options supported by the browser, and any ice candidates already gathered. the answer is delivered to the returned promise, and should then be sent to the source of the offer to continue the negotiation process. ...
...ideo-answer" to the other peer, carrying the answer to the device which sent the offer to connect. the contents of the object being passed to the sendtoserver() function, along with everything else in the promise fulfillment handler, depend entirely on your design pc.createanswer().then(function(answer) { return pc.setlocaldescription(answer); }) .then(function() { // send the answer to the
remote peer through the signaling server. }) .catch(handlegetusermediaerror); this asks rtcpeerconnection to create and return a new answer. in our promise handler, the returned answer is set as the description of the local end of the connection by calling setlocaldescription(). once that succeeds, the answer is sent to the signaling server using whatever protocol you see fit. promise.catch() is ...
RTCPeerConnection: datachannel event - Web APIs
note: this event is not dispatched when the local end of the connection creates the channel. ...
...nts that occur on that channel. pc.addeventlistener("datachannel", ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the
remote peer to the local one. this same code can also instead use the rtcpeerconnection interface's ondatachannel event handler property, like this: pc.ondatachannel = ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; } specifications specification status comment ...
RTCPeerConnection.iceConnectionState - Web APIs
the value is one of the strings in the rtciceconnectionstate enum. rtciceconnectionstate enum the rtciceconnectionstate enum defines the string constants used to describe the current state of the ice agent and its connection to the ice server (that is, the stun or turn server). constant description "new" the ice agent is gathering addresses or is waiting to be given
remote candidates through calls to rtcpeerconnection.addicecandidate() (or both). "checking" the ice agent has been given one or more
remote candidates and is checking pairs of local and
remote candidates against one another to try to find a compatible match, but has not yet found a pair which will allow the peer connection to be made. it's possible that gathering of candidates is also st...
...it's possible that gathering is still underway, and it's also possible that the ice agent is still checking candidates against one another looking for a better connection to use. ...
RTCPeerConnection.onaddstream - Web APIs
the rtcpeerconnection.onaddstream event handler is a property containing the code to execute when the addstream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is added to this connection by the
remote peer. the event is sent immediately after the call set
remotedescription() and doesn't wait for the result of the sdp negotiation. important: this property has been
removed from the specification; you should now use rtcpeerconnection.ontrack to watch for track events instead. it is included here in order to help you adapt existing code and understand existing samples, which may not be up-to-date yet. syntax rtcpeerconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of typ...
...ow use rtcpeerconnection.ontrack to watch for track events instead. it is included here in order to help you adapt existing code and understand existing samples, which may not be up-to-date yet. syntax rtcpeerconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of type mediastreamevent, are sent when streams are added to the connection by the
remote peer. the first time an event occurs may be nearly immediately after the
remote end of the connection is set using rtcpeerconnection.set
remotedescription(); it doesn't wait for a particular stream to be accepted or rejected using sdp negotiation. example this code, based on an older version of our signaling and video calling sample, responds to addstream events by setting the video source fo...
RTCPeerConnection.onnegotiationneeded - Web APIs
gotiationneeded event. there's no additional information provided in the event; anything you need, you can get by examining the properties of the rtcpeerconnection. example this example, derived from the example in signaling and video calling, establishes a handler for negotiationneeded events to handle creating an offer, configuring the local end of the connection, and sending the offer to the
remote peer. pc.onnegotiationneeded = function() { pc.createoffer().then(function(offer) { return pc.setlocaldescription(offer); }) .then(function() { // send the offer to the
remote peer through the signaling server }); }) .catch(reporterror); } first, it creates the offer by calling createoffer(). when that succeeds, the offer is passed into setlocaldescription() to set th...
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onnegotiationneeded' in that specification. ...
RTCPeerConnection.onsignalingstatechange - Web APIs
signalingstatechange event handler property of the rtcpeerconnection interface specifies a function to be called when the signalingstatechange event occurs on an rtcpeerconnection interface. the function receives as input the event object of type event; this event is sent when the peer connection's signalingstate changes, which may happen either because of a call to setlocaldescription() or to set
remotedescription(). syntax rtcpeerconnection.onsignalingstatechange = errorhandler; value set this to a function which you provide that receives an event object as input; this contains the signalingstatechange event. this event object doesn't provide details about what changed, but you can examine the signalingstate property to determine what the new state is. you may also, as always, set up a...
... pc.onsignalingstatechange = function(event) { if (pc.signalingstate === "have-local-pranswer") { // setlocaldescription() has been called with an answer } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe d...
RTCRtpStreamStats.qpSum - Web APIs
the compression. see the individual codec specifications for details. example calculating average quantization the calculateaverageqp() function shown below computes the average qp for the given rtcrtpstreamstats object, returning 0 if the object doesn't describe an rtp stream. ...
...ion the calculateaverageqp() function shown below computes the average qp for the given rtcrtpstreamstats object, returning 0 if the object doesn't describe an rtp stream. function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "
remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "
remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: qpsum' in that specification. candidate recommendation initial definition. identifiers...
RTCSessionDescription - Web APIs
iptioninit dictionary containing the values to assign the two properties. rtcsessiondescription.tojson() returns a json description of the object. the values of both properties, type and sdp, are contained in the generated json. ...
...ct. the values of both properties, type and sdp, are contained in the generated json. ...
RTCStats - Web APIs
define the contents of the objects that contain each of the various types of statistics for webrtc are structured in such a way that they build upon the core rtcstats dictionary, each layer adding more relevant information. rtcstats is the foundation of all webrtc statistics objects rtcrtpstreamstats adds to rtcstats information that applies to all rtp endpoints (that is, both local and
remote endpoints, and regardless of whether the endpoint is a sender or a receiver) rtcreceivedrtpstreamstats further adds statistics measured at the receiving end of an rtp stream, regardless of whether it's local or
remote. rtcinboundrtpstreamstats contains statistics that can only be measured on a receiver at the local end of the rtp connection. rtcoutboundrtpstre...
...sender or a receiver) rtcreceivedrtpstreamstats further adds statistics measured at the receiving end of an rtp stream, regardless of whether it's local or
remote. rtcinboundrtpstreamstats contains statistics that can only be measured on a receiver at the local end of the rtp connection. rtcoutboundrtpstreamstats contains statistics related to the receiver at the
remote end of the rtp stream. rtcsentrtpstreamstats offers statistics related to the sending end of an rtp stream. rtcoutboundrtpstreamstats contains statistics about the local sending endpoint of an rtp stream. rtc
remoteoutboundrtpstreamstats holds statistics related to the
remote sending end an rtp stream. specifications ...
RTCTrackEvent - Web APIs
ed to the connection. by the time the track event is delivered to the rtcpeerconnection's ontrack handler, the new media has completed its negotiation for a specific rtcrtpreceiver (which is specified by the event's receiver property). in addition, the mediastreamtrack specified by the receiver's track is the same one specified by the event's track, and the track has been added to any associated
remote mediastream objects. you can add a track event listener to be notified when the new track is available so that you can, for example, attach its media to a <video> element, using either rtcpeerconnection.addeventlistener() or the ontrack event handler property. note: it may be helpful to keep in mind that you receive the track event when a new inbound track has been added to your connection,...
...t you can, for example, attach its media to a <video> element, using either rtcpeerconnection.addeventlistener() or the ontrack event handler property. note: it may be helpful to keep in mind that you receive the track event when a new inbound track has been added to your connection, and you call addtrack() to add a track to the far end of the connection, thereby triggering a track event on the
remote peer. example this simple example creates an event listener for the track event which sets the srcobject of the <video> element with the id videobox to the first stream in the list passed in the event's streams array. peerconnection.addeventlistener("track", e => { let videoelement = document.getelementbyid("videobox"); videoelement.srcobject = e.streams[0]; }, false); specifications ...
Range.compareNode() - Web APIs
obsolete since gecko 1.9 (firefox 3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be
removed at any time. try to avoid using it. the range.comparenode() returns a constant indicating the position of the node. the possible values are: node_before (0) node starts before the range node_after (1) node ends after the range node_before_and_after (2) node starts before and ends after the range node_inside (3) node starts after and ends before the range, i.e. the node is completely selected by the range. ...
...node() returns a constant indicating the position of the node. the possible values are: node_before (0) node starts before the range node_after (1) node ends after the range node_before_and_after (2) node starts before and ends after the range node_inside (3) node starts after and ends before the range, i.e. the node is completely selected by the range. warning: this method has been
removed from gecko 1.9 (firefox 3) and will not exist in future versions of firefox, which was the only browser implementing it; you should switch to range.compareboundarypoints() as soon as possible. the following function can be used as replacement: function rangecomparenode(range, node) { var noderange = node.ownerdocument.createrange(); try { noderange.selectnode(node); } catch (e)...
Range.selectNodeContents() - Web APIs
selected within a range. example range = document.createrange(); referencenode = document.getelementsbytagname("div")[0]; range.selectnodecontents(referencenode); live sample this example lets the user select and deselect a paragraph with buttons. document.createrange(), range.selectnodecontents(), and selection.addrange() are used to select the content. window.getselection() and selection.
removeallranges() are used to deselect it. html <p id="p"><b>use the buttons below</b> to select or deselect the contents of this paragraph.</p> <button id="select-button">select paragraph</button> <button id="deselect-button">deselect paragraph</button> javascript const p = document.getelementbyid('p'); const selectbutton = document.getelementbyid('select-button'); const deselectbutton = docume...
...lect paragraph</button> <button id="deselect-button">deselect paragraph</button> javascript const p = document.getelementbyid('p'); const selectbutton = document.getelementbyid('select-button'); const deselectbutton = document.getelementbyid('deselect-button'); selectbutton.addeventlistener('click', e => { // clear any current selection const selection = window.getselection(); selection.
removeallranges(); // select paragraph const range = document.createrange(); range.selectnodecontents(p); selection.addrange(range); }); deselectbutton.addeventlistener('click', e => { const selection = window.getselection(); selection.
removeallranges(); }); result specifications specification status comment domthe definition of 'range.selectnodecontents()' ...
ResizeObserverEntry.contentRect - Web APIs
ple feature detection test to see if the browser supports the newer resizeobserverentry.contentboxsize property — if so, it uses that to get the sizing data it needs. if not, it uses contentrect. ...
....contentboxsize property — if so, it uses that to get the sizing data it needs. if not, it uses contentrect. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + '
rem'; pelem.style.fontsize = math.max(1, entry.contentboxsize.inlinesize/600) + '
rem'; } else { h1elem.style.fontsize = math.max(1.5, entry.contentrect.width/200) + '
rem'; pelem.style.fontsize = math.max(1, entry.contentrect.width/600) + '
rem'; } } }); resizeobserver.observe(divelem); specifications specification status comment resize observerthe definition of 'contentrect' in that specification. editor's draft initial de...
ResizeObserverEntry - Web APIs
mple feature detection test to see if the browser supports the newer contentboxsize property — if so, it uses that to get the sizing data it needs. if not, it uses the older contentrect property. ...
...perty — if so, it uses that to get the sizing data it needs. if not, it uses the older contentrect property. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + '
rem'; pelem.style.fontsize = math.max(1, entry.contentboxsize.inlinesize/600) + '
rem'; } else { h1elem.style.fontsize = math.max(1.5, entry.contentrect.width/200) + '
rem'; pelem.style.fontsize = math.max(1, entry.contentrect.width/600) + '
rem'; } } }); resizeobserver.observe(divelem); specifications specification status comment resize observerthe definition of 'resizeobserverentry' in that specification. editor's draft initia...
Resource Timing API - Web APIs
e size the performanceresourcetiming interface has three properties that can be used to obtain size data about a resource. the transfersize property returns the size (in octets) of the fetched resource including the response header fields plus the response payload body. the encodedbodysize property returns the size (in octets) received from the fetch (http or cache), of the payload body, before
removing any applied content-codings. decodedbodysize returns the size (in octets) received from the fetch (http or cache) of the message body, after
removing any applied content-codings. other properties the nexthopprotocol property returns the network protocol used to fetch the resource. the initiatortype property returns the type of resource that initiated the performance entry such as "css" fo...
... the performance entry such as "css" for a css resource, "xmlhttprequest" for an xmlhttprequest and "img" for an image (such as a jpeg). if the current context is a worker, the workerstart property can be used to obtain a domhighrestimestamp when the worker was started. methods the resource timing api includes two methods that extend the performance interface. the clearresourcetimings() method
removes all "resource" type performance entries from the browser's resource performance entry buffer. the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the specified number of resource performance entries. the performanceresourcetiming interface's tojson() method returns a json serialization of a "resource" type performance entry. implementation status as ...
SVGElement - Web APIs
lso be defined in svg using attributes of the form data-*, where * is the key name for the pair. this works just like html's htmlelement.dataset property and html's data-* global attribute. svgelement.classname read only an svganimatedstring that reflects the value of the class attribute on the given element, or the empty string if class is not present. this attribute is deprecated and may be
removed in a future version of this specification. authors are advised to use element.classlist instead. svgelement.ownersvgelementread only an svgsvgelement referring to the nearest ancestor <svg> element. null if the given element is the outermost <svg> element. svgelement.viewportelementread only the svgelement, which established the current viewport. often, the nearest ancestor <svg> elemen...
... via the onerror property. load fires on an svgelement when it is loaded in the browser. also available via the onload property. resize fired when an svg document is being resized. also available via the onresize property. scroll fired when an svg document view is being shifted along the x and/or y axes. also available via the onscroll property. unload fired when the dom implementation
removes an svg document from a window or frame. also available via the onunload property. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgelement' in that specification. candidate recommendation adds the dataset property. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgelement' in tha...
SVGGraphicsElement: cut event - Web APIs
on through the browserʼs user interface. if the user attempts a cut action on uneditable content, the cut event still fires but the event object contains no data. bubbles yes cancelable yes interface clipboardevent event handler property oncut the eventʼs default action is to copy the current selection (if any) to the system clipboard and
remove it from the document. a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action f...
...dify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action for "cut" while modifying the clipboard must also manually
remove the selection from the document. the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic cut event, but this will not affect the system clipboard or the document's contents. specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to ...
SVGPathElement - Web APIs
properties this interface also inherits properties from its parent, svggeometryelement. svgpathelement.pathlength an svganimatednumber corresponding to the pathlength attribute of the given <path> element. note: in svg 2 this property was moved to the svggeometrye...
...tand-alone, parentless svgpathsegcurvetoquadraticsmoothabs object. svgpathelement.createsvgpathsegcurvetoquadraticsmoothrel() returns a stand-alone, parentless svgpathsegcurvetoquadraticsmoothrel object. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgpathelement' in that specification. candidate recommendation
removed the getpathsegatlength() and createsvgpathseg* methods and moved the pathlength property and the gettotallength() and getpointatlength() methods to svggeometryelement. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpathelement' in that specification. recommendation initial definition ...
SVGStyleElement - Web APIs
properties this interface also inherits properties from its parent interface, svgelement and implements properties from linkstyle. svgstyleelement.type a domstring corresponding to the type attribute of the given element. svg 1.1 defined that a domexception is raised with code no_modification_allowed_err on an attempt to change the value of a read-only attribute. this restriction was
removed in svg 2. svgstyleelement.media a domstring corresponding to the media attribute of the given element. svg 1.1 defined that a domexception is raised with code no_modification_allowed_err on an attempt to change the value of a read-only attribute. this restriction was
removed in svg 2. svgstyleelement.title a domstring corresponding to the title attribute of the given element. svg 1.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements methods from linkstyle. ...
Selection.deleteFromDocument() - Web APIs
the deletefromdocument() method of the selection interface deletes the selected text from the document's dom. syntax sel.deletefromdocument() parameters none. example this example lets you delete selected text by clicking a button. upon clicking the button, the window.getselection() method gets the selected text, and the deletefromdocument() method
removes it. ...
...ace deletes the selected text from the document's dom. syntax sel.deletefromdocument() parameters none. example this example lets you delete selected text by clicking a button. upon clicking the button, the window.getselection() method gets the selected text, and the deletefromdocument() method
removes it. html <p>try highlighting some of the text in this paragraph. ...
ServiceWorkerContainer.register() - Web APIs
n(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } the following code, if included in example.com/index.html, at the root of a site, would apply to exactly the same pages as the example above.
remember the scope, when included, uses the page's location as its base. alternatively, if this code were included in a page at example.com/product/description.html, with the javascript file residing at example.com/product/sw.js, then the service worker would only apply to resources under example.com/product. if ('serviceworker' in navigator) { // declaring scope manually navigator.serviceworke...
... specifications specification status comment service workersthe definition of 'serviceworkercontainer: register' in that specification. working draft initial definition. ...
ServiceWorkerRegistration.showNotification() - Web APIs
otification. this string must be a valid bcp 47 language tag. renotify: a boolean that indicates whether to suppress vibrations and audible alerts when reusing a tag value. if options’s renotify is true and options’s tag is the empty string a typeerror will be thrown. the default is false. requireinteraction: indicates that on devices with sufficiently large screens, a notification should
remain active until the user clicks or dismisses it. if this value is absent or false, the desktop version of chrome will auto-minimize notifications after approximately twenty seconds. the default value is false. silent: when set indicates that no sounds or vibrations should be made. if options’s silent is true and options’s vibrate is present a typeerror exception will be thrown. the default ...
...ktop version of chrome will auto-minimize notifications after approximately twenty seconds. the default value is false. silent: when set indicates that no sounds or vibrations should be made. if options’s silent is true and options’s vibrate is present a typeerror exception will be thrown. the default value is false. tag: an id for a given notification that allows you to find, replace, or
remove the notification using a script if necessary. timestamp: a domtimestamp representing the time when the notification was created. it can be used to indicate the time at which a notification is actual. for example, this could be in the past when a notification is used for a message that couldn’t immediately be delivered because the device was offline, or in the future for a meeting that is ...
SourceBuffer.mode - Web APIs
e to segments when the initial value is sequence, an exception will be thrown. the existing segment order must be maintained in sequence mode. you can, however, change the value from segments to sequence. it just means the play order will be fixed, and new timestamps generated to reflect this. this property cannot be changed during while the sourcebuffer is processing either an appendbuffer() or
remove() call. syntax var mymode = sourcebuffer.mode; sourcebuffer.mode = 'sequence'; value a domstring. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to segments when the initial value is sequence. invalidstateerror the sourceb...
...this property. exception explanation invalidaccesserror an attempt was made to set the value to segments when the initial value is sequence. invalidstateerror the sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), the last media segment appended to this sourcebuffer is incomplete, or this sourcebuffer has been
removed from the mediasource. example this snippet sets the sourcebuffer mode to 'sequence' if it is currently set to 'segments', thus setting the play order to the sequence in which media segments are appended. var curmode = sourcebuffer.mode; if (curmode == 'segments') { sourcebuffer.mode = 'sequence'; } specifications specification status comment media source e...
SpeechSynthesis.cancel() - Web APIs
the cancel() method of the speechsynthesis interface
removes all utterances from the utterance queue. if an utterance is currently being spoken, speaking will stop immediately. syntax speechsynthesisinstance.cancel(); returns void. parameters none. ...
... draft ...
Storage API - Web APIs
imum storage limits). origin 1 has some web storage data as well as some indexeddb data, but also has some free space left; its current usage hasn't yet reached its quota. origin 2 has no data stored in it yet; it's just an empty box waiting for content. this origin, however, has a lower quota than the other two do. it may be a less-visited site, or one known to have lower data storage requi
rements. origin 3's storage unit is completely full; it's reached its quota and can't store any more data without some existing material being
removed. user agents are likely to use various techniques to determine the quota for various origins. one of the most likely methods—one which the specification specifically encourages, in fact—would be to consider the popularity and/or usage levels of ...
...leared rather than providing some means of clearing only data from individual apis. if a box is marked as "persistent", the contents won't be cleared by the user agent without either the data's origin itself or the user specifically doing so. this includes scenarios such as the user selecting a "clear caches" or "clear recent history" option. the user will be asked specifically for permission to
remove persistent site storage units. quotas and usage estimates the user agent determines, using whatever mechanism it chooses, the maximum amount of storage a given site can use. this maximum is the origin's quota. the amount of this space which is in use by the site is called its usage. both of these values are estimates; there are several reasons why they're not precise: user agents are enco...
SubtleCrypto.deriveBits() - Web APIs
.derivebits( { name: "ecdh", namedcurve: "p-384", public: publickey }, privatekey, 128 ); const buffer = new uint8array(sharedsecret, 0, 5); const sharedsecretvalue = document.queryselector(".ecdh .derived-bits-value"); sharedsecretvalue.classlist.add("fade-in"); sharedsecretvalue.addeventlistener("animationend", () => { sharedsecretvalue.classlist.
remove("fade-in"); }); sharedsecretvalue.textcontent = `${buffer}...[${sharedsecret.bytelength} bytes total]`; } // generate 2 ecdh key pairs: one for alice and one for bob // in more normal usage, they would generate their key pairs // separately and exchange public keys securely const generatealiceskeypair = window.crypto.subtle.generatekey( { name: "ecdh", namedcurve: "p-384" }, ...
... "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, 256 ); const buffer = new uint8array(derivedbits, 0, 5); const derivedbitsvalue = document.queryselector(".pbkdf2 .derived-bits-value"); derivedbitsvalue.classlist.add("fade-in"); derivedbitsvalue.addeventlistener("animationend", () => { derivedbitsvalue.classlist.
remove("fade-in"); }); derivedbitsvalue.textcontent = `${buffer}...[${derivedbits.bytelength} bytes total]`; } const derivebitsbutton = document.queryselector(".pbkdf2 .derive-bits-button"); derivebitsbutton.addeventlistener("click", () => { getderivedbits(); }); specifications specification status comment web cryptography apithe definition of 'subtlecrypto.derivebits...
User Timing API - Web APIs
entrytype) returns all performance entries in the performance timeline with the specified name and entrytype, thus set entrytype to "mark" to get all marks (and set name accordingly to retrieve more specific entries). performance.getentriesbytype(entrytype) returns all performance entries in the performance timeline with the specified entrytype, thus set entrytype to "mark" to get all marks.
removing performance marks to
remove a specific mark from the performance timeline, call performance.clearmarks(name) where name is the name of the mark(s) you want
removed. if this method is called with no arguments, all mark type entries will be
removed from the performance timeline. performance measures measure events are also named by the application but they are placed between two marks thus ...
...returns all performance entries in the performance timeline with the specified name and entrytype, thus set entrytype to "measure" to get all measures (and set name accordingly to retrieve more specific entries). performance.getentriesbytype(entrytype) returns all performance entries in the performance timeline with the specified entrytype, thus set entrytype to "measure" to get all measures.
removing performance measures to
remove a specific measure from the performance timeline, call performance.clearmeasures(name) where name is the name of the measure(s) you want
removed. if this method is called with no arguments, all measure type entries will be
removed from the performance timeline. interoperability as shown in the performance interface's browser compatibility table, the user tim...
WebGLRenderingContext.stencilOp() - Web APIs
test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. the default value is gl.keep. return value none. constants gl.keep keeps the current value. gl.zero sets the stencil buffer value to 0. gl.replace sets the stencil buffer value to the reference value as specified by webglrenderingcontext.stencilfunc(). gl.incr inc
rements the current stencil buffer value. clamps to the maximum representable unsigned value. gl.incr_wrap inc
rements the current stencil buffer value. wraps stencil buffer value to zero when inc
rementing the maximum representable unsigned value. gl.decr dec
rements the current stencil buffer value. clamps to 0. gl.decr_wrap dec
rements the current stencil buffer value. wraps stencil buffer value...
... gl.invert inverts the current stencil buffer value bitwise. examples the stencil testing is disabled by default. to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test. ...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. the default value is gl.keep. return value none. constants gl.keep keeps the current value. gl.zero sets the stencil buffer value to 0. gl.replace sets the stencil buffer value to the reference value as specified by webglrenderingcontext.stencilfunc(). gl.incr inc
rements the current stencil buffer value. clamps to the maximum representable unsigned value. gl.incr_wrap inc
rements the current stencil buffer value. wraps stencil buffer value to zero when inc
rementing the maximum representable unsigned value. gl.decr dec
rements the current stencil buffer value. clamps to 0. gl.decr_wrap dec
rements the current stencil buffer value. wraps stencil buffer value...
... gl.invert inverts the current stencil buffer value bitwise. examples the stencil testing is disabled by default. to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test. ...
Hello GLSL - Web APIs
« previousnext » this webgl example demonstrates a very basic glsl shader program that draws a solid color square. note: this example will most likely work in all modern desktop browsers. but it may not work in some mobile or older browsers. if the canvas
remains blank, you can check the output of the next example, which draws exactly the same thing. but
remember to read through the explanations and code on this page, before moving on to the next. hello world program in glsl a very simple first shader program. <p>hello world! hello glsl!</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black;...
...x-shader"> #version 100 void main() { gl_position = vec4(0.0, 0.0, 0.0, 1.0); gl_pointsize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 void main() { gl_fragcolor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use strict" window.addeventlistener("load", setupwebgl, false); var gl, program; function setupwebgl (evt) { window.
removeeventlistener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = document.queryselector("#fragment-shader").innerhtml var fragmentshader = gl.createshader(gl.
Raining rectangles - Web APIs
width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); var gl, timer, rainingrect, scoredisplay, missesdisplay; function setupanimation (evt) { window.
removeeventlistener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); rainingrect = new rectangle(); timer = settimeout(drawanimation, 17); document.queryselector("canvas") .addeventlistener("click", playerclick, false); var displays = document.queryselectorall("strong"); scoredisplay = displays[0]; missesdisplay = disp...
...ew rectangle(); } // we are using settimeout for animation. so we reschedule // the timeout to call drawanimation again in 17ms. // otherwise we won't get any animation. timer = settimeout(drawanimation, 17); } function playerclick (evt) { // we need to transform the position of the click event from // window coordinates to relative position inside the canvas. // in addition we need to
remember that vertical position in // webgl increases from bottom to top, unlike in the browser // window. var position = [ evt.pagex - evt.target.offsetleft, gl.drawingbufferheight - (evt.pagey - evt.target.offsettop), ]; // if the click falls inside the rectangle, we caught it. // inc
rement score and create a new rectangle. var diffpos = [ position[0] - rainingrect.posit...
Simple color animation - Web APIs
e]</strong> the animation </button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addeventlistener("load", function setupanimation (evt) { "use strict" window.
removeeventlistener(evt.type, setupanimation, false); // a variable to hold a timer that drives the animation. var timer; // click event handlers. var button = document.queryselector("#animation-onoff"); var verb = document.queryselector("strong"); function startanimation(evt) { button.
removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopani...
...veeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); verb.innerhtml="stop"; // setup animation loop by redrawing every second. timer = setinterval(drawanimation, 1000); // give immediate feedback to user after clicking, by // drawing one animation frame. drawanimation(); } function stopanimation(evt) { button.
removeeventlistener(evt.type, stopanimation, false); button.addeventlistener("click", startanimation, false); verb.innerhtml="start"; // stop animation by clearing the timer. clearinterval(timer); } // call stopanimation() once to setup the initial event // handlers for canvas and button. stopanimation({type: "click"}); var gl; function drawanimation () { if (!gl) { ...
Matrix math for the web - Web APIs
a matrix is to use the css matrix3d() transform. first we'll set up a simple <div> with some content. the style is not shown, but it's set to a fixed width and height and is centered on the page. the <div> has a transition set for the transform so that matrix is animated in making it easy to see what is being done. <div id='move-me' class='transformable'> <h2>move me with a matrix</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipisicing elit...</p> </div> finally, for each of the examples we will generate a 4x4 matrix, then update the <div>'s style to have a transform applied to it, set to a matrix3d. bear in mind that even though the matrix is made up of 4 rows and 4 columns, it collapses into a single line of 16 values. matrices are always stored in one-dimensional lists in javas...
...); why matrices are important matrices are important because they comprise a small set of numbers that can describe a wide range of transformations in space. they can easily be shared around in programs. different coordinate spaces can be described with matrices, and some matrix multiplication will move one set of data from one coordinate space to another coordinate space. matrices effectively
remember every part of the previous transforms that were used to generate them. for uses in webgl, the graphics card is particularly good at multiplying a large number of points in space by matrices. different operations like positioning points, calculating lighting, and posing animated characters all rely on this fundamental tool. ...
Using textures in WebGL - Web APIs
if (ispowerof2(image.width) && ispowerof2(image.height)) { // yes, it's a power of 2. generate mips. gl.generatemipmap(gl.texture_2d); } else { // no, it's not a power of 2. turn off mips and set // wrapping to clamp to edge gl.texpa...
...ttribute for image elements is implemented in gecko 8.0. tainted (write-only) 2d canvases can't be used as webgl textures. a 2d <canvas> becomes tainted, for example, when a cross-domain image is drawn on it. note: cors support for canvas 2d drawimage is implemented in gecko 9.0. this means that using a cross-domain image with cors approval does no longer taint the 2d canvas, so the 2d canvas
remains usable as the source of a webgl texture. note: cors support for cross-domain videos and the crossorigin attribute for <video> elements is implemented in gecko 12.0. « previousnext » ...
Writing WebSocket servers - Web APIs
status codes can be used only before the handshake. after the handshake succeeds, you have to use a different set of codes (defined in section 7.4 of the spec). server handshake response when the server receives the handshake request, it should send back a special response that indicates that the protocol will be changing from http to websocket. that header looks something like the following (
remember each header line ends with \r\n and put an extra \r\n after the last one to indicate the end of the header): http/1.1 101 switching protocols upgrade: websocket connection: upgrade sec-websocket-accept: s3pplmbitxaq9kygzzhzrbk+xoo= additionally, the server can decide on extension/subprotocol requests here; see miscellaneous for details. the sec-websocket-accept header is important in tha...
...ayload concatenated to previous message) client: fin=1, opcode=0x0, msg="year!" server: (process complete message) happy new year to you too! notice the first frame contains an entire message (has fin=1 and opcode!=0x0), so the server can process or respond as it sees fit. the second frame sent by the client has a text payload (opcode=0x1), but the entire message has not arrived yet (fin=0). all
remaining parts of that message are sent with continuation frames (opcode=0x0), and the final frame of the message is marked by fin=1. section 5.4 of the spec describes message fragmentation. pings and pongs: the heartbeat of websockets at any point after the handshake, either the client or the server can choose to send a ping to the other party. when the ping is received, the recipient must send b...
Web Video Text Tracks Format (WebVTT) - Web APIs
h is the starting time for showing the text that appears underneath. on the same line, we then have a string of "-->". we finish the first line with a second time, which is the ending time for showing the associated text. we can then have one or more lines that start with a hyphen (-), each containing part of the text track to be shown. we can also place comments in our .vtt file, to help us
remember important information about the parts of our file. these should be on separate lines, starting with the string note. you'll find more about these in the below section. it is important to not use "extra" blank lines within a cue, for example between the timings line and the cue payload. webvtt is line based; a blank line will close the cue. webvtt comments comments are an optional componen...
... used between style blocks. style ::cue(b) { color: peachpuff; } 00:00:00.000 --> 00:00:10.000 - hello <b>world</b>. note style blocks cannot appear after the first cue. we can also use identifiers inside webvtt file, which can be used for defining a new style for some particular cues in the file. the example where we wanted the transcription text to be red highlighted and the other part to
remain normal, we can define it as follows using css. where it must be noted that the css uses escape sequences the way they are used in html pages: webvtt 1 00:00.000 --> 00:02.000 that’s an, an, that’s an l! crédit de transcription 00:04.000 --> 00:05.000 transcrit par célestes™ ::cue(#\31) { color: lime; } ::cue(#crédit\ de\ transcription) { color: red; } positioning of text tracks ...
Rendering and the WebXR frame animation callback - Web APIs
veform, which cycles 60 times per second in the united states (50 in europe), for timing purposes. this figure goes by a number of different names, but they're all equivalent or nearly so: refresh rate vertical refresh rate vertical blanking rate (vbl) vertical sync rate vertical refresh rate there are other similar terms used as well, but regardless of what it's called, the unit of measu
rement applied is the hertz, or hz. a display that refreshes 60 times per second has a 60 hz refresh rate. that means that the maximum number of frames it can display in a second is 60. no matter how many frames per second you render beyond that, only 60 of them will make it to the screen in the course of a second. but not all displays run at 60 hz; nowadays, higher performance displays are beginnin...
... browser can paint the next frame of your scene, the function you provided to requestanimationframe() is invoked. it receives as input the time at which the frame being drawn and an xrframe object providing details about the state of the scene for the frame you need to render. ideally, you want this code to be fast enough that it can maintain a 60 fps frame rate, or as close to that as possible,
remembering that there's more going on than just your code in this one function. you need to make sure that the main thread doesn't need to run for more time per frame than the duration of the frame itself. a basic renderer in this version of the webxr renderering callback, we use a very straightforward approach that works great for relatively simple projects. this pseudocode outlines that process:...
Using the Web Audio API - Web APIs
lume, and pan it from left to right. controlling sound programmatically from javascript code is covered by browsers' autoplay support policies, as such is likely to be blocked without permission being granted by the user (or a whitelist). autoplay policies typically require either explicit permission or a user engagement with the page before scripts can trigger audio to play. these special requi
rements are in place essentially because unexpected sounds can be annoying and intrusive, and can cause accessibility problems. you can learn more about this in our article autoplay guide for media and web audio apis. since our scripts are playing audio in response to a user input event (a click on a play button, for instance), we're in good shape and should have no problems from autoplay blocking. ...
... the voice-change-o-matic is a fun voice manipulator and sound visualization web app that allows you to choose different effects and visualizations. the application is fairly rudimentary, but it demonstrates the simultaneous use of multiple web audio api features. (run the voice-change-o-matic live). another application developed specifically to demonstrate the web audio api is the violent the
remin, a simple web application that allows you to change pitch and volume by moving your mouse pointer. it also provides a psychedelic lightshow (see violent the
remin source code). also see our webaudio-examples repo for more examples. ...
Web Audio API - Web APIs
audio source. mediaelementaudiosourcenode the mediaelementaudiosourcenode interface represents an audio source consisting of an html5 <audio> or <video> element. it is an audionode that acts as an audio source. mediastreamaudiosourcenode the mediastreamaudiosourcenode interface represents an audio source consisting of a mediastream (such as a webcam, microphone, or a stream being sent from a
remote computer). if multiple audio tracks are present on the stream, the track whose id comes first lexicographically (alphabetically) is used. it is an audionode that acts as an audio source. mediastreamtrackaudiosourcenode a node of type mediastreamtrackaudiosourcenode represents an audio source whose data comes from a mediastreamtrack. when creating the node using the createmediastreamtracksour...
... directly using javascript in a worklet thread rather than on the main thread. obsolete: script processor nodes before audio worklets were defined, the web audio api used the scriptprocessornode for javascript-based audio processing. because the code runs in the main thread, they have bad performance. the scriptprocessornode is kept for historic reasons but is marked as deprecated and will be
removed in a future version of the specification. scriptprocessornode the scriptprocessornode interface allows the generation, processing, or analyzing of audio using javascript. it is an audionode audio-processing module that is linked to two buffers, one containing the current input, one containing the output. an event, implementing the audioprocessingevent interface, is sent to the object ea...
Web Crypto API - Web APIs
erface allowing a script to use cryptographic primitives in order to build systems using cryptography. warning: the web crypto api provides a number of low-level cryptographic primitives. it's very easy to misuse them, and the pitfalls involved can be very subtle. even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are ext
remely hard to get right, and are generally the domain of specialist security experts. errors in security system design and implementation can make the security of the system completely ineffective. if you're not sure you know what you are doing, you probably shouldn't be using this api. interfaces some browsers implemented an interface called crypto without having it well defined or being crypt...
...ity system design and implementation can make the security of the system completely ineffective. if you're not sure you know what you are doing, you probably shouldn't be using this api. interfaces some browsers implemented an interface called crypto without having it well defined or being cryptographically sound. in order to avoid confusion, methods and properties of this interface have been
removed from browsers implementing the web crypto api, and all web crypto api methods are available on a new interface: subtlecrypto. the crypto.subtle property gives access to an object implementing it. specifications specification status comment web cryptography api recommendation initial definition ...
Window.controllers - Web APIs
rollers is an object of type xulcontrollers (nsicontrollers). specification xul-specific. not part of specification. by default, a window's controller contains the code that supports the global window commands. ...
...cific. not part of specification. by default, a window's controller contains the code that supports the global window commands. ...
Window.event - Web APIs
to change preferences in firefox, visit about:config.ie full support 4opera full support 7safari fu...
...to change preferences in firefox, visit about:config.opera android full support 10.1safari ios full support 1samsun...
Window: popstate event - Web APIs
d by a call to history.pushstate() or was affected by a call to history.replacestate(), the popstate event's state property contains a copy of the history entry's state object. these methods and their corresponding events can be used to add data to the history stack which can be used to reconstruct a dynamically generated page, or to otherwise alter the state of the content being presented while
remaining on the same document. note that just calling history.pushstate() or history.replacestate() won't trigger a popstate event. the popstate event will be triggered by doing a browser action such as a click on the back or forward button (or calling history.back() or history.forward() in javascript). browsers tend to handle the popstate event differently on page load. chrome (prior to v34) and ...
...ent is not already visible, it's made visible and the pageshow event is fired at the document with the pagetransitionevent's persisted attribute set to true. the document's url is set to that of new-entry. if the history traversal is being performed with replacement enabled, the entry immediately prior to the destination entry (taking into account the delta parameter on methods such as go()) is
removed from the history stack. if the new-entry doesn't have persisted user state and its url's fragment is non-null, the document is scrolled to that fragment. next, current-entry is set to new-entry. the destination entry is now considered to be current. if new-entry has serialized state information saved with it, that information is deserialized into history.state; otherwise, state is null. i...
Window.requestFileSystem() - Web APIs
ich lets a web site or app gain access to a sandboxed file system for its own use. the returned filesystem is then available for use with the other file system apis. even compared to the rest of the file and directory entries api, requestfilesystem() is especially non-standard; only chrome implements it, and all other browser makers have decided that they will not implement it. it has even been
removed from the proposed specification. do not use this method! syntax this method is prefixed with webkit in all browsers that implement it (that is, google chrome). window.requestfilesystem(type, size, successcallback[, errorcallback]); parameters type the type of storage to request. specify window.temporary if it's acceptable for the browser to delete the files at its own discretion, s...
...thod is prefixed with webkit in all browsers that implement it (that is, google chrome). window.requestfilesystem(type, size, successcallback[, errorcallback]); parameters type the type of storage to request. specify window.temporary if it's acceptable for the browser to delete the files at its own discretion, such as if storage space runs low, or window.persistent if you need the files to
remain in place unless the user or the web site or app explicitly permit it. persistent storage requires that the user grant the site quota. size the amount of storage space you wish to have allocated for your app's use. successcallback a function which is invoked when the file system has been successfully obtained. the callback receives a single parameter: a filesystem object representing the fi...
Window.showModalDialog() - Web APIs
the window.showmodaldialog() created and displayed a modal dialog box containing a specified html document. syntax returnval = window.showmodaldialog(uri[, arguments][, options]); returnval holds the returnvalue property as set by the document specified by uri. uri is the url of the document to display in the dialog. arguments is an optional variant containing values passed to the dialog; these are made available in the window object's window.dialogarguments property. ...
... nofirefox no support 3 — 56ie full support 4opera no support nosafari full support 5.1notes full support 5.1notes notes see webkit bug 151885 for possible future
removal from safari.webview android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet andr...
Window - Web APIs
zanimationstarttime the time in milliseconds since epoch at which the current animation cycle began. use animation.starttime instead. window.mozpaintcount returns the number of times the current document has been rendered to the screen in this window. this can be used to compute rendering performance. window.orientation read only returns the orientation in degrees (in 90 degree inc
rements) of the viewport relative to the device's natural orientation. window.pkcs11 formerly provided access to install and
remove pkcs11 modules. window.returnvalue the return value to be returned to the function that called window.showmodaldialog() to display the window as a modal dialog. methods this interface inherits methods from the eventtarget interface and implements methods from ...
...rglobalscope.settimeout(). windoworworkerglobalscope.createimagebitmap() accepts a variety of different image sources, and returns a promise which resolves to an imagebitmap. optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network. eventtarget.
removeeventlistener
removes an event listener from the window. windoworworkerglobalscope.setinterval() schedules a function to execute every time a given number of milliseconds elapses. windoworworkerglobalscope.settimeout() schedules a function to execute in a given amount of time. deprecated methods window.back() moves back one in the window history. this method is deprecated; you sh...
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
) and setinterval() are shared, which means you can technically use cleartimeout() and clearinterval() interchangeably. however, for clarity, you should avoid doing so. example run the script below in the context of a web page and click on the page once. you'll see a message popping up in a second. if you click the page multiple times in one second, the alert only appears once. ...
... once. you'll see a message popping up in a second. if you click the page multiple times in one second, the alert only appears once. var alarm = {
remind: function(amessage) { alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.cancel(); } this.timeoutid = window.settimeout(function(msg) { this.
remind(msg); }.bind(this), 1000, 'wake up!'); }, cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown. specifications specification status comment html living standardthe definition of 'windoworworkergloba...
Synchronous and asynchronous requests - Web APIs
tion of function loadfile are "applied" to the running of the callback function. line 5 declares a function invoked when the xhr operation fails to complete successfully. line 11 stores the success callback given as the second argument to loadfile in the xhr object's callback property. line 12 slices the arguments array given to the invocation of loadfile. starting with the third argument, all
remaining arguments are collected, assigned to the arguments property of the variable xhr, passed to the success callback function xhrsuccess., and ultimately supplied to the callback function (in this case, showmessage) which is invoked by function xhrsuccess. line 15 specifies true for its third parameter to indicate that the request should be handled asynchronously. line 16 actually initiates th...
...ote: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), blink 39.0, and edge 13, synchronous requests on the main thread have been deprecated due to their negative impact on the user experience. synchronous xhr requests often cause hangs on the web. but developers typically don't notice the problem because the hang only manifests with poor network conditions or when the
remote server is slow to respond. synchronous xhr is now in deprecation state. the recommendation is that developers move away from the synchronous api and instead use asynchronous requests. all new xhr features such as timeout or abort are not allowed for synchronous xhr. doing so will raise an invalidaccesserror. example: http synchronous request this example demonstrates how to make a simple sy...
XSLTProcessor - Web APIs
ets a parameter in the xslt stylesheet that was imported. (sets the value of an <xsl:param>.) a null value for namespaceuri is treated the same as an empty string. [throws] any xsltprocessor.getparameter(string namespaceuri, string localname) gets the value of a parameter from the xslt stylesheet. a null value for namespaceuri is treated the same as an empty string. [throws] void xsltprocessor.
removeparameter(string namespaceuri, string localname)
removes the parameter if it was previously set. this will make the xsltprocessor use the default value for the parameter as specified in the stylesheet. a null value for namespaceuri is treated the same as an empty string. void xsltprocessor.clearparameters()
removes all set parameters from the xsltprocessor. the xsltprocessor will then use th...
... if it was previously set. this will make the xsltprocessor use the default value for the parameter as specified in the stylesheet. a null value for namespaceuri is treated the same as an empty string. void xsltprocessor.clearparameters()
removes all set parameters from the xsltprocessor. the xsltprocessor will then use the defaults specified in the xslt stylesheet. void xsltprocessor.reset()
removes all parameters and stylesheets from the xsltprocessor. properties non-web-exposed properties the following properties are [chromeonly] and not exposed to web content: [chromeonly] attribute unsigned long xsltprocessor.flags flags that tweak the behavior of the processor. not reset by calling xsltprocessor.reset(). default value: 0 possible values are: name value ...
ARIA: dialog role - Accessibility
the dialog role helps assistive technology identify the dialog's content as being grouped and separated from the rest of the page content. however, adding role="dialog" alone is not sufficient to make a dialog accessible. additionally, the following needs to be done: the dialog must be properly labeled keyboard focus must be managed correctly the sections below describe how these two requi
rements can be met. labeling even though it is not required for the dialog itself to be able to receive focus, it still needs to be labeled. the label given to the dialog will provide contextual information for the interactive controls inside the dialog. in other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element provides a grouping la...
...v> keep in mind that a dialog's title and description text do not have to be focusable in order to be perceived by screen readers operating in a non-virtual mode. the combination of the aria dialog role and labeling techniques should make the screen reader announce the dialog's information when focus is moved into it. required javascript features focus management a dialog has particular requi
rements for how keyboard focus should be managed: dialogs should always have at least one focusable control. for many dialogs, there will be a button like "close", "ok" or "cancel". in addition to the needed control, dialogs can contain any number of focusable elements, even entire forms or other container widgets like tabs. when the dialog appears on the screen, keyboard focus (whose control dep...
ARIA: listbox role - Accessibility
moves focus to the last option. control + a (optional): selects all options in the list. optionally, if all options are selected, it may also unselect all options. required javascript features selecting an option in a single select listbox when the user selects an option, the following must occur: deselect the previously selected option, setting the aria-selected to false, or
removing the attribute altogether, changing the appearance of the newly unselected option to appear not selected. select the newly selected option, setting aria-selected="true" on the option and changing the appearance of the newly selected option to appear selected. update the aria-activedescendant value on the listbox to the id of the newly selected option visually handle the blur, focus, and se...
...more options, similar to html select with size attribute greater than one. collapsible dropdown listbox example: single-select collapsible listbox that expands when activated, similar to html select with the attribute size="1". example listboxes with rearrangeable options: examples of both single-select and multi-select listboxes with accompanying toolbars where options can be added, moved, and
removed. best practices to be keyboard accessible, authors should manage focus of all descendants of this role. it is recommended that authors use different styling for the selection when the list is not focused, e.g. a non-active selection is often shown with a lighter background colour. if the listbox is not part of another widget, it should have the aria-labelledby property set. if one or ...
ARIA: textbox role - Accessibility
tting aria-readonly="true" on the element. associated aria properties aria-activedescendent attribute taking as it's value the id of is either a descendant of the element with dom focus or is a logical descendant as indicated by the aria-owns attribute, it indicates when that element has focus, when it is part of a composite widget such as a combobox. for example, in a combobox, focus may
remain on the textbox while the value of aria-activedescendant on the textbox element refers to a descendant of a popup listbox that is controlled by the textbox.this attribute must be updated programmatically as the focus changes. aria-autocomplete attribute indicates whether and how the user's input into the field could trigger display of a prediction of the intended value. it supports the follow...
...ble, permanent, indicates what kind of information is expected, and increases the hit area for setting focus on the control, whereas placeholder text is only temporary hint about the expected value, which if implemented incorrectly can decrease accessibility. the placeholder should be visible when the control's value is the empty string such as when the control first receives focus and when users
remove a previously-entered value. instead of using aria-placeholder, use the semantic <input type="text"> or <textarea> with a placeholder attribute. aria-readonly attribute indicates that the user cannot modify the value of the text field. instead of using aria-readonly, use the semantic <input type="text"> or <textarea> with a readonly attribute. aria-required attribute indicates that a value ...
WAI-ARIA Roles - Accessibility
a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads.aria: figure rolethe aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist.
...g data arranged in rows and columns, similar to the native <table> html element.aria: tabpanel rolethe aria tabpanel role indicatesaria: textbox rolethe textbox role is used to identify an element that allows the input of free-form text. aria: timer rolethe timer role indicates to assistive technologies that an element is a numerical counter the amount of elapsed time from a starting point or the
remaining time until an end point. please claim the role you want to work on by adding your name after the role's name: (old pages are linked from https://developer.mozilla.org/docs/web/accessibility/aria/aria_techniques). ones for which the first draft is completed have been
removed from the below list. alertdialog banner combobox command columnheader (estelle) complementary composite d...
Architecture - Accessibility
to piece its final text representation together. they are kept in iaccessible2 for backward compatibility with msaa clients that expect text in leaf nodes. html (role_whitespace) objects are implemented by nshtmlbraccessible. they end up getting exposed as '\n' in their parent nshypertextaccessible. when the hierarchy is finally exposed to atk they are stripped out as leaf nodes, but the \n
remains in the containing text. they are in the nsiaccessible hierarchy to make it easy for nshypertextaccessible to piece its text representation together. everything else uses whatever nsaccessible-derived implementation that's appropriate. if it has text siblings, then it gets exposed as the unicode char for an embedded object, which is '\xfffc' within the parent nshypertextaccessible. in additi...
... the caret: many editors, including the mozilla editor, have a strange issue with caret offsets. the caret can sometimes visually appear at the end of a line, but logically it is on the first character on the next line. you can test this in a given editor by pressing the end key on a line, to see whether the caret is shown past the end of the line. to doublecheck, hit the delete key and see if it
removes the first char of the next line. therefore, as the user arrows up and down, if you use the accessibletext::caretoffset and retrieve the line with that offset, you may not get the line with the visual caret returned. you are getting the line starting with the logical caret offset, which may be the next line. to get around this problem, mozilla allows the magic value of -2 to be passed into acc...
HTML To MSAA - Accessibility
this table reflects mapping rules for specific elements only, it doesn't reflect any general rules applicable to all elements. for example, if name column has n/a value then it means specific elements doesn't provide own rules to calculate name but name can be computed from aria markup or @title attribute. ...
...tains child accessible for list bullet ol, ul and others role_system_ list n/a n/a state_system_ readonly n/a n/a n/a optgroup bstr role n/a n/a n/a n/a n/a n/a option role_system_ listitem from @label attribute, from child text nodes n/a state_system_ selected if option is selected n/a "select" event_object_ selectionwithin event_object_ selectionadd if selected event_object_ selection
remove if unselected select @size > 1 role_system_ list n/a n/a state_system_ multiselectable if multiselectable n/a n/a n/a select @size = 1 role_system_ combobox n/a name of focused option state_system_ expanded if combobox open state_system_ collapsed if combobox is collapsed state_system_ haspopup state_system_ focusable n/a "open"/"close" depending on state event_object_ valuechange ...
Color contrast - Accessibility
t</div> div { /* general div styles here */ } .good { background-color: #fae6fa; } .bad { background-color: #400064; } both pieces of text have their default black color. ...
...make the color contrast as good as it can be within your design constraints — ideally go for the aaa rating (see 1.4...
Perceivable - Accessibility
round and background colors should be user-selectable. text blocks should be no wider than 80 characters (or glyphs), for maximum readability. text should not be fully justified (e.g., text-align: justify;). line height should be at least 1.5 times the text size within paragraphs (e.g., line-height: 1.5;), and at least 2.25 times the text size between paragraphs (e.g., padding: 2.25
rem;). when the text size is doubled, the content should not need to be scrolled. 1.4.9 images of text (no exception) (aaa) text should not be presented as part of an image unless it is purely decoration (i.e., it does not convey any content) or cannot be presented in any other way. 1.4.10 reflow (aa) added in 2.1 no horizontal scrolling for le...
... at least 0.12 times the font size word spacing to at least 0.16 times the font size understanding text spacing 1.4.13 content on hover or focus (aa) added in 2.1 while additional content may appear and disappear in coordination with hover and keyboard focus, this success criterion specifies three conditions that must be met: dismissable (can be closed/
removed) hoverable (the additional content does not disappear when the pointer is over it) persistent (the additional content does not disappear without user action) understanding content on hover or focus note: also see the wcag description for guideline 1.4: distinguishable: make it easier for users to see and hear content including separating foreground from backgrou...
-webkit-mask-composite - CSS: Cascading Style Sheets
image replaces the destination mask image. source-over the source mask image is rendered over the destination mask image. source-in overlapping pixels in the source mask image and the destination mask image are replaced by the pixels of the source mask image; all other pixels are cleared. source-out overlapping pixels in the source mask image and the destination mask image are cleared; all
remaining pixels of the source mask image are rendered. source-atop the pixels of the destination mask image are rendered. the pixels of the source mask image are rendered only if they overlap a nontransparent portion of the destination mask image. this causes the source mask image to have no effect. destination-over the destination mask image is rendered over the source mask image. destination-...
...f the destination mask image are rendered. the pixels of the source mask image are rendered only if they overlap a nontransparent portion of the destination mask image. this causes the source mask image to have no effect. destination-over the destination mask image is rendered over the source mask image. destination-in overlapping pixels in the source mask image and the destination mask image
remain the pixels of the destination mask image; all other pixels are cleared. destination-out overlapping pixels in the source mask image and the destination mask image are cleared; all
remaining pixels of the source mask image are rendered. destination-atop the pixels of the source mask image are rendered. the pixels of the destination mask image are rendered only if they overlap a nontranspare...
@font-face - CSS: Cascading Style Sheets
syntax @font-face { font-family: "open sans"; src: url("/fonts/opensans-regular-webfont.woff2") format("woff2"), url("/fonts/opensans-regular-webfont.woff") format("woff"); } descriptors font-display determines how a font face is displayed based on whether and when it is downloaded and ready to use. font-family specifies a name that will be used as the font face value for font properties. font-stretch a font-stretch value. ...
...-variant a font-variant value. font-feature-settings allows control over advanced typographic features in opentype fonts. font-variation-settings allows low-level control over opentype or truetype font variations, by specifying the four letter axis names of the features to vary, along with their variation values. src specifies the resource containing the font data. this can be a url to a
remote font file location or the name of a font on the user's computer. to provide the browser with a hint as to what format a font resource is — so it can select a suitable one — it is possible to include a format type inside a format() function: src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("truetype"); the available types are: "woff", "woff2", "tru...
prefers-reduced-motion - CSS: Cascading Style Sheets
bottom of this page has a scaling movement that may be problematic for some readers. readers with vestibular motion disorders may wish to enable the reduce motion feature on their device before viewing the animation. syntax no-preference indicates that the user has made no preference known to the system. reduce indicates that user has notified the system that they prefer an interface that
removes or replaces the types of motion-based animation that trigger discomfort for those with vestibular motion disorders. user preferences for firefox, the reduce request is honoured if: in gtk/gnome: gnome tweaks > general tab (or appearance, depending on version) > animations is turned off. alternatively, add gtk-enable-animations = false to the [settings] block of the gtk 3 configura...
... in windows 10: settings > ease of access > display > show animations in windows. in windows 7: control panel > ease of access > make the computer easier to see > turn off all unnecessary animations (when possible). in macos: system preferences > accessibility > display > reduce motion. in ios: settings > general > accessibility > reduce motion. in android 9+: settings > accessibility >
remove animations. in firefox about:config: add a number preference called ui.prefersreducedmotion and set its value to 1. changes to this preference take effect immediately. examples this example has a scaling animation by default. if reduce motion is enabled in your accessibility preferences, the animation is toned down to a simple dissolve without vestibular motion triggers. html <div class=...
@media - CSS: Cascading Style Sheets
hes the device on which the content is being used. note: in javascript, the rules created using @media can be accessed with the cssmediarule css object model interface. syntax the @media at-rule may be placed at the top level of your code or nested inside any other conditional group at-rule. /* at the top level of your code */ @media screen and (min-width: 900px) { article { padding: 1
rem 3
rem; } } /* nested within another conditional at-rule */ @supports (display: flex) { @media screen and (min-width: 900px) { article { display: flex; } } } for a discussion of media query syntax, please see using media queries. description media types media types describe the general category of a device. except when using the not or only logical operators, the media typ...
...px) { body { line-height: 1.4; } } @media (400px <= width <= 700px) { body { line-height: 1.4; } } for more examples, please see using media queries. specifications specification comment feedback media queries level 5the definition of '@media descriptors' in that specification. reinstates light-level, inverted-colors and custom media queries, which were
removed from level 4. adds prefers-reduced-motion, prefers-reduced-transparency, prefers-contrast, and prefers-color-scheme media features. css working group drafts github issues css conditional rules module level 3the definition of '@media' in that specification. defines the basic syntax of the @media rule. css working group drafts github issues media queries level 4th...
Border-radius generator - CSS: Cascading Style Sheets
t_value = 0; slider.addeventlistener("click", function(e) { setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addeventlistener("mousemove", slidermotion); }); document.addeventlistener("mouseup", function(e) { document.
removeeventlistener("mousemove", slidermotion); document.body.style.cursor = "auto"; slider.style.cursor = "pointer"; }); var slidermotion = function slidermotion(e) { slider.style.cursor = "e-resize"; var delta = (e.clientx - startx) / obj.sensivity | 0; var value = delta * obj.step + start_value; setvalue(obj.topic, value); } return slider; } var inputslider = functio...
... document.addeventlistener('mouseup', dragend, false); } var dragstart = function dragstart(e) { if (e.button !== 0) return; active = true; lastx = e.clientx; lasty = e.clienty; document.addeventlistener('mousemove', mousedrag, false); } var dragend = function dragend(e) { if (e.button !== 0) return; if (active === true) { active = false; document.
removeeventlistener('mousemove', mousedrag, false); } } var mousedrag = function mousedrag(e) { notify(e.clientx - lastx, e.clienty - lasty); lastx = e.clientx; lasty = e.clienty; } var subscribe = function subscribe(callback) { subscribers.push(callback); } var unsubscribe = function unsubscribe(callback) { var index = subscribers.indexof(callback); subscribers.sp...
Using feature queries - CSS: Cascading Style Sheets
der browsers using floats. we can start by creating that floated layout with the following code, which gives us three columns. when browsers don't understand a css property or value, they ignore it. so we could start enhancing our layout by using css grid. browsers that do not support grid will ignore the grid value of the display property. once a floated item becomes a grid item, the float is
removed — something you can read more about in supporting older browsers. therefore the grid version should just overwrite the floated one. we have a problem however, caused by the width property we used on our floated items to make them display as three columns. this is now interpreted by grid as being the width of the column track, not the width of the container as it is for the float. what w...
...you can read more about in supporting older browsers. therefore the grid version should just overwrite the floated one. we have a problem however, caused by the width property we used on our floated items to make them display as three columns. this is now interpreted by grid as being the width of the column track, not the width of the container as it is for the float. what we need is a way to
remove the width if display: grid is supported. this is exactly the situation feature queries solve. we can set the width back to auto if grid is supported. in the above scenario, it doesn't matter that ie11 doesn't support feature queries or css grid — it would get the floated version anyway, which is then overwritten by browsers that do support grid. an alternate way to write the above code i...
Variable fonts guide - CSS: Cascading Style Sheets
custom property. example code follows at the end of the guide. weight weight (represented by the wght tag) defines the design axis of how thin or thick (light or heavy, in typical typographic terms) the strokes of the letterforms can be. for a long time in css there has existed the ability to specify this via the font-weight property, which takes numeric values ranging from 100 to 900 in inc
rements of 100, and keywords like normal or bold, which are simply aliases for their corresponding numeric values (400 and 700 in this case). these are still applied when dealing with non-variable or variable fonts, but with variable ones, any number from 1 to 1000 is now valid. it should be noted that at this point there is no way in the @font-face declaration to 'map' a specific point on the varia...
...ght: 125 950; font-stretch: 75% 125%; font-style: normal; } example for a font that includes both upright and italics: @font-face { font-family: 'myvariablefontname'; src: 'path/to/font/file/myvariablefont.woff2' format('woff2-variations'); font-weight: 125 950; font-stretch: 75% 125%; font-style: oblique 0deg 20deg; } note: there is no set specific value for the upper-end degree measu
rement in this case; they simply indicate that there is an axis so the browser can know to render upright or italic (
remember that italics are only on or off) example for a font that contains only italics and no upright characters: @font-face { font-family: 'myvariablefontname'; src: 'path/to/font/file/myvariablefont.woff2' format('woff2-variations'); font-weight: 125 950; font-stretch: 75% 12...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
on with a 2fr track then two 1fr tracks. the available space is split into four. two parts are given to the first track and one part each to the next two tracks. .wrapper { display: grid; grid-template-columns: 2fr 1fr 1fr; } in this final example, we mix absolute sized tracks with fraction units. the first track is 500 pixels, so the fixed width is taken away from the available space. the
remaining space is divided into three and assigned in proportion to the two flexible tracks. .wrapper { display: grid; grid-template-columns: 500px 1fr 2fr; } track listings with repeat() notation large grids with many tracks can use the repeat() notation, to repeat all or a section of the track listing. for example the grid definition: .wrapper { display: grid; grid-template-columns: 1f...
...he below example, i am creating a 10-pixel gap between columns and a 1em gap between rows. .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 10px; row-gap: 1em; } note: when grid first shipped in browsers the column-gap, row-gap and gap were prefixed with the grid- prefix as grid-column-gap, grid-row-gap and grid-gap respectively. browsers are updating to
remove this prefix, however the prefixed versions will be maintained as aliases making them safe to use. at the present time, some browsers do not support the unprefixed versions which is why the live examples in this guide use grid- prefixed versions. <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> * {box-sizing: border-box;}...
Layout using named grid lines - CSS: Cascading Style Sheets
col1-start; } <div class="wrapper"> <div class="item1">i am placed from col1-start line 1 to col2-start line 2</div> <div class="item2">i am placed from col1-start line 2 spanning 2 lines named col1-start</div> </div> over the last three guides you have discovered that there are a lot of different ways to place items using grid. this can seem a little bit overcomplicated at first, but
remember you don’t need to use all of them. in practice i find that for straightforward layouts, using named template areas works well, it gives that nice visual representation of what your layout looks like, and it is then easy to move things around on the grid. if working with a strict multiple column layout for example the named lines demonstration in the last part of this guide works very well...
...art / span 12; } .side1 { grid-column: col-start / span 3; grid-row: 2; } .content { grid-column: col-start 4 / span 6; grid-row: 2; } .side2 { grid-column: col-start 10 / span 3; grid-row: 2; } once again, the grid highlighter is helpful to show us how the grid we have placed our items on works. that’s all i need. i don’t need to do any calculations, grid automatically
removed my 10 pixel gutter track before assigning the space to the 1fr column tracks. as you start to build out your own layouts, you will find that the syntax becomes more familiar and you choose the ways that work best for you and the type of projects you like to build. try building some common patterns with these various methods, and you will soon find your most productive way to work. then, in th...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
column and row tracks with the grid-column-gap and grid-row-gap properties. these specify a gap that acts much like the column-gap property in multi-column layout. note: when grid first shipped in browsers the column-gap, row-gap and gap properties were prefixed with the grid- prefix as grid-column-gap, grid-row-gap and grid-gap respectively. browsers are updating their rendering engines to
remove this prefix, however the prefixed versions will be maintained as aliases, making them safe to use. at the present time, some browsers do not support the unprefixed versions, which is why the live examples in this guide use grid- prefixed versions. gaps only appear between tracks of the grid, they do not add space to the top and bottom, left or right of the container. we can add gaps to our e...
...et the start line as span 3. this means the item will need to span upwards from the specified row line. the area will start at line 4 and span 3 lines to line 1. .box1 { grid-column-start: 1; grid-row-start: span 3; grid-row-end: 4; } to become familiar with line based positioning in grid try to build a few common layouts by placing items onto grids with varying numbers of columns.
remember that if you do not place all of the items, any leftover items will be placed according to auto-placement rules. this may result in the layout you want, but if something is appearing somewhere unexpected, check that you have set a position for it. also,
remember that items on the grid can overlap each other when you place them explicitly like this. that can create some nice effects, however ...
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
id; grid-template-columns: repeat(12, [col-start] 1fr); grid-gap: 20px; } we are once again going to make this a responsive layout, this time however using named lines. every breakpoint will use a 12-column grid, however the number of tracks that items will span changes depending on the size of the screen. we start mobile first, and all we want for the narrowest screens is for the items to
remain in source order, and all span right across the grid. .wrapper > * { grid-column: col-start / span 12; } at the next breakpoint we want to move to a two-column layout. our header and navigation still span the full grid, so we do not need to specify any positioning for them. the sidebar is starting on the first column line named col-start, spanning 3 lines. it goes after row line 3, as the ...
...arial, sans-serif; } a:link, a:visited { text-decoration: none; color: #f08c00; } h2 { background-color: #f08c00; color: #fff; text-align: center; margin: 0; padding: 20px; } we are going to create a grid with a flexible number of flexible columns. i want them never to become smaller than 200 pixels, and then to share any available
remaining space equally – so we always get equal width column tracks. we achieve this with the minmax() function in our repeat notation for track sizing. .listing { list-style: none; margin: 2em; display: grid; grid-gap: 20px; grid-template-columns: repeat(auto-fill,minmax(200px, 1fr)); } as soon as i add this css, the items start to lay out as a grid. if i make the window smaller or w...
Subgrid - CSS: Cascading Style Sheets
s being created to hold those items. take a look at the next example — it uses the same parent and child grid as in the example above, however inside the subgrid i have twelve items trying to autoplace into ten grid cells. as the subgrid is on both dimensions there is nowhere for the extra two items to go and so they go into the last track of the grid, as defined in the specification. if we
remove the grid-template-rows value we enable regular creation of implicit tracks and, although these won't line up with the tracks of the parent, as many as are required will be created. the gap properties and subgrid if you have a gap, column-gap, or row-gap specified on the parent, this will be passed into the subgrid, so it will have the same spacing between tracks as the parent. in some situ...
... a track sizing method is used that allows content to affect the size. in such a case, auto-sized row tracks for example will grow to fit content in the main grid and content in the subgrid. as the subgrid value acts in much the same way as a regular nested grid, it is easy to switch between the two. for example, if you realise that you need an implicit grid for rows, all you would need to do is
remove the subgrid value of grid-template-rows and perhaps give a value for grid-auto-rows to control the implicit track sizing. specification specification status comment css grid layout module level 2 working draft initial definition of subgrids. see also on the mozilla developer youtube channel, see the videos laying out forms using subgrid and don't w...
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
second and third sections, the scrolling stops 40 pixels away from the start of the section. try changing the scroll-padding value to see how this changes the distance. this is potentially useful if you have a fixed element, for example a navigation bar, which could end up overlapping scrolled content. by using scroll-padding you can reserve a space for it as in the example below where my <h1>
remains on screen as the content scrolls beneath it. without padding, the heading would overlap some of the content when snapping happens. margins on scroll children the scroll-margin property can be set set on child elements, essentially defining an outset from the defined box. this allows for different amounts of space for different child elements, and can be used in conjunction with scroll-pad...
... ...
Shapes From Images - CSS: Cascading Style Sheets
he text. cors compatibility something that you will run into when creating shapes from an image is that the image you use must be cors compatible. an image hosted on the same domain as your site should work, however if your images are hosted on a different domain such as on a cdn you should ensure that they are sending the correct headers to enable them to be used for shapes. due to this requi
rement for cors compatible images, if you are previewing your file locally without using a local web server, your shape will not work. is it a cors issue? devtools can help you to identify cors errors. in chrome the console will alert you to cors problems. in firefox if you inspect the property you will be alerted to the fact that the image could not be loaded. this should alert you to the fact tha...
...near gradient. i am using that same value as the value of shape-outside. the linear gradient goes from purple to transparent, so by changing the value of shape-image-threshold i can decide how transparent the pixels need to be that create my shape. you can play with that value in the example below to see how the diagonal line will move across the shape depending on that value. you could also try
removing the background image completely, thus using the gradient purely to create the shape and not displaying it on the page at all. in this next example i am using a radial gradient with an ellipse, once again using a transparent part of the gradient to create the shape. you can experiment directly in these live examples, to see how changing the gradient will change the path of your shape. ...
Recipe: Media objects - CSS: Cascading Style Sheets
the image can be on the left or right. the image might be small or large. media objects can be nested. the media object should clear the contents no matter which side is tallest. ...
... of possible fallbacks for this pattern, depending on the browsers you wish to support. a good catch-all would be to float the image left, and to add a clearfix to the box to ensure that it contained the floats. download this example once floated elements become grid items the float no longer applies so you don’t need to do anything special to clear the float. what you will need to do is
remove any margins applied to the item, and any widths which we don’t need in a grid context (we have the gap property to control it in grids, and the track takes control of the sizing). relevant resources on mdn css grid layout progressive enhancement and grid layout using grid template areas fit-content grid-template-areas ...
Sticky footers - CSS: Cascading Style Sheets
if the content of the page extends past the viewport bottom, the footer then sits below the content as normal. ...
... if the content of the page extends past the viewport bottom, the footer then sits below the content as normal. ...
Testing media queries programmatically - CSS: Cascading Style Sheets
stener setup, passing an event object of type mediaquerylistevent as the argument to the callback function. ...
...bject also includes the media and matches properties, so you can query these features of the mediaquerylist by directly accessing it, or accessing the event object. ...
Using media queries - CSS: Cascading Style Sheets
o conditionally apply styles with the css @media and @import at-rules. to target specific media for the <style>, <link>, <source>, and other html elements with the media= attribute. to test and monitor media states using the window.matchmedia() and mediaquerylist.addlistener() javascript methods. note: the examples on this page use css's @media for illustrative purposes, but the basic syntax
remains the same for all types of media queries. syntax a media query is composed of an optional media type and any number of media feature expressions. multiple queries can be combined in various ways by using logical operators. media queries are case-insensitive. a media query computes to true when the media type (if specified) matches the device on which a document is being displayed and all m...
... level 3, the not keyword can't be used to negate an individual media feature expression, only an entire media query. only the only operator is used to apply a style only if an entire query matches, and is useful for preventing older browsers from applying selected styles. when not using only, older browsers would interpret the query screen and (max-width: 500px) simply as screen, ignoring the
remainder of the query, and applying its styles on all screens. if you use the only operator, you must also specify a media type. , (comma) commas are used to combine multiple media queries into a single rule. each query in a comma-separated list is treated separately from the others. thus, if any of the queries in a list is true, the entire media statement returns true. in other words, lists behav...
CSS reference - CSS: Cascading Style Sheets
reakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-inc
rementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-inside><display-internal><display-legacy><display-listitem><display-outside>dpcmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:fir...
...nline-endpadding-inline-startpadding-leftpadding-rightpadding-top@pagepage-break-afterpage-break-beforepage-break-insidepaint()paint-orderpath()pc<percentage>perspectiveperspective()perspective-originplace-contentplace-itemsplace-self::placeholderpointer-eventspolygon()<position>positionprefix (@counter-style)ptpxqqquotesrradradial-gradient()range (@counter-style)<ratio>:read-only:read-writerect()
remrepeat()repeating-linear-gradient()repeating-radial-gradient():requiredresize<resolution>revertrgb()rgba():rightright@right-bottom:rootrotaterotate()rotate3d()rotatex()rotatey()rotatez()row-gapsssaturate()scalescale()scale3d()scalex()scaley()scalez():scopescroll-behaviorscroll-marginscroll-margin-blockscroll-margin-block-endscroll-margin-block-startscroll-margin-bottomscroll-margin-inlinescroll-ma...
Shorthand properties - CSS: Cascading Style Sheets
similarly, shorthands handling properties related to corners of a box, like border-radius, always use a consistent 1-to-4-value syntax representing those corners: ...
...ork. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> element nested inside to inherit. if you
remove the rule how does it change the color of the link? do you understand why the third and fourth links are the color that they are? check the description of the values above if not. which of the links will change color if you define a new color for the <a> element — for example a { color: red; }? see cascade and inheritance or introducing the css cascade for more information about how in...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
which leads us to this: notice the repetition in the css. the background color is set to brown in several places. for some css declarations, it is possible to declare this higher in the cascade and let css inheritance solve this problem naturally. for non-trivial projects, this is not always possible. by declaring a custom property on the :root pseudo-class and us...
... inheritance of custom properties custom properties do inherit. this means that if no value is set for a custom property on a given element, the value of its parent is us...
Visual formatting model - CSS: Cascading Style Sheets
and inline-level boxes. read more about flow layout in css. floats in the float model, a box is first laid out according to the normal flow, then taken out of the flow and positioned, typically to the left or right. content may flow along the side of a float. find out more about floats. absolute positioning in the absolute positioning model (which also includes fixed positioning), a box is
removed from the normal flow entirely and assigned a position with respect to a containing block (which is the viewport in the case of fixed positioning). an element is called out of flow if it is floated, absolutely positioned, or is the root element. an element is called in-flow if it is not out of the flow. read about css positioned layout. formatting contexts and the display property boxes ca...
...s either participate in the formating context of their containing block or establish an independent formatting context. a grid container, for example, establishes a new grid formatting context for its children. independent formatting contexts contain floats, and margins do not collapse across formatting context boundaries. therefore, creating a new block formatting context can ensure that floats
remain inside a box. developers sometimes clear floats by changing the value of the overflow property, as this creates a new block formatting context. the newer value of display: flow-root creates a new block formatting context in order to gain the useful effects of this, without any unwanted issues caused by changing the value of overflow. block boxes in specifications, block boxes, block-level bo...
WebKit CSS extensions - CSS: Cascading Style Sheets
clamp -webkit-line-grid -webkit-line-snap -webkit-locale -webkit-logical-height -webkit-logical-width m -webkit-margin-after-collapse -webkit-margin-after -webkit-margin-before-collapse -webkit-margin-before -webkit-margin-bottom-collapse -webkit-margin-collapse -webkit-margin-end** -webkit-margin-start** -webkit-margin-top-collapse -webkit-marquee-direction -webkit-marquee-inc
rement -webkit-marquee-repetition -webkit-marquee-speed -webkit-marquee-style -webkit-marquee -webkit-mask-box-image-outset -webkit-mask-box-image-repeat -webkit-mask-box-image-slice -webkit-mask-box-image-source -webkit-mask-box-image-width -webkit-mask-box-image -webkit-mask-repeat-x -webkit-mask-repeat-y -webkit-mask-source-type -webkit-max-logical-height -webkit-max-logical-width ...
... ::-webkit-input-placeholder ::-webkit-media-controls ::-webkit-media-controls-current-time-display ::-webkit-media-controls-enclosure ::-webkit-media-controls-fullscreen-button ::-webkit-media-controls-mute-button ::-webkit-media-controls-overlay-enclosure ::-webkit-media-controls-panel ::-webkit-media-controls-play-button ::-webkit-media-controls-timeline ::-webkit-media-controls-time-
remaining-display ::-webkit-media-controls-toggle-closed-captions-button ::-webkit-media-controls-volume-control-container ::-webkit-media-controls-volume-control-hover-background ::-webkit-media-controls-volume-slider ::-webkit-meter-bar ::-webkit-meter-even-less-good-value ::-webkit-meter-inner-element ::-webkit-meter-optimum-value ::-webkit-meter-suboptimum-value -webkit-media-text-track...
animation - CSS: Cascading Style Sheets
lidein; } .a3 { animation: 3s slidein; } .animation { background: #3f87a6; width: 100%; height: calc(100% - 1.5em); transform-origin: left center; } window.addeventlistener('load', function () { var animation = array.from(document.queryselectorall('.animation')); var button = array.from(document.queryselectorall('button')); function togglebutton (btn, type) { btn.classlist.
remove('play', 'pause', 'restart'); btn.classlist.add(type); btn.title = type.touppercase(type); } function playpause (i) { var btn = button[i]; var anim = animation[i]; if (btn.classlist.contains('play')) { anim.style.animationplaystate = 'running'; togglebutton(btn, 'pause'); } else if (btn.classlist.contains('pause')) { anim.style.animationplaystate...
...'play' : 'pause'); anim.style.animationplaystate = ''; anim.classlist.add('a' + (i + 1)); }, 100) } } animation.foreach(function (node, index) { node.addeventlistener('animationstart', function () { togglebutton(button[index], 'pause'); }); node.addeventlistener('animatio...
attr() - CSS: Cascading Style Sheets
t is including the unit (e.g. 12.5em). if it is not valid, that is not a length or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. em, ex, px,
rem, vw, vh, vmin, vmax, mm, cm, in, pt, or pc <length> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as a <length> with the specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolut...
... <fallback> the value to be used if the associated attribute is missing or contains an invalid value. if not set, css will use the default value defined for each <type-or-unit>. ...
border-image - CSS: Cascading Style Sheets
s interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: you should specify a separate border-style in case the border image fails to load. indeed, this is required according to the specification, although not all browsers implement this requi
rement. constituent properties this property is a shorthand for the following css properties: border-image-outset border-image-repeat border-image-slice border-image-source border-image-width syntax /* source | slice */ border-image: linear-gradient(red, blue) 27; /* source | slice | repeat */ border-image: url("/images/border.png") 27 space; /* source | slice | width */ border-image: ...
... note: if the computed value of border-image-source is none, or if the image cannot be displayed, the border-style will be displayed instead. values <'border-image-source'> the source image. see border-image-source. <'border-image-slice'> the dimensions for slicing the sou...
box-flex-group - CSS: Cascading Style Sheets
pace based on the ratio of that element's flexibility compared to the flexibility of other elements within the same flex group. if the space of all flexible children within the group has been increased to the maximum, the process repeats for the children within the next flex group, using any space left over from the previous flex group. ...
...to the maximum, the process repeats for the children within the next flex group, using any space left over from the previous flex group. once there are no more flex groups, and there is still space
remaining, the extra space is divided within the containing box according to the box-pack property. if the box would overflow after the preferred space of the children has been computed, then space is
removed from flexible elements in a manner similar to that used when adding extra space. each flex group is examined in turn and space is
removed according to the ratio of the flexibility of each element. elements do not shrink below their minimum widths. syntax the box-flex-group property is specified as any positive <integer>. formal definition initial value1applies toin-flow children of box el...
box-lines - CSS: Cascading Style Sheets
multiple rows or columns) in order to accommodate all of its children. the box must attempt to fit its children on as few lines as possible by shrinking all elements down to their minimum widths or heights if necessary. if the children in a horizontal box still do not fit on a line after being reduced to their minimum widths, then children are moved one by one onto a new line, until the elements
remaining on the previous line fit. this process can repeat to an arbitrary number of lines. if a line contains only a single element that doesn't fit, then the element should stay on that line and overflow out of the box. the later lines are placed below the earlier lines in normal direction boxes and above in reverse direction boxes. the height of a line is the height of the largest child in that l...
... a computed value of auto should be treated as having a value of 0. a similar process occurs for children in a vertical box. later lines in normal direction boxes are placed to the right of earlier lines and to the left in reverse direction boxes. once the number of lines has been determined, elements with a computed value for box-flex other than 0 stretch as necessary in an attempt to fill the
remaining space on the lines. each line computes flexes independently, so only elements on that line are considered when evaluating box-flex and box-flex-groups. the packing of elements in a line, as specified by the box-pack property, is also computed independently for each line. syntax the box-lines property is specified as one of the keyword values listed below. values single box elements l...
break-after - CSS: Cascading Style Sheets
e columns using column-width: 200px. by default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uniform place. however, we used break-after: column on the <p> elements to force a column break after each one, meaning that you end up with an <h2> neatly at the top of each column. html <article> <h1>main heading</h1> <h2>subheading</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla vitae fringilla mauris. quisque commodo eget nisi sed pretium. mauris luctus nec lacus in ultricies. mauris vitae hendrerit arcu, ac scelerisque lacus. aliquam lobortis in lacus sit amet posuere. fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <h2>subheading</h2> <p>praesent condimentum dui dui, sit amet rutrum diam...
...2> <p>in finibus viverra enim vel suscipit. quisque consequat velit eu orci malesuada, ut interdum tortor molestie. proin sed pellentesque augue. nam risus justo, faucibus non porta a, congue vel massa. cras luctus lacus nisl, sed tincidunt velit pharetra ac. duis suscipit faucibus dui sed ultricies.</p> </article> css html { font-family: helvetica, arial, sans-serif; } h1 { font-size: 3
rem; letter-spacing: 2px; column-span: all; } h2 { font-size: 1.2
rem; color: red; letter-spacing: 1px; } p { line-height: 1.5; break-after: column; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-after' in that specification. candidate reco...
break-before - CSS: Cascading Style Sheets
olumns using column-width: 200px. by default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uniform place. however, we used break-before: column on the <h2> elements to force a column break before each one, meaning that you end up with an <h2> neatly at the top of each column. html <article> <h1>main heading</h1> <h2>subheading</h2> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. nulla vitae fringilla mauris. quisque commodo eget nisi sed pretium. mauris luctus nec lacus in ultricies. mauris vitae hendrerit arcu, ac scelerisque lacus. aliquam lobortis in lacus sit amet posuere. fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <h2>subheading</h2> <p>praesent condimentum dui dui, sit amet rutrum diam...
...2> <p>in finibus viverra enim vel suscipit. quisque consequat velit eu orci malesuada, ut interdum tortor molestie. proin sed pellentesque augue. nam risus justo, faucibus non porta a, congue vel massa. cras luctus lacus nisl, sed tincidunt velit pharetra ac. duis suscipit faucibus dui sed ultricies.</p> </article> css html { font-family: helvetica, arial, sans-serif; } h1 { font-size: 3
rem; letter-spacing: 2px; column-span: all; } h2 { font-size: 1.2
rem; color: red; letter-spacing: 1px; break-before: column; } p { line-height: 1.5; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-before' in that specification. candidate re...
<color> - CSS: Cascading Style Sheets
apurple #663399 transparent keyword the transparent keyword represents a fully transparent color. this makes the background behind the colored item completely visible. technically, transparent is a shortcut for rgba(0,0,0,0). compatibility note: to prevent unexpected behavior, such as in a <gradient>, the current css spec states that transparent should be calculated in the alpha-p
remultiplied color space. however, be aware that older browsers may treat it as black with an alpha value of 0. historical note: transparent wasn't a true color in css level 2 (revision 1). it was a special keyword that could be used instead of a regular <color> value on two css properties: background and border. it was essentially added to allow developers to override an inherited solid color. wi...
...r. -moz-visitedhyperlinktext user's preference for the text color of visited links. should be used with the default document background color. interpolation in animations and gradients, <color> values are interpolated on each of their red, green, and blue components. each component is interpolated as a real, floating-point number. note that interpolation of colors happens in the alpha-p
remultiplied srgba color space to prevent unexpected gray colors from appearing. in animations, the interpolation's speed is determined by the timing function. accessibility considerations some people have difficulty distinguishing colors. the wcag 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. see color and color contra...
counter-set - CSS: Cascading Style Sheets
the counter-set css property sets a css counter to a given value. it manipulates the value of existing counters, and will only create new counters if there isn't already a counter of the given name on the element. note: the counter's value can be inc
remented or dec
remented using the counter-inc
rement css property. syntax /* set "my-counter" to 0 */ counter-set: my-counter; /* set "my-counter" to -1 */ counter-set: my-counter -1; /* set "counter1" to 1, and "counter2" to 4 */ counter-set: counter1 1 counter2 4; /* cancel any counter that could have been set in less specific rules */ counter-set: none; /* global values */ counter-set: inherit; counter-set: initial; counter-set: unset; the counter-set property is specified as either one of the following: a <custom-ident> naming th...
... a space. the keyword value none. values <custom-ident> the name of the counter to set. <integer> the value to set the counter to on each occurrence of the element. defaults to 0 if not specified. if there isn't currently a counter of the given name on the element, the element will create a new counter of the given name with a starting value of 0 (though it may then immediately set or inc
rement that value to something different). none no counter set is to be performed. this can be used to override a counter-set defined in a less specific rule. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>? ]+ | none examples setting named counters h1 { counter-set: chapter secti...
<custom-ident> - CSS: Cascading Style Sheets
ouble quotes as this would be identical to a <string>. moreover, the first character must not be a decimal digit, nor a hyphen (-) followed by a decimal digit or another hyphen. to prevent ambiguity, each property that uses <custom-ident> forbids the use of specific values: animation-name forbids the global css values (unset, initial, and inherit), as well as none. counter-reset counter-inc
rement forbids the global css values (unset, initial, and inherit), as well as none. @counter-style list-style-type forbids the global css values (unset, initial, and inherit), as well as the values none, inline, and outside. also, quite a few predefined values are implemented by the different browsers: disc, circle, square, decimal, cjk-decimal, decimal-leading-zero, lower-roman, upper-roman, lo...
...-12rad it must not start with a dash followed by a decimal digit. bili.bob only alphanumeric characters, _, and - needn't be escaped. --toto it must not start with two dashes. this would be a custom property. 'bilibob' this would be a <string>. "bilibob" this would be a <string>. specifications ...
<dimension> - CSS: Cascading Style Sheets
<number> with a unit attached to it, for example 10px. css uses dimensions to specify distances (<length>), durations (<time>), frequencies (<frequency>), resolutions (<resolution>), and other quantities. syntax the syntax of <dimension> is a <number> immediately followed by a unit which is an identifier. unit identifiers are case insensitive. examples valid dimensions 12px 12 pixels 1
rem 1
rem 1.2pt 1.2 points 2200ms 2200 milliseconds 5s 5 seconds 200hz 200 hertz 200hz 200 hertz (values are case insensitive) invalid dimensions 12 px the unit must come immediately after the number. 12"px" units are identifiers and therefore unquoted. 3sec the seconds unit is abbreviated "s" not "sec". specifications specification statu...
...e seconds unit is abbreviated "s" not "sec". specifications specification status comment css values and units module level 4the definition of '<dimension>' in that specification. editor's draft adds cap, ic, lh, rlh, vi, vb css values and units module level 3the definition of '<dimension>' in that specification. candidate recommendation adds ch,
rem, vw, vw, vmin, vmax, q css level 2 (revision 1)the definition of '<dimension>' in that specification. recommendation defined under numbers and length css level 1the definition of '<dimension>' in that specification. recommendation initial definition under "length units" ...
<display-box> - CSS: Cascading Style Sheets
selves. they are replaced by their pseudo-box and their child boxes. please note that the css display level 3 spec defines how the contents value should affect "unusual elements" — elements that aren’t rendered purely by css box concepts such as replaced elements. see appendix b: effects of display: contents on unusual elements for more details. due to a bug in browsers this will currently
remove the element from the accessibility tree — screen readers will not look at what's inside. see the accessibility concerns section below for more details. none turns off the display of an element so that it has no effect on layout (the document is rendered as though the element did not exist). all descendant elements also have their display turned off. to have an element take up the space th...
...e display of an element so that it has no effect on layout (the document is rendered as though the element did not exist). all descendant elements also have their display turned off. to have an element take up the space that it would normally take, but without actually rendering anything, use the visibility property instead. accessibility concerns current implementations in most browsers will
remove from the accessibility tree any element with a display value of contents. this will cause the element — and in some browser versions, its descendant elements — to no longer be announced by screen reading technology. this is incorrect behavior according to the csswg specification. more accessible markup with display: contents | hidde de vries display: contents is not a css reset | adria...
flex-grow - CSS: Cascading Style Sheets
//github.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-grow: 3; flex-grow: 0.6; /* global values */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; the flex-grow property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 0. ...
...unset; the flex-grow property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 0. description this property specifies how much of the
remaining space in the flex container should be assigned to the item (the flex grow factor). the main size is either width or height of the item which is dependent on the flex-direction value. the
remaining space is the size of the flex container minus the size of all flex items' sizes together. if all sibling items have the same flex grow factor, then all items will receive the same share of
remaining space, otherwise it is distributed according to the ratio defined by the different flex grow factors. flex-grow is used alongside the other flex properties flex-shrink and flex-basis, and norma...
flex - CSS: Cascading Style Sheets
<'flex-grow'> <'flex-shrink'>? ...
... #flex-container > .raw-item { width: 5
rem; } var flex = document.getelementbyid("flex"); var raw = document.getelementbyid("raw"); flex.addeventlistener("click", function() { raw.style.display = raw.style.display == "none" ? "block" : "none"; }); #flex-container { width: 100%; font-family: consolas, arial, sans-serif; } #flex-container > div { border: 1px solid #f00; padding: 1
rem; } #flex-container > .raw-item { border: 1px solid #000; } result specifications specification status comment css flexible box layout modulethe definition of 'flex' in that specification. candidate recommendation initial definition ...
hanging-punctuation - CSS: Cascading Style Sheets
comma at the end of a line hangs. allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification. ...
...rete formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and closing quotes to hang html <p>“lo
rem ipsum dolor sit amet, consectetur adipiscing elit. curabitur dignissim nunc mauris, et sollicitudin est scelerisque sed. praesent laoreet tortor massa, sit amet vulputate nulla pharetra ut.”</p> css p { hanging-punctuation: first last; margin: .5
rem; } result specifications specification status comment css text module level 3the definition of 'hanging-punctuation' in that specification. working draft initial definition ...
mask-border-outset - CSS: Cascading Style Sheets
the mask-border-outset css property specifies the distance by which an element's mask border is set out from its border box. syntax /* <length> value */ mask-border-outset: 1
rem; /* <number> value */ mask-border-outset: 1.5; /* vertical | horizontal */ mask-border-outset: 1 1.2; /* top | horizontal | bottom */ mask-border-outset: 30px 2 45px; /* top | right | bottom | left */ mask-border-outset: 7px 12px 14px 5px; /* global values */ mask-border-outset: inherit; mask-border-outset: initial; mask-border-outset: unset; the mask-border-outset property may be specified as one, two, three, or four values. each value is a <length> or <number>. negative values are invalid. when one value is specified, it applies the same outset to all four sides. when two values are specified, the firs...
...tion typediscrete formal syntax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to move the mask away from the inner edge of the element's border box — you can use it to make the mask start from part way across the border, rather than the inside of it. mask-border-outset: 1
rem; chromium-based browsers support an outdated version of this property — mask-box-image-outset — with a prefix: -webkit-mask-box-image-outset: 1
rem; note: the mask-border page features a working example (using the out-of-date prefixed border mask properties supported in chromium), so you can get an idea of the effect. specifications specification status comment ...
max() - CSS: Cascading Style Sheets
<calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <dimension> | <percentage> | ( <calc-sum> ) examples setting a minimum size for a font another use case for css functions is allow a font size to grow while ensuring it is at least a mimum size, enabling responsive font sizes while ensuring legibility. let's look at some css: h1 { font-size: 2
rem; } h1.responsive { font-size: max(4vw, 2em, 2
rem); } the font-size will at minimum be 2
rems, or twice the default size of font for the page. this ensure it is legible and ensures accessibility <h1>this text is always legible, but doesn't change size</h1> <h1 class="responsive">this text is always legible, and is responsive, to a point</h1> think of the max() function as finding the minim...
...x() function as finding the minimum value allowed for a property. accessibility concerns when max() is used for controlling text size, make sure the text is always large enough to read. a suggestion is to use the min() function nested within a max() that has as its second value a relative length unit that is always large enough to read. for example: small { font-size: max(min(0.5vw, 0.5em), 1
rem); } this ensures a minimum size of 1
rem, with a text size that scales if the page is zoomed. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 specifications specification status comment css values and units module level 4the definition of 'max()' in that specification. editor's draft ini...
min-width - CSS: Cascading Style Sheets
l support 12notes full support 12notes notes edge uses auto as the initial value for min-width.firefox full support 34 full support 34 no support 16 — 22notes notes firefox 18 and later (until the value was
removed), used auto as the initial value for min-width.ie no support noopera full support 12.1notes full support 12.1notes notes opera uses auto as the initial value for min-width.safari no support nowebview android ...
... 25notes full support 25notes notes chrome uses auto as the initial value for min-width.firefox android full support 34 full support 34 no support 16 — 22notes notes firefox 18 and later (until the value was
removed), used auto as the initial value for min-width.opera android full support 14notes full support 14notes notes opera uses auto as the initial value for min-width.safari ios no support nosamsung internet android full support ...
overflow - CSS: Cascading Style Sheets
p { overflow: auto; /* append scrol...
...ow values for text p { width: 12em; height: 6em; border: dotted; overflow: visible; /* content is not clipped */ } visible (default) sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dolo
remque laudantium. p { overflow: hidden; /* no scrollbars are provided */ } overflow: hidden sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dolo
remque laudantium. p { overflow: scroll; /* always show scrollbars */ } overflow: scroll sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dolo
remque laudantium. p { overflow: auto; /* append scrollbars if necessary */ } overflow: auto sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dolo
remque laudantium. specifications specificat...
repeat() - CSS: Cascading Style Sheets
ks, then the <percentage> must be treated as auto. the user-agent may adjust the intrinsic size contributions of the track to the size of the grid container and increase the final size of the track by the minimum amount that would result in honoring the percentage. <flex> a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a share of the
remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of ...
...-template-rows or grid-template-columns), if that is definite. otherwise, as its minimum track sizing function, and taking grid-gap into account. if any number of repetitions would overflow, then the repetition is 1. otherwise, if the grid container has a definite minimal size in the relevant axis, the number of repetitions is the smallest possible positive integer that fulfills that minimum requi
rement. otherwise, the specified track list repeats only once. auto-fit behaves the same as auto-fill, except that after placing the grid items any empty repeated tracks are collapsed. an empty track is one with no in-flow grid items placed into or spanning across it. (this can result in all tracks being collapsed, if they’re all empty.) a collapsed track is treated as having a single fixed t...
rotate - CSS: Cascading Style Sheets
the rotate css property allows you to specify rotation transforms individually and independently of the transform property. this maps better to typical user interface usage, and saves having to
remember the exact order of transform functions to specify in the transform property. syntax /* keyword values */ rotate: none; /* angle value */ rotate: 90deg; rotate: 0.25turn; rotate: 1.57rad; /* x, y, or z axis name plus angle */ rotate: x 90deg; rotate: y 0.25turn; rotate: z 1.57rad; /* vector plus angle value */ rotate: 1 1 1 90deg; values angle value an <angle> specifying the angle to rotate the affected element through, around the z axis. equivalent to a rotate() (2d rotation) function. x, y, or z axis name plus angle value the name of the axis you want to rotate the affected eleme...
... editor's draft initial definition. ...
scale - CSS: Cascading Style Sheets
the scale css property allows you to specify scale transforms individually and independently of the transform property. this maps better to typical user interface usage, and saves having to
remember the exact order of transform functions to specify in the transform value. syntax /* keyword values */ scale: none; /* single values */ /* values of more than 1 make the element grow */ scale: 2; /* values of less than 1 make the element shrink */ scale: 0.5; /* two values */ scale: 2 0.5; /* three values */ scale: 2 0.5 2; values single number value a <number> specifying a scale factor to make the affected element scale by the same factor along both the x and y axes. equivalent to a scale() (2d scaling) function with a single value specified. two length/percentage values two <number>s...
... editor's draft initial definition. ...
shape-image-threshold - CSS: Cascading Style Sheets
| <percentage> examples aligning text to a gradient this example creates a <div> block with a gradient background image. the gradient is established as a css shape using shape-outside, so that pixels within the gradient which are at least 20% opaque (that is, those pixels with an alpha component greater than 0.2) are considered part of the shape. html <div id="gradient-shape"></div> <p> lo
rem ipsum dolor sit amet, consectetur adipisicing elit. vel at commodi voluptates enim, distinctio officia. saepe optio accusamus doloribus sint facilis itaque ab nulla, dolor molestiae assumenda cum sit placeat adipisci, libero quae nihil porro debitis laboriosam inventore animi impedit nostrum nesciunt quisquam expedita! dolores consectetur iure atque a mollitia dicta repudiandae illum ex...
...inventore animi impedit nostrum nesciunt quisquam expedita! ...
text-decoration - CSS: Cascading Style Sheets
ation-thickness property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. text decorations are drawn across descendant text elements. this means that if an element specifies a text decoration, then a child element can't
remove the decoration. for example, in the markup <p>this text has <em>some emphasized words</em> in it.</p>, the style rule p { text-decoration: underline; } would cause the entire paragraph to be underlined. the style rule em { text-decoration: none; } would not cause any change; the entire paragraph would still be underlined. however, the rule em { text-decoration: overline; } would cause a second...
... overline; } .thick { text-decoration: solid underline purple 4px; } .blink { text-decoration: blink; } <p class="under">this text has a line underneath it.</p> <p class="over">this text has a line over it.</p> <p class="line">this text has a line going through it.</p> <p>this <a class="plain" href="#">link will not be underlined</a>, as links generally are by default. ...
touch-action - CSS: Cascading Style Sheets
uch-action: unset; by default, panning (scrolling) and pinching gestures are handled exclusively by the browser. an application using pointer events will receive a pointercancel event when the browser starts handling a touch gesture. by explicitly specifying which gestures should be handled by the browser, an application can supply its own behavior in pointermove and pointerup listeners for the
remaining gestures. applications using touch events disable the browser handling of gestures by calling preventdefault(), but should also use touch-action to ensure the browser knows the intent of the application before any event listeners have been invoked. when a gesture is started, the browser intersects the touch-action values of the touched element and its ancestors, up to the one that implemen...
...an-x enable single-finger horizontal panning gestures. may be combined with pan-y, pan-up, pan-down and/or pinch-zoom. pan-y enable single-finger vertical panning gestures. may be combined with pan-x, pan-left, pan-right and/or pinch-zoom. manipulation enable panning and pinch zoom gestures, but disable additional non-standard gestures such as double-tap to zoom. disabling double-tap to zoom
removes the need for browsers to delay the generation of click events when the user taps the screen. this is an alias for "pan-x pan-y pinch-zoom" (which, for compatibility, is itself still valid). pan-left, pan-right, pan-up, pan-down enable single-finger gestures that begin by scrolling in the given direction(s). once scrolling has started, the direction may still be reversed. note that scro...
matrix3d() - CSS: Cascading Style Sheets
transform: rotatey(-90deg) translatez(50px); } .top { background: rgba(210,210,0,.7); transform: rotatex(90deg) translatez(50px); } .bottom { background: rgba(210,0,210,.7); transform: rotatex(-90deg) translatez(50px); } result matrix translation and scale example another transform3d() example, which implements an animated combined translate and scale. ...
...ba(210,0,210,.7); transform: rotatex(-90deg) translatez(50px); } result matrix translation and scale example another transform3d() example, which implements an animated combined translate and scale. html <div class="foo"> lo
rem ipsum dolor sit amet, consectetur adipisicing elit. ...
translate - CSS: Cascading Style Sheets
the translate css property allows you to specify translation transforms individually and independently of the transform property. this maps better to typical user interface usage, and saves having to
remember the exact order of transform functions to specify in the transform value. syntax /* keyword values */ translate: none; /* single values */ translate: 100px; translate: 50%; /* two values */ translate: 100px 200px; translate: 50% 105px; /* three values */ translate: 50% 105px 5
rem; values single <length-percentage> value a <length> or <percentage> that specifies a 2d translation, with the same translation along both the x and y axes. equivalent to a translate() (2d translation) function with a single value specified. two <length-percentage> values two <length> or <percentage...
... editor's draft initial definition. initial valuenoneapplies totransformable elementsinheritedn...
Adding captions and subtitles to HTML5 video - Developer guides
es" type="button" data-state="subtitles">cc</button> </div> css changes the video controls have undergone some minor changes in order to make space for the extra button, but these are relatively straightforward. no image is used for the captions button, so it is simply styled as: .controls button[data-state="subtitles"] { height:85%; text-indent:0; font-size:16px; font-size:1
rem; font-weight:bold; color:#666; background:#000; border-radius:2px; } there are also other css changes that are specific to some extra javascript implementation, but these will be mentioned at the appropriate place below. subtitle implementation a lot of what we do to access the video subtitles revolves around javascript. similar to the video controls, if a browser supports html...
...ack> element. building a caption menu our aim is to use the subtitles button we added earlier to display a menu that allows users to choose which language they want the subtitles displayed in, or to turn them off entirely. we have added the button, but before we make it do anything, we need to build the menu that goes with it. this menu is built dynamically, so that languages can be added or
removed later by simply editing the <track> elements within the video's markup. all we need to do is to go through the video's texttracks, reading their properties and building the menu up from there: var subtitlesmenu; if (video.texttracks) { var df = document.createdocumentfragment(); var subtitlesmenu = df.appendchild(document.createelement('ul')); subtitlesmenu.classname = 'subtitles-m...
Challenge solutions - Developer guides
number the oceans using roman numerals from i to v. solution define a rule for list items to use the lower-roman list style: li { list-style: lower-roman; } capital letters challenge change your stylesheet to identify the headings with capital letters in parentheses. solution add a rule to the body element (parent of the headings) to reset a new counter, and one to display and inc
rement the counter on the headings: /* numbered headings */ body {counter-reset: headnum;} h3:before { content: "(" counter(headnum, upper-latin) ") "; counter-inc
rement: headnum; } boxes ocean border challenge add one rule to your stylesheet, making a wide border all around the oceans in a color that
reminds you of the sea. solution the following rule achieves this effect: ul { ...
... solution move the position of the :hover pseudo-class from a specific petal, to all petals #inner-petals { --segment-fill-fill-hover: pink; } /* no...
Content categories - Developer guides
outline. heading content heading content defines the title of a section, whether marked by an explicit sectioning content element, or implicitly defined by the heading content itself. elements belonging to this category are <h1>, <h2>, <h3>, <h4>, <h5>, <h6> and <hgroup>. though likely to contain heading content, the <header> is not heading content itself. note: the <hgroup> element was
removed from the w3c html specification prior to html 5 being finalized, but is still part of the whatwg specification and is at least partially supported by most browsers. phrasing content phrasing content defines the text and the mark-up it contains. runs of phrasing content make up paragraphs. elements belonging to this category are <abbr>, <audio>, <b>, <bdo>, <br>, <button>, <canvas>, <cite>...
.... instead, they serve to support scripts, either by containing or specifying script code directly, or by specifying data that will be used by scripts. the script-supporting elements are: <script> <template> transparent content model if an element has a transparent content model, then its contents must be structured such that they would be valid html 5, even if the transparent element were
removed and replaced by the child elements. for example, the <del> and <ins> elements are transparent: <p>we hold these truths to be <del><em>sacred & undeniable</em></del> <ins>self-evident</ins>.</p> if those elements were
removed, this fragment would still be valid html (if not correct english). <p>we hold these truths to be <em>sacred & undeniable</em> self-evident.</p> other conte...
Rich-Text Editing in Mozilla - Developer guides
nes4eeujvigapwyac0csocq7sdlwjkakca6tomywiargqf3mrqviejkksvlibsfewhdrih4fh/dzmice3/c4nbqbads=" /> <img class="intlink" title="redo" onclick="formatdoc('redo');" src="data:image/gif;base64,r0lgodlhfgawamihab1chdljwl9vj1ie34kl8apd+7/i1////yh5baekaacalaaaaaawabyaaankelrc/jdksesyphi7siegsvxzeatdicqbvjjpqwzt9naednbqk1wcqsxlynxmaimhydofaeljasrrvazvrqqqxuy7cgx4tc6bswkaow==" /> <img class="intlink" title="
remove formatting" onclick="formatdoc('
removeformat')" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8f...
...rly2txqf9vj414wzwibxmorpqbmpgjudclfaezxsa0cb/i1+3yitha7prkiphvbups+/fvrvv8/f///////////////////////////////////////////////yh5baeaab8alaaaaaawabyaaawn4ceozgmeakqubgsuspvbsyfjjvds6njlb0khr4akbcmfscgbqaocwjf5gwquvyksfbwze+awibv0ghfog2ewidchjwriqo9e2fx4xd5r+b0ddaenbxbhbhn2dgwdaqfjjyvhcqyrfgoidgiqjawtcqmriwwmfgicnvcaaamoak+blaortluyt7i5uiuhads=" /> </div> <div id="textbox" contenteditable="true"><p>lo
rem ipsum</p></div> <p id="editmode"><input type="checkbox" name="switchmode" id="switchbox" onchange="setdocmode(this.checked);" /> <label for="switchbox">show html</label></p> <p><input type="submit" value="send" /></p> </form> </body> </html> note: if you want to see how to standardize the creation and the insertion of your editor in your page, please see our more complete rich-text editor exam...
HTML5 Parser - Developer guides
rsing prior to html5, parsers reparsed the document if they hit the end of the file within certain elements or within comments. for example, if the document lacked a </title> closing tag, the parser would reparse to look for the first '<' in the document, or if a comment was not closed, it would look for the first '>'. this behavior created a security vulnerability. if an attacker could force a p
remature end-of-file, the parser might change which parts of the document it considered to be executable scripts. in addition, supporting reparsing led to unnecessarily complex parsing code. with html5, parsers no longer reparse documents. this change has the following consequences for web developers: if you omit the closing tag for <title>, <style>, <textarea>, or <xmp>, the page will fail to be...
...ages where authors have pasted partial svg fragments into html (who knows why) or used a <math> tag for non-mathml purposes, attempts to nest various common html elements as children of svg elements (without foreignobject) will immediately break out of svg or mathml context. this may make some typos have surprising effects. performance improvement with speculative parsing unrelated to the requi
rements of html5 specification, the gecko 2 parser uses speculative parsing, in which it continues parsing a document while scripts are being downloaded and executed. this results in improved performance compared to older parsers, because most of the time, gecko can complete these tasks in parallel. to best take advantage of speculative parsing, and help your pages to load as quickly as possible, en...
Printing - Developer guides
w to print. ...
...utilize a hidden <iframe> (see: htmliframeelement), automatically
removing it after the user prints its contents. ...
User input and controls - Developer guides
andscape) through the screen orientation api. orientation data can be retrieved through the screen.orientation attribute or through the orientation media feature. when screen.orientation changes, the screen.orientationchange event is fired on the screen object. locking the screen orientation is made possible by invoking the screen.lockorientation method, while the screen.unlockorientation method
removes all the previous screen locks that have been set. note: more information about the screen orientation api can be found in managing screen orientation. fullscreen you might need to present an element of your application (such as a <video>, for example) in fullscreen mode. you can achieve this by calling element.requestfullscreen() on that element. bear in mind that many browsers still imp...
... at a time, allowing the user to draw in a <canvas> with more than one finger at a time. it will only work on a browser that supports touch events. simple pointer lock demo we've written a simple pointer lock demo to show you how to use it to set up a simple control system. the demo uses javascript to draw a ball inside a <canvas> element. when you click the canvas, pointer lock is then used to
remove the mouse pointer and allow you to move the ball directly using the mouse. contenteditable demo this is a working example showing how contenteditable can be used to create an editable document section, the state of which is then saved using localstorage. tutorials touch events guide managing screen orientation using fullscreen mode dragging and dropping multiple items drag operation...
HTML attribute: accept - HTML: Hypertext Markup Language
the accept attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow. the accept property is an attribute of the file <input> type. it was supported on the <form> element, but was
removed in favor of file in html5. because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is acceptable. for instance, there are a number of ways microsoft word files can be identified, so a site that accepts word files might use an <input> like this: <input type="file" id="docpicker" accept=".doc,.docx,application/msword,application/vnd.openxmlformats-offi...
... doesn't validate the types of the selected files; it simply provides hints for browsers to guide users towards selecting the correct file types. it is still possible (in most cases) for users to toggle an option in the file chooser that makes it possible to override this and select any file they wish, and then choose incorrect file types. because of this, you should make sure that expected requi
rement is validated server-side. examples when set on a file input type, the native file picker that opens up should only enable selecting files of the correct file type. most operating systems lighten the files that don't match the criteria and aren't selectable. <p> <label for="soundfile">select an audio file:</label> <input type="file" id="soundfile" accept="audio/*"> </p> <p> <label for=...
HTML attribute: multiple - HTML: Hypertext Markup Language
the attribute is not present. when multiple is set on the email input type, the user can inlclude zero (if not also required), one or more comma-separated email addresses. <input type="email" multiple name="emails" id="emails"> if 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 s...
...hful</option> <option value="sneezy@woodworkers.com">sneezy</option> <option value="dopey@woodworkers.com">dopey</option> <option value="doc@woodworkers.com">doc</option> </datalist> input:invalid {border: red solid 3px;} if 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. if the required attribute is present, at least one email address is required. some browsers support the appearance of the list of options from the associated <datalist> for subsequent email addresses when multiple is present. others do not. file input when multiple is set on the file input type, the user can select one or more files: <form method="post" en...
HTML attribute: pattern - HTML: Hypertext Markup Language
ssion, so that the pattern is treated as a sequence of unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requi
rements are to match the pattern. you should also include other explanatory text nearby. some of the input types supporting the pattern attribute, notably the email and url input types, have expected value syntaxes that must be matched. if the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the validitystate object's read-only typemismatch pro...
...ribute for the visual display of text content is generally discouraged as many user agents do not expose the attribute in an accessible manner. some browsers show a tooltip when an element with a title is hovered, but that leaves out keyboard-only and touch-only users. this is one of the several reasons you must include information informing users how to fill out the the control to match the requi
rements. while titles are used by some browsers to populate error messaging, because browsers sometimes also show the title as text on hover, it therefore shows in non-error situations, so be careful not to word titles as if an error has occurred. specifications specification status comment html living standardthe definition of 'pattern' in that specification. living sta...
HTML attribute: step - HTML: Hypertext Markup Language
for example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid. if omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step defaults to 1. for 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number...
...on. living standard html5the definition of 'step attribute' in that specification. recommendation accessibility concerns provide instructions to help users understand how to complete the form and use individual form controls. indicate any required and optional input, data formats, and other relevant information. when using the min attribute, ensure this minimum requi
rement is understood by the user. providing instructions within the <label> may be sufficient. if providing instructions outside of labels, which allows more flexible positioning and design, consider using aria-labelledby or aria-describedby. ...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
d. calling any of the following on a tainted canvas will result in an error: calling getimagedata() on the canvas's context calling toblob() on the <canvas> element itself calling todataurl() on the canvas attempting any of these when the canvas is tainted will cause a securityerror to be thrown. this protects users from having private data exposed by using images to pull information from
remote web sites without permission. storing an image from a foreign origin in this example, we wish to permit images from a foreign origin to be retrieved and saved to local storage. implementing this requires configuring the server as well as writing code for the web site itself. web server configuration the first thing we need is a server that's configured to host images with the access-contro...
... ...
Date and time formats used in HTML - HTML: Hypertext Markup Language
s essentially makes the average year 365.25 days long, which is close to correct. the adjustments to the algorithm (taking a leap year when the year can be divided by 400, and skipping leap years when the year is divisible by 100) help to bring the average even closer to the correct number of days (365.2425 days). scientists occasionally add leap seconds to the calendar (seriously) to handle the
remaining three ten-thousandths of a day and to compensate for the gradual, naturally occurring slowing of earth's rotation. while month 02, february, normally has 28 days, it has 29 days in leap years. months of the year there are 12 months in the year, numbered 1 through 12. they are always represented by a two-digit ascii string whose value ranges from 01 through 12. see the table in the sectio...
...00.01 am 1986-01-28 11:38:00.010 1986-01-28t11:38:00.011 january 28, 1986 at 11:38:00.01 am 0170-07-31t22:00:00 0170-07-31t22:002 july 31, 170 at 10:00 pm notice that after normalization, this is the same string as the previous datetime-local string. the space has been replaced with the "t" character and the trailing zero in the fraction of a second has been
removed to make the string as short as possible. note that the normalized form of this date drops the ":00" indicating the number of seconds to be zero, because the seconds are optional when zero, and the normalized string minimizes the length of the string. global date and time strings a global date and time string specifies a date and time as well as the time zone in which it occurs. a valid gl...
<a>: The Anchor element - HTML: Hypertext Markup Language
g success criterion 2.4.1 size and proximity size interactive elements, like links, should provide an area large enough that it is easy to activate them. this helps a variety of people, including those with motor control issues and those using imprecise inputs such as a touchscreen. a minimum size of 44×44 css pixels is recommended. text-only links in prose content are exempt from this requi
rement, but it’s still a good idea to make sure enough text is hyperlinked to be easily activated. understanding success criterion 2.5.5: target size target size and 2.5.5 quick test: large touch targets proximity interactive elements, like links, placed in close visual proximity should have space separating them. spacing helps people with motor control issues, who may otherwise accidentall...
...nding success criterion 2.5.5: target size target size and 2.5.5 quick test: large touch targets proximity interactive elements, like links, placed in close visual proximity should have space separating them. spacing helps people with motor control issues, who may otherwise accidentally activate the wrong interactive content. spacing may be created using css properties like margin. hand t
remors and the giant-button-problem specifications specification status comment referrer policythe definition of 'referrer attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe definition of '<a>' in that specification. living standard html5the definition of '<a>' in that spe...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
the obsolete html applet element (<applet>) embeds a java applet into the document; this element has been deprecated in favor of <object>. use of java applets on the web is deprecated; most browsers no longer support use of plug-ins, including the java plug-in. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content zero or more <param> elements, then transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. ...
...tion the applet on the page relative to content that might flow around it. the html 4.01 specification defines values of bottom, left, middle, right, and top, whereas microsoft and netscape also might support absbottom, absmiddle, baseline, center, and texttop. alt this attribute causes a descriptive text alternate to be displayed on browsers that do not support java. page designers should also
remember that content enclosed within the <applet> element may also be rendered as alternative text. archive this attribute refers to an archived or compressed version of the applet and its associated class files, which might help reduce download time. code this attribute specifies the url of the applet's class file to be loaded and executed. applet filenames are identified by a .class filename e...
<button>: The Button element - HTML: Hypertext Markup Language
button an accessible name, put text in the <button> element that concisely describes the button's functionality. example <button name="favorite"> <svg aria-hidden="true" viewbox="0 0 10 10"><path d="m7 9l5 8 3 9v6l1 4h3l1-3 1 3h3l7 6z"/></svg> add to favorites </button> if you want to visually hide the button's text, an accessible way to do so is to use a combination of css properties to
remove it visually from the screen, but keep it parseable by assistive technology. however, it is worth noting that leaving the button text visually apparent can aid people who may not be familiar with the icon's meaning or understand the button's purpose. this is especially relevant for people who are not technologically sophisticated, or who may have different cultural interpretations for the icon...
...ch targets - the a11y project proximity large amounts of interactive content — including buttons — placed in close visual proximity to each other should have space separating them. this spacing is beneficial for people who are experiencing motor control issues, who may accidentally activate the wrong interactive content. spacing may be created using css properties such as margin. hand t
remors and the giant-button-problem - axess lab firefox firefox will add a small dotted border on a focused button. this border is declared through css in the browser stylesheet, but you can override it to add your own focused style using button::-moz-focus-inner { }. if overridden, it is important to ensure that the state change when focus is moved to the button is high enough that people experi...
<dfn>: The Definition element - HTML: Hypertext Markup Language
this looks like this rendered in your browser: links to definitions to add links to the definitions, you create the link the same way you always do, with the <a> element. html <p>the <strong>html definition element</strong> (<strong><dfn id="definition-dfn"><dfn></dfn></strong>) is used to indicate the term being defined within the context of a definition phrase or sentence.</p> <p>lo
rem ipsum dolor sit amet, consectetur adipiscing elit. graece donan, latine voluptatem vocant. confecta res esset. duo reges: constructio interrete. scrupulum, inquam, abeunti; </p> <p>negare non possum. dat enim intervalla et relaxat. quonam modo? equidem e cn. quid de pythagora? in schola desinis. </p> <p>ubi ut eam caperet aut quando? cur iustitia laudatur? aperiendum est igitur, quid sit volupt...
...tine voluptatem vocant. confecta res esset. duo reges: constructio interrete. scrupulum, inquam, abeunti; </p> <p>negare non possum. dat enim intervalla et relaxat. quonam modo? equidem e cn. quid de pythagora? in schola desinis. </p> <p>ubi ut eam caperet aut quando? cur iustitia laudatur? aperiendum est igitur, quid sit voluptas; quid enim? non est igitur voluptas bonum. urgent tamen et nihil
remittunt. quid enim possumus hoc agere divinius? </p> <p>because of all of that, we decided to use the <code><a href="#definition-dfn"><dfn></a></code> element for this project.</p> here we see the definition — now with an id attribute, "definition-dfn", which can be used as the target of a link. later on, a link is created using <a> with the href attribute set to "#definition-dfn" to set ...
<input type="file"> - HTML: Hypertext Markup Language
next, let's walk through the javascript. in the first lines of script, we get references to the form input itself, and the <d...
...thumbnail preview of the image by calling url.createobjecturl(curfiles[i]). then, insert the image into the list item too by creating a new <img> and setting its src to the thumbnail. if the file type is invalid, we display a message inside a list item telling the user that they need to select a different file type. ...
<input type="hidden"> - HTML: Hypertext Markup Language
ically includes it when the form is sent to the server. you need to use well-designed secrets to actually secure your website. validation hidden inputs don't participate in constraint validation; they have no real value to be constrained. examples let's look at how we might implement a simple version of the edit form we described earlier (see tracking edited content), using a hidden input to
remember the id of the record being edited. the edit form's html might look a little bit like this: <form> <div> <label for="title">post title:</label> <input type="text" id="title" name="title" value="my excellent blog post"> </div> <div> <label for="content">post content:</label> <textarea id="content" name="content" cols="60" rows="5"> this is the content of my excellent bl...
...no scripting is needed in the content to handle this. the output loo...
<input type="range"> - HTML: Hypertext Markup Language
both for user interface and validation purposes list the values of the list attribute is the id of a <datalist> element located in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requi
rements: users can select from this predefined list or provide a different value. see the range control with hash marks below for an example of how the options on a range are denoted in supported browsers max the greatest value in the range of permitted values. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a num...
...e value selected. adding hash marks and labels the html specification gives browsers some flexibility on how to present the range control. nowhere is this flexibility more apparent than in the area of hash marks and, to a lesser degree, labels. the specification describes how to add custom points to the range control using the list attribute and a <datalist> element, but does not have any requi
rements or even recommendations for standardized hash or tick marks along the length of the control. range control mockups since browsers have this flexibility, and to date none support all of the features html defines for range controls, here are some mockups to show you what you might get on macos in a browser which supports them. an unadorned range control this is what you get if you don't spe...
<isindex> - HTML: Hypertext Markup Language
summary <isindex> was an obsolete html element that put a text field in a page for querying the document. <isindex> provided a single line text input for entering a query string. when sent, the server would return a list of pages matching the query. its support depended on both the browser and the server to react to the query. <isindex> is
removed html standard. it was deprecated in html 4.01. the same behaviour can be achieved with an html form. all major browsers have now
removed <isindex>. attributes like all other html elements, this element accepted the global attributes. prompt this attribute added its value as a prompt for text field. action this attribute determined the server url to which the query was sent. example <head> <isindex prompt="search document..." action...
...pported by steve putz). tim berners-lee explains the purpose of isindex resulting in aggregated search results. kevin replies that he doesn't like the boolean nature of isindex and would prefer a system where everything is searchable and proposes to extend the current www framework with a specific httpd configuration and defined that some uris mapping create search queries. in 2016, after it was
removed from edge and chrome, it was proposed to
remove isindex from the standard; this
removal was completed the next day, after which safari and firefox also
removed support. html reference the html standard classifies it as a obsolete and non-conforming feature. isindex element deprecated in html 4.01 isindex in html 3.2 isindex in html 2.0 as well the description of the behavior in queries...
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
hich can be used to let you know when this state change occurs. default label text if a <details> element's first child is not a <summary> element, the user agent will use a default string (typically "details") as the label for the disclosure box. default style per the html specification, the default style for <summary> elements includes display: list-item. this makes it possible to change or
remove the icon displayed as the disclosure widget next to the label from the default, which is typically a triangle. you can also change the style to display: block to
remove the disclosure triangle. see the browser compatibility section for details, as not all browsers support full functionality of this element yet. examples below are some examples showing <summary> in use. you can find more ex...
...</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> this currently has some spacing issues that could be addressed using css. warning: because the <summary> element has a default role of button (which strips all roles from child elements), this example will not work for users of assistive technologies such as screen readers. the <h4> will have its role
removed and thus will not be treated as a heading for these users. html in summaries this example adds some semantics to the <summary> element to indicate the label as important: <details open> <summary><strong>overview</strong></summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> specifications sp...
HTML documentation index - HTML: Hypertext Markup Language
ne frames, reference, web, embedded, iframe the html inline frame element (<iframe>) represents a nested browsing context, embedding another html page into the current one. 116 <image>: the obsolete image element element, html, html element reference, html reference, html element, non-standard, obsolete, reference the obsolete html image element (<image>) is an obsolete
remnant of an ancient version of html lost in the mists of time; use the standard <img> element instead. 117 <img>: the image embed element content, element, graphics, html, html graphics, html images, html photos, html pictures, html embedded content, image, image element, media, multimedia, photos, pictures, reference, web the html <img> element embeds an image into the documen...
... date, either with a textbox that validates the input or a special date picker interface. 123 <input type="datetime"> element, html, html forms, input, input element, input type, obsolete, reference, datetime the html <input type="datetime"> was a control for entering a date and time (hour, minute, second, and fraction of a second) as well as a timezone. this feature has been
removed from whatwg html, and is no longer supported in browsers. 124 <input type="datetime-local"> date, date and time, element, form input, html, html forms, input, input element, input type, reference, time, datetime-local <input> elements of type datetime-local create input controls that let the user easily enter both a date and a time, including the year, month, and day as w...
Link types - HTML: Hypertext Markup Language
bsites create short links to make sharing links via instant messaging easier. <link> ??? sidebar obsolete since gecko 63 indicates that the hyperlink leads to a resource that would be better suited for a secondary browsing context, like a sidebar. browsers, that don't have such a context will ignore this keyword. while once part of the html specification, this has been
removed from the spec and is only implemented by versions of firefox prior to firefox 63. <a>, <area>, <link> <form> stylesheet defines an external resource to be used as a stylesheet. if the type is not set, the browser should assume it is a text/css stylesheet until further inspection. if used in combination with the alternate keyword, it defines an alternative style shee...
...d prerender values. html living standardthe definition of 'link types' in that specification. living standard added opener and made noopener the default behavior for target="_blank" links. html5the definition of 'link types' in that specification. recommendation added tag, search, prefetch, noreferrer, nofollow, icon, and author. renamed copyright to license.
removed start, chapter, section, subsection, and appendix html 4.01 specificationthe definition of 'link types' in that specification. recommendation added alternate, stylesheet, start, chapter, section, subsection, appendix, and bookmark. renamed previous to prev.
removed top, and search. unknownthe definition of '<link>' in that specification. obsolete added to...
CORS errors - HTTP
be necessary to relax certain restrictions. setting up such a cors configuration isn't necessarily easy and may present some challenges. in these pages, we'll look into some common cors error messages and how to resolve them. if the cors configuration isn't setup correctly, the browser console will present an error like "cross-origin request blocked: the same origin policy disallows reading the
remote resource at $somesite" indicating that the request was blocked due to violating the cors security rules. this might not necessarily be a set-up mistake, though. it's possible that the request is in fact intentionally being disallowed by the user's web application and
remote external service. however, if the endpoint is meant to be available, some debugging is needed to succeed. identifying th...
...lp you do so: navigate to the web site or web app in question and open the developer tools. now try to reproduce the failing transaction and check the console if you are seeing a cors violation error message. it will probably look like this: the text of the error message will be something similar to the following: cross-origin request blocked: the same origin policy disallows reading the
remote resource at https://some-url-here. (reason: additional information here). note: for security reasons, specifics about what went wrong with a cors request are not available to javascript code. all the code knows is that an error occurred. the only way to determine what specifically went wrong is to look at the browser's console for details. cors error messages firefox's console displays me...
Using HTTP cookies - HTTP
an http cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user's web browser. the browser may store it and send it back with later requests to the same server. typically, it's used to tell if two requests came from the same browser — keeping a user logged-in, for example. it
remembers stateful information for the stateless http protocol. cookies are mainly used for three purposes: session management logins, shopping carts, game scores, or anything else the server should
remember personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage. while this was legitimate when they were the only way to store data on the client, it is now recommende...
... allowing users to opt out of receiving some or all cookies. allowing users to use the bulk of your service without receiving cookies. there may be other regulations governing the use of cookies in your locality. the burden is on you to know and comply with these regulations. there are companies that offer "cookie banner" code that h...
Connection - HTTP
ork connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. connection-specific header fields such as connection and keep-alive are prohibited in http/2. chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requi
rements and won’t load any response which contains them. except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them further. standard hop-by-hop h...
...rectives close indicates that either the client or the server would like to close the connection. this is the default on http/1.0 requests. any comma-separated list of http headers [usually keep-alive only] indicates that the client would like to keep the connection open. having a persistent connection is the default on http/1.1 requests. the list of headers are the name of the header to be
removed by the first non-transparent proxy or cache in-between: these headers define the connection between the emitter and the first entity, not the destination node. ...
Expect-CT - HTTP
the expect-ct header lets sites opt in to reporting and/or enforcement of certificate transparency requi
rements, to prevent the use of misissued certificates for that site from going unnoticed. ct requi
rements can be satisfied via any one of the following mechanisms: x.509v3 certificate extension to allow embedding of signed certificate timestamps issued by individual logs a tls extension of type signed_certificate_timestamp sent during the handshake supporting ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs. browsers ignore the expect-ct header over http; the header only has effe...
...licy should be enforced and that violations should be reported. example the following example specifies enforcement of certificate transparency for 24 hours and reports violations to foo.example. expect-ct: max-age=86400, enforce, report-uri="https://foo.example/report" notes root cas manually added to the trust store override and suppress expect-ct reports/enforcement. browsers will not
remember an expect-ct policy, unless the site has 'proven' it can serve a certificate satisfying the certificate transparency requi
rements. browsers implement their own trust model regarding which ct logs are considered trusted for the certificate to have been logged to. builds of chrome are designed to stop enforcing the expect-ct policy 10 weeks after the installation's build date. specifications...
Index - HTTP
ugins that can be embedded into a document by limiting the types of resources which can be loaded. 43 csp: referrer csp, directive, http, reference, security the http content-security-policy (csp) referrer directive used to specify information in the referer header (with a single r as this was a typo in the original spec) for links away from a page. this api is deprecated and
removed from browsers. 44 csp: report-uri csp, directive, http, reference, security the deprecated http content-security-policy (csp) report-uri directive instructs the user agent to report attempts to violate the content security policy. these violation reports consist of json documents sent via an http post request to the specified uri. 45 csp: require-sri-for cs...
...st (i.e., a browser). 60 expect http, http header, reference, request header the expect http request header indicates expectations that need to be fulfilled by the server in order to properly handle the request. 61 expect-ct http, reference, header the expect-ct header allows sites to opt in to reporting and/or enforcement of certificate transparency requi
rements, which prevents the use of misissued certificates for that site from going unnoticed. 62 expires caching, http, response, header the expires header contains the date/time after which the response is considered stale. 63 feature-policy experimental, feature policy, feature-policy, http, reference, header the http feature-policy header provides a mechan...
Public-Key-Pins - HTTP
use certificate transparency and expect-ct header instead. ...
...ludesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. max-age=<expire-time> the time, in seconds, that the browser should
remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" optional if this optional parameter is specified, pin validation failures are reported to the given url. example hpkp has the potential to lock out users for a long time i...
Strict-Transport-Security - HTTP
e accessed using https, instead of using http. header type response header forbidden header name no syntax strict-transport-security: max-age=<expire-time> strict-transport-security: max-age=<expire-time>; includesubdomains strict-transport-security: max-age=<expire-time>; preload directives max-age=<expire-time> the time, in seconds, that the browser should
remember that a site is only to be accessed using https. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. preload optional see preloading strict transport security for details. not part of the specification. description if a website accepts a connection through http and redirects to https, visitors may initially comm...
...e http strict transport security header informs the browser that it should never load a site using http and should automatically convert all attempts to access the site using http to https requests instead. note: the strict-transport-security header is ignored by the browser when your site is accessed using http; this is because an attacker may intercept http connections and inject the header or
remove it. when your site is accessed over https with no certificate errors, the browser knows your site is https capable and will honor the strict-transport-security header. an example scenario you log into a free wifi access point at an airport and start surfing the web, visiting your online banking service to check your balance and pay a couple of bills. unfortunately, the access point you're us...
Firefox user agent string reference - HTTP
correspondences by looking at the mercurial repository names: repositories starting by mozilla-b2g are the release repositories for firefox os, and have both firefox os and gecko versions in their names. firefox os has a four-digit version number: x.x.x.y. the first two digits are owned by the mozilla product team and denote versions with new features (eg: v1.1, 1.2, etc). the third digit is inc
remented with regular version tags (about every 6 weeks) for security updates, and the fourth is owned by the oem. firefox web runtime the web runtime uses the same user agent string as desktop firefox. other gecko-based browsers these are some sample ua strings from other gecko-based browsers on various platforms. note that many of these have not yet been released on gecko 2.0! browser...
...ecko 2.0, it was possible for extensions to add user agent parts through the general.useragent.extra.identifier preferences, (see the obsolete user agent strings reference). but that has not been possible since bug 581008. in the past, specific plug-ins, add-ons or extensions added user agent parts to notify sites they were installed. the recommended way to do this, if it's absolutely necessary (
remember that it slows down every request) is to set a custom http header. see also firefox os user agent string (blog post w/bug 777710 reference) final user agent string for firefox 4 (blog post) recommendations on sniffing the ua string for cross-browser support window.navigator.useragent add android version to fennec ua string (bug 1169772) comments to mozilla.dev.platform ...
X-XSS-Protection - HTTP
and safari that stops pages from loading when they detect reflected cross-site scripting (xss) attacks. although these protections are largely unnecessary in modern browsers when sites implement a strong content-security-policy that disables the use of inline javascript ('unsafe-inline'), they can still provide protections for users of older web browsers that don't yet support csp. chrome has
removed their xss auditor firefox have not, and will not implement x-xss-protection edge have retired their xss filter this means that if you do not need to support legacy browsers, it is recommended that you use content-security-policy without allowing unsafe-inline scripts instead. header type response header forbidden header name no syntax x-xss-protection: 0 ...
...ne scripts instead. header type response header forbidden header name no syntax x-xss-protection: 0 x-xss-protection: 1 x-xss-protection: 1; mode=block x-xss-protection: 1; report=<reporting-uri> 0 disables xss filtering. 1 enables xss filtering (usually default in browsers). if a cross-site scripting attack is detected, the browser will sanitize the page (
remove the unsafe parts). 1; mode=block enables xss filtering. rather than sanitizing the page, the browser will prevent rendering of the page if an attack is detected. 1; report=<reporting-uri> (chromium only) enables xss filtering. if a cross-site scripting attack is detected, the browser will sanitize the page and report the violation. this uses the functionality of the csp report-uri directiv...
HTTP Index - HTTP
alid resources that may be prefetched or prerendered. 93 csp: referrer csp, content-security-policy, directive, http, obsolete, reference, security, referrer the http content-security-policy (csp) referrer directive used to specify information in the referer header (with a single r as this was a typo in the original spec) for links away from a page. this api is deprecated and
removed from browsers. 94 csp: report-to csp, content security policy, content-security-policy, http, reporting, security, report-to the content-security-policy report-to http response header field instructs the user agent to store reporting endpoints for an origin. 95 csp: report-uri csp, directive, http, reference, security the deprecated http content-secur...
... (i.e., a browser). 119 expect http, http header, reference, request header the expect http request header indicates expectations that need to be fulfilled by the server in order to properly handle the request. 120 expect-ct http, reference, header the expect-ct header allows sites to opt in to reporting and/or enforcement of certificate transparency requi
rements, which prevents the use of misissued certificates for that site from going unnoticed. 121 expires caching, http, response, header the expires header contains the date/time after which the response is considered stale. 122 feature-policy experimental, feature policy, feature-policy, http, reference, header the http feature-policy header provides a mech...
An overview of HTTP - HTTP
ection: the tcp connection is used to send a request, or several, and receive an answer. the client may open a new connection, reuse an existing connection, or open several tcp connections to the servers. send an http message: http messages (before http/2) are human-readable. with http/2, these simple messages are encapsulated in frames, making them impossible to read directly, but the principle
remains the same. for example: get / http/1.1 host: developer.mozilla.org accept-language: fr read the response sent by the server, such as: http/1.1 200 ok date: sat, 09 oct 2010 14:28:02 gmt server: apache last-modified: tue, 01 dec 2009 20:18:22 gmt etag: "51142bc1-7449-479b075b2891b" accept-ranges: bytes content-length: 29769 content-type: text/html <!doctype html... (here comes the 29769...
...shed. conclusion http is an extensible protocol that is easy to use. the client-server structure, combined with the ability to simply add headers, allows http to advance along with the extended capabilities of the web. though http/2 adds some complexity, by embedding http messages in frames to improve performance, the basic structure of messages has stayed the same since http/1.0. session flow
remains simple, allowing it to be investigated, and debugged with a simple http message monitor. ...
HTTP Public Key Pinning (HPKP) - HTTP
note: public key pinning mechanism was deprecated in favor of certificate transparency and expect-ct header. http public key pinning (hpkp) was a security feature that used to tell a web client to associate a specific cryptographic public key with a certain web server to decrease the risk of mitm attacks with forged certificates. it has been
removed in modern browsers and is no longer supported. to ensure the authenticity of a server's public key used in tls sessions, this public key is wrapped into a x.509 certificate which is usually signed by a certificate authority (ca). web clients such as browsers trust a lot of these cas, which can all create certificates for arbitrary domain names. if an attacker is able to compromise a single ca, they can perform mitm attacks on various tls conn...
..."reporturi"] pin-sha256 the quoted string is the base64 encoded subject public key information (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. see below on how to extract this information out of a certificate or key file. max-age the time, in seconds, that the browser should
remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri optional if this optional parameter is specified, pin validation failures are reported to the given url. note: the current specification requires including a second pin for a backu...
Redirections in HTTP - HTTP
rmanently get methods unchanged. others may or may not be changed to get.[1] reorganization of a web site. 308 permanent redirect method and body not changed. reorganization of a web site, with non-get links/operations. [1] the specification did not intend to allow method changes, but there are existing user agents that do change their method. 308 was created to
remove the ambiguity of the behavior when using non-get methods. temporary redirections sometimes the requested resource can't be accessed from its canonical location, but it can be accessed from another place. in this case, a temporary redirect can be used. search engine robots and other crawlers don't memorize the new, temporary url. temporary redirections are also used when creating, updating, ...
...e result page doesn't re-trigger the operation. 307 temporary redirect method and body not changed the web page is temporarily unavailable for unforeseen reasons. better than 302 when non-get operations are available on the site. [2] the specification did not intend to allow method changes, but there are existing user agents that do change their method. 307 was created to
remove the ambiguity of the behavior when using non-get methods. special redirections 304 (not modified) redirects a page to the locally cached copy (that was stale), and 300 (multiple choice) is a manual redirection: the body, presented by the browser as a web page, lists the possible redirections and the user clicks on one to select it. code text typical use case 300 ...
Regular expression syntax cheatsheet - JavaScript
the hyphen appears as the first or last character enclosed in the square brackets it is taken as a literal hyphen to be included in the character set as a normal character. for example, [^abc] is the same as [^a-c]. they initially match "o" in "bacon" and "h" in "chop". the ^ character may also indicate the beginning of input. (x) capturing group: matches x and
remembers the match. for example, /(foo)/ matches and
remembers "foo" in "foo bar". a regular expression may have multiple capturing groups. in results, matches to capturing groups typically in an array whose members are in the same order as the left parentheses in the capturing group. this is usually just the order of the capturing groups themselves. this becomes important when capturing group...
..." and stores it on the groups property of the returned matches under the name specified by <name>. the angle brackets (< and >) are required for group name. for example, to extract the united states area code from a phone number, we could use /\((?<area>\d\d\d)\)/. the resulting number would appear under matches.groups.area. (?:x) non-capturing group: matches "x" but does not
remember the match. the matched substring cannot be recalled from the resulting array's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). quantifiers if you are looking to contribute to this document, please also edit the original article note: in the following, item refers not only to singular characters, but also includes character classes, unicode ...
Groups and ranges - JavaScript
the hyphen appears as the first or last character enclosed in the square brackets it is taken as a literal hyphen to be included in the character set as a normal character. for example, [^abc] is the same as [^a-c]. they initially match "o" in "bacon" and "h" in "chop". the ^ character may also indicate the beginning of input. (x) capturing group: matches x and
remembers the match. for example, /(foo)/ matches and
remembers "foo" in "foo bar". a regular expression may have multiple capturing groups. in results, matches to capturing groups typically in an array whose members are in the same order as the left parentheses in the capturing group. this is usually just the order of the capturing groups themselves. this becomes important when capturing group...
..." and stores it on the groups property of the returned matches under the name specified by <name>. the angle brackets (< and >) are required for group name. for example, to extract the united states area code from a phone number, we could use /\((?<area>\d\d\d)\)/. the resulting number would appear under matches.groups.area. (?:x) non-capturing group: matches "x" but does not
remember the match. the matched substring cannot be recalled from the resulting array's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). examples counting vowels var aliceexcerpt = "there was a long silence after this, and alice could only hear whispers now and then."; var regexpvowels = /[aeiouy]/g; console.log("number of vowels:", aliceexcerpt.matc...
Working with objects - JavaScript
nspect)) { result = result.concat( object.getownpropertynames(objecttoinspect) ); } return result; } this can be useful to reveal "hidden" properties (properties in the prototype chain which are not accessible through the object, because another property has the same name earlier in the prototype chain). listing accessible properties only can easily be done by
removing duplicates in the array. creating new objects javascript has a number of predefined objects. in addition, you can create your own objects. you can create an object using an object initializer. alternatively, you can first create a constructor function and then instantiate an object invoking that function in conjunction with the new operator. using object initializers in addition to creat...
...time choose the first form. this form is more compact and natural. however, if you need to add getters and setters later — because you did not write the prototype or particular object — then the second form is the only possible form. the second form probably best represents the dynamic nature of javascript — but it can make the code hard to read and understand. deleting properties you can
remove a non-inherited property by using the delete operator. the following code shows how to
remove a property. // creates a new object, myobj, with two properties, a and b. var myobj = new object; myobj.a = 5; myobj.b = 12; //
removes the a property, leaving myobj with only the b property. delete myobj.a; console.log ('a' in myobj); // output: "false" you can also use delete to delete a global ...
Memory Management - JavaScript
objects. cycles are a common mistake that can generate memory leaks: var div; window.onload = function() { div = document.getelementbyid('mydivelement'); div.circularreference = div; div.lotsofdata = new array(10000).join('*'); }; in the above example, the dom element "mydivelement" has a circular reference to itself in the "circularreference" property. if the property is not explicitly
removed or nulled, a reference-counting garbage collector will always have at least one reference intact and will keep the dom element in memory even if it was
removed from the dom tree. if the dom element holds a large amount of data (illustrated in the above example with the "lotsofdata" property), the memory consumed by this data will never be released and can lead to memory related issues such as...
...ects and collect all non-reachable objects. this algorithm is an improvement over the previous one since an object having zero references is effectively unreachable. the opposite does not hold true as we have seen with circular references. as of 2012, all modern browsers ship a mark-and-sweep garbage-collector. all improvements made in the field of javascript garbage collection (generational/inc
remental/concurrent/parallel garbage collection) over the last few years are implementation improvements of this algorithm, but not improvements over the garbage collection algorithm itself nor its reduction of the definition of when "an object is no longer needed". cycles are no longer a problem in the first example above, after the function call returns, the two objects are no longer referenced b...
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
the javascript warning about string generics occurs in firefox versions prior to 68. string generics have been
removed starting with firefox 68. message warning: string.charat is deprecated; use string.prototype.charat instead warning: string.charcodeat is deprecated; use string.prototype.charcodeat instead warning: string.concat is deprecated; use string.prototype.concat instead warning: string.contains is deprecated; use string.prototype.contains instead warning: string.endswith is deprecated; use string.prototype.endswith instead warning: string.includes is deprecated; use string.prototype.includes instead warning: string.indexof is deprecated; use string.prototype.i...
...deprecated; use string.prototype.trim instead warning: string.trimleft is deprecated; use string.prototype.trimleft instead warning: string.trimright is deprecated; use string.prototype.trimright instead error type warning. javascript execution won't be halted. what went wrong? the non-standard generic string methods are deprecated and have been
removed in firefox 68 and later. string generics provide string instance methods on the string object allowing string methods to be applied to any object. examples deprecated syntax var num = 15; string.replace(num, /5/, '2'); standard syntax var num = 15; string(num).replace(/5/, '2'); shim the following is a shim to provide support to non-supporting browsers: /*globals define*/ // assumes ...
TypeError: Reduce of empty array with no initial value - JavaScript
the callback). however, if no initial value is provided, it will use the first element of the array or typedarray as the initial value. this error is raised when an empty array is provided because no initial value can be returned in that case. examples invalid cases this problem appears frequently when combined with a filter (array.prototype.filter(), typedarray.prototype.filter()) which will
remove all elements of the list. thus leaving none to be used as the initial value. var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) //
removes all elements .reduce((x, y) => x + y) // no more elements to use for the initial value. similarly, the same issue can happen if there is a typo in a selector, or an unexpected number of elements in a list: var names = document.get...
...me_list = array.prototype.reduce.call(names, (acc, name) => acc + ", " + name); valid cases these problems can be solved in two different ways. one way is to actually provide an initialvalue as the neutral element of the operator, such as 0 for the addition, 1 for a multiplication, or an empty string for a concatenation. var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) //
removes all elements .reduce((x, y) => x + y, 0) // the initial value is the neutral element of the addition another way would be two to handle the empty case, either before calling reduce, or in the callback after adding an unexpected dummy initial value. var names = document.getelementsbyclassname("names"); var name_list1 = ""; if (names1.length >= 1) name_list1 = array.prototype.reduce.c...
Arrow function expressions - JavaScript
. ...
...) { return element.length; }); // the regular function above can be written as the arrow function below elements.map((element) => { return element.length; }); // [8, 6, 7, 9] // when there is only one parameter, we can
remove the surrounding parentheses elements.map(element => { return element.length; }); // [8, 6, 7, 9] // when the only statement in an arrow function is `return`, we can
remove `return` and
remove // the surrounding curly brackets elements.map(element => element.length); // [8, 6, 7, 9] // in this case, because we only need the length property, we can use destructuring parameter: // notice that the `length` corresponds to the property we want to get whereas the // obviously non-special `lengthfoobarx` is just the name of a variable which can be changed // to any val...
Array.prototype.forEach() - JavaScript
before the first invocation of callback. elements which are appended to the array after the call to foreach() begins will not be visited by callback. if existing elements of the array are changed or deleted, their value as passed to callback will be the value at the time foreach() visits them; elements that are deleted before being visited are not visited. if elements that are already visited are
removed (e.g. using shift()) during the iteration, later elements will be skipped. (see this example, below.) foreach() executes the callback function once for each array element; unlike map() or reduce() it always returns the value undefined and is not chainable. the typical use case is to execute side effects at the end of a chain. foreach() does not mutate the array on which it is called. (howev...
...sc = object.getownpropertydescriptor(obj, name) object.defineproperty(copy, name, desc) }) return copy } const obj1 = { a: 1, b: 2 } const obj2 = copy(obj1) // obj2 looks like obj1 now modifying the array during iteration the following example logs one, two, four. when the entry containing the value two is reached, the first entry of the whole array is shifted off—resulting in all
remaining entries moving up one position. because element four is now at an earlier position in the array, three will be skipped. foreach() does not make a copy of the array before iterating. let words = ['one', 'two', 'three', 'four'] words.foreach((word) => { console.log(word) if (word === 'two') { words.shift() //'one' will delete from array } }) // one // two // four cons...
EvalError - JavaScript
constructor evalerror() creates a new evalerror object. instance properties evalerror.prototype.message error message. although ecma-262 specifies that evalerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. evalerror.prototype.name error name. inherited from error. evalerror.prototype.filename path to file that raised this error. inherited from error. ...
....prototype.linenumber line number in file that raised this error. inherited from error. evalerror.prototype.columnnumber column number in line that raised this error. inherited from error. evalerror.prototype.stack stack trace. inherited from error. examples evalerror is not used in the current ecmascript specification and will thus not be thrown by the runtime. however, the object itself
remains for backwards compatibility with earlier versions of the specification. creating an evalerror try { throw new evalerror('hello', 'somefile.js', 10); } catch (e) { console.log(e instanceof evalerror); // true console.log(e.message); // "hello" console.log(e.name); // "evalerror" console.log(e.filename); // "somefile.js" console.log(e.linen...
Intl.Locale.prototype.minimize() - JavaScript
the intl.locale.prototype.minimize() method attempts to
remove information about the locale that would be added by calling locale.maximize(). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.minimize() return value a locale instance whose basename property returns the result of the
remove likely subtags algorithm executed against locale.basename. description this method carries out the reverse of maximize(),
removing any language, script, or region subtags from the locale language identifier (essentially the contents of basename). this is useful when there are superfluous subtags in the language ...
...console.log(mylocminimized.tostring()); specifications specification ecmascript internationalization api (ecma-402) ...
JSON.stringify() - JavaScript
, as follows: if you return a number, string, boolean, or null, the stringified version of that value is used as the property's value. if you return a function, symbol, or undefined, the property is not included in the output. if you return any other object, the object is recursively stringified, calling the replacer function on each property. note: you cannot use the replacer function to
remove values from an array. if you return undefined or a function then null is used instead. note: if you wish the replacer to distinguish an initial object from a key with an empty string property (since both would give the empty string as key and potentially an object as value), you will have to keep track of the iteration count (if it is beyond the first iteration, it is a genuine empty string...
...ular references. const circularreference = {}; circularreference.myself = circularreference; // serializing circular references throws "typeerror: cyclic object value" json.stringify(circularreference); to serialize circular references you can use a library that supports them (e.g. cycle.js by douglas crockford) or implement a solution by yourself, which will require finding and replacing (or
removing) the cyclic references by serializable values. issue with plain json.stringify for use as javascript historically, json was not a completely strict subset of javascript. the literal code points u+2028 line separator and u+2029 paragraph separator could appear literally in string literals and property names in json text. but they could not appear literally in similar context in javascript t...
Object.preventExtensions() - JavaScript
y, but not exclusively, when in strict mode). object.preventextensions() only prevents addition of own properties. properties can still be added to the object prototype. this method makes the [[prototype]] of the target immutable; any [[prototype]] re-assignment will throw a typeerror. this behavior is specific to the internal [[prototype]] property, other properties of the target object will
remain mutable. there is no way to make an object extensible again once it has been made non-extensible. examples using object.preventextensions // object.preventextensions returns the object // being made non-extensible. var obj = {}; var obj2 = object.preventextensions(obj); obj === obj2; // true // objects are extensible by default. var empty = {}; object.isextensible(empty); // === true // ...
...nsible. var obj = {}; var obj2 = object.preventextensions(obj); obj === obj2; // true // objects are extensible by default. var empty = {}; object.isextensible(empty); // === true // ...but that can be changed. object.preventextensions(empty); object.isextensible(empty); // === false // object.defineproperty throws when adding // a new property to a non-extensible object. var nonextensible = {
removable: true }; object.preventextensions(nonextensible); object.defineproperty(nonextensible, 'new', { value: 8675309 }); // throws a typeerror // in strict mode, attempting to add new properties // to a non-extensible object throws a typeerror. function fail() { 'use strict'; // throws a typeerror nonextensible.newproperty = 'fail'; } fail(); a non-extensible object's prototype is immu...
Object.seal() - JavaScript
erted from data properties to accessor properties and vice versa, but it does not prevent the values of data properties from being changed. attempting to delete or add properties to a sealed object, or to convert a data property to accessor or vice versa, will fail, either silently or by throwing a typeerror (most commonly, although not exclusively, when in strict mode code). the prototype chain
remains untouched. however, the __proto__ property is sealed as well. comparison to object.freeze() existing properties in objects frozen with object.freeze() are made immutable. objects sealed with object.seal() can have their existing properties changed. examples using object.seal var obj = { prop: function() {}, foo: 'bar' }; // new properties may be added, existing properties // may be ...
...hed. however, the __proto__ property is sealed as well. comparison to object.freeze() existing properties in objects frozen with object.freeze() are made immutable. objects sealed with object.seal() can have their existing properties changed. examples using object.seal var obj = { prop: function() {}, foo: 'bar' }; // new properties may be added, existing properties // may be changed or
removed. obj.foo = 'baz'; obj.lumpy = 'woof'; delete obj.prop; var o = object.seal(obj); o === obj; // true object.issealed(obj); // === true // changing property values on a sealed object // still works. obj.foo = 'quux'; // but you can't convert data properties to accessors, // or vice versa. object.defineproperty(obj, 'foo', { get: function() { return 'g'; } }); // throws a typeerror // now...
handler.deleteProperty() - JavaScript
invariants are violated, the proxy will throw a typeerror: a property cannot be deleted, if it exists as a non-configurable own property of the target object. examples trapping the delete operator the following code traps the delete operator. ...
...raps the delete operator. const p = new proxy({}, { deleteproperty: function(target, prop) { if (prop in target){ delete target[prop] console.log('property
removed: ' + prop) return true } else { console.log('property not found: ' + prop) return false } } }) let result p.a = 10 console.log('a' in p) // true result = delete p.a // "property
removed: a" console.log(result) // true console.log('a' in p) // false result = delete p.a // "property not found: a" console.log(result) // false specifications specification ecmascript (ecma-262)the definition of '[[delete]]' in that specification. ...
SharedArrayBuffer - JavaScript
pdated simultaneously in workers or the main thread. depending on the system (the cpu, the os, the browser) it can take a while until the change is propagated to all contexts. to synchronize, atomic operations are needed. ...
...tbuffersubdata() security requi
rements shared memory and high-resolution timers were effectively disabled at the start of 2018 in light of spectre. in 2020, a new, secure approach has been standardized to re-enable shared memory. with a few security measures, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads will be available: as a baseline requi
rement, your document needs to be in a secure context. for top-level documents, two headers will need to be set to cross-origin isolate your site: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) cross-origin-opener-policy: same-origin cross-origin-embedder-poli...
String.prototype.localeCompare() - JavaScript
2 or -1 (or some other negative value) // alphabetically the word "check" comes after "against" yielding a positive value 'check'.localecompare('against'); // 2 or 1 (or some other positive value) // "a" and "a" are equivalent yielding a neutral value of zero 'a'.localecompare('a'); // 0 sort an array localecompare() enables case-insensitive sorting for an array. let items = ['réservé', 'p
remier', 'cliché', 'communiqué', 'café', 'adieu']; items.sort( (a, b) => a.localecompare(b, 'fr', {ignorepunctuation: true})); // ['adieu', 'café', 'cliché', 'communiqué', 'p
remier', 'réservé'] check browser support for extended arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them, use the "i" argument (a requi...
...ier', 'cliché', 'communiqué', 'café', 'adieu']; items.sort( (a, b) => a.localecompare(b, 'fr', {ignorepunctuation: true})); // ['adieu', 'café', 'cliché', 'communiqué', 'p
remier', 'réservé'] check browser support for extended arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them, use the "i" argument (a requi
rement that illegal language tags are rejected) and look for a rangeerror exception: function localecomparesupportslocales() { try { 'foo'.localecompare('bar', 'i'); } catch (e) { return e.name === 'rangeerror'; } return false; } using locales the results provided by localecompare() vary between languages. in order to get the sort order of the language used in the user interface o...
String.prototype.split() - JavaScript
ftover text is not included in the array at all. the array may contain fewer entries than limit if the end of the string is reached before the limit is reached. if limit is 1, str.split(separator)[0] is returned if limit is 0, [] is returned. return value an array of strings, split at each point where the separator occurs in the given string. description when found, separator is
removed from the string, and the substrings are returned in an array. if separator is a regular expression with capturing parentheses, then each time separator matches, the results (including any undefined results) of the capturing parentheses are spliced into the output array. if the separator is an array, then that array is coerced to a string and used as a separator. examples using split() w...
.../ such / people / in / it. the original string is: "oh brave new world that has such people in it." the separator is: "undefined" the array has 1 elements: oh brave new world that has such people in it. the original string is: "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec" the separator is: "," the array has 12 elements: jan / feb / mar / apr / may / jun / jul / aug / sep / oct / nov / dec
removing spaces from a string in the following example, split() looks for zero or more spaces, followed by a semicolon, followed by zero or more spaces—and, when found,
removes the spaces and the semicolon from the string. namelist is the array returned as a result of split(). const names = 'harry trump ;fred barney; helen rigby ; bill abel ;chris hand ' console.log(names) const re = /\s*(?:;|$...
String.prototype.substring() - JavaScript
anystring.substring(4)) console.log(anystring.substring(4, 7)) console.log(anystring.substring(7, 4)) // displays 'mozilla' console.log(anystring.substring(0, 7)) console.log(anystring.substring(0, 10)) using substring() with length property the following example uses the substring() method and length property to extract the last characters of a particular string. this method may be easier to
remember, given that you don't need to know the starting and ending indices as you would in the above examples. // displays 'illa' the last 4 characters let anystring = 'mozilla' let anystring4 = anystring.substring(anystring.length - 4) console.log(anystring4) // displays 'zilla' the last 5 characters let anystring = 'mozilla' let anystring5 = anystring.substring(anystring.length - 5) console.log(...
...e's a subtle difference between the substring() and substr() methods, so you should be careful not to get them confused. the arguments of substring() represent the starting and ending indexes, while the arguments of substr() represent the starting index and the number of characters to include in the returned string. furthermore, substr() is considered a legacy feature in ecmascript and could be
removed from future versions, so it is best to avoid using it if possible. let text = 'mozilla' console.log(text.substring(2,5)) // => "zil" console.log(text.substr(2,3)) // => "zil" differences between substring() and slice() the substring() and slice() methods are almost identical, but there are a couple of subtle differences between the two, especially in the way negative arguments are dea...
String.prototype.trim() - JavaScript
whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (lf, cr, etc.). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.trim() return value a new string representing the str stripped of whitespace from both ends. description the trim() method returns the string stripped of whitespace from both ends. trim() does not affect the value of the str itself. ...
...g code before any other code will create trim() if it's not natively available. if (!string.prototype.trim) { string.prototype.trim = function () { return this.replace(/^[\s\ufeff\xa0]+|[\s\ufeff\xa0]+$/g, ''); }; } examples using trim() the following example displays the lowercase string 'foo': var orig = ' foo '; console.log(orig.trim()); // 'foo' // another example of .trim()
removing whitespace from just one side. var orig = 'foo '; console.log(orig.trim()); // 'foo' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.trim' in that specification. ...
String.prototype.trimEnd() - JavaScript
trimright() is an alias of this method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.trimend(); str.trimright(); return value a new string representing the calling string stripped of whitespace from its (right) end. description the trimend() / trimright() methods return the string stripped of whitespace from its right end. trimend() or trimright() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padend the standard method name is trimend. ...
...calling string stripped of whitespace from its (right) end. description the trimend() / trimright() methods return the string stripped of whitespace from its right end. trimend() or trimright() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padend the standard method name is trimend. however, for web compatibility reasons, trimright
remains as an alias to trimend. in some engines this means: string.prototype.trimright.name === "trimend"; examples using trimend() the following example displays the lowercase string ' foo': var str = ' foo '; console.log(str.length); // 8 str = str.trimend(); console.log(str.length); // 6 console.log(str); // ' foo' specifications specification ecmascri...
String.prototype.trimStart() - JavaScript
trimleft() is an alias of this method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.trimstart(); str.trimleft(); return value a new string representing the calling string stripped of whitespace from its beginning (left end). description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end. trimleft() or trimstart() do not affect the value of the string itself. ...
...g stripped of whitespace from its beginning (left end). description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end. trimleft() or trimstart() do not affect the value of the string itself. aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart. however, for web compatibility reasons, trimleft
remains as an alias to trimstart. in some engines this means: string.prototype.trimleft.name === "trimstart"; polyfill //https://github.com/fabiovergani/js-polyfill_string-trimstart (function(w){ var string=w.string, proto=string.prototype; (function(o,p){ if(p in o?o[p]?false:true:true){ var r=/^\s+/; o[p]=o.trimleft||function(){ return t...
escape() - JavaScript
… … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. … the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. ...
...… … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. … the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. ...
globalThis - JavaScript
the globalthis property provides a standard way of accessing the global this value (and hence the global object itself) across environments. unlike similar properties such as window and self, it's guaranteed to work in window and non-window contexts. in this way, you can access the global object in a consistent manner without having to know which environment the code is being run in.to help you
remember the name, just
remember that in global scope the this value is globalthis. html and the windowproxy in many engines globalthis will be a reference to the actual global object, but in web browsers, due to iframe and cross-window security considerations, it references a proxy around the actual global object (which you can't directly access). this distinction is rarely relevant in common usag...
... in many engines globalthis will be a reference to the actual global object, but in web browsers, due to iframe and cross-window security considerations, it references a proxy around the actual global object (which you can't directly access). this distinction is rarely relevant in common usage, but important to be aware of. naming several other popular name choices such as self and global were
removed from consideration because of their potential to break compatibility with existing code. see the language proposal's "naming" document for more details. examples search for the global across environments prior to globalthis, the only reliable cross-platform way to get the global object for an environment was function('return this')(). however, this causes csp violations in some settings, s...
unescape() - JavaScript
… … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. … the unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. the escape sequences might be introduced by a function like escape. ...
...… … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. … the unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. the escape sequences might be introduced by a function like escape. ...
Destructuring assignment - JavaScript
2 ignoring some returned values you can ignore return values that you're not interested in: function f() { return [1, 2, 3]; } const [a, , b] = f(); console.log(a); // 1 console.log(b); // 3 const [c] = f(); console.log(c); // 1 you can also ignore all returned values: [,,] = f(); assigning the rest of an array to a variable when destructuring an array, you can unpack and assign the
remaining part of it to a variable using the rest pattern: const [a, ...b] = [1, 2, 3]; console.log(a); // 1 console.log(b); // [2, 3] be aware that a syntaxerror will be thrown if a trailing comma is used on the left-hand side with a rest element: const [a, ...b,] = [1, 2, 3]; // syntaxerror: rest element may not have a trailing comma // always consider using rest operator as the last element ...
... jones, father: richard jones" computed object property names and destructuring computed property names, like on object literals, can be used with destructuring. let key = 'z'; let {[key]: foo} = {z: 'bar'}; console.log(foo); // "bar" rest in object destructuring the rest/spread properties for ecmascript proposal (stage 4) adds the rest syntax to destructuring. rest properties collect the
remaining own enumerable property keys that are not already picked off by the destructuring pattern. let {a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40} a; // 10 b; // 20 rest; // { c: 30, d: 40 } invalid javascript identifier as a property name destructuring can be used with property names that are not valid javascript identifiers by providing an alternative identifier that is valid. const foo = ...
Logical AND (&&) - JavaScript
the following composite operation involving booleans: bcondition1 || (bcondition2 && bcondition3) is always equal to: bcondition1 || bcondition2 && bcondition3 specifications specification ecmascript (e...
...erting and to or the following operation involving booleans: bcondition1 && bcondition2 is always equal to: !(!bcondition1 || !bcondition2) converting or to and the following operation involving booleans: bcondition1 || bcondition2 is always equal to: !(!bcondition1 && !bcondition2)
removing nested parentheses as logical expressions are evaluated left to right, it is always possible to
remove parentheses from a complex expression following some rules. the following composite operation involving booleans: bcondition1 || (bcondition2 && bcondition3) is always equal to: bcondition1 || bcondition2 && bcondition3 specifications specification ecmascript (ecma-262)the definition of 'logical and expression' in that specification. ...
Object initializer - JavaScript
e.log((o.a === {a}.a)) // true duplicate property names when using the same name for your properties, the second property will overwrite the first. let a = {x: 1, x: 2} console.log(a) // {x: 2} in ecmascript 5 strict mode code, duplicate property names were considered a syntaxerror. with the introduction of computed property names making duplication possible at runtime, ecmascript 2015 has
removed this restriction. function havees2015duplicatepropertysemantics() { 'use strict'; try { ({prop: 1, prop: 2}); // no error thrown, duplicate property names allowed in strict mode return true; } catch(e) { // error thrown, duplicates prohibited in strict mode return false; } } method definitions a property of an object can also refer to a function or a getter or ...
...t 5 has no generators): let o = { generator: function* () { ........... } }; for more information and examples about methods, see method definitions. computed property names starting with ecmascript 2015, the object initializer syntax also supports computed property names. that allows you to put an expression in brackets [], that will be computed and used as the property name. this is
reminiscent of the bracket notation of the property accessor syntax, which you may have used to read and set properties already. now you can use a similar syntax in object literals, too: // computed property names (es2015) let i = 0 let a = { ['foo' + ++i]: i, ['foo' + ++i]: i, ['foo' + ++i]: i } console.log(a.foo1) // 1 console.log(a.foo2) // 2 console.log(a.foo3) // 3 let param = 'size' l...
for - JavaScript
uates to true, statement is executed. this conditional test is optional. if omitted, the condition always evaluates to true. if the expression evaluates to false, execution skips to the first expression following the for construct. final-expression an expression to be evaluated at the end of each loop iteration. this occurs before the next evaluation of condition. generally used to update or inc
rement the counter variable. statement a statement that is executed as long as the condition evaluates to true. to execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. to execute no statement within the loop, use an empty statement (;). examples using for the following for statement starts by declaring the variable i and initializing it to 0. i...
...condition evaluates to true. to execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. to execute no statement within the loop, use an empty statement (;). examples using for the following for statement starts by declaring the variable i and initializing it to 0. it checks that i is less than nine, performs the two succeeding statements, and inc
rements i by 1 after each pass through the loop. for (let i = 0; i < 9; i++) { console.log(i); // more statements } optional for expressions all three expressions in the head of the for loop are optional. for example, in the initialization block it is not required to initialize variables: var i = 0; for (; i < 9; i++) { console.log(i); // more statements } like the initializatio...
Template literals (Template strings) - JavaScript
r' : 'icon-collapser') }`; in es2015 with nested template literals: const classes = `header ${ islargescreen() ? '' : `icon-${item.iscollapsed ? 'expander' : 'collapser'}` }`; tagged templates a more advanced form of template literals are tagged templates. tags allow you to parse template literals with a function. the first argument of a tag function contains an array of string values. the
remaining arguments are related to the expressions. the tag function can then perform whatever operations on these arguments you wish, and return the manipulated string. (alternatively, it can return something completely different, as described in one of the following examples.) the name of the function used for the tag can be whatever you want. let person = 'mike'; let age = 28; function mytag(s...
...rows in older ecmascript versions (es2016 and earlier) // syntaxerror: malformed unicode character escape sequence es2018 revision of illegal escape sequences tagged templates should allow the embedding of languages (for example dsls, or latex), where other escapes sequences are common. the ecmascript proposal template literal revision (stage 4, to be integrated in the ecmascript 2018 standard)
removes the syntax restriction of ecmascript escape sequences from tagged templates. however, illegal escape sequences must still be represented in the “cooked” representation. they will show up as undefined element in the “cooked” array: function latex(str) { return { "cooked": str[0], "raw": str.raw[0] } } latex`\unicode` // { cooked: undefined, raw: "\\unicode" } note that the escap...
JavaScript reference - JavaScript
for...in for...of for await...of while other debugger import label with expressions and operators javascript expressions and operators. ...
... for...of for await...of while other debugger import label with expressions and operators javascript expressions and operators. ...
<mfrac> - MathML
<mfrac>numerator denominator</mfrac> attributes bevelled specifies the way the fraction is displayed. if true, the fraction line is bevelled, which means that numerator and denominator are displayed side by side and separated by a slash (/). otherwise, if set to false (which is the default value), numerator and denominator are on top of each other. this attribute is deprecated and will be
removed in the future. use u+2044 (fraction slash) instead. class, id, style provided for use with stylesheets. denomalign the alignment of the denominator under the fraction. possible values are: left, center (default), and right. this attribute is deprecated and will be
removed in the future. use css text-align instead. href used to set a hyperlink to a specified uri. linethickness the t...
...enominator under the fraction. possible values are: left, center (default), and right. this attribute is deprecated and will be
removed in the future. use css text-align instead. href used to set a hyperlink to a specified uri. linethickness the thickness of the horizontal fraction line. this attributes accepts any length values. the values medium, thin, and thick are deprecated and will be
removed in the future. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. numalign the alignment of the numerator over the fraction. possible values are: left, center (default), and right. this attribute is deprecated and will be
removed in the future. ...
<mtext> - MathML
s are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be
removed in the future. mathvariant this attribute specifies the logical class of the identifier, which varies in typography. that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: norm...
... recommendation current specification mathml 2.0the definition of 'mtext' in that specification. recommendation initial specification ...
MathML documentation index - MathML
below you'll find some examples you can look at to help you to understand how to use mathml to display increasingly complex mathematical concepts in web content. 4 mathml: deriving the quadratic formula beginner, education, example, guide, html5, mathml, needsbeginnerupdate this page outlines the derivation of the quadratic formula. 5 proving the pythagorean theo
rem beginner, example, guide, html5 math, math education, mathml, needsbeginnerupdate we will now prove the pythagorean theo
rem: 6 mathml attribute reference mathml, mathml reference this is an alphabetical list of mathml attributes. more details for each attribute are available on particular element pages. 7 values guide, mathml, mathml reference s...
...e xhtml notation of mathml), which has nothing to do with <merror>. 14 <mfenced> deprecated, mathml, mathml reference, mathml:element, mathml:general layout schemata the deprecated mathml <mfenced> element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. it has been
removed from the latest mathml standard and modern browsers no longer support it. 15 <mfrac> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mfrac> element is used to display fractions. 16 <mglyph> mathml, mathml reference, mathml:element the mathml <mglyph> element is used to display non-standard symbols where existing un...
Media container formats (file types) - Web media technologies
ed by webm codec browser support chrome edge firefox safari opus yes yes yes yes vorbis yes yes yes yes choosing the right container there are a few factors to consider when selecting the best container or containers to use for your media. the relative importance of each will depend on your needs, your license requi
rements, and the compatibility requi
rements of your target audience. guidelines the best choice also depends on what you'll be doing with the media. playing back media is a different thing than recording and/or editing it. if you're going to be manipulating the media data, using an uncompressed format can improve performance, while using a lossless compressed format at least prevent the accumulatio...
...a lossless compressed format at least prevent the accumulation of noise as compression artifacts are multiplied with each re-compression that occurs. if your target audience is likely to include users on mobile, especially on lower-end devices or on slow networks, consider providing a version of your media in a 3gp container with appropriate compression. if you have any specific encoding requi
rements, make sure the container you choose supports the appropriate codecs. if you want your media to be in a non-proprietary, open format, consider using one of the open container formats such as flac (for audio) or webm (for video). if for any reason you are only able to provide media in a single format, choose a format that's available on the broadest selection of devices and browsers, such as ...
Structural overview of progressive web apps - Progressive web apps (PWAs)
methodology which we will explain in detail in upcoming articles and use in our example application. there is also a new approach involving the streams api, which we'll mention briefly. the app shell concept the app shell concept is concerned with loading a minimal user interface and content as soon as possible, caching it so it's available offline for subsequent visits before then loading the
remainder of the app's contents. that way, the next time someone visits the app from the device, the ui loads from the cache immediately and any new content is requested from the server (if it isn’t available in the cache already). this structure is fast, and also feels fast as the user sees "something" instantly, instead of a loading spinner or a blank page. it also allows the website to be acces...
... as add to home screen or push notifications, safe in the knowledge that the app will still work ok if they are not supported by the user's browser — this is the beauty of progressive enhancement. the website feels like a native app with instant interaction and solid performance while keeping all the benefits of the web. being linkable, progressive, and responsive by design it's important to
remember the pwa advantages and keep them in mind when designing the application. the app shell approach allows websites to be: linkable: even though it behaves like a native app, it is still a website — you can click on the links within the page and send a url to someone if you want to share it. progressive: start with the "good, old basic website” and progressively add new features while re...
xml:space - SVG: Scalable Vector Graphics
all contiguous space characters are collapsed into a single space character. preserve this value tells the user agent to convert all newline and tab characters into spaces. then, it draws all space characters (including leading, trailing and multiple consecutive space ...
... all contiguous space characters are collapsed into a single space character. ...
<feComponentTransfer> - SVG: Scalable Vector Graphics
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. ...
...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. ...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
at. however, it seems that the former may also cause the latter. one way to check is to create a new profile and restart mozilla using that profile. if svg works with the new profile, then simply delete the new profile and go about cleaning your old profile using the steps in the section below. if the new profile doesn't work, clean your os file associations, then your mimetypes.rdf. create and
remove a bogus file association this solution should work for mimetypes.rdf corruption, and requires little technical knowledge. it's adapted from jp fiset's comment in bug 303581 which in turn was adapted from jeff schiller's comment in bug 303581. 1. try and open a local .svg file using mozilla and when the "opening ..." dialog comes up, select the "open with" radio button and choose any .exe exce...
...en with" radio button and choose any .exe except firefox.exe/mozilla.exe. 2. make sure the "do this automatically for files like this from now on" checkbox is checked. 3. click ok, and when the program you chose tries to open the file, just close it. 4. in firefox, go to tools > options... > downloads > view & edit actions... to open the download actions window. 5. select the svg entry, click the
remove action button and then click close to close the download actions window. 6. try and load a local .svg file and this scripting across embed demo. if the files you attempt to load in step 6 work, then your problem was mimetypes.rdf corruption. if they still don't work, then you operating system is the likely culprit. fix for os file associations your os may be associating the wrong media type...
Index - XSLT: Extensible Stylesheet Language Transformations
<xsl:sort> element, reference, xslt, sort the <xsl:sort> element defines a sort key for nodes selected by <xsl:apply-templates> or <xsl:for-each> and determines the order in which they are processed. 46 <xsl:strip-space> element, reference, xslt, strip-space the <xsl:strip-space> element defines the elements in the source document for which whitespace should be
removed. 47 <xsl:stylesheet> element, reference, stylesheet, xslt the <xsl:stylesheet> element (or the equivalent <xsl:transform> element) is the outermost element of a stylesheet. 48 <xsl:template> element, reference, template, xslt the <xsl:template> element defines an output producing template. this element must have either the match attribute or the name ...
... the <xsl:value-of> element evaluates an xpath expression, converts it to a string, and writes that string to the result tree. 52 <xsl:variable> element, reference, xslt, variable the <xsl:variable> element declares a global or local variable in a stylesheet and gives it a value. because xslt permits no side-effects, once the value of the variable has been established, it
remains the same until the variable goes out of scope 53 <xsl:when> element, reference, xslt, when the <xsl:when> element always appears within an <xsl:choose> element, acting like a case statement. 54 <xsl:with-param> element, reference, xslt, with-param the <xsl:with-param> element sets the value of a parameter to be passed into a template. ...
The Box Model - Archive of obsolete content
d to add boxes inside of the main box. the two labels and textboxes are all placed inside a horizontal box. then, the labels are placed inside another box, this time a vertical one, as are the textboxes. this inner box is what makes the elements orient vertically. the horizontal box is needed as we want the labels vbox and the inputs vbox to be placed horizontally with each other. if this box was
removed, both textboxes would appear below both of the labels. the issue now is that the 'password' label is too high. we should really use the grid element here to fix this which we'll learn about in a later section. our find files dialog example let's add some boxes to the find files dialog. a vertical box will be added around all of the elements, and a horizontal box with be added around the ...
The Chrome URL - Archive of obsolete content
referred to using this shorter form. this is convenient since all a user needs to know is the package name to be able to open the application. of course, for extensions that modify the browser interface, the user will not need to know the url, as the extension will present itself in the ui. for a skin, the file <package name>.css is selected; for a locale, the file <package name>.dtd is selected.
remember, the chrome url is not related to where it is located on disk. the first two pieces of the chrome url are the package name and the part (either content, skin, or locale). while it is common to put the content files in a directory called 'content', this is purely out of convention, and these files may be placed in an entirely different structure. in the next section, we will look at how to cr...
Tree Box Objects - Archive of obsolete content
about the tree box object box objects were described in an earlier section. the tree box object is a specialized box object used specifically for trees. the tree box implements the treeboxobject interface. redrawing the tree we already saw the rowcountchanged() function of the tree box object in the previous section. it is used to indicate that one or more rows have been added to the tree or
removed from the tree. the tree will redraw the affected area. you don't need to call the rowcountchanged() function when a row has simply changed in some way, for example if a cell's label changes. in this case, there are other drawing functions that can be used. the simplest is to call invalidaterow() which will redraw a specific row in the tree. the tree will call the view to get the updated data ...
Tree Selection - Archive of obsolete content
rt' and 'end'. then, we iterate over the set of ranges, the number of which is returned by the getrangecount() function. the getrangeat() function is called passing the range index and the start and end objects. this function will fill in the start and end indicies by assigning them to the 'value' property. so if the first range is from the third item to the seventh item, 'start.value' will be 2 (
remember that indices start with 0, so we subtract one.) and 'end.value' will be 6. an alert is displayed for each index. if you just want to find out if a specific row is selected, use can use the isselected() function. it takes a row index as an argument and returns true if that row is selected. alert(tree.view.selection.isselected(3)); modifying the tree selection the selection object has a numbe...
Trees and Templates - Archive of obsolete content
to do this, we use the persist attribute on each treecol element. there are five attributes of columns that need to be persisted, to save the column width, the column order, whether the column is visible, which column is currently sorted and the sort direction. the following example shows a sample column: <treecol id="date" label="date" flex="1" persist="widt...
XBL Example - Archive of obsolete content
l=nexttext" oncommand="parentnode.parentnode.parentnode.page++;"/> because the 'page' property is only on the outer xul element, we need to to use the parentnode property to get to it. the first parentnode returns the parent of the button which is the horizontal box, the second its parent, the vertical box, and finally, its parent which is the outer box. the 'page' property is inc
remented or dec
remented. this will call the onget script to get the value, inc
rement or dec
rement the value by one, and then call the onset handler to set the value. setpage method now let's define the 'setpage' method. it will take one parameter, the page number to set the page to. it will need to make sure the page is not out of range and then modify the deck's selectedindex attribute and the tex...
Using the Editor from XUL - Archive of obsolete content
ment, from which the editorshell can get the xul document in which it is living. it needs this to poke the ui (e.g. for command state maintenance, starting and stopping the throbber etc.). the contentwindow (another settable attribute on nsieditorshell) points to the xul element which is to become editable. note: since we already know this when we have an <editor></editor> tag, we should
remove the need to call this. editorstartup() does some other minor bits of setup before finally kicking off the url load, which the most important part here. when the xul was parsed, the src attribute on the content frame was set to about:blank (our default 'blank page' url). we can't set that before xul parsing, so we have to force a load of the page we now want to edit. we get the url ...
Window icons - Archive of obsolete content
see also bug 1531836 for more details. starting with firefox 1.5, thunderbird 1.5, and xulrunner 1.8, you can specify an icon for a xul window by putting files named mywindow.ico (for windows) and mywindow.xpm or mywindow16.xpm (linux), where mywindow is the id of the <window> you want to attach the icon to, in the chrome/icons/default subfolder of your bundle. these icons will override the global icon files, which are located in app_dir/browser/chrome/icons/default. note: the global icons override does not currently work due to bug bug 543490. global icon files currently take precedence and bundles are only searched for icons which are not provided by the application. ...
Writing Skinnable XUL and CSS - Archive of obsolete content
ponent that could be installed or uninstalled, then the overlaying should not occur in the xul file. it should instead take place through the chrome registry. examples of overlays that should take place using the chrome registry include the security padlock icon and any messenger ui in the navigator window. style="..." is prohibited in xul files without approval any usages of inline style are ext
remely dangerous, since they are overriding the included skin, and must be approved before their usage will be allowed. image chrome urls should never occur in xul. any chrome url that references an image in the skin is strictly forbidden in the xul. if you find yourself needing to display an image from the skin, then use <titledbutton> and style it rather than using <html:img>. the problem here is ...
XUL Accesskey FAQ and Policies - Archive of obsolete content
irst or second word of the label. use a distinctive consonant or a vowel in the label. use letters with wide widths, such as w, m, and capital letters. avoid: letters with descenders, such as p, g, q, or y. example: p, g, q, y. letters next to a letter with a descender. letters that are only one pixel wide, such as i or l. example: i, l. make it easy to
remember do the most important prompts first, so that they get the best accesskeys. see if a similar prompt has an accesskey elsewhere in mozilla, and use the same accesskey. there are standard accesskeys used in windows as well, like properties. if not, try the first letter of the first word in the prompt. next, try the first letter of another word in the prompt. finally, use any n...
XUL accessibility tool - Archive of obsolete content
general information the xul accessibility tool is a firefox extension designed by aaron andersen of webaim as part of a mozilla foundation accessibility minigrant in the spring of 2007. it is designed to test (insofar as automated testing is possible) the guidelines and requi
rement for creating accessible xul as set forth in the xul accessibility guidelines, and to report on any problems found in tested documents. while not meant to be a comprehensive test suite (meaning that passing all included tests does not guarantee that an application is free of accessibility bugs or issues), many of the most common accessibility mistakes will be found and reported. availability the xul accessibility tool can currently be obtained from [http://www.xulplanet.com/aaron/files...bilitytool.xpi]. fu...
caption - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements groupbox, checkbox ...
checkbox - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulcheckboxelement ...
command - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related xul:list of commands ...
commandset - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
datepicker - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
dialogheader - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements dialog, window ...
editor - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
key - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata details on key, keycode, and modifiers attributes for example, consider the following key: <key key="r" modifiers="shift"/> this key will only match when the shift key is pressed as well as...
menubar - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menuitem, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider ...
menuseparator - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menubar, menuitem, menulist, menupopup interfaces nsiaccessibleprovider, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
param - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
radio - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements radiogroup, checkbox interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement, nsidomxullabeledcontrolelement ...
richlistitem - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
rule - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
wizardpage - Archive of obsolete content
getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(),
removeattribute(),
removeattributenode(),
removeattributens(),
removechild(),
removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related wizard ...
XUL - Archive of obsolete content
form drag and drop operations. overlays overlays are used to describe extra content for the ui. they provide a powerful mechanism for extending and customizing existing xul applications. xul periodic table this collection of xul demos used to be available as a web page, but can no longer be viewed in firefox since support for
remote xul was disabled. there is a xulrunner application containing the xul periodic table which can be opened with gecko based browsers. you can get it here. see: using firefox 3 to run xulrunner applications for instructions on running xulrunner apps in firefox. view all... community ...
Building XULRunner - Archive of obsolete content
by default, xulrunner is built with javaxpcom support; the build system must be able to find an appropriate jdk on the system; see the instructions on building javaxpcom for more details. if you do not want to build javaxpcom support, specify --disable-javaxpcom in your configuration. on mac, xulrunner requires mac os x 10.3 or higher and xcode 1.5 or higher to build properly. the runtime requi
rement is mac os x 10.2. a basic minimal mozconfig which will build a release configuration of xulrunner is: mk_add_options moz_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/obj-xulrunner ac_add_options --enable-application=xulrunner #uncomment the following line if you don't want to build javaxpcom: #ac_add_options --disable-javaxpcom cvs tags and xulrunner versions older xulrunne...
Building XULRunner with Python - Archive of obsolete content
get machine. perhaps eventually a xulrunner with a minimal python installation can be generated with something like py2exe or pyinstaller. untill then simply deploy thedist\bin folder and the xul application. don't copy any.pyo files that exist for python modules in the application or errors will occur on the target machine. it is possible to test for python in a batch file using something like
rem check python 2.5 installed reg query "hklm\software\python\pythoncore\2.5" > nul 2>&1 || reg query "hkcu\software\python\pythoncore\2.5" > nul 2>&1 if errorlevel 1 ( echo python 2.5 was not found. please install it. echo exiting... pause exit /b 1 ) start "xulrunner with python" "%moz_bin%\xulrunner.exe" -app application.ini %opts% exit /b 0 see xulrunner:deploying_xulrunne...